Solve the equation $\frac{\sqrt {3}}{2}\sin x-\cos x=\cos^2x$
My approach $\cos^2x=1-\sin^2x $
$\frac{\sqrt {3}}{2}\sin x-\cos^2x =\cos x$
$\frac{\sqrt {3}}{2}\sin x+\sin^2x -1=\cos x$
$\sqrt {3}\sin x+2\sin^2x-2=2\cos x$
Though the equation comes in form of $\sin x$ from here onward after squaring still not getting the answer.