<s>[INST] Integration by Parts - $\int \frac{x}{(x+1)^2} dx$ I have been trying to evaluate the following integral by using integration by parts, but I contine to yield the incorrect answer.
$$\int \frac{x}{(x+1)^2} dx$$
I choose $u=x$, $dv=\frac{1}{(x+1)^2}dx => du=dx$, $v=\frac{-1}{x+1}$.
The integration by parts formula, $\int udv = uv - \int vdu$ yields
$$\int \frac{x}{(x+1)^2} dx = \frac{-x}{x+1} - \int \frac{-1}{x+1}dx = \frac{-x}{x+1}+ ln(x+1)+C$$
However, the integral should be
$$\frac{1}{x+1} + ln(x+1) + C$$
Where did I go wrong? This is my first ask on math stack exchange, so please be kind.
 [/INST] $$g'= (\frac{-x}{x+1}+ ln(x+1)+C)'= \frac {-1(x+1)+x}{(x+1)^2}+\frac 1 {x+1}=\frac x {(x+1)^2}$$
Your answer is correct..
</s>