The polynomial $A(x)=x^4+2x^3-5x^2-22x-24$ is divisible by $B(x)=x^2+ax+b$. Find for which values of $a$ and $b$ the polynomial $A(x)=x^4+2x^3-5x^2-22x-24$ is divisible by $B(x)=x^2+ax+b$.
We can write $$A(x)=B(x)Q(x)+R(x)$$ where $Q(x)$ is the quotient and $R(x)$ is the remainder. We want to show that $R(x)=0$. The degree of $Q(x)$ is equal to $4-2=2$, so $Q(x)=mx^2+nx+p$.
The degree of $R(x)$ is at most $1$, so we can consider that $R(x)=qx+r$. What to do next?

By plugging in small values of $x$ (for example $x=-2,-1,0,1,2,\ldots$), we can note that for $x=3$ and $x=-2\;$, $A(x)=0$. Hence by Rational root theorem $(x-3)(x+2)=x^2-x-6$ is a factor of $A(x)$. The other factor can be found by for example long division or other methods. The factorization will be ,
$$x^4+2x^3-5x^2-22x-24=(x^2-x-6)(x^2+3x+4)$$
Hence there are two set of values for $a$ and $b$.
