Different solutions of trigonometric equations

Please take a look at this trigonometric equation,
$\cos9x\cos7x = \cos5x\cos3x$

To solve this equation, we can proceed as,

$2\cos9x\cos7x = 2\cos5x\cos3x$
or, $\cos(9x+7x)+\cos(9x-7x) = \cos(5x+3x)+\cos(5x-3x)$
or, $\cos16x+\cos2x = \cos8x+\cos2x$
or, $\cos16x = \cos8x$

From the above situation we can proceed in two ways,

First Way
$\cos16x = \cos8x$
or, $\cos(2\times8x) = \cos8x$
or, $2\cos^28x -1 = \cos8x$
or, $2\cos^28x-\cos8x -1 = 0$
or, $2\cos^28x-2\cos8x+\cos8x -1 = 0$
or, $2\cos8x(\cos8x-1)+(\cos8x -1) = 0$
or, $2\cos8x(\cos8x-1)+(\cos8x -1) = 0$
or, $(\cos8x -1)(2\cos8x+1) = 0$

Either or both of the above factors are zero.

Taking the first one,
$(\cos8x -1) = 0$
or, $\cos8x = 1$
or, $8x = 2n\pi$, where $n$ is an integer, +ve or -ve.
or, $x = {n\pi \over4}$

Taking the second one,
$(2\cos8x+1) = 0$
or, $2\cos8x = -1$
or, $\cos8x = -\frac1 2$
or, $8x = 2n\pi \pm \frac {2\pi} 3$, where $n$ is an integer, +ve or -ve.
or, $x = \frac{n\pi} 4 \pm \frac {\pi} {12}$

Second Way
$\cos16x = \cos8x$
or, $2\sin{8x-16x\over2}\sin{8x+16x\over2} = 0$
or, $2\sin(-4x)\sin{12x} = 0$
or, $-2\sin(4x)\sin{12x} = 0$

Again, either or both of the above factors are zero.

Taking the first one,
$\sin4x = 0$
or, $4x=n\pi$
or, $x=\frac{n\pi}4$

Taking the second one,
$\sin12x = 0$
or, $12x=n\pi$
or, $x=\frac{n\pi}{12}$

Now, as you must have noticed, we are getting two different sets of solutions, $x = \left\{{n\pi \over4}, \frac{n\pi} 4 \pm \frac {\pi} {12}\right\}$ and $x = \left\{{n\pi \over4}, \frac{n\pi}{12}\right\}$. The member $x=\frac{n\pi}4$ is common to both of the sets. Moreover, all these solutions satisfy the equation under consideration.

Could anybody please tell me why is this happening. In addition to the specific answer, some general insight will be most welcome. We have got a number of similar problems in hand. So, unless we can develop some acumen, life may become difficult.

If $x\in\{\frac{n\pi}4,\frac{n\pi}4\pm\frac\pi{12}\mid n\in\mathbb Z\}$, then $12x=3n\pi$ or $12x=3n\pi+\pi$ or $12x=3n\pi-\pi$ for some $n\in\mathbb Z$, hence $12x=m\pi$ for some $m\in\mathbb Z$ (namely $m=3n$ or $m=3n+1$ or $m=3n-1$. On the other hand, every $m\in \mathbb Z$ can be written either as $m=3n$ or $m=3n+1$ or $m=3n-1$, depending on the remainder modulo $3$. Therefore $x\in\{\frac{n\pi}4,\frac{n\pi}4\pm\frac\pi{12}\mid n\in\mathbb Z\}\iff \frac{12}\pi x\in\mathbb Z$.
Moreover, if $x=\frac{n\pi}4$ with $n\in \mathbb Z$, then $x=\frac{m\pi}{12}$ with $m:=3n\in\mathbb Z$, hence $\{\frac {n\pi}4\mid n\in\mathbb Z\}\subseteq \{\frac {n\pi}{12}\mid n\in\mathbb Z\}$, which ultimately makes $$\left\{\frac{n\pi}4,\frac{n\pi}4\pm\frac\pi{12}\mid n\in\mathbb Z\right\} = \left\{\frac{n\pi}4,\frac{n\pi}{12}\mid n\in\mathbb Z\right\}=\left\{\frac{n\pi}{12}\mid n\in\mathbb Z\right\}.$$
They aren't actually different sets of numbers. They are both all the numbers of the form $n\pi/12$.
• Could you please elaborate a bit, are you suggesting that ${n \pi \over 4} \pm {\pi \over 12}$ and ${n \pi \over 12}$ are the same numbers? – Masroor Feb 14 '13 at 6:23
• $\left\{ \frac{n\pi}{4}, \frac{n\pi}{4} \pm \frac{\pi}{12} \right\} = \left\{ \frac{3n\pi}{12}, \frac{(3n \pm 1)\pi}{12}\right\} = \left\{ \frac{(3n-1)\pi}{12}, \frac{3n\pi}{12}, \frac{(3n+1)\pi}{12} \right\} = \left\{\frac{n\pi}{12}\right\}$, since any integer can be written as one of $3n-1$, $3n$, or $3n+1$. Also, $\left\{\frac{n\pi}{4}, \frac{n\pi}{12}\right\} = \left\{\frac{3n\pi}{12}, \frac{n\pi}{12} \right\} = \left\{\frac{n\pi}{12} \right\}$, because "all integer multiples of $\pi/12$" includes "all integer multiples of $3\pi/12$". – Blue Feb 14 '13 at 8:12