Use the chain rule:
[tex]x=\tan y[/tex]
[tex]\dfrac{\mathrm d}{\mathrm dx}x=\dfrac{\mathrm d}{\mathrm dx}\tan y[/tex]
[tex]1=\sec^2y\dfrac{\mathrm dy}{\mathrm dx}[/tex]
[tex]1=\sec^2y\,y'[/tex]
[tex]y'=\dfrac1{\sec^2y}=\cos^2y[/tex]
Furthermore, if you restrict the domain of [tex]y[/tex], we could write
[tex]x=\tan y\iff \tan^{-1}x=y[/tex]
and so we could also have
[tex]y'=\cos^2(\tan^{-1}x)=\left(\dfrac1{\sqrt{x^2+1}}\right)^2=\dfrac1{x^2+1}[/tex]