How to build a constraint with summation?

You appear to be missing a final parenthesis on the last line. May I ask what editor you use? Most have a feature to indicate matching pairs of parentheses, often as little bars that show under both parentheses if you place the cursor on one of them.