Help in evaluating $\displaystyle\int\ \cos^2\Big(\arctan\big(\sin\left(\text{arccot}(x)\right)\big)\Big)\ \text{d}x$ Is there an easy way to prove this result?

$$\int\ \cos^2\Big(\arctan\big(\sin\left( \text{arccot}(x)\right)\big)\Big)\ \text{d}x = x - \frac{1}{\sqrt{2}}\arctan\left(\frac{x}{\sqrt{2}}\right)$$

I tried some substitutions but I got nothing helpful, like:

*

*$x = \cot (z)$
I also tried the crazy one:

*

*$x = \cot(\arcsin(\tan(\arccos(z))))$
Any hint?
Thank you!
 A: 
$\alpha = \cot^{-1} x\\
\beta = \tan^{-1} (\sin \alpha)$
Use trig indentities to find $\csc \alpha$ and $\sin \alpha$
$\sin\alpha = \tan \beta$
Use similar identities to find $\sec \beta$ and $\cos\beta$
A: As mentioned in comments, draw the triangles.  You have
$$
\frac x 1 = x = \cot\theta = \frac{\text{adjacent}}{\text{opposite}}
$$
so if you have a triangle in which $\text{opposite}=1$ and $\text{adjacent} = x$ then you have $\text{hypotenuse} = \sqrt{x^2+1}$ and so
$$
\sin\theta = \frac{\text{opposite}}{\text{hypotenuse}} = \frac 1 {\sqrt{x^2+1}}
$$
so
$$
\sin\operatorname{arccot} x = \frac 1 {\sqrt{x^2+1}}.
$$
Then do a similar thing with the cosine of the arctangent.
A: HINT:
$$\cos \left(\arctan \left(x\right)\right)=\frac{\sqrt{1+x^2}}{1+x^2}$$
So
$$\begin{align}
\\& \int \:\left(\cos \left(\arctan \left(\sin \left(\operatorname{arccot}\left(x\right)\right)\right)\right)\right)^2dx
\\& = \int \frac{x^2+1}{x^2+2}dx
\\& = \color{red}{\frac{\sqrt{2}x-\arctan \left(\frac{\sqrt{2}x}{2}\right)}{\sqrt{2}}+C}
\end{align}$$
A: After using trigonometry, you should be able to get 
$$\cos(\arctan(\sin( \text{arccot}(x)))) = \sqrt{1 - \frac{1}{x^2+2}}$$
From there, I'd assume it's just a trig sub problem.
A: The integral is equal to $$\int 1-\frac{1}{2+x^2} \, dx$$ this is now easy to integrate.
