Jelly, 15 bytes
Æṛ‘Ė’Uj€“x^”j”+
This uses Æṛ
to construct the coefficients of a monic polynomial with given roots. Try it online!
How it works
Æṛ‘Ė’Uj€“x^”j”+ Main link. Argument: A (list of roots)
Æṛ Yield the coefficients of a monic polynomial with roots A.
‘ Increment each root by 1.
Ė Enumerate the roots, yielding
[[1, coeff. of x^0 + 1], ... [n + 1, coeff. of x^n + 1]].
’ Decrement all involved integers, yielding
[[0, coeff. of x^0], ... [n, coeff. of x^n]].
U Upend to yield [[coeff. of x^0, 0], ... [coeff. of x^n, n]].
j€“x^” Join each pair, separating by 'x^'.
j”+ Join the pairs, separating by '+'.
Alternate version, 24 bytes
1WW;ð0;_×µ/‘Ė’Uj€“x^”j”+
This uses no polynomial-related built-ins. Try it online!
How it works
1WW;ð0;_×µ/‘Ė’Uj€“x^”j”+ Main link. Argument: A (list of roots)
1WW Yield [[1]].
; Concatenate with A.
ð µ/ Reduce [[1]] + A by the following, dyadic chain:
0; Prepend a zero to the left argument (initially [1]).
This multiplies the left argument by "x".
× Take the product of both, unaltered arguments.
This multiplies the left argument by "r", where r is
the root specified in the right argument.
_ Subtract.
This computes the left argument multiplied by "x-r".
‘Ė’Uj€“x^”j”+ As before.
numpy.poly
? \$\endgroup\$