Explanation:
a polynomial of degree 4 must have 4 zeroes.
when we know these zeroes, we can define the polynomial by the factors defining these zeroes.
after all, a multiplication of several factors can only be zero, if at least one of the factors is zero.
we have 3 zeroes at x = -1. and 1 zero at x = 0.
so,
f(x) = (x + 1)(x + 1)(x + 1)x
you see ? this will only be zero, if x = -1 or x = 0. and -1 is built in as zero 3 times.
let's do the multiplications :
(x + 1)(x + 1) = x² + 2x + 1
(x + 1)x = x² + x
(x² + 2x + 1)(x² + x) = x⁴ + x³ + 2x³ + 2x² + x² + x =
= x⁴ + 3x³ + 3x² + x
f(x) = 1x⁴ + 3x³ + 3x² + 1x