Create polynomial coefficients from its roots

Given some roots : $r_1,r_2,\ldots,r_n$, how can we reconstruct polynomial coefficients?

I know the Horner scheme and that we can just go backwards receiving those coefficients.

But I'm curious if there's some other nice solution to this problem.


Solution 1:

Knowing the location of roots really only pins down a family of polynomials, which vary by multiplicative constants. If you know the roots of $P(x)$ are $r_1, r_2, \dots, r_n $ then you can write the polynomial as $$ P(x) = a (x-r_1)(x-r_2) \cdots (x-r_n) $$

where $a$ is some non-zero constant. However, we can not be more precise than that. We can pin down $a$ if we know the value of $P$ are any other point. If we knew $a$, then simply expanding the right hand side would produce the polynomial in a form where you could read off the constants.

Solution 2:

The polynomial is $P(z) = a_0 (z-r_1)\times (z-r_2) \times \cdots \times (z-r_n)$. Now labeling coefficients as $P(z) = a_0 z^n + a_1 z^{n-1} + \ldots + a_n$ we have $$ a_1 = -a_0 ( r_1 + r_2 + \ldots + r_n) \qquad a_n = (-1)^n a_0 r_1 \times r_2 \times \cdots \times r_n $$ In general: $$ a_k = \frac{(-1)^k}{k!} a_0 \sum_\pi r_{\pi(1)} \times \cdots \times r_{\pi(k)} $$ where the sum is over permutations $ \pi \in \mathfrak{S}_n$.