Help with $\int \frac{x-\sqrt x}{x+\sqrt x} \, \mathrm d x$ I need help with this integral. I tried $$\int \frac{x-\sqrt x}{x+\sqrt x}\,\mathrm dx = \int \frac{(x-\sqrt x)^2}{x^2-x} \,\mathrm dx = \int \frac {x(x-2\sqrt x+1)}{x(x-1)}\,\mathrm dx = \int \frac {(x-2\sqrt x+1)}{(x-1)}\,\mathrm dx$$ but I don't know how to proceed? Thank you for your help. 
 A: Use substitution $\; t=\sqrt x$, $\;\mathrm d x=2t\,\mathrm d t$ You obtain the integral
$$\int\frac{t^2-t}{t^2+t}\,2t\,\mathrm d t=2\int\frac{t^2-t}{t+1}\,\mathrm d t. $$
You've come down ti=o the integral of a rational function. As the degree of the numerator is smaller than that of the denominator, you first have to perform the Euclidean division of the numerator by the denominator:
$$t^2-t=(t-2)(t+1)+2, $$
so that
$$\int\frac{t^2-t}{t+1}\,\mathrm d t=\int(t-2)\,\mathrm d t+\int\frac{2}{t+1}\,\mathrm d t=\dotsm$$
A: Let $u=\sqrt{x}$ and resolve the integrand into partial fractions,
A: Sustuting $$\sqrt{x}=t$$ we get $$x=t^2$$ and $$dx=2t\,dt$$ and we get
$$\int\frac{t^2-t}{t^2+t}\cdot 2t \, dt$$ and this is $$2\int\frac{t^2-t}{t+1} \, dt$$
and write your Integrand as $$t-2+2(t+1) ^{-1}$$
A: Before substitution:
$$\int \frac{x-\sqrt x}{x+\sqrt x} dx= \int \frac{\sqrt x -1}{\sqrt x+1} dx = \int \frac{\sqrt x +1-2}{\sqrt x+1} dx = \int \left(1- \frac{2}{\sqrt x+1} \right)dx$$ $$= x-2 \int \frac{1}{\sqrt x+1}dx$$
Then $x = (u-1)^2$:
$$\int \frac{1}{\sqrt x+1}dx = \int \frac{2(u-1)}{u} du = 2\int \left( 1- \frac{1}{u} \right) du$$
A: Expand $$\int \frac{x-\sqrt x}{x+\sqrt x}\,dx =\int\left(1-\frac2{\sqrt x}+\frac2{\sqrt x(\sqrt x+1)}\right)dx.$$
Then the first two terms are immediate and the third is of the form $f'/(f+1)$.
Hence
$$x-4\sqrt x+4\log(\sqrt x+1).$$
