Ta có:
f(x) chia x+1 dư 7
=> f(-1) =7
<=> -1-a-b = 7
<=>-a-b=8
f(x) chia x-3 dư -5
=> f(3) = -5
<=> 27+3a+b = -5
<=> 3a+b = -32
=>\(\left\{\begin{matrix}-a-b=8\\3a+b=-32\end{matrix}\right.\Leftrightarrow\left\{\begin{matrix}2a=-24\\-a-b=8\end{matrix}\right.\Leftrightarrow}\left\{\begin{matrix}a=-12\\b=4\end{matrix}\right.\)Vậy a=-12; b=4