You can use the identity
\(\boxed{cos(a)+cos(b)=2\;cos\frac{a+b}{2}\;cos\frac{a-b}{2}}\\~\\\)
\(y = \cos(12x) + \cos(14x)\\ \text{roots are given by}\\ \cos(12x) + \cos(14x)=0\\ 2\cos\frac{14x+12x}{2}\;\cos \frac{14x-12x}{2}=0\\ 2\cos(13x)\;\cos (x)=0\\ \cos(13x)=0\qquad \qquad or \qquad cos(x)=0\\ 13x=\pm \frac{\pi}{2}+2\pi n \qquad or \qquad x=\pm\frac{\pi}{2}+2\pi n\\ x=\pm \frac{\pi}{26}+\frac{2\pi n}{13} \qquad or \qquad x=\pm\frac{\pi}{2}+2\pi n\\ x=\pm \frac{\pi}{26}+\frac{4\pi n}{26} \qquad or \qquad x=\pm\frac{13\pi}{26}+2\pi n\\ x=\frac{\pi}{26}(4n\pm1) \qquad or \qquad x=\pm\frac{13\pi}{26}+2\pi n\\ \)
n | 0 | 1 | 1 | 2 | 2 | 3 | 3 | |
x | \(\frac{\pi}{26}\) | \(\frac{3\pi}{26}\) | \(\frac{5\pi}{26}\) | \(\frac{7\pi}{26}\) | \(\frac{9\pi}{26}\) | \(\frac{11\pi}{26}\) | etc |
Coding:
y = \cos(12x) + \cos(14x)\\
\text{roots are given by}\\
\cos(12x) + \cos(14x)=0\\
2\cos\frac{14x+12x}{2}\;\cos \frac{14x-12x}{2}=0\\
2\cos(13x)\;\cos (x)=0\\
\cos(13x)=0\qquad \qquad or \qquad cos(x)=0\\
13x=\pm \frac{\pi}{2}+2\pi n \qquad or \qquad x=\pm\frac{\pi}{2}+2\pi n\\
x=\pm \frac{\pi}{26}+\frac{2\pi n}{13} \qquad or \qquad x=\pm\frac{\pi}{2}+2\pi n\\
x=\pm \frac{\pi}{26}+\frac{4\pi n}{26} \qquad or \qquad x=\pm\frac{13\pi}{26}+2\pi n\\
x=\frac{\pi}{26}(4n\pm1) \qquad or \qquad x=\pm\frac{13\pi}{26}+2\pi n\\