When a polynomial $p(x)$ is divided by $x + 1,$ the remainder is 5.  When $p(x)$ is divided by $x + 5,$ the remainder is $-7.$  Find the remainder when $p(x)$ is divided by $(x + 1)(x + 5).$
I know that the remainder theorem tells me that $p(-1) = 5$ and $p(-5) = -7,$ since those are the values of $x$ that make the divisors zero. I also know that the remainder when $p(x)$ is divided by $(x + 1)(x + 5)$ must be a polynomial of degree at most 1, since the divisor has degree 2. So I can assume that the remainder has the form $r(x) = ax + b,$ and I want to find $a$ and $b.$ To do that, I can use the fact that $p(-1) = r(-1) = a(-1) + b = 5$ and $p(-5) = r(-5) = a(-5) + b = -7.$ This gives me a system of two linear equations in two unknowns: \begin{align*} -a + b &= 5 \\ -5a + b &= -7 \end{align*} I can solve this system by subtracting the first equation from the second, which gives me $-4a = -12,$ so $a = 3.$ Then I can plug in $a = 3$ into either equation, say the first one, and get $b = 5 + 3 = 8.$ Therefore, the remainder is $r(x) = 3x + 8.$ 