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?
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.