I'm reading the solution to a math question, and part of the solution states this:
$\prod_{k = 1}^{n - 1}(x - e^{\frac{2\pi ik}{n}})$ is equal to $\frac{x^n - 1}{x - 1}$ by the roots of unity.
However, I'm not quite getting how these two are equal--not that I doubt it, I'm just stuck on how they got there by the roots of unity. In other words, could someone prove or further explain how they got from the first to the second expression?
By fundamental theorem of algebra we have $$ x^n-1=\prod_{k=1}^n (x-x_k),\tag1 $$ where $x_k$ are the roots of the polynomial $x^n-1$. It is easy to check by direct substitution that the roots are: $$ x_k=e^{i\frac{2\pi k}n},\quad k=1\dots n.\tag2 $$ Since all $n$ roots in $(2)$ are distinct, one concludes that the roots are simple and no other roots exist.
Finally assuming $x\ne1$ divide both sides of the equation $(1)$ by $x-x_n=x-1$ to obtain the identity in question.