Problem:
Solve $2\cos^2{x}=\sqrt{3}\sin{2x}$ and give the sum of all the solutions in the interval $0\leq x\leq2\pi.$
Attempt: Using the fact that $\sin{2\theta}= 2\cos{\theta}\sin{\theta}$ on the RHS I get $$2\cos^2{x}=2\sqrt{3}\cos{x}\sin{x}.$$
Dividing by $2\cos{x}$ I get $$\cos{x}=\sqrt{3}\sin{x}.$$
Dividing by $\cos{x}$ again I get $$\tan{x}=\frac{1}{\sqrt{3}} \ \Longleftrightarrow \ x=\pi k+\frac{\pi}{6}, \ \ \forall \in \mathbb{Z.}$$
But it's not correct. Why?