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!

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.
