# Doubts on solution of product of diagonals of $n$-sided regular polygon

The OP in this post asked the following:

If you take a regular $n$-sided polygon, which is inscribed in the unit circle and find the product of all its diagonals (including two sides) carried out from one corner you will get $n$ exactly:

$A_1A_2\cdot A_1A_3\cdot ...\cdot A_1A_n = n$

user21820 used the following idea to solve the above question.

Let $z$ be a complex number such that $z^n=1$ where $n$ is the number of sides of that polygon. Denote $z_0=1,z_1,...,z_{n-1}$ be roots of the equation $z^n=1.$ It suffices to show that $$\prod_{k=1}^{n-1}|1-z_k| = n.$$

By the definition of roots, we have $$z^n-1=\prod_{k=0}^{n-1}(z-z_k) = (z-1)\prod_{k=1}^{n-1}(z-z_k).$$ Also by factorization, we have $$z^n-1 = (z-1)\sum_{k=0}^{n-1}z^k$$ By equating the two equations and cancelling the factor $(z-1)$, we have $$\prod_{k=1}^{n-1}(z-z_k) = \sum_{k=0}^{n-1}z^k.$$ Let $z=1.$ So we have $$\prod_{k=1}^{n-1}(1-z_k) = \sum_{k=0}^{n-1}z^k = n.$$ Therefore, $$\prod_{k=1}^{n-1}|1-z_k| = n.$$

Question: After we cancel the factor $(z-1),$ I thought the substitution $z=1$ at latter part is invalid? My doubt arises from the fact that cancellation in the following $$0\cdot x = 0 \cdot y \Rightarrow x = y$$ is not valid.

• See it as $$p(x)g(x)=p(x)f(x) \implies g(x)=f(x)$$ – Aakash Kumar Aug 9 '17 at 13:09

The thing is that $z^n - 1$ has algebraic factors regardless of whether any is zero. The product of all of the factors, outside $(z-1)$, is then the sum of powers from $z^0$ to $z^{n-1}$, which when $z=1$, is indeed the same as $n$. It equates to a repunit of $n$ terms.
In fact, the equation just showed the expansion of L.H.S, it's not that we were calculating concrete numbers, but that like rewritting equation. You know, the equation holds as long as at least $n$ distinct numbers satisfy it, so just ignore it.