<s>[INST] Something wrong at $\int \frac{x^2}{x^2+2x+1}dx$ I have to calculate $$\int \frac{x^2}{x^2+2x+1}dx$$ and I obtain: $$\int \frac{x^2}{x^2+2x+1}dx=\frac{-x^2}{x+1}+2\left(x-\log\left(x+1\right)\right)$$
but I verify on wolfram and this is equal with:  $$x-\frac{1}{x+1}-2\log\left(x+1\right)$$ where did I go wrong?

P.S: Here is all steps: $$\int \:\frac{x^2}{x^2+2x+1}dx=-\frac{x^2}{x+1}+\int \:\frac{2x}{x+1}dx=-\frac{x^2}{x+1}+2\left(x-\log\left(x+1\right)\right)$$ I am sure that is not wrong, but the form on wolfram seems easily then it.
 [/INST] Your answer is equivalent, since
$$\frac{-x^2}{x+1} + 2x  = \frac{2x^2 + 2x-x^2}{x+1} = \frac{x^2 + 2x + 1 - 1}{x+1} = x - \frac{1}{x+1} +1$$
and it differs by a constant $1$. 
</s>