<s>[INST] General solution of $\sin 2x+\cos x=0$ 
Solve the trigonometric equation $\sin 2x+\cos x=0$

My Attempt
$$
2\sin x\cos x+\cos x=0\implies\cos x=0 \text{ or }\sin x=\frac{-1}{2}=\sin\frac{-\pi}{6}\\
x=(2n+1)\frac{\pi}{2} \text{ or }x=n\pi+(-1)^n\frac{-\pi}{6}\\
x=n\pi+\frac{\pi}{2} \text{ or }x=2n\pi-\frac{\pi}{6}\text{ or }x=2n\pi+\pi+\frac{\pi}{6}
$$
Reference
$$
\cos x=-\sin 2x=\cos\Big(\frac{\pi}{2}+2x\Big)\implies x=2n\pi\pm\Big(\frac{\pi}{2}+2x\Big)\\
-x=2n\pi+\frac{\pi}{2}\text{ or }3x=2n\pi-\frac{\pi}{2}\implies x=2m\pi-\frac{\pi}{2}\text{ or }x=\frac{2m\pi}{3}-\frac{\pi}{6}
$$
But my reference gives the solution $x=2n\pi-\dfrac{\pi}{2}$ or $x=\dfrac{2n\pi}{3}-\dfrac{\pi}{6}$. I understand how it is reached and both represent the same solutions. But, how do I derive the solution in my reference from what I found in my attempt ? i.e.,

How to derive
  $$
\bigg[x=n\pi+\frac{\pi}{2} \text{ or }x=2n\pi-\frac{\pi}{6}\text{ or }x=2n\pi+\pi+\frac{\pi}{6}\bigg]\\
\implies \bigg[x=2n\pi-\dfrac{\pi}{2}\text{ or }x=\dfrac{2n\pi}{3}-\dfrac{\pi}{6}\bigg]
$$

 [/INST] You and your reference (assuming no typos) have omitted many solutions.  For instance, $x = \pi/2$, which you are missing, and $-\pi/2$, which your reference is missing.
Assuming throughout that $k$ is any integer.
From $\cos(x) = 0$, $x = \pm \cos^{-1}(0) + 2\pi k$, giving the two solution families $x = \pm \frac{\pi}{2} + 2\pi k$.  These can be written as a single family (note the coefficient of $k$): $\frac{\pi}{2} + \pi k$, which is equivalent to $\frac{-\pi}{2} + \pi k$.  This equivalence is most likely what is going on between your solution and your reference's.
From $\sin(x) = \frac{-1}{2}$, $x = \sin^{-1}\left(\frac{-1}{2}\right) + 2\pi k = \frac{-\pi}{6} + 2 \pi k$ or $x = \pi - \sin^{-1}\left(\frac{-1}{2}\right) + 2\pi k = \frac{7 \pi}{6} + 2 \pi k$.  Taken together, you should recognize these as your solution and one of them you quote from your reference.
Are you sure you have copied your reference's entire answer and correctly copied its $k$ coefficients?
</s>