Math Help - factor theorm

1. factor theorm

Given that x-1 and x+2 are factors of f(x)= x^3 + px + q where p and q are integers, find p and q.

How do i start in find p and q????

2. Re: factor theorm

If $x-a$ is a factor, then $f(a)=0$

3. Re: factor theorm

so wait if i use x-1 then where x is, it would be replaced by 1,

F(1) = 1^3 + p(1) + q

and i was just end up where i started, so how to advance on this questions , and thanks

4. Re: factor theorm

$F(1) = 1^3 + p(1) + q = 0$
This gives you one equation in $p$ and $q$. Now find another using the other factor.

5. Re: factor theorm

then i simultaneously solve right???
thanks alot your help greatly appreciated,

6. Re: factor theorm

Another method:

$x^3+px+q=(x-1)(x+2)(x-k)$

We know k is real as complex roots come in conjugate pairs.

$x^3+px+q=\left(x^2+x-2\right)(x-k)$

$x^3+px+q=\left(x^3+x^2-2x\right)-\left(kx^2+kx-2k\right)$

$x^3+0\cdot x^2+px+q=x^3+(1-k)x^2-(2+k)x+2k$

Now equate coefficients.