So we know that
$$\left[ x^2+2x \right]_{a}^{b} = b^2+2b-a^2-2a$$
This is quite clear from the notation. However, there's another fairly common evaluation notation, as follows:
$$\left. x^2+2x \right|_{a}^{b}$$
In this case, it becomes a but confusing. The question then is whether it means $\left[ x^2+2x \right]_{a}^{b}$ or $x^2 + \left[ 2x \right]_{a}^{b}$.
This is quite important when writing things like
$$\left. x^3-4x \right|_{1}^{2} + \left. x^2+2x \right|_{3}^{4}$$
where it's not completely clear if the $3$ and $4$ limits refer to the $x^2+2x$ or just the $2x$. This problem can prop up when integrating by parts or doing some questions.
Which one does it apply to, then? Does the evaluation symbol "$|$" apply to all terms before it, up until the next evaluation symbol on the left?