When a polynomial $f(x)$ is divided by $(x-2),$ the remainder is $7$. When $f(x)$ is divided by $(x+1)$ the remainder is $-2$.
(a) If the remainder is $px+q$ when $f(x)$ is divided by $(x-2)(x+1)$, find the values of $p$ and $q$.
(b) Find the remainder when $f(x+3)$ is divided by $(x+1)(x+4)$
I found the values of $p$ and $q$ which are $3$ and $1$ by using remainder theorem.
$f(x)=Q(x)*(x-2)(x+1)+(px+q)$
However I don't know how to get the remainder of part(b).
Let $g(x)=f(x+3)$.
When $g(x)$ is divided by $(x+1)$, the remainder
$=g(-1)$
$=f(-1+3)$
$=f(2)$
When $g(x)$ is divided by $(x+4)$, the remainder
$=g(-4)$
$=f(-4+3)$
$=f(-1)$
At this point, since the two remainders I got are the same when $f(x)$ is divided by $(x-2)$ and $(x+1)$,
I assume $f(x+3)=Q(x)*(x+1)(x+4)+(px+q)$.
But $3x+1$ is not the answer.
What mistakes have I made and how to solve part(b)?