Differentiate both sides of tan y = x {\displaystyle \displaystyle \tan y=x} with respect to x {\displaystyle \displaystyle x} . (Don't forget to apply the chain rule!)
d d x tan y = d d x x sec 2 y ⋅ d y d x = 1 d y d x = 1 sec 2 y . {\displaystyle \displaystyle {\begin{aligned}{\frac {d}{dx}}\tan y&={\frac {d}{dx}}x\\\sec ^{2}y\cdot {\frac {dy}{dx}}&=1\\{\frac {dy}{dx}}&={\frac {1}{\sec ^{2}y}}.\end{aligned}}}
Now apply the trig identity sec 2 y = 1 + tan 2 y {\displaystyle \sec ^{2}y=1+\tan ^{2}y} to get
d y d x = 1 1 + tan 2 y = 1 1 + x 2 {\displaystyle \displaystyle {\begin{aligned}{\frac {dy}{dx}}={\frac {1}{1+\tan ^{2}y}}={\color {blue}{\frac {1}{1+x^{2}}}}\end{aligned}}}
after noting that tan y = x ⟹ tan 2 y = x 2 {\displaystyle \displaystyle \tan y=x\implies \tan ^{2}y=x^{2}} .