Answer
$$
\int_{0}^{4} \frac{d x}{x^{2}-x-2}
$$
Observe that the given integral is improper because $ f(x)= \frac{1}{x^{2}-x-2}$ has the vertical asymptote $x=2 $. The infinite discontinuity occurs at the middle of the interval $ [0,4] $ at $x = 2$.
The given improper integral is divergent.
Work Step by Step
$$
\int_{0}^{4} \frac{d x}{x^{2}-x-2}
$$
Observe that the given integral is improper because $ f(x)= \frac{1}{x^{2}-x-2}$ has the vertical asymptote $x=2 $. Since the infinite discontinuity occurs at the middle of the interval $ [0,4] $ at $x = 2$, we must use part (c) of Definition 3 with $ c=2$:
$$
\int_{0}^{4} \frac{d x}{x^{2}-x-2} =\int_{0}^{2} \frac{d x}{x^{2}-x-2} +\int_{2}^{4} \frac{d x}{x^{2}-x-2}
$$
Now
$$
\frac{1}{x^{2}-x-2}=\frac{1}{(x+1)(x-2)}=\frac{A}{(x+1)}+\frac{B}{(x-2)}\\
\Rightarrow \quad 1=A(x-2)+B(x+1)
$$
Set $x=2$ to get $1=3B $ , so $B=\frac{1}{3} $ ,
Set $x=-1$ to get $1=-3A $ , so $A=\frac{-1}{3} $.
Thus
$$
\begin{split}
\int_{0}^{2} \frac{d x}{x^{2}-x-2} & =\lim _{t \rightarrow 2^{-}} \int_{0}^{t}\left(\frac{-\frac{1}{3}}{x+1}+\frac{\frac{1}{3}}{x-2}\right) d x \\
& =\lim _{t \rightarrow 2^{-}}\left[-\frac{1}{3} \ln |x+1|+\frac{1}{3} \ln |x-2|\right]_{0}^{t} \\
& =\lim _{t \rightarrow 2^{-}}\left[\left(-\frac{1}{3} \ln |t+1|+\frac{1}{3} \ln |t-2|\right)- \\
\quad \quad \quad - \left(-\frac{1}{3} \ln |1|+\frac{1}{3} \ln |-2|\right)\right] \\
& =-\infty, \quad \text { since } \lim _{t \rightarrow 2^{-}}\left(\frac{1}{3} \ln |t-2|\right)=-\infty
\end{split}
$$
so the integral
$$
\int_{0}^{2} \frac{d x}{x^{2}-x-2}
$$
is divergent, and hence,
$$
\int_{0}^{4} \frac{d x}{x^{2}-x-2}
$$
is divergent .
Thus the given improper integral is divergent.