SOLUTION : $x=\cos 2 \theta$
$=\tan ^{-1}\left\{\frac{\sqrt{1+\cos 2 \theta}-\sqrt{1-\cos 2 \theta}}{\sqrt{1+\cos 2 \theta}+\sqrt{1-\cos 2 \theta}}\right\}=\tan ^{-1}\left\{\frac{\cos \theta-\sin \theta}{\cos \theta+\sin \theta}\right\}=\tan ^{-1}\left\{\frac{1-\tan \theta}{1+\tan \theta}\right\} \\$
$=\tan ^{-1} \tan \left(\frac{\pi}{4}-0\right)=\frac{\pi}{4}-\theta=\frac{\pi}{2}-\frac{1}{2} \cos ^{-1} x \\$
$\tan ^{-1} \frac{x-2}{x-4}+\tan ^{-1} \frac{x+2}{x+4}=\frac{\pi}{4}$
$\frac{(x-2)(x+4)+(x+2)(x-4)}{\left(x^2-16\right)-\left(x^2-4\right)}=1$ $2 x^2-16=-16+4 \Rightarrow 2 x^2=4 \Rightarrow x^2=2 \Rightarrow x= \pm \sqrt{2}$.