Where does sum symbol end in an expression such as $\sum_{i=1}^n (a_i+b)^2 + \sum_{j=1}^m a_j$? I am looking at the following equation:
$$\sum_{i=1}^n (a_i+b)^2 + \sum_{j=1}^m a_j$$
I am not sure what the convention for the order of operations for this would be.  
Is it:
$$(\sum_{i=1}^n (a_i+b)^2) + \sum_{j=1}^m a_j$$
or
$$\sum_{i=1}^n ((a_i+b)^2 + \sum_{j=1}^m a_j)$$

Edit: If the plus sign was changed to a product, how would this be evaluated?
$$\sum_{i=1}^n (a_i+b)^2 \sum_{j=1}^m a_j$$
Like this:
$$(\sum_{i=1}^n (a_i+b)^2) \sum_{j=1}^m a_j$$
or
$$\sum_{i=1}^n ((a_i+b)^2 \sum_{j=1}^m a_j)$$

I suppose the general question I am trying to ask is twofold:


*

*What is the order of operations for sums?

*Searching "Order of operations" in Google doesn't help me find interesting results.  What are the correct search terms?

 A: As commented after the first paragraph of this answer to a related question,  the expression
$$\sum_i c + d$$
is ambiguous. The usual convention is: if the second term don't depend on $i$ (the summation index) then the sum should not include it: $ (\sum_i c) + d$. Elsewhere (of course) it would include it: $ \sum_i (c + d)$. 
In your example, this criterion would vote for your first interpretation - and I think this agrees with the way most people here would parse it:
$$\sum_{i=1}^n (a_i+b)^2 + \sum_{j=1}^m a_j = \left(\sum_{i=1}^n (a_i+b)^2\right) + \sum_{j=1}^m a_j$$
But it's better to avoid the ambiguity, and write it differently so that the precedence is clear.
See also here (actually, after seeing that, I'm wondering if this question should be closed as duplicated... )
A: For the whole expression the first interpretation is correct. 
For the first expression, you can see what's happening if you write out the sum with an ellipsis:
$$
\sum_{i=1}^n (a_i+b)^2 = (a_1 + b_1)^2 + (a_2 + b_2)^2 + \cdots + (a_n + b_n)^2   .
$$
Writing sums with an ellipsis is often a good strategy for figuring out what is meant.
Edit (in response to comment). The squaring occurs for each sum because  in conventional order of operations, the exponentiation takes precedence over the sum. Writing the sum as an ellipsis makes the structure clearer.
Edit in response to edited question. Most mathematicians would read the successive sums as parenthesized (your first opiton).
