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]
$$


There are two ways to solve the equation.
Your method: $2\sin x\cos x+\cos x=0$, so $\cos x(2\sin x+1)=0$. Thus we have either $\cos x=0$ or $\sin x=-1/2$. Thus 
\begin{align}
x&=\frac{\pi}{2}+2n\pi &\text{or}&&  x&=-\frac{\pi}{2}+2n\pi && \text{(from $\cos x=0$)} \\[4px]
x&=-\frac{\pi}{6}+2n\pi  &\text{or}&& x&=\frac{7\pi}{6}+2n\pi && \text{(from $\sin x=-1/2$)}
\end{align}
(you grouped together the families of solutions of $\cos x$ and of $\sin x=-1/2$, but I prefer to keep them separated). Good job.
Alternative method: $\cos x=-\sin2x=\cos(\frac{\pi}{2}+2x)$. Therefore either
$$
x=\frac{\pi}{2}+2x+2n\pi \to x=-\frac{\pi}{2}-2n\pi
$$
or
$$
x=-\frac{\pi}{2}-2x+2n\pi \to 3x=-\frac{\pi}{2}+2n\pi \to x=\frac{2n\pi}{3}-\frac{\pi}{6}
$$
How do you recover the previous sets of solutions?
One set is already present. For the other three, consider the cases when $n=3k$, $n=3k+1$ or $n=3k+2$, with integer $k$. Then
\begin{align}
n&=3k & x&=\frac{6k\pi}{3}-\frac{\pi}{6}=2k\pi-\frac{\pi}{6} \\[4px]
n&=3k+1 & x&=\frac{(6k+2)\pi}{3}-\frac{\pi}{6}=2k\pi+\frac{2\pi}{3}-\frac{\pi}{6}=2k\pi+\frac{\pi}{2}\\[4px]
n&=3k+2 & x&=\frac{(6k+4)\pi}{3}-\frac{\pi}{6}=2k\pi+\frac{4\pi}{3}-\frac{\pi}{6}=2k\pi+\frac{7\pi}{6}
\end{align}
