```We sometimes wish to express the values of trigonometric functions
for some rational multiple of pi as a radical expression.  For example,
we might wish to express cos(2pi/7) as a radical function of rational
than one might think.  To illustrate, note that the values of
cos(k pi/m) can be expressed algebraically as

1       / [ 1 + 1^(1/m) ]^2 \
--- sqrt( ------------------- )
2       \      1^(1/m)      /

but this isn't very useful for computing numerical answers.  In
general the values of 4cos^2(k pi/m) are the roots of the polynomial
whose coefficients (with alternating signs) are taken from a diagonal
of Pascal's triangle starting on the mth row.  To take the specific
example, the value of 4cos^2(2pi/7) is a root of the 7th diagonal

1
1   1
1   2   1
1   3   3  (1)
1   4  (6)  4   1
1  (5) 10  10   5   1
(1)  6  15  20  15   6   1

so we have the cubic

x^3 - 5x^2 + 6x - 1  =  0

We could just solve this cubic for the values of 4cos^2(k pi/7), but
since those values are all squares, we know that each root x of this
polynomial is a square, so setting x=y^2 and substituting into the
above equation gives

y^6 - 5y^4 + 6y^2 - 1  =  (y^3 - y^2 - 2y + 1) (y^3 + y^2 - 2y - 1)

The value of 2cos(2pi/7) is a root of the right-hand cubic, which
gives the result

/2pi\      1   / / 7+21R(-3) \ 1/3   / 7-21R(-3) \ 1/3    \
cos( --- )  = --- ( ( ----------  )   + ( ----------- )   - 1  )
\ 7 /      6   \ \     2     /       \     2     /        /

where R() signifies square root.  So here we have an explicit
because we need to evaluate the cube root of a complex number.

By the way, for a related bit of trivia, notice that 7 = 2^3 - 1 is
a Mersenne prime.  Furthermore, if we write

6cos(pi/7)  =  2  -  (q)^(1/3)  -  (q*)^(1/3)

where "*" denotes the complex conjugate we have

q = 28 + 144 sqrt(-3)

whose norm is

(28)^2  +  3(144)^2   =   62992

=   (2^4)(2^5 - 1)(2^7 - 1)

so the odd prime divisors are the next two Mersenne primes after
7, i.e., 31 and 127.
```