<s>[INST] Integration and Limits I suspect the following integration to be wrong. My answer is coming out to be $3/5$, but the solution says $1$.
$$\int_0^1\frac{2(x+2)}{5}\,dx=\left.\frac{(x+2)^2}{5}\;\right|_0^1=1.$$
Please help out. Thanks.
 [/INST] $$\left. \dfrac{(x+2)^2}5 \right \vert_0^1 = \dfrac{(1+2)^2}5 - \dfrac{(0+2)^2}5 = \dfrac{3^2}5 - \dfrac{2^2}5 = \dfrac{9}5 - \dfrac45 = \dfrac{9-4}5 = \dfrac55 = 1$$
Note that we can integrate $\displaystyle \int_{x_1}^{x_2} (x+a) dx$ in seemingly  two different ways.
The first method is to treat $x+a$ together as one object i.e. $$\displaystyle \int (x+a) dx = \dfrac{(x+a)^2}2 + c_1$$
The second method is to treat $x+a$ as two separate objects i.e. $$\displaystyle \int (x+a) dx = \int x dx + \int a dx = \dfrac{x^2}2 + ax + c_2$$
It might seem that both are different. However, note that the first answer can be re-written as $$\dfrac{(x+a)^2}2 + c_1 = \dfrac{x^2}2 + ax + \dfrac{a^2}2 + c_1.$$ Now this looks more closely like the second. The only difference in fact is that the constants are different. They are in fact related as $c_2 = c_1 + \dfrac{a^2}2$. While performing a definite integral, the constants cancel off and hence both ways should give us the same answer.
As an exercise, we will integrate what you have by treating $x$ and $2$ separately.
\begin{align}
\int_0^1 \dfrac{2(x+2)}5 dx & = \dfrac25 \int_0^1 (x+2)dx = \dfrac25 \int_0^1 xdx + \dfrac25 \int_0^1 2dx = \dfrac25 \cdot \left. \dfrac{x^2}2 \right \vert_{0}^1 + \dfrac25 \cdot 2 \cdot \left(1 - 0 \right)\\
& = \dfrac25 \cdot \left(\dfrac{1^2}2 - \dfrac{0^2}2 \right) + \dfrac45 = \dfrac25 \cdot \dfrac12 + \dfrac45 = \dfrac15 + \dfrac45 = 1
\end{align}
</s>