\(f\left(x\right)=x^3+ax+b\)
\(f\left(x\right)\)chia \(x+1\)dư \(7\)nên \(f\left(-1\right)=7\)
\(f\left(x\right)\)chia \(x-3\)dư \(5\)nên \(f\left(3\right)=5\)
\(\hept{\begin{cases}-1-a+b=7\\27+3a+b=5\end{cases}}\Leftrightarrow\hept{\begin{cases}a=-\frac{15}{2}\\b=\frac{1}{2}\end{cases}}\)