One way to do this is apply the polynomial remainder theorem. First, note that

which means either of

are roots to

.
The polynomial remainder theorem states that the remainder upon dividing a polynomial

by a linear expression

is equal to the value of

.
So what our factorization above tells us is that if we plug in, for example,

, we would get

Expanding the left hand side gives

Alternatively, you could have determined the quotient and remainder via long division, which you would find to be

Then, since you know

is a factor of the cubic polynomial, you also know that the remainder should be 0, which means we're left with the equation

as expected.