If $f(x)=(x-2)q(x)-8$ for polynomial $q$, and $x+2$ is a factor of $f(x)$, find the remainder when $f(x)$ is divided by $x^2-4$ 
Given:
$f(x)=(x-2)q(x) -8$, where $q(x)$ is a polynomial
$(x+2)$ is a factor of $f(x)$
Find the remainder when $f(x)$ is divided by $(x^2-4)$.

I know the answer is $-2x-4$, but I do not know the working behind it?

We know that when $f(x)$ is divided by $x-2$ the remainder is $-8$, so
$$f(x) = (x-2)q(x) - 8$$
for some polynomial $q(x)$.
We also know that $x+2$ is a factor of of $f(x)$.  This means that when we plug in $x=-2$ to $f(x)$ we should get $0$.  So
$$0 = (-2 -2)q(-2) - 8$$
$$8 = -4q(-2)$$
$$-2 = q(-2)$$
This last result tells us that when $q(x)$ is divided by $x+2$, the remainder is $-2$, so for some polynomial $u(x)$ we have
$$q(x)=(x+2)u(x) - 2$$
Combining these results, we now know that
$$f(x) = (x-2)((x+2)u(x) - 2) - 8$$
$$f(x) = (x^2-4)u(x) -2(x-2) - 8$$
$$f(x) = (x^2 - 4)u(x) -2x - 4$$
and now you can see the remainder when $f(x)$ is divided by $x^2-4$.
