Integral $\int \frac{\sqrt{x}}{(x+1)^2}dx$ First, i used substitution $x=t^2$ then $dx=2tdt$ so this integral becomes $I=\int \frac{2t^2}{(1+t^2)^2}dt$ then i used partial fraction decomposition the following way:
$$\frac{2t^2}{(1+t^2)^2}= \frac{At+B}{(1+t^2)} + \frac{Ct + D}{(1+t^2)^2} \Rightarrow 2t^2=(At+B)(1+t^2)+Ct+D=At+At^3+B+Bt^2 +Ct+D$$
for this I have that $A=0, B=2, C=0, D=-2$ 
so now I have 
$I=\int \frac{2t^2}{(1+t^2)^2}dt= \int\frac{2}{1+t^2}dt - \int\frac{2}{(1+t^2)^2}dt$ 
Now,
$$ \int\frac{2}{1+t^2}dt = 2\arctan t$$
and 
$$\int\frac{2}{(1+t^2)^2}dt$$
using partial integration we have:
$$u=\frac{1}{(1+t^2)^2} \Rightarrow du= \frac{-4t}{1+t^2}$$
and $$dt=dv \Rightarrow t=v$$  
so now we have:
$$\int\frac{2}{(1+t^2)^2}dt =\frac{t}{(1+t^2)^2} + 4\int\frac{t^2}{1+t^2}dt = \frac{t}{(1+t^2)^2} + 4\int\frac{t^2 + 1 -1}{1+t^2}dt = \frac{t}{(1+t^2)^2} + 4t -4\arctan t$$
so, the final solution should be:
$$I=2\arctan t - \frac{t}{(1+t^2)^2} - 4t +4\arctan t$$
since the original variable was $x$ we have 
$$I= 6\arctan \sqrt{x} - \frac{\sqrt{x}}{(1+x)^2} - 4\sqrt{x} $$
But, the problem is that the solution to this in my workbook is different, it says that solution to this integral is $$I=\arctan \sqrt{x} - \frac{\sqrt{x}}{x+1}$$
I checked my work and I couldn't find any mistakes, so i am wondering which solution is correct?
 A: You have mistake here:
$u=\frac{1}{(1+t^2)^2} \Rightarrow du= \frac{-4t}{\color{red}(1+t^2\color{red}{)^3}}$
A: I'd try the following: substitute $\;t^2=x\implies 2t\,dt=dx\;$, and your integral becomes
$$I=\int\frac{2t^2dt}{(t^2+1)^2}$$
and already here integrate by parts:
$$\begin{cases}u=t&u'=1\\{}\\v'=\frac{2t}{(t^2+1)^2}&v=-\frac1{t^2+1}=\end{cases}\;\;\;\implies$$
$$I=-\frac t{t^2+1}+\int\frac1{1+t^2}dt=-\frac t{1+t^2}+\arctan t+C$$
and going back to the original variable
$$I=-\frac{\sqrt x}{x+1}+\arctan\sqrt x+C$$
so I think the book's right.
A: Alternative Approach:
Let $x=\tan^2{\theta}$,$dx=2\tan{\theta} \sec^2{\theta} d\theta$
\begin{align}
I&=\int{\frac{\tan{\theta}\cdot 2\tan{\theta}\sec^2{\theta} d\theta}{ \sec^4{\theta} }}\\&=2\int{\sin^2{\theta}}d\theta\\&=\int{1-\cos{(2\theta)}}d\theta\\&=\theta-\frac12 \sin{(2\theta)}+C\\&=\arctan{\sqrt x}-\frac{\sqrt x}{1+x}+C
\end{align}
A: Integrating by parts, $$\int\dfrac{2t^2}{(1+t^2)^2}dt=t\int\dfrac{2t}{(1+t^2)^2}dt-\int\left(\dfrac{dt}{dt}\cdot\int\dfrac{2t}{(1+t^2)^2}dt\right)dt$$
$$=-\dfrac t{(1+t^2)}-\int\dfrac{dt}{1+t^2}=?$$

Alternatively, choose $\sqrt x=\arctan u\implies x=(\arctan u)^2,dx=\dfrac{\arctan u}{1+u^2}du$
A: One may observe that
$$
\int \frac{2t}{\left(1+t^2\right)^2} \, dt=\int \frac{\left(1+t^2\right)'}{\left(1+t^2\right)^2} \, dt=-\frac{1}{ 1+t^2}
$$ then, using an integration by parts, one has
$$
\int \frac{2t^2}{\left(1+t^2\right)^2} \, dt=t \times \left(-\frac{1}{ 1+t^2} \right)+\int \frac1{\left(1+t^2\right)} \, dt=-\frac{t}{ 1+t^2}+\arctan t+C
$$
A: Notice, you can continue from here without using partial fractions $$\int \frac{2t^2}{(1+t^2)^2}\ dt$$
 $$=\int \frac{2t^2}{t^4+2t^2+1}\ dt$$
$$=\int \frac{2}{t^2+\frac{1}{t^2}+2}\ dt$$
$$=\int \frac{\left(1+\frac{1}{t^2}\right)+\left(1-\frac{1}{t^2}\right)}{t^2+\frac{1}{t^2}+2}\ dt$$
$$=\int \frac{\left(1+\frac{1}{t^2}\right)dt}{t^2+\frac{1}{t^2}+2}+\int \frac{\left(1-\frac{1}{t^2}\right)dt}{t^2+\frac{1}{t^2}+2}$$
$$=\int \frac{d\left(t-\frac{1}{t}\right)}{\left(t-\frac{1}{t}\right)^2+4}+\int \frac{d\left(t+\frac{1}{t}\right)}{\left(t+\frac{1}{t}\right)^2}$$
$$=\frac 12\tan^{-1}\left(\frac{t-\frac 1t}{2}\right)-\frac{1}{\left(t+\frac{1}{t}\right)}+c$$
$$=\frac 12\tan^{-1}\left(\frac{x-1}{2\sqrt x}\right)-\frac{\sqrt x}{x+1}+c$$
let $\sqrt x=\tan\theta\implies \theta=\tan^{-1}(\sqrt x)$, 
$$=\frac 12\tan^{-1}\left(\frac{\tan^2\theta-1}{2\tan\theta}\right)-\frac{\sqrt x}{x+1}+c$$
$$=\frac 12\tan^{-1}\left(\tan\left(\frac{\pi}{2}+2\theta\right)\right)-\frac{\sqrt x}{x+1}+c$$
$$=\frac{\pi}{4}+\theta-\frac{\sqrt x}{x+1}+c$$
$$=\theta-\frac{\sqrt x}{x+1}+C$$
$$=\color{red}{\tan^{-1}(\sqrt x)-\frac{\sqrt x}{x+1}+C}$$
