so I am trying to find $\displaystyle \frac {dy}{dx}$ for $\displaystyle x=tan(y)$

here's some of my work

not sure if I'm right but I'm applying the product rule to find it

$\displaystyle u=tan$

$\displaystyle u'=sec^2$

$\displaystyle v=y$

$\displaystyle v'= \frac {dy}{dx}$

$\displaystyle tan \frac {dy}{dx} + sec^2 y=1$

the 1 is from the derivative of x

then I subtracted $\displaystyle sec^2 y$ from both sides

which is where I got stuck

the answer for the problem is supposed to be $\displaystyle cos^2 y$ but I don't know how to get there...