#theta = tan^-1 x# if and only if #-pi/2 < theta < pi/2# and #tan theta = x#
#cos(2theta) = 2cos^2 theta -1#
There are several ways to find #cos^2 theta# for #tan theta = x#.
Here are two:
Method 1: Sketch a triangle
You can sketch a right triangle with one angle #theta#. Label the side opposite #theta# as length #x# and the side adjacent has length #1#, so the hypotenuse has length #sqrt(1+x^2)#
We can see that #cos theta = 1/sqrt(1+x^2)#
Method 2: Use a trigonometric identity
Recall that #tan^2 theta +1 = sec^2 theta = 1/cos^2 theta#.
So #x^2+1 = 1/cos^2 theta#.
Using either method we continue
#cos^2 theta = 1/(1+x^2)#, so
#cos(2theta) = 2/(1+x^2) - 1#
# = (1-x^2)/(1+x^2)#.
And we have
#cos(2tan^-1 x) = (1-x^2)/(1+x^2)#