% This is lecture no. 13 of MH1101/: Calculus II.

\chapter{Improper Integrals}%
\label{cha:improper_integrals}

\section{Unbounded Interval}%
\label{sec:unbounded_interval}

\begin{definition}
	Improper integral over an unbounded interval.
	If the integral:
	\[
	\int_{a}^{t} f(x) \ud x
	\]
	exists for every number $t\geqslant a$, then we define the improper integral over an unbounded interval as follows:
	\[
	\int_{a}^{\infty} f(x) \ud x=\lim_{t \to \infty}\int_{a}^{t} f(x) \ud x
	.\]
	It is convergent if the corresponding limit exists, and divergent if the limit does not exist.
\end{definition}
\begin{exmp}
	Determine whether $\displaystyle{\int_{1}^{\infty} \frac{1}{x} \ud x}$ is convergent of divergent.
	\begin{sol}
		Let $t\geqslant 1$.
		Then:
		\[
			\int_{1}^{t} \frac{1}{x} \ud x = [\ln|x|]^{t}_{1} = \ln t
		,\]
		which exists, and thus we have:
		\[
		\int_{1}^{\infty} \frac{1}{x} \ud x = \lim_{t \to \infty}\int_{1}^{t} \frac{1}{x} \ud x = \lim_{t \to \infty}\ln t = \infty
		.\]
		Thus the improper limit is divergent.
	\end{sol}
\end{exmp}
\begin{exmp}
	Is the improper integral $\int_{0}^{\infty} xe^{-x} \ud x$ convergent?
	If it is, what is its value?
	\begin{sol}
		\begin{align*}
			\int_{0}^{\infty} xe^{-x} \ud x & = \lim_{t \to \infty}\int_{0}^{t} xe^{-x} \ud x\\
							& = \lim_{t \to \infty}\left([xe^{-x}]^{t}_{0}-\int_{0}^{t} -e^{-x} \ud x\right)\\
							& = \lim_{t \to \infty}\left(\frac{t}{e^{t}}\right) + \lim_{t \to \infty}\int_{0}^{t} e^{-x} \ud x\\
							& = \lim_{t \to \infty}\left(\frac{t}{e^{t}}\right) + \lim_{t \to \infty}[-e^{-x}]^{t}_{0}\\
							& = \lim_{t \to \infty}\left(\frac{1}{e^{t}}\right) - \lim_{t \to \infty}(e^{-t}-1)\\
							& = 0-(0-1)\\
							& =1.
		\end{align*}
		$\therefore$ the series is convergent.
	\end{sol}
\end{exmp}

\begin{thrm}
	Convergence and divergence of the integral of a function over all of $\mathbb{R}$.
	If both of the following integrals:
	\[
	\int_{a}^{\infty} f(x) \ud x,\ \int_{-\infty}^{a} f(x) \ud x
	,\]
	are convergent for some $a\in\mathbb{R}$, then we define:
	\[
	\int_{-\infty}^{\infty} f(x) \ud x=\int_{-\infty}^{a} f(x) \ud x + \int_{a}^{\infty} f(x) \ud x
	.\]
	The improper integral over $\mathbb{R}$ is said to be convergent.
	If either of the integrals is divergent, then the improper integral over $\mathbb{R}$ is divergent.
\end{thrm}

\section{Infinite Discontinuity}%
\label{sec:infinite_discontinuity}

\begin{definition}
	Infinite discontinuity at left end-point.
	If $f$ is continuous on $(a,b]$ and is discontinuous at $a$, then:
	\[
	\int_{a}^{b} f(x) \ud x=\lim_{t \to a^{+}}\int_{t}^{b} f(x) \ud x
	,\]
	if the limit exists.
	The improper integral is said to be convergent if the limit exists and divergent if the limit does not exist.
\end{definition}
\begin{exmp}
	Determine the value of the integral $\displaystyle{\int_{2}^{5} \frac{1}{\sqrt{x-2}} \ud x}$.
	\begin{sol}
		The function:
		\[
			f(x) = \frac{1}{\sqrt{x-2}}
		,\]
		has an infinite discontinuity at the left endpoint of $(2,5]$.
		Therefore, the integral is improper, thus we evaluate it as follows:
		\begin{align*}
			\int_{2}^{5} \frac{1}{\sqrt{x-2}} \ud x & = \lim_{x \to 2^{+}}\int_{t}^{5} \frac{1}{\sqrt{x-2}} \ud x\\
								& = \lim_{t \to 2^{+}}\left[2\sqrt{x-2}\right]^{5}_{t}\\
								& = \lim_{t \to 2^{+}}2\left(\sqrt{3}-\sqrt{t-2}\right)\\
								& = 2\sqrt{3}.
		\end{align*}
	\end{sol}
\end{exmp}
\begin{definition}
	Infinite discontinuity at right end-point.
	If $f$ is continuous on $[a,b)$ and is discontinuous at $b$, then:
	\[
	\int_{a}^{b} f(x) \ud x=\lim_{t \to b^{-}}\int_{a}^{t} f(x) \ud x
	,\]
	if the limit exists.
	The improper integral is said to be convergent if the limit exists and divergent if the limit does not exist.
\end{definition}
\begin{exmp}
	Evaluate $\displaystyle{\int_{-1}^{0} \frac{1}{x^2} \ud x}$.
	\begin{sol}
		Since $\displaystyle{\lim_{x \to 0^{-}}\frac{1}{x^2}=\infty}$, we replace the upper limit 1 by a variable $t<0$:
		\[
		\int_{-1}^{t} \frac{1}{x^2} \ud x
		.\]
		Then the improper integral is evaluated as follows:
		\begin{align*}
			\int_{-1}^{0} \frac{1}{x^2} \ud x & = \lim_{t \to 0^{-}}\int_{-1}^{t} \frac{1}{x^2} \ud x\\
							  & = \lim_{t \to 0^{-}}\left[-\frac{1}{x}\right]^{t}_{-1}\\
							  & = \lim_{t \to 0^{-}}\left(-\frac{1}{t}-1\right)\\
							  & = \infty.
		\end{align*}
		Thus, the improper integral diverges to infinity.
	\end{sol}
\end{exmp}
\begin{thrm}
	If $f$ has a discontinuity at $c$, where $a<c<b$, and both of the following integrals are convergent:
	\[
	\int_{a}^{c} f(x) \ud x,\ \int_{c}^{b} f(x) \ud x
	,\]
	then we define
	\[
	\int_{a}^{b} f(x) \ud x = \int_{a}^{c} f(x) \ud x + \int_{c}^{b} f(x) \ud x
	,\]
	if either of the summands are divergent, we say that their summation is divergent.
\end{thrm}
\begin{exmp}
	Evaluate $\displaystyle{\int_{0}^{2} \frac{1}{\sqrt{2x-x^2}} \ud x}$.
	\begin{sol}
		The integrand is continuous on $(0,2)$.
		However, note that
		\[
			\lim_{x \to 0^{+}}\frac{1}{\sqrt{2x-x^2}}=\infty
		,\]
		and
		\[
			\lim_{x \to 2^{-}}\frac{1}{\sqrt{2x-x^2}}=\infty
		.\]
		Thus, we evaluate the given improper integral as follows:
		\[
			\int_{0}^{2} \frac{1}{\sqrt{2x-x^2}} \ud x = \int_{0}^{1} \frac{1}{\sqrt{2x-x^2}} \ud x + \int_{1}^{2} \frac{1}{\sqrt{2x-x^2}} \ud x
		.\]
		We then proceed to evaluate each summand:
		\begin{align*}
			\int_{0}^{1} \frac{1}{\sqrt{2x-x^2}} \ud x & = \lim_{t \to 0^{+}}\int_{t}^{1} \frac{1}{\sqrt{2x-x^2}} \ud x\\
								   & = \lim_{t \to 0^{+}}\int_{t}^{1} \frac{1}{\sqrt{1-(x-1)^2}} \ud x\\
								   & = \lim_{t \to 0^{+}}\left[-\sin^{-1}(x-1)\right]^{1}_{t}\\
								   & = \lim_{t \to 0^{+}}\left(-\sin^{-1}(t-1)\right)\\
								   & = \frac{\pi}{2}.
		\end{align*}
		And for the second summand:
		\begin{align*}
			\int_{1}^{2} \frac{1}{\sqrt{2x-x^2}} \ud x & = \lim_{t \to 2^{-}}\int_{1}^{t} \frac{1}{\sqrt{2x-x^2}} \ud x\\
								   & = \lim_{t \to 2^{-}}\int_{1}^{t} \frac{1}{\sqrt{1-(x-1)^2}} \ud x\\
								   & = \lim_{t \to 2^{-}}\left[\sin^{-1}\left(x-1\right)\right]^{t}_{1}\\
								   & = \lim_{t \to 2^{-}}\left(\sin^{-1}(t-1)\right)\\
								   & = \frac{\pi}{2}.
		\end{align*}
		Thus we have:
		\[
			\int_{0}^{2} \frac{1}{\sqrt{2x-x^2}} \ud x = \frac{\pi}{2} + \frac{\pi}{2} + \pi
		.\]
		And we conclude that the improper integral converges to $\pi$.
	\end{sol}
\end{exmp}
