ĐKXĐ : \(x\ne\left\{-1;2\right\}\)
\(\frac{x^2+5}{x^3-3x-2}=\frac{a}{x-2}+\frac{b}{\left(x+1\right)^2}\)
\(\Leftrightarrow\frac{x^2+5}{\left(x-2\right)\left(x+1\right)^2}=\frac{a\left(x+1\right)^2+b\left(x-2\right)}{\left(x-2\right)\left(x+1\right)^2}\)
\(\Leftrightarrow\frac{x^2+5}{\left(x-2\right)\left(x+1\right)^2}=\frac{ax^2+2ax+a+bx-2b}{\left(x-2\right)\left(x+1\right)^2}\)
\(\Leftrightarrow\frac{x^2+5}{\left(x-2\right)\left(x+1\right)^2}=\frac{ax^2+x\left(2a+b\right)+\left(a-2b\right)}{\left(x-2\right)\left(x+1\right)^2}\)
Đồng nhất hệ số ta được : \(\hept{\begin{cases}a=1\\2a+b=0\\a-2b=5\end{cases}\Leftrightarrow\hept{\begin{cases}a=1\\b=-2\end{cases}}}\)
Vậy \(a=1;b=-2\)