I need to integrate the following: $$\int \dfrac{\sqrt x}{1+\sqrt x}\, dx$$
So I do $u$-substitution with $u = 1+\sqrt{x}$ and $du=\dfrac{1}{\sqrt{x}}\,dx$ and I multiply the numerator and the denominator by $\sqrt{x}$ to get:
$$\int \dfrac{(u-1)^2}{u}du.$$
But according to this website I still need to multiply the result by $2$. Why is it?
In order to solve the integral $$\int \frac{\sqrt x}{1+\sqrt x} dx$$ by $u$ substitution, first you should pick a suitable $u$, as you say, it should be $u=1+\sqrt{x}$. Now the second step is complete the differential in the integral, a basic calculation shows that $du=\frac{1}{2\sqrt{x}}dx$ . Finally, to complete the differential, we should multiply by $1$ our integral, in this case, $1=\frac{1}{2\sqrt{x}}\cdot 2 \sqrt{x}$ for a non zero $x$.
Now rewriting our integral.
$$\int \frac{\sqrt x}{1+\sqrt x} dx=\int \frac{\sqrt x}{1+\sqrt x} dx \cdot \frac{1}{2\sqrt{x}}\cdot 2 \sqrt{x}=2\int \frac{x}{1+\sqrt{x}} \cdot \frac{1}{2\sqrt{x}}dx$$
Finally, since $u=1+\sqrt{x}$, we get that $x=(u-1)^2$. So by a simple substitution, we get
$$\int \frac{\sqrt x}{1+\sqrt x} dx=2\int \frac{(u-1)^2}{u} du $$.