Difficult definite integration $\int_{-2}^{0}\frac{x^2 + x - 5}{(x-1)^2}e^x\,\mathrm dx$
Integration by part we get \begin{align*} \int\frac{x^2 + x - 5}{(x-1)^2}e^x \, \mathrm{d}x&=-\frac{x^2 + x - 5}{x-1}e^x +\int e^{x}\left ( x+4 \right )\, \mathrm{d}x \\ &=-\frac{x^2 + x - 5}{x-1}e^x+e^{x}\left ( x+3 \right )\\ &=\frac{x+2}{x-1}e^{x} \end{align*} Then you can take it from here.
Substituting for $u=x-1$, we get, $$I=\int_{-2}^{0} \frac {x^2-x+5}{(x-1)^2} e^x dx =\int_{-3}^{-1} \frac {u^2+3u-3}{u^2} e^{u+1} du $$ $$\Rightarrow I=e [\int_{-3}^{-1} [3 (\frac {e^u}{u} -\frac {e^u}{u^2}) du] +\int_{-3}^{-1} e^u du] =e [3I_1-3I_2 +I_3] $$ Now we have $$I_1-I_2 =\int_{-3}^{-1}(\frac {e^u}{u}-\frac {e^u}{u^2}) du =\int_{-3}^{-1} d (\frac {e^u}{u}) =\frac {e^u}{u} \mid_{-3}^{-1} $$ We see that $I_3$ is easy to solve. Finally the answer is $-2$. Hope it helps.