Why I am getting wrong answer to this definite integral? $$\int_0^{\sqrt3} \sin^{-1}\frac{2x}{1+x^2}dx $$
Obviously the substitution must be $x=tany$
$$2\int_0^{\frac{\pi}{3}}y\sec^2y \ dy $$
Taking $u=y $, $du=dy;dv=sec^2y \ dy, v=\tan y $
$$2\Big(y\tan y+\ln(\cos y)\Big)^{\frac{\pi}{3}}_{0} $$ 
Hence $$2\frac{\pi}{\sqrt 3}+2\ln\frac{1}{2} $$
But the answer given is $\frac{\pi}{\sqrt 3}$.

$$I=\int_{0}^{\sqrt{3}} \sin^{-1} \frac{2x}{1+x^2} dx$$
Notice that $$\frac{d}{dx} \sin^{1} \frac{2x}{1+x^2}= \frac{2}{1+x^2}~~ \frac{|1-x^2|}{(1-x^2)}= \frac{2}{1+x^2}, ~if~~ x^2<1,~~\frac{-2}{1+x^2}~if~ x^2>1.$$ 
So let us integrate by parts taking 1 as the second function. Then
$$I=\left ( x \sin^{-1} \frac{2x}{1+x^2}\right)
-\left(\int_{0}^{1} x\frac{d}{dx} \sin^{-1} \frac{2x}{1+x^2} dx+\int_{1}^{\sqrt{3}} x\frac{d}{dx} \sin^{-1} \frac{2x}{1+x^2} dx\right)$$
$$I=\left ( x \sin^{-1} \frac{2x}{1+x^2}\right)
-\left(\int_{0}^{1} \frac{2x}{1+x^2} dx+\int_{1}^{\sqrt{3}} \frac{-2x}{1+x^2} dx\right).$$
$$I=\left ( x \sin^{-1} \frac{2x}{1+x^2}\right)_{(0,\sqrt{3})}-(\ln 2-\ln 4 +\ln 2)=\frac{\pi}{\sqrt{3}}.$$
