My teacher gave me a simple problem:
Find $\int \dfrac{x}{\sqrt{x+1}} \, dx$.
This is how I approached it:
I set $u = \sqrt{x+1}$, which implies $u^2 = x + 1$, thus $2u \, du = dx$.
Therefore,
$$
\int \dfrac{x}{\sqrt{x+1}} \, dx = 2 \int \dfrac{u^2 - 1}{u} \, u \, du = 2 \int (u^2 - 1) \, du = \dfrac{2u^3}{3} - 2u + C
$$
That will give :
$$
\int \dfrac{x}{\sqrt{x+1}} \, dx = \dfrac{2(\sqrt{x+1})^3}{3} - 2\sqrt{x+1} + C
$$
My teacher said it was wrong because $u = \sqrt{x+1}$ cannot be squared and then differentiated.
I don't understand how my approach is incorrect?