I am basically using the result that given any polynomials $\displaystyle f(x),g(x)$ with $\displaystyle g(x)\not\equiv0,$ there exist polynomials $\displaystyle q(x),r(x)$ with either $\displaystyle r(x)\equiv0$ or $\displaystyle \deg r(x)<\deg g(x)$ such that $\displaystyle f(x)=q(x)g(x)+r(x).$ (This applies to polynomials over a field such as the field of rationals, reals or complex numbers.) The polynomial $\displaystyle r(x)$ is the remainder when $\displaystyle f(x)$ is divided by $\displaystyle g(x).$

Actually, I didn’t do a great job in my post above. Let me re-do the proof in a clearer way.

Given polynomials $\displaystyle P(z)$ and $\displaystyle (z-1)(z+3)$ we have that there exist a polynomial $\displaystyle R(z)$ and constants $\displaystyle k,h$ such that

$\displaystyle P(z)\ =\ (z-1)(z+3)R(z)+kx+h$

As $\displaystyle P(-1)=-8$ and $\displaystyle P(3)=4$ we have $\displaystyle -k+h=-8$ and $\displaystyle 3k+h=4.$ Solving the two simultaneous equations should yield $\displaystyle k=3,\,h=-5.$ Hence the remainder is $\displaystyle 3x-5.$