Solution (source code)

= Solution

<Eisenstein criterion> says that a primitive <integer> <polynomial> is irreducible over $\mathbb Q$ if some prime divides all coefficients except the leading one, does not divide the leading coefficient, and its square does not divide the constant coefficient. The passage from primitive <integer> factorization to rational factorization is <Gauss lemma for polynomials>.

Translate the variable:
$$
(x+1)^8+1=x^8+8x^7+28x^6+56x^5+70x^4+56x^3+28x^2+8x+2.
$$
This is Eisenstein at two. Translation is an automorphism of $\mathbb Q[x]$, so $x^8+1$ itself is irreducible.

Set $\zeta=e^{i\pi/8}$ and $c=\cos(\pi/8)$. Since $\zeta$ is a root of that irreducible degree-eight <polynomial>, $[\mathbb Q(\zeta):\mathbb Q]=8$. Also $c=(\zeta+\zeta^{-1})/2$, so $\mathbb Q(c)\subseteq\mathbb Q(\zeta)$ and $\zeta$ solves $T^2-2cT+1=0$. The extension degree is at most two. It is not one, since every element of $\mathbb Q(c)$ is real and $\zeta$ is not. The <tower law for field extensions> now gives
$$
\boxed{[\mathbb Q(\zeta):\mathbb Q(c)]=2,\qquad[\mathbb Q(c):\mathbb Q]=4}.
$$