<s>[INST] Using partial fractions to find an antiderivative of $(x^2+2x)/(x+1)^2$ 
Evaluate $$
\int\frac{x^2+2x}{(x+1)^2}dx
$$

My solution
Let $u =x+1$, 
$
du=dx
$.
Then 
$
du(x^2+2x)=(x^2+2x)dx
$ and 
$
x=u-1
$.
We get 
$$
\int\frac{(u-1)^2+2(u-1)}{u^2}du
=
\int\frac{u^2-2u+1+2u-2}{u^2}du
=
\int\frac{u^2-1}{u^2}du
$$
which simplifies to 
$$
\int(1-u^{-2})du
=u-\frac{u^{-1}}{-1} +C
=u+\frac{1}{u}+C
=x+1+\frac{1}{x+1}+C
$$
... But the answer is
$$
x+\frac{1}{x+1}+C
$$
What is wrong? 
 [/INST] The question has been well-answered, this is just a comment. Note that $x^2+2x=(x+1)^2-1$. 
So we are integrating $\dfrac{(x+1)^2-1}{(x+1)^2}$, that is, $1-\dfrac{1}{(x+1)^2}$. Easier!
</s>