Let's use the formula `cos ( 3 theta ) = 4 cos^3 ( theta ) - 3 cos ( theta ) ` and note that `x = pi ` is not a root of this equation. After this, we can use tangent half-angle substitution:
`sin theta = ( 2 tan ( theta / 2 ) ) / ( 1 + tan^2 ( theta / 2 ) ) , ` `cos theta = ( 1 - tan^2 ( theta / 2 ) ) / ( 1 + tan^2 ( theta / 2 ) ) .`
The function `tan ( theta / 2 ) ` has period `2 pi ` and reaches each real value exactly once on `( 0, 2 pi ] . ` Denote it `t ` and make it a new variable.
Our equation becomes
`1 - ( 6 t ) / ( 1 + t^2 ) + 4 ( 1 - t^2 )^3 / ( 1 + t^2 )^3 - 3 ( 1 - t^2 ) / ( 1 + t^2 ) = 0 .`
It is obviously equivalent to a polynomial equation of degree 6. Such equation has no more than 6 roots, so our original equation also has no more than 6 roots.
Now return to the original equation. The function is continuous, and it is easy to show that it has 6 sign changes using only `theta = n pi / 6 , n in ZZ . ` This way, it has at least 6 roots, which means it has exactly 6 roots.