Let $-\infty < a < b < \infty$ and $f:[a,b]\to \mathbb{R}$ be a bounded
function. Partition the interval $[a,b]$ by $P=\{ x_0,\dots,x_n\}$ where
$$
a = x_0 < x_1 < \dots < x_n = b.
$$
The partition $P$ has a norm $\| P\|$ given by its maximal interval
length
$$
\| P\| = \max \{ \Delta x_i=x_i - x_{i-1}\, :\, i=1,2,\dots ,n\}.
$$
Define
\begin{align*}
m_i(f)&= \inf\{ f(x): x_{i-1} \le x < x_i \}\\
M_i(f)&= \sup\{f(x): x_{i-1} \le x < x_i \}.
\end{align*}
and consider the lower and upper partial sums of $f$
(with respect to the partition $P$) given by
\begin{align*}
L(f,P)&= \sum_{i=1}^n m_i \Delta x_i,\\
U(f,P)&= \sum_{i=1}^n M_i \Delta x_i.
\end{align*}
It is easy to see that $L(f,P) \le U(f,P)$.
Remark
In fact, for any two partitions $P_1$ and $P_2$ for $[a,b]$, we
always have $L(f,P_1) \leq U(f, P_2)$.
Let
$$
P_1 : a= x_0 < x_1 < \dots < x_n =b\text{ and }P_2: a=y_0 <
y_1 < \dots < y_m = b,
$$
and define a refinement (partition) $P$ for $P_1$ and $P_2$ by using
$x_0,\dots,x_n$
and $y_0,\dots,y_m$ as end points in the appropriate natural
order. Denote such a refinement by $P_1 \cup P_2$. Then
$$
L(f, P_1) \leq L(f,P) \leq U(f,P) \leq U(f, P_2).
$$
Definition (Riemann Integral)
Now the lower and upper integrals of $f$ on $[a,b]$ are defined by
\begin{align*}
L(f)&= \lim_{\| P\|\to 0} L(f,P)\text{ and}\\
U(F)&= \lim_{\| P\| \to 0} U(f,P),
\end{align*}
respectively. They both always exist by monotonicity. Let $f\in
\operatorname{B}\bigl([a, b],\mathbb{R}\bigr)$, that is, a
real valued bounded function defined on $[a,b]$. It is said to be
(Riemann) integrable, or simply R-integrable
iff
$$
L(f) = U(f).
$$
Conditions for Riemann Integrability
Theorem
Let $f\in \operatorname{B}\bigl([a, b],\mathbb{R}\bigr)$ Then $f$ is
R-integrable iff, for any $\epsilon > 0$, there is a partition $P$ of
$[a,b]$ such that
$$
U(f,P) - L(f,P)\leq\epsilon.
$$
"$\Rightarrow$": if $f$ is (R-)integrable, then $L(f) = U(f)$. Given
$\epsilon>0$, there are $P_1$ and $P_2$ such that
$$
-L(f,P_1) + L(f)\leq\epsilon/2\text{ and }U(f,P_2) - U(f)\leq
\epsilon/2,
$$
by definition of lower and upper integral. Since $L(f)=U(f)$ it
follows that
$$
U(f, P) - L(f,P)\leq\epsilon
$$
for $P=P_1\cup P_2$.
"$\Leftarrow$": it always holds that $L(f) \ge L(f, P)$ and $U(f)
\le U(f,P)$. If, for any $\epsilon>0$, there is $P$ such that $U(f,P)
- L(f,P)\leq\epsilon$, then
$$
U(f) - L(f)\leq \epsilon.
$$
Now $U(f) - L(f) \ge 0$ is a fixed number and the inequality holds for
all $\epsilon>0$ so that indeed $U(f)-L(f) = 0$ and $f$ is integrable.
Examples
(a) If $f\in \operatorname{C}\bigl([a,b],\mathbb{R}\bigr)$,
then $f$ is integrable.
(b) Let the Dirichlet function $D:\mathbb{R}\to
\mathbb{R}$ be defined by
$$
D(x)=\begin{cases}
1,&x\text{ is rational}\\
0,&x\text{ is irrational}\end{cases}
$$
Then $D$ is not integrable on any interval $[a,b]$, since
$U(f)=b-a>0=L(f)$. The Dirichlet function is the typical example of a
non-integrable function.
(c) Let $R:[0,1]\to \mathbb{R}$ be given by
$$
R(x)=\begin{cases}
0,&x\text{ is irrational,}\\
1/n,&x=m/n\text{ and }(m,n) =1.\end{cases}
$$
Then $R$ is integrable on $[0,1]$.
(d) If $f:[a,b]\to \mathbb{R}$ is monotone, then it is
integrable.
(a) Continuity of $f$ implies uts uniform continuity since
$[a,b]$ is compact. Thus, given $\epsilon>0$, there is $\delta>0$ such
that
$$
|f(x_1) - f(x_2) |\leq\frac{\epsilon}{b-a}\text{, whenever }|x_1 -
x_2 |\leq\delta\text{ for }x_1, x_2 \in [a,b]\, .
$$
It suffices now to choose $n$ such that $\frac{b-a}{n} \leq\delta$
and
$$
P: x_0 = a < x_1< \dots < x_n =b\text{ with }x_j = x_{j-1} +
\frac{b-a}{n},
$$
to see that $M_j - m_j\leq\frac{\epsilon}{b-a}$ and that
$$
U(f,P) - L(f,P) \le \sum_{j=1}^n (M_j - m_j) \Delta
x_j\leq\frac{\epsilon}{b-a} \sum_{i=1}^n \Delta x_i=\epsilon.
$$
(c) Exercise.
(d) Let $P: a=x_0 < x_1 < \dots < x_n=b$ be any
partition for $[a,b]$. Since $f$ is increasing, it follows that
\begin{gather*}
m_i = \inf\{f(x): x_{i-1} \le x < x_i \} = f(x_{i-1}),\\
M_i=\sup \{f(x): x_{i-1} \le x < x_i \} = f(x_i - 0)\le f(x_i).
\end{gather*}
Therefore
\begin{equation*}
U(f,P) - L(f,P) = \sum_{i=1}^n (M_i - m_i) \Delta x_i \le \| P\|
\sum_{i=1}^n (M_i - m_i)\leq\big[f(b) - f(a)\big]\| P\|,
\end{equation*}
since
$$
M_1 - m_1 + M_2 - m_2+\dots + M_n - m_n \le M_n - m_1 \le f(b) -f(a).
$$
For $\epsilon>0$ and for any partition $P$ for $[a,b]$ with
$\|P\|\leq\frac{\epsilon}{f(b) - f(a)}$ it follows that
$$
U(f,P) - L(f,P)\leq \big[f(b) - f(a)\big]\frac{\epsilon}{f(b) - f(a)}
= \epsilon
$$
and $f$ is integrable.
For a bounded $f:[a,b]\to \mathbb{R}$ define
$$
D(f)=\{ x\in[a,b]\, :\, f\text{ is discontinuous at }x\}.
$$
Theorem
Let $f\in \operatorname{B}\bigl([a,b],\mathbb{R}\bigr)$. Then
$$
f \text{ is integrable iff } m(D) = 0\, (\text{i.e. iff }D\text{ has
measure }0).
$$
Remark
Notice that $D$ is said to have measure $0$ iff, for any $\epsilon>0$,
there exist $a_i\leq b_i$ for $i\in \mathbb{N}$ such that
$$
D\subset \bigcup_{j=1}^\infty (a_j,b_j)\text{ and }\sum_{j=1}^\infty
(b_j - a_j)\leq\epsilon.
$$
Theorem
Let $f\in \operatorname{B}\bigl([a,b],\mathbb{R}\bigr)$. Then $f$ is
integrable on $[a,b]$ iff $f^+$ and $f^-$ are integrable, where
$$
f^+(x)=\begin{cases}
f(x),&\text{if } f(x) \geq 0\\
0,&\text{if }f(x) < 0\end{cases}\text{ and }
f^-(x)=\begin{cases}
f(x),&\text{if } f(x) \leq 0\\
0,&\text{if }f(x) > 0\end{cases}
$$
Corollary
If $f$ is integrable on $[a,b]$, then $|f|$ is integrable on $[a,b]$.
The converse is not true in general.
Nexample
The function $f:[0,1]\to \mathbb{R}$ defined by
$$
f(x)=\begin{cases}
1,&x\text{ is rational}\\
-1,&x\text{ is irrational}\end{cases}
$$
is not integrable since $L(f,P)=-1$ and $U(f,p)=1$, while $|f|\equiv
1$ is integrable.
Improper Integrals
Next we consider the integrality of certain unbounded functions.
Definition
Let $f:(a,b)\to \mathbb{R}$ be a function (notice that such a
function can be unbounded even if it is assume continuous). If $f\big
|_{[c, d]}$ is integrable for any choice of $c,d$ with $a < c < d
< b$, then it is called integrable iff
$$
\int_a^b f(x) dx=:\lim_{c\to a, d\to b}\int_{c}^d f(x) dx\:
\text{exists.}
$$
Proposition
If $f:(a,b)\to \mathbb{R}$ is integrable on $[c_1, c_2]$ for any
$a < c_1 < c_2 < b$ and $|f|$ is integrable on $(a,b)$, then $f$
is integrable on $(a,b)$. The converse is not true in general.
Nexample
Let $f(x) = \frac{1}{x^\alpha}$ for $x\in(0,1]$. Then
(i) $f$ is integrable when $\alpha<1$.
(ii) $f$ is not integrable when $\alpha\ge 1$.
For $\alpha \ne 1$ one computes
$$
\int_{\epsilon}^1 f(x)\, dx=\int_{\epsilon}^1
\frac{1}{x^\alpha}\, dx=\frac{1}{1-\alpha}x^{1-\alpha}
\Big | _{\epsilon}^1 = \frac{1}{\alpha-1} \epsilon^{1- \alpha}
-\frac{1}{\alpha-1},
$$
and thus
$$
\lim_{\epsilon \to 0^+} \int_{\epsilon}^1 \frac{1}{x^\alpha} \, dx =
-\frac{1}{\alpha-1} + \lim_{\epsilon \to 0^+} \frac{1}{\alpha-1}
\epsilon^{1-\alpha}=
\begin{cases}
< \infty\, ,&\text{if }\alpha < 1\, ,\\ +\infty\, ,&\text{if
}\alpha>1\end{cases}
$$
As for $\alpha=1$ it holds
$$
\int_0^\epsilon \frac{1}{x}\, dx =\log(\epsilon)\to\infty\text{ as
}\epsilon\to 0+.
$$
Theorem (Comparison)
Assume that $f,g:(a,b)\to \mathbb{R}$ are continuous and that $|g|$ is
integrable. If
$$
|f(x)|\leq |g(x)|,\: x\in (a,b),
$$
then $|f|$ is integrable and so is $f$.
Examples
(a) Determine whether $\int_0^1 \frac{1}{\sqrt{x}}
\sin(\frac{1}{x}) dx$ converges or not.
(b) Determine whether $\int_0^1 \frac{\sin (x)}{x^{3/2}}\, dx$
converges.
(c) What about $\int_{0}^1 \frac{\cos(x)}{x^{3/2}}\, dx$?
(a) Observe that $\frac{1}{\sqrt{x}} \sin(\frac{1}{x})$ is
continuous on $(0,1]$ and that
$$
\Big |\frac{1}{\sqrt{x}} \sin(\frac{1}{x})\Big
|\leq\frac{1}{\sqrt{x}},\: x \in (0,1].
$$
Since it is known that $\int_0^1 \frac{1}{\sqrt{x}} < + \infty$ the
theorem yields convergence.
(b) Observe that $\sin(x) \leq x$ for $x \in[0, \pi/2]$ so that
$$
0 \le \frac{\sin(x)}{x^{3/2}} \le \frac{x}{x^{3/2}} =
\frac{1}{x^{1/2}}
$$
Comparison again yields convergence.
(c) Since
$$
\frac{\cos x}{x^{3/2}} \geq\frac{1-x^2/2}{x^{3/2}}, \: x\in [0,1],
$$
it follows that
$$
\int_\epsilon^1\frac{\cos x}{x^{3/2}} dx\geq\int
_\epsilon^1\frac{1-x^2/2}{x^{3/2}}=\int _\epsilon^1\frac{1}{x^{3/2}}-\int_0^1
\frac{1}{x^{1/2}}\, dx\to\infty\text{ as }\epsilon\to 0+,
$$
Next we deal with unbounded interval of integration
Definition
Let $f:\mathbb{R}\to \mathbb{R}$ be such that $f\big |_{[a,b]}$ is
integrable for any $a,b\in \mathbb{R}$ with $a < b$. Then
(i) $\int_a^\infty f(x)\, dx = \lim_{b \to +\infty} \int_a^b f(x)\,
dx$ if the limit exists.
(ii) $\int_{-\infty}^b f(x) \, dx = \lim_{a \to -\infty} \int_a^b f(x)
\, dx$ if the limit exists.
(iii) $\int_{\infty}^\infty f(x) \, dx = \lim_{a \to -\infty, b \to
\infty} \int_a^b f(x) \, dx$ if the limit exists.
Examples
(a) If $\alpha\geq 0$ and $f(x) = \frac{1}{x^\alpha}$ for $x \in
[1,\infty)$, then
$$
\int_1^\infty \frac{1}{x^\alpha}\, dx=
\begin{cases}\frac{1}{\alpha-1},&\alpha>1\\
\infty,&\alpha\le 1\end{cases}
$$
(b) Determine whether $\int_0^\infty \frac{\sin (x) } { \ln
(x+2)}\, dx$ converges.
(b) First observe that
\begin{equation*}
\int_0^\infty \frac{\sin(x)}{\ln(x+2)} \, dx= -\frac{\cos(x)}{\ln (x+2)}\Big |
_{x=0}^\infty+ \int_0^\infty \bigl( \frac{1}{\ln(x+2)}\bigr)' \cos(x) \, dx
=\frac{1}{\ln 2} -\int_0^\infty \frac{\cos x}{(x+2)\ln ^2(x+2)}\, dx.
\end{equation*}
Next for $p>1$ one has that
\begin{equation*}
\int_2^\infty \frac{1}{x}\frac{1}{(\ln x)^p} \, dx =\int_2^\infty \frac{1}{(\ln x)^p}
d \ln x=-\frac{1}{p-1} (\ln x)^{1-p} \Big | _{x=2}^\infty=\frac{1}{p-2}(\ln
2)^{1-p}<\infty.
\end{equation*}
Combining this with
\begin{equation*}
\int_0^\infty \Big |\frac{-1}{(\ln (x+2)^2} \frac{1}{x+2} \cos(x)\Big |\,
dx\le\int_0^\infty\frac{1}{(x+2)\ln ^2(x+2)} \, dx
=-\ln(x+2)^{-1} \Big |_{x=0}^\infty =(\ln 2)^{-1}<+\infty
\end{equation*}
and the fact that the integrand is continuous on $(0, \infty)$, and using the
comparison test yields the convergence of $\int_0^\infty \frac{\cos(x)}{(x+2)\ln
^2(x+2)}\, dx$ and therefore that of $\int_0^\infty \frac{\sin (x) }{\ln(x+2)}$.
Next we look at some important techniques used to compute
integrals. We begin with integration by parts (a consequence
of the product rule) which reads
$$
\int _a^bf(x)g'(x)\, dx = f(x)g(x) \Big |_a^b - \int_a^b f'(x) g(x)\,
dx.
$$
Substitution is a consequence of the chain rule and amounts
to
$$
\int_a^b f(\phi(x)) \phi'(x) \, dx = \int_c^d f(y)dy,
$$
for an onto function $\phi: [a,b] \to [c,d]$ and by stipulating that
$y=\phi(x)$.
Theorem (Newton-Leibniz)
If $f:[a,b]\to \mathbb{R}$ is integrable and
$$
F(x):=\int_a^x f(t)\, dt\, ,\: x\in [a,b]\, ,
$$
then $F'(x_0) = f(x_0)$ whenever $f$ is continuous at $x_0$.
Observe that $F=\int_a^\cdot f(t)\, dt$ is an anti-derivative (or a
primitive) of $f$.
It holds that
\begin{equation*}
F(x)=\int_0^{x^2 - \sin(x)} e^{t^2} (t+2)\, dt + \int_{x- \cos(x)}^0
e^{t^2} (t+2)\, dt,
\end{equation*}
and we thus have that
\begin{align*}
F'(x)&=\Big[ \int_0^{x^2 - \sin(x)} e^{t^2} (t+2) dt \Big] '
-\Big[\int_0^{x-\cos(x)} e^{t^2} (t+2) dt \Big]'\\
&=e^{[x^2 - \sin (x)]^2} \big[x^2 - \sin (x) + 2\big](x^2-\sin x)'
- e^{(x- \cos(x))^2} (x- \cos x +2) (x - \cos x)' \\
&=e^{[x^2- \sin (x)]^2} \big[x^2 - \sin (x) + 2\big](2x-\cos x)- e^{(x-
\cos(x))^2} (x- \cos x +2) (1 +\sin x).
\end{align*}
Important inequalities
Theorem
Let $f,g\in\operatorname{B}\bigl([a,b],\mathbb{R}\bigr)$ be
integrable. Then
(i) $f\cdot g$ is integrable on $[a,b]$
(ii) (Cauchy-Schwarz inequality)
$$
\bigl( \int_a^b f(x)g(x) \, dx \bigr)^2 \leq \int_a^b f^2(x)\,
dx\int_a^b g^2(x)\, dx.
$$
(i) Exercise.
(ii) It follows from
\begin{equation*}
0\leq\int_a^b\big[f(x) + \lambda g(x)\big]^2\, dx=\int_a^b f^2(x)
\,dx +2\lambda\int _a^b f(x) g(x) \, dx+ \lambda^2\int_a^bg^2(x)\, dx,
\end{equation*}
for any $\lambda\in\mathbb{R}$ that
$$
\big[2 \int _a^b f(x) g(x) \, dx\big]^2-4\int_a^b g^2(x)\, dx\int_a^b
f^2(x)\, dx\le 0,
$$
which is equivalent to the claim.
Theorem (Hölder Inequality)
Let $f,g\in\operatorname{B}\bigl([a,b],\mathbb{R}\bigr)$ be integrable
and assume that $1\leq p,q < \infty$ satisfy $\frac{1}{p}+\frac{1}{q}
=1$. Then $f\cdot g$ is integrable and
$$
\Big |\int_a^b f(x) g(x)\, dx\Big |\leq\Bigl(\int_a^b |f(x) |^p \,
dx\Bigr)^{1/p}\Bigl(\int_a^b |g(x)|^q\, dx\Bigr)^{1/q}.
$$
W.l.o.g we can assume that $f,g\geq 0$. We consider two cases. First
assume that $\int_a^b f^p(x)\, dx=1$ and $\int_a^b g^q(x)\, dx =1$. In
this case the claim amounts to proving that
$$
\int_a^b f(x)g(x) \, dx \le 1\, .
$$
This readily follows from
\begin{equation*}
\int_a^b f(x) g(x) \, dx \le\int_a^b \Big(\frac{1}{p} f(x) ^p +
\frac{1}{q} g(x)^q \Big)\, dx=\frac{1}{p} \int_a^b f^p(x)\, dx +
\frac{1}{q} \int_a^b g^q(x) \, dx=\frac{1}{p}+\frac{1}{q}=1.
\end{equation*}
In general, define
$$
F(x) = \frac{f(x)}{\bigl(\int_a^b f(x)^p \, dx\bigr)^{1/p}},\quad G(x) =
\frac{g(x)}{\bigl(\int_a^b g(x)^q \, dx\bigr)^{1/q}}
$$
so that
$$
\int_a^b F^p(x)\, dx=\frac{1}{\int_a^b f^p(x)\, dx}\int_a^b f^p(x)\,
dx=1\text{ and }\int_a^b G^q(x)\, dx =1.
$$
Thus it follows from the previous case that $\int_a^b F(x) G(x) \, dx
\le 1$ and therefore that
$$
\int_a^b f(x) g(x) \, dx \le \Big(\int_a^b f(x)^p \, dx\Big)^{1/p}
\Big(\int_a^bg(x)^q \, dx\Big)^{1/q}.
$$
as claimed.
Reminder
For any $x,y\geq 0$ one has that
$$
xy \leq\frac{1}{2}(x^2+y^2)\text{ and that }
xy \leq\frac{x^p}{p} + \frac{y^q}{q}
$$
whenever $\frac{1}{p}+\frac{1}{q} =1$ for $p,q\in(1,\infty)$. Latter
follows from
$$
xy =e^{\frac{1}{p} \ln x^p + \frac{1}{q} \ln y^q} \le \frac{1}{p}
e^{\ln x^p}+\frac{1}{q} e^{\ln x^q}=\frac{1}{p}x^p + \frac{1}{q} y^q
$$
and the convexity of the exponential function.