Background
If the phasors ($m\cos(ax)+q\cos(bx)$) of two summed cosines are the same($m=q$), we can find the roots via the following:
$$m\cos(ax)+q\cos(bx)=0$$
$$m\cos(ax)=-q\cos(bx)$$
Since $m=q$, can cancel these from both sides and find the arc cosine:
$$\cos^{-1}(\cos(ax))=\cos^{-1}(-\cos(bx))$$
$$ax=\pi-bx+2\pi n$$
$$and$$
$$ax=-\pi+bx+2\pi n$$
$$\boxed{x=\pm\frac{\pi+2\pi n}{(a\pm b)}}$$
Question
How does one then solve for the roots when $m\neq q$ ?
After much trial and error, I've been using with good success: $$x=\pm\frac{(m\pm q)(\pi+2\pi n)}{2(am \pm bq)}$$
This has very closely resembled the roots with exact matches when $m=\pm q$, $m=0$, $q=0$, or $m,q\to \pm \infty$. Here is an example for the first zero:
first zero for cos(ln(2)x)+y*cos(ln(3)x)
Looks almost like a match for both the top and bottom, until we zoom in:
With the exception of those locations where it matches perfectly, it is slightly off, enough to warrant reassessment. What correction or different equation would produce the correct n-th roots? Thank you.