I'm a class 12 student and this a question from my textbook:
$$I=\int{\arcsin{2x\over 1+x^2}}\mathrm{d}x$$
I did it using integration by parts like this:
$$I=\arcsin{\left(2x\over 1+x^2\right)}\cdot\int1\cdot\mathrm{d}x-\int(\frac{\mathrm{d}}{\mathrm{d}x}\arcsin{\left(2x\over1+x^2\right)}\int1\cdot\mathrm{d}x)\mathrm{d}x+c$$
Now,
$$\frac{\mathrm{d}}{\mathrm{d}x}\arcsin{\left(2x\over1+x^2\right)}\ = {1\over\sqrt{1-\left(2x\over1+x^2\right)^2}} { 2(1+x^2) - (2x)(2x)\over(1+x^2)^2}\ ={1+x^2(2(1-x^2)\over(1-x^2)^2(1+x^2)^2}\ ={2\over1-x^4}$$
So
$$I=\arcsin{\left(2x\over 1+x^2\right)}(x)-\int{2\over1-x^4}{x}\mathrm{d}x + c$$
let $I_1=\int{(2x)\over(1-x^4)}\mathrm{d}x$
$$I_1=\int{(2x)\over(1-x^2)(1+x^2)}\mathrm{d}x$$
Let $x^2=t$
So $2x\mathrm{d}x = \mathrm{d}t$ and
$$I_1=\int{\mathrm{d}t\over(1-t)(1+t)}\ =$\int{\mathrm{d}t\over1-t^2}\ ={1\over2}\log{|1+t|\over|1-t|}+c_2\ ={1\over2}\log{1+x^2\over1-x^2}+c_2$$
From all of this, we conclude
$$I=x \arcsin{\left(2x\over 1+x^2\right)}-{1\over2}\log{|1+x^2|\over|1-x^2|}+c$$
But the answer given in the book is :
$$(2x)\arctan x-{\log(1+x^2)} + c$$
I know they have done this using
$$\arcsin{\left(2x\over 1+x^2\right)}=2\arctan x$$
And then applied integration by parts, but I'd very much like to know where I went wrong.
Any help appreciated.
HINT
Your calculation of $ \frac{\mathrm{d}}{\mathrm{d}x} \sin^{-1}\left (\frac{2x}{1+x^2} \right) $ is wrong. It will be:
$$\begin{align} \dfrac{\mathrm{d}}{\mathrm{d}x} \sin^{-1}\left (\dfrac{2x}{1+x^2} \right) &= {\dfrac{1}{\sqrt{1-\left(\frac{2x}{1+x^2}\right)^2}}} \cdot { 2(1+x^2) - (2x)(2x)\over(1+x^2)^2} \\ &= \color{red}{ \dfrac{2(1+x^2)(1-x^2)}{(1-x^2)(1+x^2)^2}} \\ &= \dfrac{2}{1+x^2} \end{align}$$