Integral involving composition of Trig. and Inverse Trig. functions. For a minor class i am taking this year, I found the following integral in a problem set, and where i had no luck in evaluating it: $$\int \cos(2\cot^{-1}\sqrt{\frac{(1-x)}{(1+x)}})dx$$.
I proceeded as follows:
->first, let $x=\cos(2\theta)$ $\implies$ $dx=-2\sin2\theta d\theta$ so the integral becomes: $$\int \cos(2\cot^{-1}\sqrt{\frac{(1-\cos(2\theta))}{(1+\cos(2\theta))}}).-2\sin2\theta d\theta =\int \cos(2\cot^{-1}\sqrt{\frac{(\sin^2(\theta))}{(\cos^2\theta)}}).-2\sin2\theta d\theta\\=\int \cos(2\cot^{-1}(\tan\theta).-2\sin2\theta d\theta=\int \cos(\frac{2}{\theta}).-2\sin2\theta d\theta$$
After this i am stuck. How do i proceed? I cant seem to find any mistakes with my substitution and the succeeding lines. Where did i make a mistake(if any) though? Can i still use this substitution?. I tried looking this up for some guidance and in this online integral solver i found, https://www.integral-calculator.com/ , they used some other method to get to the right answer which i didn't quite understand(refer to image). I wanted to keep using a substitution method if possible.


Totally off-topic
$$\sqrt{\frac{1-x}{1+x}}=1-x+\frac{x^2}{2}-\frac{x^3}{2}+\frac{3 x^4}{8}-\frac{3 x^5}{8}+\frac{5
   x^6}{16}-\frac{5 x^7}{16}+\frac{35 x^8}{128}-\frac{35 x^9}{128}+O\left(x^{10}\right)$$
$$\cot ^{-1}\left(\sqrt{\frac{1-x}{1+x}}\right)=\frac{\pi }{4}+\frac{x}{2}+\frac{x^3}{12}+\frac{3 x^5}{80}+\frac{5
   x^7}{224}+\frac{35 x^9}{2304}+O\left(x^{10}\right)$$
$$\cos \left(2 \cot ^{-1}\left(\sqrt{\frac{1-x}{1+x}}\right)\right)=-x+O\left(x^{10}\right)$$
