I don't know what domain you're looking for so I just gave one answer. You can adjust accordingly in you want a general solution:
<a href="http://www.codecogs.com/eqnedit.php?latex=cosx=2cos^2(\frac{x}{2})-1\\ \therefore 1@plus;cosx=cos(\frac{x}{2})\\ 1@plus;2cos^2\frac{x}{2}-1=cos\frac{x}{2}\\ cos(\frac{x}{2})(2cos(\frac{x}{2})-1)=0\\ cos\frac{x}{2}=0\textup{ OR } cos\frac{x}{2}=\frac{1}{2}\\ \frac{x}{2}=\frac{\pi}{2} \textup{ OR } \frac{x}{2}=\frac{\pi}{3}\\ \therefore x=\pi,\frac{2\pi}{3}" target="_blank"><img src="http://latex.codecogs.com/gif.latex?cosx=2cos^2(\frac{x}{2})-1\\ \therefore 1+cosx=cos(\frac{x}{2})\\ 1+2cos^2\frac{x}{2}-1=cos\frac{x}{2}\\ cos(\frac{x}{2})(2cos(\frac{x}{2})-1)=0\\ cos\frac{x}{2}=0\textup{ OR } cos\frac{x}{2}=\frac{1}{2}\\ \frac{x}{2}=\frac{\pi}{2} \textup{ OR } \frac{x}{2}=\frac{\pi}{3}\\ \therefore x=\pi,\frac{2\pi}{3}" title="cosx=2cos^2(\frac{x}{2})-1\\ \therefore 1+cosx=cos(\frac{x}{2})\\ 1+2cos^2\frac{x}{2}-1=cos\frac{x}{2}\\ cos(\frac{x}{2})(2cos(\frac{x}{2})-1)=0\\ cos\frac{x}{2}=0\textup{ OR } cos\frac{x}{2}=\frac{1}{2}\\ \frac{x}{2}=\frac{\pi}{2} \textup{ OR } \frac{x}{2}=\frac{\pi}{3}\\ \therefore x=\pi,\frac{2\pi}{3}" /></a>