<s>[INST] Solve $2\cos^2{x}=\sqrt{3}\sin{2x}$. 
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?
 [/INST] The right way to solve is:
$$2\cos^2{x}=2\sqrt{3}\cos{x}\sin{x} \to \cos x(\cos x-\sqrt{3}\sin x)=0$$
what give you:
$$\cos x=0 \text{ or } \cos x-\sqrt{3}\sin x=0$$
For 
$$\cos x=0\to x=\frac{\pi}{2}+k\pi$$
and for,
$$\cos x-\sqrt{3}\sin x=0\to \tan x=\frac{\sqrt{3}}{3}\to x=\frac{\pi}{6}+k\pi$$
</s>