<s>[INST] Factoring $x^n + 1$. By the Fundamental Theorem of Algebra, every polynomial of degree $n$ can be factored into a product of $n$ linear polynomials.
As an example, since the polynomial $ x^5 +1$ has the five complex roots $$\tag{1} -1,\quad e^{\frac{\pi i}{5}}, \quad  e^{\frac{-\pi i}{5}}, \quad  e^{\frac{3\pi i}{5}}, \quad  e^{\frac{-3\pi i}{5}},$$ we can write $$\tag{2} x^5+1=(x+1)(x- e^{\frac{\pi i}{5}})(x- e^{\frac{-\pi i}{5}})(x- e^{\frac{3\pi i}{5}})(x- e^{\frac{-3\pi i}{5}}).$$
Multiplying several terms in $(2)$ gives $$\tag{3} x^5+1=(x+1)(x^2 -2\cos{\frac{\pi}{5}}x + 1)(x^2 -2\cos{ \frac{3\pi}{5}}x+1).$$
Now, $(3)$ is of course a specific example of the general theorem (which also relies on the structure of $\mathbb{C}$):

Any polynomial with real coefficients can be factored into a product of real linear and real quadratic polynomials.

Generalising $(3)$ to any odd value  $n\in \mathbb{N}$, gives the following formula:
$$\tag{4} x^n +1 = (x+1) \left(x^2 -2\big(\cos{\frac{\pi}{n}}\big)x + 1\right) \left(x^2 -2\big(\cos{\frac{3\pi}{n}}\big)x + 1\right)\cdots \left(x^2 -2\big(\cos{\frac{(n-2)\pi}{n}}\big)x + 1\right) .$$
This result is interesting to me, as it suggests that even in $\mathbb{R}$ the cosine function is, in some vague sense, built in to exponentiation.
Question: I am wondering if either the general formula $(4)$ or a specific case, such as $(3)$, could be derived using only real analytical tools (and maybe some ring theory?): i.e., without complex numbers and Euler’s formula?
 [/INST] The case $\,n=5\,$ can be solved algebraically by first factoring $\,x^5+1$ $ = (x+1)(x^4-x^3+x^2-x+1)\,$, then the second factor is a palindromic polynomial which reduces to a quadratic in $\,x+1/x\,$:
$$
\begin{align}
x^4-x^3+x^2-x+1 &= x^2\left(\left(x^2+\frac{1}{x^2}\right)-\left(x+\frac{1}{x}\right)+1\right) \\
 &= x^2\left(\left(x+\frac{1}{x}\right)^2 - \left(x+\frac{1}{x}\right) - 1\right) \\
 &= x^2\left(\left(x+\frac{1}{x}\right)-z_1\right)\left(\left(x+\frac{1}{x}\right)-z_2\right) \\
 &= \left(x^2-z_1 x + 1\right)\left(x^2-z_2 x + 1\right)
\end{align}
$$
In the latter $\,z_{1,2}=\dfrac{1\pm\sqrt{5}}{2}\,$ are the roots of $\,z^2-z-1=0\,$, and the expression matches the trigonometric form. In fact, this is one way to prove that $\,\cos \dfrac{\pi}{5}=\dfrac{1+\sqrt{5}}{4}\,$.
Similarly, the case $\,n=7\,$ factors as:
$$
x^7+1=(x+1)\left(x^2-z_1 x + 1\right)\left(x^2-z_2 x + 1\right)\left(x^2-z_3 x + 1\right)
$$
Here $\,z_{1,2,3}\,$ are the roots of the cubic $\,z^3-z^2-2z+1=0\,$.
For odd $\,n\,$ the problem reduces to factoring a polynomial of degree $\,\dfrac{n-1}{2}\,$, however that is not solvable by radicals in general for $\,n \gt 9\,$.
</s>