It is much simpler to deal with this as follows:\begin{align}\frac{\sin(x)}{\cos(x)}=\cos(x)&\iff\sin(x)=\cos^2(x)\\&\iff\sin(x)=1-\sin^2(x)\\&\iff\sin^2(x)+\sin(x)-1=0.\end{align}So, solve the equation $y^2+y-1=0$.