A Trigonometry Game for Sunday

Photo by Sandro Katalina on Unsplash

I’m an early bird, and my wife is not. So at the weekends, when I get up from bed, I always have some time alone in the morning, and I like to use that time for whatever thoughts come to my mind. Last Sunday, for example, I was pondering the question, of under what condition cosines have values that can be written in terms of root expressions. By root expression, I mean an expression that can be written as a sum of roots of integer or rational numbers. For instance, cos(π/4)=√2/2. Or cos(π/3)=√1/2. But what about cos(π/12288)? Or more generally, suppose we know that cos x is a root expression for some given x . We can ask: is cos( x / N ) also a root expression if N is an integer? Surprisingly, as I played with this question on Sunday morning, it quickly turned out that this question has connections to Galois theory and number theory. I found this game quite amusing, so I wanted to share this with you. But let’s first rephrase the question:

Suppose cos( Nx ) is a root expression for some given Nx , where N is integer and N is an integer. Is cos x then also a root expression?

Using Euler’s formula, we can write

$$ e^{i N x}=\cos N x+i \sin N x $$

so cos Nx is just the real part of that.

On the other hand, we have

$$ e^{i N x}=\left(e^{i x}\right)^N=(\cos x+i \sin x)^N $$

Using the binomial theorem, we can expand the braces on the right-hand side:

$$ \begin{aligned} & \cos N x=\operatorname{Re}(\cos x+i \sin x)^N \\ = & \operatorname{Re} \sum_{k=0}^N\left(\begin{array}{l} N \\ k \end{array}\right) \cos ^{N-k} x \cdot i^k \cdot \sin ^k x \end{aligned} $$

For taking the real part, we just have to take into account terms with even k . So we get

$$ \begin{gathered} =\sum_{k=0}^{\left\lfloor\frac{N}{2}\right\rfloor}\left(\begin{array}{c} N \\ 2 k \end{array}\right) \cos ^{N-2 k} x \cdot i^{2 k} \cdot \sin ^{2 k} x \\ =\sum_{k=0}^{\left\lfloor\frac{N}{2}\right\rfloor}\left(\begin{array}{c} N \\ 2 k \end{array}\right) \cos ^{N-2 k} x \cdot(-1)^k \cdot \sin ^{2 k} x \\ =\sum_{k=0}^{\left\lfloor\frac{N}{2}\right\rfloor}\left(\begin{array}{c} N \\ 2 k \end{array}\right) \cos ^{N-2 k} x \cdot(-1)^k \cdot\left(1-\cos ^2 x\right)^k \end{gathered} $$

Using the binomial theorem again, we get

$$ \begin{gathered} =\sum_{k=0}^{\left\lfloor\frac{N}{2}\right\rfloor} \sum_{j=0}^k\left(\begin{array}{l} N \\ 2 k \end{array}\right)\left(\begin{array}{l} k \\ j \end{array}\right) \cos ^{N-2 k} x \cdot(-1)^k \cdot(-1)^j \cos ^{2 j} x \\ =\sum_{k=0}^{\left\lfloor\frac{N}{2}\right\rfloor} \sum_{j=0}^k\left(\begin{array}{l} N \\ 2 k \end{array}\right)\left(\begin{array}{l} k \\ j \end{array}\right)(-1)^{k+j} \cos ^{N-2 k+2 j} x \end{gathered} $$

We see from this that cos Nx can be written as a polynomial of degree N of cos x with integer coefficients:

$$ \cos N x=\sum_{n=0}^N a_n z^n $$

for z =cos x . If N is even, then the polynomial contains only even powers of z , otherwise only odd powers.

The point is, for telling whether z is a root expression when cos Nx is a root expression, we would have to find the zeros of the polynomial

$$ \sum_{n=0}^N a_n z^n-\cos N x $$

But as we know from Abel’s famous theorem, for N >4 the zeros of such a polynomial in general cannot be written in terms of the root expressions we are interested in. So for N ≥5, we cannot know the answer! Is this an example of Gödel’s undecidability? But for N=2,3,4 we can decide. So we can say that if N =2,3 or 4 and cos Nx is a root expression, then cos x is a root expression as well. But we can say more: if N only has prime factors 2 and/or 3 and cos Nx is a root expression, then cos x is a root expression, too. But if N contains a prime factor greater than 3, we cannot tell. Which brings us back to our original question whether cosπ/12288 is a root expression or not. We know that cosπ = − √1. But N =12288=2¹²⋅3. So yes, it can be written as a root expression. It would be a very complicated one, but it would be a root expression.

As an illustration, let’s calculate something simpler: cosπ/32. We know that

$$ \cos \frac{\pi}{4}=\frac{\sqrt{2}}{2} $$

or

$$ \cos \left(2 \frac{\pi}{8}\right)=\frac{\sqrt{2}}{2} $$

Since N=2, we can deduce that cos π/8 is a root expression. Which one? Well, we have

$$ \begin{aligned} & \cos \left(2 \frac{\pi}{8}\right)=\frac{\sqrt{2}}{2} \\ & =\cos ^2 \frac{\pi}{8}-\sin ^2 \frac{\pi}{8} \\ & =2 \cos ^2 \frac{\pi}{8}-1 \end{aligned} $$

So we have to solve (setting z = cos π/8):

$$ 2 z^2-1=\frac{\sqrt{2}}{2} $$

which is just a quadratic equation. The solution is

$$ z= \pm \frac{\sqrt{\sqrt{2}+2}}{2} $$

Since we had defined z=cosπ/8, we can discard the negative solution. So we have

$$ \cos \frac{\pi}{8}=\frac{\sqrt{\sqrt{2}+2}}{2} $$

Now we play the same game again:

$$ \cos \frac{\pi}{8}=\cos \left(2 \frac{\pi}{16}\right)=\frac{\sqrt{\sqrt{2}+2}}{2} $$

This time we have to solve (setting z=cosπ/16 now):

$$ 2 z^2-1=\frac{\sqrt{\sqrt{2}+2}}{2} $$

Again a quadratic equation with solution

$$ z= \pm \frac{\sqrt{\sqrt{\sqrt{2}+2}+2}}{2} $$

And again, we can discard the negative solution. Playing the same game once more we finally arrive at our solution:

$$ \cos \frac{\pi}{32}=\frac{\sqrt{\sqrt{\sqrt{\sqrt{2}+2}+2}+2}}{2} $$

You can see, in each step, we used a prime factor 2 of had to solve a quadratic equation to get one step further. If we have a prime factor of 3, we would have to solve a cubic equation, which quickly gets ugly. The case N=4 never occurs because you can reduce it to two steps of N=2. So you never have to solve a quartic equation. And if you happen to have prime factors greater than 4, well, then we can’t decide as we would have to find the roots of a polynomial of a degree greater than 4, which is not possible, in general.