TITLE: Integrating $x/(x-2)$ from $0$ to $5$
QUESTION [6 upvotes]: How would one go about integrating the following?
$$\int_0^5 \frac{x}{x-2} dx$$
It seems like you need to use long division, split it up into two integrals, and the use limits. I'm not quite sure about the limits part.

REPLY [5 votes]: The integrand $\frac{x}{x-2}$ has a vertical asymptote at $x=2$. Therefore
the integral 
$$
\begin{equation*}
I=\int_{0}^{5}\frac{x}{x-2}dx=\int_{0}^{2}\frac{x}{x-2}dx+\int_{2}^{5}\frac{x
}{x-2}dx=I_{1}+I_{2}
\end{equation*}
$$
is an improper integral of the second kind. It exists only if both integrals 
$I_{1}$ and $I_{2}$ exist. Let's compute the first one using the
substitution $u=x-2,dx=du$, as commented above
$$
\begin{eqnarray*}
I_{1} &=&\int_{0}^{2}\frac{x}{x-2}dx=\int_{-2}^{0}\frac{u+2}{u}
du=\int_{-2}^{0}1du+\int_{-2}^{0}\frac{2}{u}du \\
&=&2+2\int_{-2}^{0}\frac{1}{u}du=2+2\ln \left\vert u\right\vert
_{-2}^{0}=2+2\lim_{\varepsilon \rightarrow 0}\ln \left\vert u\right\vert
_{-2}^{-\varepsilon },\quad \varepsilon >0 \\
&=&2+2\lim_{\varepsilon \rightarrow 0}\ln \left\vert -\varepsilon
\right\vert -2\ln \left\vert -2\right\vert  \\
&=&2-2\ln 2+2\lim_{\varepsilon \rightarrow 0}\ln \varepsilon .
\end{eqnarray*}
$$
Since $\lim_{\varepsilon \rightarrow 0}\ln  \varepsilon
 $ ($\varepsilon>0$) doesn't exist, the integral $\int_{-2}^{0}\frac{2}{u}du$ does
not converge and so does $I_{1}$. Similarly we might conclude that $I_{2}$
does not converge as well.