Notes 2. Riemann Integration
Notes 2. Riemann Integration
j=1
f(z
j
)x
j
, where x
j
:= x
j
x
j1
.
Geometrically, S(f,
P) is an approximate area of the region bounded by x = a, x =
b, y = 0 and y = f(x) (assuming f is non-negative). We call f Riemann integrable
on [a, b] if there exists L R so that > 0, > 0 s.t.
[S(f,
P) L[ < , P, [[P[[ < ,
for any tag. It is easy to show that such L is uniquely determined whenever it exists.
It is called the Riemann integral of f over [a, b] and is denoted by
_
b
a
f.
Example 1. The constant function f
1
(x) = c is integrable on [a, b] and
_
b
a
f
1
=
c(b a). For, let P be any partition of [a, b], we have S(f
1
,
P) =
j
f
1
(z
j
)X
j
=
j
c
j
= c(b a), hence the conclusion follows.
Example 2. Dene f
2
(x) = 1 (x is rational) and = 0 (otherwise). In any interval,
there are rational and irrational points, hence we can nd tags z and w so that
f
2
(z) = 1 and f
2
(w) = 0. It follows that S(f
2
,
P) = b a for the former but
S(f
2
,
P) = 0 for the latter. Clearly, the number L does not exist, so f
2
is not
integrable.
1
Example 3. Let f
3
(x) be equal to 0 except at w
1
, , w
n
[a, b] where f
3
(w
j
) ,= 0.
We will show that f
3
is integrable with integral equal to 0. To see this, let P be
a partition whose length is . Every subinterval of this partition contains or does
not contain some w
j
s. Hence there are at most 2n-many subintervals which contain
some w
j
. Denote these subintervals by B. Then
0 S(f
3
,
P) 0 =
B
f
3
(z
j
)x
j
, M = sup [f
3
(x)[ : x [a, b],
M 2n < ,
provided we choose < /2n(M + 1).
From these examples we gather the impression that a function is integrable if
its points of discontinuity are not so abundant. We will pursue this in the following
sections. To proceed, we introduce some concept. First, we use 1[a, b] to denote
the set of all Riemann integrable functions on [a, b]. For any partition P, we dene
its Darboux upper and lower sums respectively by
S(f, P) :=
n
j=1
M
j
x
j
,
and
S(f, P) :=
n
j=1
m
j
x
j
,
where M
j
:= supf(x) : x [x
j1
, x
j
] and m
j
:= inff(x) : x [x
j1
, x
j
]. A
partition P
2
is a renement of P
1
if every partition point of P
1
is a partition point
of P
2
. We have
Proposition 1. Let P
2
be a renement of P
1
. Then
S(f, P
1
) S(f, P
2
), (1)
and
S(f, P
1
) S(f, P
2
). (2)
2
Proof. Let [x
j1
, x
j
] be a subinterval of P
1
. It can be decomposed into the union of
subinterval of P
2
: [y
k1
, y
k
] [y
l1
, y
l
] where y
k1
= x
j1
and y
l
= x
j
Then
M
j
M
k
, ..., M
l
,
where M
j
= sup f over [x
j1
, x
j
] and M
k
= sup f over [y
k1
, y
k
], etc. From this we
conclude that
S(f, P
1
) =
M
j
x
j
j
y
j
= S(f, P
2
).
So (1) holds. Similarly, one can prove (2).
The following properties are now clear.
Proposition 2. For any partitions P and Q,
S(f, P) S(f, Q). (3)
Proof. By putting the partition points of P and Q together we obtain a partition R
which renes both P and Q. By Proposition 1,
S(f, P) S(f, R) S(f, R) S(f, Q).
The following proposition is a straightforward consequence from the denition
of the Darboux sums.
Proposition 3. For any partition P,
S(f, P) S(f,
P) S(f, P).
for any tags. Moreover, given > 0, there exists a tag such that
S(f, P) + S(f,
P),
and another tag S(f,
P) such that
S(f, P) S(f,
P).
3
We dene the Riemann upper and lower integrals respectively to be
S(f) := inf
P
S(f, P),
and
S(f) := sup
P
S(f, P).
Proposition 4.
S(f) = lim
n
S(f, P
n
),
and
S(f) = lim
n
S(f, P
n
),
for any P
n
, [[P
n
[[ 0.
This proposition asserts that by simply taking any sequence of partitions whose
lengths tend to zero, the limit of the corresponding Darboux upper and lower sums
always exist and give you the Riemann upper and lower integrals respectively.
Proof. Given > 0, there exists a partition Q such that
S(f) +/2 > S(f, Q).
Let m be the number of partition points of Q (excluding the endpoints). Consider
any partition P
n
and let R
n
be the partition by putting together P
n
and Q. Note
that the number of subintervals in P
n
which contain some partition points of Q in
its interior must be less than or equal to m. Denote the indices of the collection of
these subintervals in P
n
by J. We have
0 S(f, P
n
) S(f, R
n
)
jJ
2Mx
j
2M m[[P
n
[[,
where M = sup
[a,b]
[f[, because the contributions of S(f, P
n
) and S(f, Q) from the
subintervals not in J cancel out. Hence, by Proposition 1
S(f) +/2 > S(f, Q) S(f, R
n
) S(f, P
n
) 2Mm[[P
n
[[,
4
i.e.,
0 S(f, P
n
) S(f) < /2 + 2Mm[[P
n
[[.
Now, as [[P
n
[[ 0, we can nd n
0
such that
[[P
n
[[ <
1 + 4Mm
, n n
0
,
then
0 S(f, P
n
) S(f) < , n n
0
.
Similarly, one can prove the second assertion.
Now we relate the upper/lower Riemann integrals to Riemann integrability.
Theorem 5. (Integrability Criterion I) Let f be bounded on [a, b]. Then f is
Riemann integrable on [a, b] if and only if S(f) = S(f). When this holds,
_
b
a
f =
S(f) = S(f).
Proof. According to the denition of integrability, when f is integrable, there exists
some L R so that for any given > 0, > 0 such that for all partition P with
[[P[[ < ,
[S(f,
P) L[ < /2,
holds for any tags. Let
P be another tagged partition. By the triangle inequality
we have
[S(f,
P) S(f,
P)[ [S(f,
P) L[ +[S(f,
P) L[ < /2 +/2 = .
Since the tags are arbitrary, it implies
S(f, P) S(f, P) .
As a result,
0 S(f) S(f) S(f, P) S(f, P) .
Note that the rst inequality comes from Proposition 4. Since > 0 is arbitrary,
S(f) = S(f).
5
Conversely, suppose that f is not integrable. Then for the number S(f), there
exist
0
> 0 and partition P
n
, [[P
n
[[ 0, such that
[S(f,
P
n
) S(f)[
0
,
for some tags. That means either
S(f,
P
n
) S(f)
0
,
or
S(f,
P
n
) S(f)
0
,
for each P
n
. If the second case holds for innitely many P
n
, we will have
S(f) S(f)
0
.
according to Proposition 4, which is impossible. Hence the rst case holds for all
suciently large n. Now, it implies
S(f, P
n
) S(f)
0
.
After passing to limit, we get
S(f) S(f)
0
> 0,
so the upper and lower integral do not coincide.
Finally, when f is integrable, using denition we know that
S(f,
P
n
)
_
b
a
f,
for |P
n
| 0. On the hand, for the same sequence of partitions,
S(f, P
n
), S(f, P
n
) S(f) = S(f),
as |P
n
| 0. It follows from the sandwich rule that
_
b
a
f = S(f). The proof of this
theorem is completed.
6
From the proof of this criterion we deduce the following useful way of evaluating
integral.
Theorem 6. For any integrable f,
_
b
a
f is equal to the limit of S(f, P
n
), S(f, P
n
)
or S(f,
P
n
) for any sequence of (tagged) partitions P
n
, [[P
n
[[ 0.
Example 4. We show that the linear function f(x) = x is integrable on [a, b] with
integral given by (b
2
a
2
)/2. To see this we note that f is increasing, so for any
partition P, we have
S(f, P) =
n
1
x
j
x
j
, S(f, P) =
n
1
x
j1
x
j
.
Therefore,
S(f) S(f) S(f, P) S(f, P)
n
1
x
j
x
j
.
It follows that
S(f) S(f) (b a)|P|.
By taking P = P
n
, |P
n
| 0 we conclude the upper and lower integrals coincide, so
f is integrable by Criterion I.
To evaluate the integral, we make a good of tag points by letting z
j
= (x
j
+
x
j1
)/2, then
S(f,
P) =
1
2
n
1
z
j
x
j
=
1
2
n
1
(x
2
j
x
2
j1
) =
1
2
(b
2
a
2
).
By tricky choice of tag points one may evaluate the integrals of all monomials.
Next we formulate our second criterion. Essentially nothing new, but the new
formulation is useful in many occasions.
We dene the oscillation of a (bounded) function f over an interval I to be
osc
I
f = sup[f(x) f(y)[ : x, y I
7
It is clear that
osc
I
f = sup
I
f inf
I
f.
Using this concept we can reformulate our rst criterion into our second integrability
criterion. Its proof is immediate from the rst one.
Theorem 7. (Integrability Criterion II) Let f be a bounded function on [a, b].
Then f is Riemann integrable on [a, b] if and only if for every > 0, there exists a
partition R such that
n
j=1
osc
I
j
fx
j
< .
Proof. We have just shown that f is integrable if and only if S(f) = S(f). For > 0,
there exist partitions P and Q such that S(f, P)S(f) < /2 and S(f)S(f, Q) <
/2. Then for the partition R formed by putting P and Q together,
n
1
osc
I
j
fx
j
= S(f, R)S(f, R) S(f, P)S(f, Q) < S(f)+/2S(f)+/2 = .
The converse is left to you as an exercise.
Using either one of these criteria we now show that Riemann integrability is
preserved under vector space operations, multiplication and division. One may also
deduce it right from the denition, but using the criterion it looks clean.
Theorem 8. Let f and g be integrable on [a, b] and , R. We have
(a) f +g is integrable on [a, b] and
_
b
a
(f +g) =
_
b
a
f +
_
b
a
g,
(b) fg is integrable on [a, b],
(c) f/g is integrable on [a, b] provided [g[ for some positive number , and
(d) [f[ is integrable on [a, b] and
_
b
a
f
_
b
a
[f[.
(e) f is integrable on every [c, d] [a, b].
8
Proof. (a). We use the denition to prove (a). As f and g are integrable, for any
> 0, there exists such that
S(f,
P)
_
b
a
f
S(g,
P)
_
b
a
g
< ,
for |P| < . Using the formula,
S(f +g,
P) = S(f,
P) +S(f,
P),
we have
S(f +g,
P)
_
b
a
f
_
b
a
g
([[ +[[),
so the conclusion follows.
(b) We use the second criterion. Observe that
[f(x)g(x) f(y)g(y)[ [f(x)[[g(x) g(y)[ +[g(y)[[f(x) f(y)[
implies
oscfg M
1
oscg +M
2
oscf,
where M
1
= sup [f[ and M
2
= sup [g[. It follows immediately from Criterion II that
fg is integrable.
We leave (c), (d) and (e) to you.
We also have
Theorem 9. Let g be obtained from an integrable function f on [a, b] by modifying
it at nitely many points. Then g is also integrable and the integral of g is equal to
the integral of f.
Proof. Let w
1
, , w
N
be the points at which f and g are dierent. The function
h = g f is zero except at these points. From Example 3, we know that h is
integrable and its integral is 0. By Theorem 8 (a) we conclude that g = f + h is
integrable and g and f have the same integral.
9
Theorem 8 in particular shows that the collection of all Riemann integrable
functions form a vector space which is closed under multiplication. In the next
section we will show that every continuous function is integrable, so the inclusion
C[a, b] 1[a, b]
holds.
Since continuity and dierentiability (the chain rule) are preserved under com-
position of functions, it is natural to ask if integrability enjoys the same property.
Unfortunately, this is not true. There are examples showing that the composition
of two integrable functions may not be integrable. On the other hand, it can be
shown that if f 1[a, b] and g C[c, d] and f[a, b] [c, d], then g f 1[a, b], see
exercise.
In concluding this section, we would like to point out that although the two cri-
teria provide ecient means to verify integrability, they do not tell how to compute
the integral. To achieve this job, we need to use Theorem 6. By choosing a suitable
sequence of partitions with length tending to zero and suitable tags on them, the
integral can be obtained by evaluating the limit of the Riemann sums. Thus we
have the freedom in choosing the partitions as well as the tags. See Exercises no.16,
17 in 7.1 of Text. In fact, the concept of using approximate sum of rectangles to
calculate areas or volumes were known in many ancient cultures. In particular, in
the works of Archimedes the areas and volumes of many common geometric objects
were found by using ingenious methods. In terms of modern calculus, he used good
choices of partitions and tags. This method, of course, cannot be pushed too far.
We have to wait more than one thousand years until Newton related integration
to dierentiation. Then the evaluation of integrals becomes much easier. We shall
discuss this shortly in the fundamental theorem of calculus.
10
1.2 Integrable Functions
Theorem 10. Any continuous function on [a, b] is integrable.
Proof. That f is continuous on [a, b] implies that it is bounded and uniformly con-
tinuous on [a, b]. For > 0, > 0 s.t.
[f(x) f(y)[ <
2(b a)
, x, y [a, b], [x y[ < .
Consider any P, [[P[[ < , we have
S(f, P) =
f(z
j
)x
j
,
S(f, P) =
f(w
j
)x
j
,
where f(z
j
) = M
j
and f(w
j
) = m
j
by continuity. Therefore,
0 S(f, P) S(f, P) =
(f(z
j
) f(w
j
))x
j
,
(b a)
2(b a)
< .
By Integrability Criterion II, f is integrable on [a, b].
Theorem 11. Let f and g be integrable on [a, b] and [b, c] respectively. Then
F(x) =
_
_
_
f(x), if x [a, b],
g(x), if x (b, c],
is integrable on [a, c] and
_
c
a
F =
_
b
a
f +
_
c
b
g.
Consequently, every bounded function with nitely many discontinuity is integrable.
Proof. By Integrability Criterion II, for any > 0, we can nd partitions P and Q
on [a, b] and [b, c] respectively such that
P
oscfx
j
<
3
,
Q
oscgx
j
<
3
.
11
Furthermore, for later use we assume [[Q[[ < /3(1 + M + M
R
oscFx
j
=
P
oscfx
j
+ osc
I
g(x
1
b) +
Q/I
oscgx
j
P
oscfx
j
+ osc
I
g(x
1
b) +
Q
oscgx
j
<
3
+ (M +M
)
3(M +M
+ 1)
+
3
= ,
so F is integrable on [a, c] by the Integrability Criterion II.
To nd the integral, we let P
n
and Q
n
be partitions of [a, b] and [b, c] respectively
with lengths tending to zero. Then the lengths of the partitions R
n
:= P
n
Q
n
tend
to zero too. Taking the tags lying on the interior of each subinterval of R
n
, then
S(F,
R
n
) = S(f,
P
n
) +S(g,
Q
n
) and according to Theorem 6,
_
b
a
F = lim
n
S(F,
R
n
) = lim
n
S(f,
P
n
) + lim
n
S(g,
Q
n
) =
_
b
a
f +
_
c
b
g.
We point out that when applying to the same function f on [a, b] and [b, c], this
theorem yields
_
c
a
f =
_
b
a
f +
_
c
b
f.
In practise it is frequently encountered the integral limits a, b, and c are unordered.
To facilitate this situation we enter the following convention: For a < b,
_
a
b
f :=
_
b
a
f,
and
_
a
a
f := 0.
12
Under this convention we have
_
c
a
f =
_
b
a
f +
_
c
b
f,
for any a, b, and c regardless of their ordering. Verify it for yourself.
In the exercise you are asked to show that the function obtained from modifying
an integrable one at nitely many points is still integrable and has the same integral
as the old one. Together with Theorem 10 and 11 it shows that any piecewise con-
tinuous function in [a, b] is integrable. Recall that a bounded function is piecewise
continuous if there exists a partition x
0
< < x
N
of [a, b] so that f[
(x
j1
,x
j
)
is
continuous.
Next we consider another class of integrable functions.
Theorem 12. Any monotone function on [a, b] is integrable.
Proof. Let P be the partition which divides [a, b] equally. Observing that M
j
m
j
=
f(x
j
) f(x
j1
) (here f is assumed to be increasing). For any > 0,
S(f, P) S(f, P) =
n
j=1
(M
j
m
j
)x
j
=
b a
n
n
j=1
(f(x
j
) f(x
j1
))
=
(b a)(f(b) f(a))
n
< ,
if we choose n so large that (ba)(f(b)f(a))/ < n. By the Integrability Criterion
I, f is integrable on [a, b].
In concluding this section, we prove the basic Cauchy-Schwarz inequality. We
start with an almost trivial proposition.
Proposition 13. For every non-negative Riemann integrable function f on [a, b],
_
b
a
f 0.
13
Proposition 14. Let f, g 1[a, b],
_
b
a
fg
_
b
a
f
2
_
b
a
g
2
.
In fact, when f and g are continuous, the equality sign in this inequality holds if
and only if f and g are linearly independent.
Proof. For every real t, the function (g tf)
2
is non-negative and integrable, so by
the previous proposition,
0
_
(g tf)
2
=
_
g
2
2t
_
fg +t
2
_
f
2
a 2bt +ct
2
,
where we have dropped the a and b in the integrals. This is a quadratic equation and
it is non-negative for all t means its has at most one real root. So the discriminant
is non-positive:
0 = (2b)
2
4ac = 4(
_
fg)
2
4(
_
f
2
)(
_
g
2
),
and the inequality follows. Moreover, we know that equality sign holds if and only
if there is a single root, that is to say, there is a t
0
such that a2bt
0
+ct
2
0
= 0, which
means
_
(g t
0
f)
2
= 0. When f and g are continuous, this implies g t
0
f 0 on
[a, b].
1.3 Lebesgues Theorem
We have seen that any function with nite discontinuity is integrable. Also it is not
hard to show that a function with countably many discontinuity is still integrable
provided these discontinuous points converges to a single points. On the other hand,
functions with too many discontinuous points are not integrable. A typical example
is f(x) = 1 if x is rational, and = 0 otherwise. This function is discontinuous
everywhere. In this section we prove Lebsegue fundamental theorem characterizing
Riemann integrability in terms of the size of discontinuity set. This section can
be skipped in a rst reading.
14
For any bounded f on [a, b] and x [a, b], its oscillation at x is dened by
(f, x) := inf
_
k=1
O(k), (4)
where O(k) := x [a, b] : (f, x) 1/k.
A subset E of R is of measure zero if > 0, a sequence of open intervals
I
j
such that
E
_
j=1
I
j
,
and
j=1
[I
j
[ < .
It is not hard to show that
Proposition 15. The following statements hold.
(a) Any countable set is of measure zero.
(b) Any countable union of measure zero sets is again of measure zero.
Proof. Let E = x
1
, x
2
, ... be a countable set. Given > 0, the intervals I
j
=
(x
j
2
j+2
, x
j
+
2
j+2
) satisfy
E
_
j=1
I
j
,
and
j=1
[I
j
[ =
j=1
2
2
j+2
=
2
< ,
so E is of measure zero. (a) is proved. (b) can be proved by a similar argument.
We leave it as an exercise.
15
There are uncountable sets of measure zero. The famous Cantor set is one of
them. See Chapter 7 of the textbook. Now, we state the necessary and sucient
condition for Riemann integrability due to Lebesgue.
Theorem 16. A bounded function f on [a, b] is Riemann integrable if and only if
its discontinuity set is of measure zero.
We shall use the compactness of a closed, bounded interval in the proof of this
theorem. Recall that compactness is equivalent to the following property: Let K
be a compact set in R. Suppose that I
j
is a sequence of open intervals satisfying
K
j=1
I
j
. Then we can choose nitely many intervals I
j
1
, ..., I
j
N
so that K
I
j
1
I
j
N
.
Proof. Suppose that f is Riemann integrable on [a, b]. Recall the formula
D =
_
k=1
O(k).
By Proposition 12 (b) it suces to show that each O(k) is of measure zero. Given
> 0, by Integrability Criterion I, we can nd a partition P such that
S(f, P) S(f, P) < /2k.
Let J be the index set of those subintervals of P which contains some elements of
O(k) in their interiors. Then
1
k
jJ
[I
j
[
jJ
(sup
I
j
f inf
I
j
f)x
j
j=1
(sup
I
j
f inf
I
j
f)x
j
= S(f, P) S(f, P)
< /2k.
Therefore
jJ
[I
j
[ < /2.
16
Now, the only possibility that an element of O(k) is not contained by one of these
I
j
is it being a partition point. Since there are nitely many partition points, say
N, we can nd some open intervals I
1
, ..., I
N
containing these partition points which
satisfy
[I
i
[ < /2.
So I
j
and I
i
together form a covering of O(k) and its total length is strictly less
than . We conclude that O(k) is of measure zero.
Conversely, given > 0, x a large k such that
1
k
< . Now the set O(k) is of
measure zero, we can nd a sequence of open intervals I
j
satisfying
O(k)
_
j=1
I
j
,
j=1
[I
i
j
[ < .
One can show that O(k) is closed and bounded, hence it is compact. As a result,
we can nd I
i
1
, ..., I
i
N
from I
j
so that
O(k) I
i
1
... I
i
N
,
N
j=1
[I
j
[ < .
Without loss of generality we may assume that these open intervals are mutually
disjoint since, whenever two intervals have nonempty intersection, we can put them
together to form a larger open interval. Observe that [a, b] (I
i
1
I
i
N
) is a
nite disjoint union of closed bounded intervals, call them V
i
s, i A. We will show
that for each i A, one can nd a partition on each V
i
:= [v
i1
, v
i
] such that the
oscillation of f on each subinterval in this partition is less than 1/k.
Fix i A. For each x V
i
, we have
(f, x) <
1
k
.
17
By the denition of (f, x), one can nd some
x
> 0 such that
supf(y) : y B(x,
x
) [a, b] inff(z) : z B(x,
x
) [a, b] <
1
k
,
where B(y, ) := (y , y + ). Note that V
i
xV
i
B(x,
x
). Since V
i
is closed
and bounded, it is compact. Hence, there exist x
l
1
, . . . , x
l
M
V
i
such that V
i
M
j=1
B(x
i
j
,
x
l
j
). By replacing the left end point of B(x
i
j
,
x
l
j
) with v
i1
if x
l
j
x
l
j
<
v
i1
, and replacing the right end point of B(x
i
j
,
x
l
j
) with v
i
if x
l
j
+
x
l
j
> v
i
, one
can list out the endpoints of B(x
l
j
,
l
j
)
M
j=1
and use them to form a partition S
i
of
V
i
. It can be easily seen that each subinterval in S
i
is covered by some B(x
l
j
,
x
l
j
),
which implies that the oscillation of f in each subinterval is less than 1/k. So, S
i
is
the partition that we want.
The partitions S
i
s and the endpoints of I
i
1
, ..., I
i
N
form a partition P of [a, b].
We have
S(f, P) S(f, P) =
I
i
j
(M
j
m
j
)x
j
+
(M
j
m
j
)x
j
2M
N
j=1
[I
i
j
[ +
1
k
x
j
2M +(b a)
= [2M + (b a)],
where M = sup
[a,b]
[f[ and the second summation is over all subintervals in V
i
, i A.
By Integrability Criterion I, f is integrable on [a, b].
2 More on Riemann Integral
2.1 The Thomaes function
Thomaes function is an example of complicated integrable functions. In last
semester we saw that this function is discontinuous at rational points and continuous
at irrational points in the unit interval.
Recall that Thomaes function h : [0, 1] R is given by
18
h(x) :=
_
_
0 if x is irrational, or 0,
1
q
if x =
p
q
, for some p, q N with (p, q) = 1,
where (p, q) denotes the greatest common divisor of p and q. We set h(0) := 1.
We show that h 1[0, 1]. The key idea is the following observation: Given
q
0
N, the number of points in E
q
0
:= x [0, 1] : h(x) 1/q
0
is a nite set
depending on q
0
. For, as h(x) 1/q
0
> 0, x must be a rational number. Assuming
that it is of the form p/q, where (p, q) = 1, 0 < p q. So, h(x) = 1/q 1/q
0
, it
means 1 q q
0
. From the two inequalities 1 q q
0
and 0 < p q, we see that
the number of elements in E
N
must be less than (q
0
+ 1)
2
.
Now, given > 0, we x q
0
N such that (b a)/q
0
< /2. There are at
most N
0
many points x
j
in [0, 1] such that h(x
j
) 1/q
0
, j = 1, , N
0
. (In fact,
N
0
(1 + q
0
)
2
.) For any partition P, there are at most 2N
0
many subintervals
touching some x
j
, and the rest are disjoint from them. Call the former bad and
the latter good subintervals. Now, let be chosen such that 1/4N
0
. Then,
for any partition P with length less than , we have
0 S(h,
P) 0
h(z
j
)x
j
bad
h(z
j
)x
j
+
good
h(z
j
)x
j
1 2N
0
+
1
q
0
(b a)
<
2
+
2
= .
From the denition of Riemann integral, h is integrable and its integral is 0 over
[0, 1].
Of course, if we are willing to use the powerful Lebsegues theorem, the integra-
bility of h comes immediately from the fact that the Thomaes function is continuous
at all irrationals but discontinuous at rationals. Nevertheless, the above argument,
aside from being elementary, has the advantage of nding the integral at the same
time.
19
2.2 Fundamental Theorem of Calculus
Newton discovered that integration and dierentiation are inverse to each other.
The word inverse here cannot be taken too strict. We have seen that dierentiation
T :=
d
dx
is a linear transformation from D(a, b) to F(a, b). On the other hand, for
any f 1[a, b], the indenite integral F of f, which is dened by
F(x) :=
_
x
a
f(t)dt
is a well-dened function on (a, b). Furthermore, one can dene by f := F,
which forms a linear transformation from 1[a, b] to F(a, b). In an ideal setting, one
would like to see if there exist : 1[a, b] D(a, b) and T : D(a, b) 1[a, b]
such that Tf = f, f D(a, b), and Tf = f, f 1[a, b]. Unfortunately,
this is not true for (at least) two reasons. First, we have already seen that T is
not injective, the derivative of any constant function is equal to zero. As a result,
Tf = f can never hold for non-zero constant functions. Next, (R[a, b]) is not
contained in D(a, b). According to Darboux theorem, the function f(x) = 1 for
x 0, and = 0 for x < 0, which is in 1[1, 1], cannot be the derivative of any
dierentiable function. Also, f is not dierentiable at 0 and so f / D(1, 1).
Hence T may not make sense on 1[a, b].
In view of these considerations, we must be careful in formulating the fundamen-
tal theorems. Here is the rst form. It corresponds to the case Tf = f.
Theorem 17. Let F be dierentiable on [a, b] and F
_
b
a
f
n
j=1
f(z
j
)x
j
j=1
F(x
j
) F(x
j1
).
Applying the mean-value theorem to F on each [x
j1
, x
j
], we nd z
j
(x
j1
, x
j
)
such that
F(x
j
) F(x
j1
) = f(z
j
)(x
j
x
j1
).
Taking z
j
to be the tags for this P, we have
_
b
a
f (F(b) F(a))
_
b
a
f
n
j=1
f(z
j
)x
j
< .
So, the theorem follows as > 0 is arbitrary.
A function F is called a primitive function of f if F is dierentiable and
F
(c) = f(c).
Proof. We only consider the case when c (a, b), while the case c = a or b can be
treated similarly. Fix c (a, b). For [h[ > 0 small,
F(c +h) F(c)
h
=
1
h
_
_
c+h
a
f
_
c
a
f
_
=
1
h
_
c+h
c
f.
As f is continuous at c, for each > 0, > 0 such that
[f(x) f(c)[ < , x (c , c +).
For 0 < [h[ < ,
1
h
_
c+h
c
(f(t) f(c))dt
.
We conclude that F
_
1 if x [0, 1],
0 if x [1, 0).
Then,
F(x) =
_
_
x if x [0, 1],
0 if x [1, 0).
So, F
, g := G
b
a
_
b
a
Fg,
where FG
b
a
:= F(b)G(b) F(a)G(a).
Proof. By assumption, (FG)
(x
0
)(x x
0
) + +
f
(n)
(x
0
)
n!
(x x
0
)
n
+
1
n!
_
x
x
0
f
(n+1)
(t)(x t)
n
dt.
You should compare this proposition with Theorem 6.4.1 in the textbook. In Theo-
rem 6.4.1 the regularity requirement on f is weaker: f
(n+1)
1[, ] is not necessary
and the remainder (error) is given by
f
(n+1)
(c)
(n+1)!
(x x
0
)
n+1
for some c between x and
x
0
.
Proof. Let F(t) := f
(n)
(t), G(t) :=
(xt)
n
n!
(and so g(t) =
(xt)
n1
(n1)!
). By integration
by parts, one has
1
n!
_
x
x
0
f
(n+1)
(t)(x t)
n
dt =
_
x
x
0
F
(t)G(t)dt
=
1
n!
f
(n)
(t)(x t)
n
x
x
0
+
1
(n 1)!
_
x
x
0
f
(n)
(t)(x t)
n1
dt
=
f
(n)
(x
0
)
n!
(x x
0
)
n
+
1
(n 1)!
_
x
x
0
f
(n)
(t)(x t)
n1
dt.
Keep integrating by parts we get the complete formula.
Integration by parts is one of the most useful methods in integration. To illustrate
its use we shall establish the following formulas obtained by Wallis not long before
Newton invented calculus. Due to humans special feeling to , any formula for this
transcendental number catches attention. Wallis formulas are one of the earliest
ones. They are not good in computing for slow convergence. We shall encounter
more formulas in other courses later.
Theorem 21. (Wallis formulas) The following formulas hold true.
(a) lim
n
_
2
1
2
3
4
3
4
5
6
5
6
7
2n
2n 1
2n
2n + 1
_
=
2
.
(b) lim
n
(n!)
2
2
2n
(2n)!
n
=
.
23
Proof. For each n N, let
I
n
:=
_
2
0
sin
n
xdx,
a
n
:=
2
1
2
3
4
3
4
5
2n
2n 1
2n
2n + 1
,
and
b
n
:=
(n!)
2
2
2n
(2n)!
n
.
We note I
0
=
2
and I
1
= 1. Now, for a general I
n
(that is, for n 2), we use
integration by parts to get
I
n
= cos x sin
n1
x
2
0
_
2
0
(cos x)(n 1) sin
n2
x cos xdx
= (n 1)
_
2
0
cos
2
x sin
n2
xdx
= (n 1)(I
n2
I
n
).
It follows that
I
n
=
n 1
n
I
n2
.
From this recursive formula, we see that, n N,
I
2n
=
2n 1
2n
I
2n2
= =
1 3 (2n 3) (2n 1)
2 4 (2n 2) (2n)
I
0
,
and,
I
2n+1
=
2n
2n + 1
I
2n1
= =
2 4 (2n 2) (2n)
3 5 (2n 1) (2n + 1)
I
1
.
Therefore,
I
2n
I
2n+1
=
1 3 3 5 5 (2n 1) (2n 1) (2n + 1)
2 2 4 4 6 (2n 2)(2n)(2n)
2
,
or we set
a
n
=
I
2n+1
I
2n
2
.
Noting that (a) will hold if we can show that
I
2n+1
I
2n
1 as n , but this is easy
to see from
sin
2n
x sin
2n+1
x sin
2n+2
x, x [0,
2
],
24
as it implies I
2n
I
2n+1
I
2n+2
and so
1
I
2n+1
I
2n
I
2n+2
I
2n
=
2n + 1
2n + 2
1.
To prove (b) we note that
b
2
n
=
2n + 1
n
a
n
, n N.
(Please verify this using mathematical induction.) Hence, (b) follows from (a).
3.2 Stirlings formula
This formula was discovered by Stirling not long after calculus was invented. In
practise it gives a way to compute the factorial function by means of power of n.
On the theoretical level it determines the order of growth of the factorial function.
We usually use the power of n to describe the order of growth.
Theorem 22. (Stirlings formula)
n!
2n
_
n
e
_
n
as n ,
where a
n
b
n
means a
n
/b
n
1 as n .
Proof. Note that f(x) := ln x is increasing on [1, ). For each n N, we partition
the interval [1, n] equally into [1, 2], [2, 3], . . . , [n1, n], and this partition is denoted
by P
n
. Then the integral
_
n
1
ln xdx = nln n (n 1),
which is the area of y = ln x over [1, n] and it can be approximated from below by
1
2
_
S(f; P
n
) +S(f; P
n
)
_
=
1
2
(ln 2 + + ln n + ln 1 + + ln(n 1))
= ln(n!)
1
2
ln n.
25
Clearly taking the average of these two sums yields sharper error than using either
sum. We want to estimate the error E
n
, where
E
n
:=
_
n
1
ln xdx
1
2
_
S(f; P
n
) +S(f; P
n
)
_
= nln n(n1) ln n! +
ln n
2
> 0. (5)
Clearly E
n
is a strictly increasing sequence of numbers. To show its conver-
gence it suces to establish an upper bound. To this end we need to estimate the
error over each subinterval [j, j +1]. Since ln x is a concave function, the tangent of
f passing A hits a point on x = j +1 at a point D lying above B = (j +1, ln(j +1)).
The coordinates of D are given by (j +1, 1/j +ln j). The area between arc
AB and
AB is less than the area of ABD. Now, BC = ln(j + 1) ln j = ln(1 +
1
j
) and
BD = CD BC =
1
j
ln(1 +
1
j
)
1
2j
2
. Hence,
the area of ABD =
1
2
AC BD
1
2
1
1
2j
2
=
1
4j
2
.
It follows that
E
n
1
4
n1
j=1
1
j
2
1
4
j=1
1
j
2
< ,
and E := lim
n
E
n
exists.
Taking exponential on (5) yields
n
n+
1
2
e
n1
n!
= e
En
L := e
E
, as n .
To evaluate the limit, we set
a
n
:=
n
n+
1
2
e
n1
n!
and observe that
a
2
n
a
2n
=
n
2n+1
e
2n2
(n!)
2
e
2n1
(2n)!
(2n)
2n+
1
2
=
(2n)! n
1
2
e
(n!)
2
2
2n+
1
2
,
which brings us to the Wallis formula:
a
2
n
a
2n
=
(2n)! n
1
2
(n!)
2
2
2n
e
2
.
As n , we get
L
2
L
=
1
2
.
26
So,
L =
e
2
and the Stirlings formula follows.
3.3 Changes of Variables
Theorem 23. (Change of Variables) Let f be a continuous function on some
interval I. Suppose : [, ] I is a dierentiable function with
1[, ].
Then,
_
b
a
f(x)dx =
_
f((t))
(t).
On the other hand, f((t)) C[, ] and
(t) is inte-
grable on [, ]. By the rst fundamental theorem of calculus,
F() F() =
_
f((t))
(t)dt,
i.e.
_
b
a
f(x)dx =
_
f((t))
(t)dt.
Example 1. Evaluate
_
1
0
1 x
2
dx.
Let x = (t) = sin t, t [0,
2
]. Then,
(t) = cos t, so
_
1
0
1 x
2
dx =
_
2
0
_
1 sin
2
t cos tdt =
_
2
0
cos
2
tdt =
4
.
27
3.4 Improper Integrals
Very often we face the situation where f is unbounded on [a, b] or the domain of
integration is unbounded, for example [a, ) or (, ). As the setting of Riemann
integration is a bounded function over a closed and bounded interval, we need to
extend the concept of integration to allow these new situations. These generalized
integrals are called improper integrals. They are rather common in applications.
We briey discuss two typical cases: Consider when f is bounded on any subin-
terval [a
, b], a
> a, and
lim
a
a
+
_
b
a
f exists.
We let
_
b
a
f := lim
a
a
+
_
b
a
f.
Next, let f be in 1[a, b], b > a. Then we call f 1[a, ) if
lim
b
_
b
a
f exists.
In this case, we dene
_
a
f := lim
b
_
b
a
f.
A simple integrability criterion for the rst case is the following Cauchy crite-
rion.
Proposition 24. Let f be a function dened on (a, b] which is integrable on [a
, b]
for all a
(a, b). Suppose that for any > 0, there exist small
0
> 0 such that
_
a+
a+
< ,
for any ,
(0,
0
). Then the improper integral
_
b
a
f exists.
Similarly, for the second case we have
28
Proposition 25. Let f be a function dened on [a, ) which is integrable on [a, b]
for all b > a. Suppose that for any > 0, there exists large number b
0
> a such that
_
b
b
f
< ,
for all b
, b b
0
. Then the improper integral
_
a
f exists.
Both proofs are immediate consequence of the fact that any Cauchy sequence
converges. Fill in the proofs if you like.
Example 2. Let f be a continuous function on (0, 1] satisfying the estimate [f(x)[
Cx
p
, p > 1. We claim that the improper integral
_
1
0
f exists. For, for <
small,
x
p
C
p+1
p + 1
.
It is clear that for any > 0 we can nd and
x +
3
x
dx.
By the previous example, this improper integral exists. Let x = (t) = t
6
,
t [, 1]. Then, as 0,
_
1
6
1
x +
3
x
dx =
_
1
6t
5
t
3
+t
2
dt
= 6
_
1
t
3
t + 1
dt
2t
3
3t
2
+ 6t 6 ln [1 +t[
1
0
= 5 6 ln 2.
29