Calculus for mathematicians

D. J. Bernstein, University of Illinois at Chicago, djb@pobox.com

19970403, draft 5

1. Introduction

This booklet presents the main concepts, theorems, and techniques of single-variable calculus. It differs from a typical undergraduate real analysis text in that (1) it focuses purely on calculus, not on developing topology and analysis for their own sake; (2) it’s short.

Notation and terminology. The reader must be comfortable with functions, not just numbers, as objects of study. I use the notation x ↦ x^{2} for the function that takes x to x^{2}; thus (x ↦ x^{2})(3) = 9. In general f = (t ↦ f(t)) for any function f.

An open ball around c means an interval Ball(c, h) = {x : |x − c| < h} for some positive real number h. The intersection of two open balls around c is another open ball around c.

If S is a set, and f(x) is defined for all x ∈ S, then f(S) is defined as {f(x) : x ∈ S}.

Part I. Continuity

2. Continuous functions

Definition 2.1. Let f be a function defined at c. Then f is continuous at c if, for any open ball F around f(c), there is an open ball B around c such that f(B) ⊆ F.

In other words, if f is continuous at c, and F is an open ball around f(c), then there is some h > 0 such that f(x) ∈ F for all x with |x − c| < h.

Example: The function x ↦ 3x is continuous—i.e., continuous at c for every c. Indeed, Ball(3c, ϵ) contains (x ↦ 3x)(Ball(c, ϵ/3)), because |x − c| < ϵ/3 implies |3x − 3c| < ϵ.

Another example: If f(x) = 3 for x < 2 and f(x) = 5 for x ≥ 2, then f is not continuous at 2. Indeed, consider the open ball F = Ball(5, 1). If B is any open ball around 2, then B contains numbers smaller than 2, so 3 ∈ f(B); thus f(B) is not contained in F.

Theorem 2.2. Let f and g be functions continuous at c. Assume that f(x) = g(x) for all x ≠ c such that f(x) and g(x) are both defined. Then f(c) = g(c).

Proof. I will show that |f(c) − g(c)| < 2ϵ for any ϵ > 0. Write F = Ball(f(c), ϵ) and G = Ball(g(c), ϵ). By continuity of f and g, there are balls A and B around c such that f(A) ⊆ F and g(B) ⊆ G. Find a point x ≠ c contained in both A and B. By construction f(x) ∈ F and f(x) = g(x) ∈ G, so |f(c) − g(c)| ≤ |f(x) − f(c)| + |f(x) − g(c)| < 2ϵ as claimed. □

3. Continuity of sums, products, and compositions

Theorem 3.1. Let f and g be functions continuous at c. Define h = f + g. Then h is continuous at c.

Proof. Given a ball H = Ball(h(c), ϵ), consider the balls F = Ball(f(c), ϵ/2) and G = Ball(g(c), ϵ/2). By continuity of f and g, there are open balls A and B around c such that f(A) ⊆ F and g(B) ⊆ G. Define D = A ∩ B; D is an open ball around c. If x ∈ D then f(x) ∈ F and g(x) ∈ G so h(x) = f(x) + g(x) ∈ H. Thus h(D) ⊆ H. □

Theorem 3.2. Let f and g be functions continuous at c. Define h = fg. Then h is continuous at c.

Proof. Define L = f(c) and M = g(c), so that LM = h(c). Given an open ball H = Ball(LM, ϵ), I will find an open ball D around c so that h(D) ⊆ H.

If L = M = 0, take the intersection of open balls where |f(x)| < ϵ and |g(x)| < 1. Then |h(x)| < ϵ.

If L = 0 and M ≠ 0, take the intersection of open balls where |f(x)| < ϵ/(2 |M|) and |g(x) − M| < |M|. Then |g(x)| < 2 |M| so |h(x)| < ϵ. Similarly if L ≠ 0 and M = 0.

If L ≠ 0 and M ≠ 0, take the intersection of open balls where |f(x) − L| < ϵ/(4 |M|), |g(x) − M| < ϵ/(2 |L|), and |g(x) − M| < |M|. Then |g(x)| < 2 |M| so |h(x) − LM| = |g(x)(f(x) − L) + L(g(x) − M)| < 2 |M| (ϵ/(4 |M|)) + |L| (ϵ/(2 |L|)) = ϵ. □

Theorem 3.3. Let g be a function continuous at c. Let f be a function continuous at g(c). Define h = (x ↦ f(g(x))). Then h is continuous at c.

For example, x ↦ cos 2x is continuous, since x ↦ 2x and y ↦ cos y are continuous,

Proof. Let F be an open ball around h(c) = f(g(c)). By continuity of f, there is some open ball G around g(c) with f(G) ⊆ F. By continuity of g, there is some open ball B around c with g(B) ⊆ G. Finally h(B) = f(g(B)) ⊆ f(G) ⊆ F. □

4. Continuity of simple functions

Theorem 4.1. x ↦ b is continuous at c, for any b and c.

Proof. Ball(b, h) contains (x ↦ b)(D) for any open ball D. □

Theorem 4.2. x ↦ x is continuous at c, for any c.

Proof. Ball(c, h) contains (x ↦ x)(Ball(c, h)). □

By Theorems 3.2 and 4.2, x ↦ x^{2} is continuous; x ↦ x^{3} is continuous; in general x ↦ x^{n} is continuous for any positive integer n. Thus, by Theorems 3.1, 3.2, and 4.1, any polynomial function x ↦ c_{0} + c_{1}x + ⋯ + c_{n}x^{n} is continuous.

The function x ↦ 1/x is continuous at c for c ≠ 0. (It’s not even defined at 0, so it can’t be continuous there.) By Theorem 3.3, x ↦ 1/f(x) is continuous whenever f is continuous and nonzero. For example, x ↦ x^{n} is continuous except at 0 when n is a negative integer.

Part II. Derivatives

5. Differentiable functions

Definition 5.1. Let f be a function defined at c. Then f is differentiable at c if there is a function f_{1}, continuous at c, such that f = (x ↦ f(c) + (x − c)f_{1}(x)).

Definition 5.2. Let f be a function defined at c. Then f has derivative d at c if there is a function f_{1}, continuous at c, such that f = (x ↦ f(c) + (x − c)f_{1}(x)) and f_{1}(c) = d.

By Theorem 2.2, there is at most one continuous function f_{1} satisfying f_{1}(x) = (f(x) − f(c))/(x − c) for all x ≠ c, so f has at most one derivative at c, called the derivative of f at c. The derivative of f at c is written f′(c). The derivative of f, written f′, is the function c ↦ f′(c).

For example, consider the function f = (x ↦ x^{2}). Here f(x) = f(3) + (x − 3)f_{1}(x) with f_{1} = (x ↦ x + 3). The function f_{1} is continuous at 3, so f is differentiable at 3; its derivative at 3 is f_{1}(3) = 6. In general f′(c) = 2c.

Theorem 5.3. Let f be a function. If f is differentiable at c then f is continuous at c.

Proof. By definition of differentiability, there is a function f_{1}, continuous at c, with f = (x ↦ f(c) + (x − c)f_{1}(x)). Apply Theorems 3.1, 3.2, 4.1, and 4.2. □

6. Derivatives of sums, products, and compositions

Theorem 6.1. Let f and g be functions. Define h = f + g. If f and g are differentiable at c then h is differentiable at c. Furthermore h′(c) = f′(c) + g′(c).

In short (f + g)′ = f′ + g′ if the right side is defined. This is the sum rule.

Proof. Say f(x) = f(c) + (x − c)f_{1}(x) and g(x) = g(c) + (x − c)g_{1}(x) with f_{1} and g_{1} continuous at c. Define h_{1} = f_{1} + g_{1}; then h_{1} is continuous at c by Theorem 3.1, and h(x) = h(c) + (x − c)h_{1}(x), so h is differentiable at c. Finally h′(c) = h_{1}(c) = f_{1}(c) + g_{1}(c) = f′(c) + g′(c). □

Theorem 6.2. Let f and g be functions. Define h = fg. If f and g are differentiable at c then h is differentiable at c. Furthermore h′(c) = f′(c)g(c) + f(c)g′(c).

In short (fg)′ = f′g + fg′ if the right side is defined. This is the product rule.

Proof. Say f(x) = f(c) + (x − c)f_{1}(x) and g(x) = g(c) + (x − c)g_{1}(x) with f_{1} and g_{1} continuous at c. Then h(x) = h(c) + (x − c)h_{1}(x) where h_{1}(x) = f_{1}(x)g(x) + f(c)g_{1}(x). This function h_{1} is continuous at c by Theorems 3.1, 3.2, 4.1, and 5.3, so h is differentiable at c, with derivative h_{1}(c) = f_{1}(c)g(c) + f(c)g_{1}(c) = f′(c)g(c) + f(c)g′(c). □

Theorem 6.3. Let f and g be functions. Define h = (x ↦ f(g(x))). If g is differentiable at c, and f is differentiable at g(c), then h is differentiable at c. Furthermore h′(c) = f′(g(c))g′(c).

In short (f ∘ g)′ = (f′ ∘ g)g′ if the right side is defined. This is the chain rule.

Proof. Write b = g(c). Say f(x) = f(b)+(x−b)f_{1}(x) and g(x) = b+(x−c)g_{1}(x) with f_{1} continuous at b and g_{1} continuous at c. Now h(x) = f(g(x)) = f(b)+(g(x)−b)f_{1}(g(x)) = f(b)+(x−c)g_{1}(x)f_{1}(g(x)). Thus h(x) = h(c)+(x−c)h_{1}(x) where h_{1}(x) = g_{1}(x)f_{1}(g(x)). Finally h_{1} is continuous at c by Theorems 3.3, 3.2, and 5.3, so h is differentiable at c, with derivative h_{1}(c) = g_{1}(c)f_{1}(g(c)) = g′(c)f′(g(c)). □

7. Derivatives of simple functions

A constant function, such as x ↦ 17, has derivative c ↦ 0, since 17 = 17 + (x − c)0.

The identity function x ↦ x has derivative c ↦ 1, since x = c + (x − c)1.

In general, for any positive integer n, the function x ↦ x^{n} has derivative c ↦ nc^{n−1}, since x^{n} = c^{n} + (x − c)(x^{n−1} + cx^{n−2} + ⋯ + c^{n−1}).

The function x ↦ 1/x, defined for nonzero inputs, has derivative c ↦ −1/c^{2}. Indeed, 1/x = 1/c + (x − c)(−1/cx), and x ↦ −1/cx is continuous at c with value −1/c^{2}.

Now the chain rule, with f = (x ↦ 1/x), states that 1/g has derivative −g′/g^{2} at any point c where g(c) ≠ 0. In particular, for any negative integer n, x ↦ x^{n} has derivative c ↦ nc^{n−1}.

Finally, the product rule implies that h/g has derivative (gh′ − hg′)/g^{2} at any point c where g(c) ≠ 0; this is the quotient rule.

Part III. Completeness and its consequences

8. Completeness of the real numbers

Definition 8.1. Let S be a set of real numbers. A real number c is an upper bound for S if x ≤ c for all x ∈ S.

For example, any number c ≥ π is an upper bound for the set {3, 3.1, 3.14, 3.141, …}. The smallest upper bound is π.

The real numbers are complete: if S is a nonempty set, and there is an upper bound for S, then there is a smallest upper bound for S. The smallest upper bound is unique; it is called the supremum of S, written sup S.

9. The intermediate-value theorem

Theorem 9.1. Let f be a continuous real-valued function. Let y be a real number. Let b ≤ c be real numbers with f(b) ≤ y ≤ f(c). Then f(x) = y for some x ∈ [b, c].

Here [b, c] means {x : b ≤ x ≤ c}. For example, if f(3) = −5 and f(4) = 7, and f is continuous, then f must have a root between 3 and 4.

Proof. Define S = {x ∈ [b, c] : f(x) ≤ y}. S is nonempty, because it contains b, and it has an upper bound, namely c, so it has a smallest upper bound, say u.

Suppose f(u) > y. By continuity, there is an open ball D around u such that f(x) > y for x ∈ D. Pick any t ∈ D with t < u. If x ∈ [t, u] then x ∈ D so f(x) > y so x ∉ S. Thus t is an upper bound for S—but u is the smallest upper bound. Contradiction.

Suppose f(u) < y. Then u ≠ c so u < c. By continuity, there is an open ball D around u such that f(x) < y for x ∈ D. Pick any x ∈ D with u < x < c; then f(x) < y. But x ∉ S since u is an upper bound for S; so f(x) > y. Contradiction. □

10. The maximum-value theorem

Theorem 10.1. Let f be a continuous real-valued function. Let b ≤ c be real numbers. Then there is an upper bound for f([b, c]).

Proof. Let S be the set of x ∈ [b, c] such that f([b, x]) is bounded—i.e., has an upper bound. S is nonempty, because it contains b. Define u = sup S.

By continuity, there is an open ball D around u such that f(D) ⊆ Ball(f(u), 1). Select t ∈ D with t < u; then t is not an upper bound for S, so there is some x ∈ S with t < x ≤ u. Now f([b, x]) and f([x, u]) ⊆ f(D) are bounded, so f([b, u]) is bounded.

Suppose u < c. Select v ∈ D with u < v < c. Then f([u, v]) is bounded, so v ∈ S. Contradiction. Hence u = c, and f([b, c]) = f([b, u]) is bounded. □

Theorem 10.2. Let f be a continuous real-valued function. Let b ≤ c be real numbers. Then there is some u ∈ [b, c] such that, for all z ∈ [b, c], f(u) ≥ f(z).

This is the maximum-value theorem: a continuous function on a closed interval achieves a maximum. The same is not true for open intervals: consider 1/x for 0 < x < 1.

Proof. By Theorem 10.1, there is an upper bound for f([b, c]). Define M = sup f([b, c]).

Let S be the set of x ∈ [b, c] such that sup f([x, c]) = M. Then b ∈ S. Define u = sup S.

Suppose f(u) < M. By continuity there is an open ball D around u such that f(D) ⊆ Ball(f(u), (M − f(u))/2); then sup f(D) < M. Select t ∈ D with t < u; then t is not an upper bound for S, so there is some x ∈ S with t < x ≤ u. Then sup f([x, c]) = M, but sup f([x, u]) < M, so u < c. Select v ∈ D with u < v < c. Then sup f([x, v]) < M, so sup f([v, c]) = M, so v ∈ S. Contradiction. Hence f(u) = M = sup f([b, c]). □

Theorem 10.3. Let f be a continuous real-valued function. Let b ≤ c be real numbers. Then there is some u ∈ [b, c] such that, for all x ∈ [b, c], f(u) ≤ f(x).

Proof. Apply Theorem 10.2 to −f. □

Part IV. The mean-value theorem

11. Fermat’s principle

Theorem 11.1. Let f be a real-valued function differentiable at t. Assume that f(t) ≥ f(x) for all x in an open ball B around t. Then f′(t) = 0.

Proof. By assumption f(x) = f(t) + (x − t)f_{1}(x) where f_{1} is continuous at t. Suppose f_{1}(t) > 0. Then f_{1}(x) > 0 for all x in an open ball D around t. Pick x > t in both B and D; then f(t) ≥ f(x) = f(t) + (x − t)f_{1}(x) > f(t). Contradiction. Thus f_{1}(t) ≤ 0. Similarly f_{1}(t) ≥ 0. Hence f′(t) = f_{1}(t) = 0. □

Theorem 11.2. Let f be a real-valued function differentiable at t. Assume that f(t) ≤ f(x) for all x in an open ball B around t. Then f′(t) = 0.

Proof. Apply Theorem 11.1 to −f. □

12. Rolle’s theorem

Theorem 12.1. Let f be a differentiable real-valued function. Let b < c be real numbers. If f(b) = f(c) then there is some x with b < x < c such that f′(x) = 0.

Proof. By Theorem 10.2, there is some t ∈ [b, c] such that f’s maximum value on [b, c] is achieved at t. If f(t) > f(b) then t ≠ b and t ≠ c, so there is an open ball B around t such that B ⊆ [b, c]. By Theorem 11.1, f′(t) = 0.

Similarly, by Theorem 10.3, there is some u ∈ [b, c] such that f achieves its minimum at u. If f(u) < f(b) then f′(u) = 0 as above.

The only remaining case is that f(t) ≤ f(b) and f(u) ≥ f(b). Then f(b) is both the maximum and the minimum value of f on [b, c]; i.e., f is constant on [b, c]. Hence f′(x) = 0 for any x between b and c. □

13. The mean-value theorem

Theorem 13.1. Let f be a differentiable real-valued function. Let b < c be real numbers. Then there is some x with b < x < c such that f(c) − f(b) = f′(x)(c − b).

This is the mean-value theorem. The terminology “mean value” comes from the fundamental theorem of calculus, which can be interpreted as saying that (f(c)−f(b))/(c−b) is the average (“mean”) value of f′(x) for x ∈ [b, c]. See Theorem 16.1.

Proof. Define g(x) = (c − b)f(x) − (x − b)(f(c) − f(b)). Then g is differentiable, and g(b) = (c − b)f(b) = (c − b)f(c) − (c − b)(f(c) − f(b)) = g(c). By Theorem 12.1, g′(x) = 0 for some x between b and c. But g′(x) = (c − b)f′(x) − (f(c) − f(b)). □

Theorem 13.2. Let f be a differentiable real-valued function. If f′(x) = 0 for all x then f is constant.

More generally, two functions with the same derivative must differ by a constant.

Proof. Pick any real numbers b < c. By Theorem 13.1, there is some x such that f(c) − f(b) = f′(x)(c − b) = 0, so f(c) = f(b). □

Part V. Integration

14. Tagged divisions and gauges

Definition 14.1. Let b ≤ c be real numbers. Let x_{0}, x_{1}, …, x_{n} and t_{1}, …, t_{n} be real numbers. Then x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n} is a tagged division of [b, c] if b = x_{0} ≤ t_{1} ≤ x_{1} ≤ t_{2} ≤ ⋯ ≤ x_{n−1} ≤ t_{n} ≤ x_{n} = c.

The idea is that [b, c] is divided into the intervals [x_{0}, x_{1}], [x_{1}, x_{2}], …, [x_{n−1}, x_{n}]; in each interval [x_{k−1}, x_{k}] there is a tag t_{k}. For example, consider the tagged division 0, 1, 4, 5, 6, 6, 7 of [0, 7]; here the intervals are [0, 4], [4, 6], [6, 7], with tags 1, 5, 6 respectively.

Definition 14.2. Let b ≤ c be real numbers. A gauge on [b, c] is a function assigning to each point t ∈ [b, c] an open interval containing t.

For example, given ϵ > 0, the function t ↦ Ball(t, ϵ) is a gauge on any interval.

Definition 14.3. Let b ≤ c be real numbers. Let G be a gauge on [b, c]. A tagged division x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n} of [b, c] is inside G if [x_{k−1}, x_{k}] ⊂ G(t_{k}) for every k.

Theorem 14.4. Let b ≤ c be real numbers. Let G be a gauge on [b, c]. Then there is a tagged division of [b, c] inside G.

Proof. Let S be the set of x ∈ [b, c] such that there is a tagged division of [b, x] inside G. S is nonempty: b, b, b is a tagged division of [b, b] inside G, so b ∈ S. Also, c is an upper bound for S. Thus there is a smallest upper bound for S, say y.

Select v ∈ G(y) such that v < y. Then v is not an upper bound for S, so there is some x > v with x ∈ S. Let x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n} be a tagged division of [b, x] inside G.

Suppose y < c. Pick z ∈ G(y) with y < z ≤ c. Then [x_{n}, z] = [x, z] ⊂ [v, z] ⊂ G(y), so x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n}, y, z is a tagged division of [b, z] inside G. Thus z ∈ S; but z > y, and y is an upper bound for S. Contradiction.

Thus y = c. Finally x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n}, y, y is a tagged division of [b, c] inside G. □

15. The definite integral

Definition 15.1. Let b ≤ c be real numbers. Let x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n} be a tagged division of [b, c]. Let f be a function defined on [b, c]. The Riemann sum for f on x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n} is (x_{1} − x_{0})f(t_{1}) + ⋯ + (x_{n} − x_{n−1})f(t_{n}).

For example, the Riemann sum for f on 0, 1, 4, 5, 6, 6, 7 is (4 − 0)f(1) + (6 − 4)f(5) + (7 − 6)f(6). This may be visualized as the sum of areas of three rectangles: one stretching from 0 to 4 horizontally with height f(1), another from 4 to 6 with height f(5), and another from 6 to 7 with height f(6).

Definition 15.2. Let b ≤ c be real numbers. Let f be a function defined on [b, c]. Let I be a number. Then f has integral I on [b, c] if, for every open ball E around I, there is a gauge G on [b, c] such that E contains the Riemann sum for f on any tagged division of [b, c] inside G.

Theorem 15.3. Let b ≤ c be real numbers. Let f be a function. If f has integral I on [b, c] and f has integral J on [b, c] then I = J.

Thus there is at most one number I such that f has integral I on [b, c]. If this number exists, it is called the integral of f from b to c, written ∫_{b}^{c} f.

Proof. I will show that |I − J| < 2ϵ for any ϵ > 0.

By definition of integral, there is a gauge G on [b, c] such that Ball(I, ϵ) contains the Riemann sum for f on any tagged division of [b, c] inside G.

Similarly, there is a gauge H on [b, c] such that Ball(J, ϵ) contains the Riemann sum for f on any tagged division of [b, c] inside G.

Define F (t) as the intersection of G(t) and H(t). Then F is a gauge on [b, c]. By Theorem 14.4, there is a tagged division x_{0}, …, x_{n} of [b, c] inside F.

Let R be the Riemann sum for f on x_{0}, …, x_{n}. Observe that x_{0}, …, x_{n} is inside both G and H, so R ∈ Ball(I, ϵ) and R ∈ Ball(J, ϵ). Hence |I − J| ≤ |I − R| + |R − J| < 2ϵ. □

16. The fundamental theorem of calculus

Theorem 16.1. Let f be a differentiable function. Let b ≤ c be real numbers. Then f(c) − f(b) = ∫_{b}^{c} f′.

Proof. Pick ϵ > 0. I will construct a gauge G such that Ball(f(c) − f(b), ϵ(c − b + 1)) contains the Riemann sum for f′ on any tagged division of [b, c] inside G.

Fix t ∈ [b, c]. Since f is differentiable at t, there is a function f_{1}, continuous at t, such that f(x) = f(t) + (x − t)f_{1}(x). By definition of continuity, f_{1}(x) is within ϵ of f_{1}(t) = f′(t) for all x in some open ball around t. Define G(t) as the union of all such balls. Then G is a gauge on [b, c].

Observe that if x, y ∈ G(t), with x ≤ t ≤ y, then (y − x)f′(t) is within ϵ(y − x) of f(y)−f(x). Indeed, |f_{1}(x) − f′(t)| < ϵ by definition of G, and f(x)−f(t) = (x−t)f_{1}(x), so

|f(x) − f(t) − (x − t)f′(t)| = |(x − t)(f_{1}(x) − f′(t))| ≤ ϵ |x − t| .

Similarly |f(y) − f(t) − (y − t)f′(t)| ≤ ϵ |y − t|. Thus |f(y) − f(x) − (y − x)f′(t)| ≤ ϵ(|y − t| + |x − t|); and |y − t| + |x − t| = y − x.

Finally, say x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n} is a tagged division of [b, c] inside G. Then x_{k−1}, x_{k} ∈ G(t_{k}), with x_{k−1} ≤ t_{k} ≤ x_{k}, so (x_{k}−x_{k−1})f′(t_{k}) is within ϵ(x_{k}−x_{k−1}) of f(x_{k})−f(x_{k−1}) as above. Thus the Riemann sum for f′ on x_{0}, t_{1}, x_{1}, …, t_{n}, x_{n} is within

∑_{1≤k≤n} ϵ(x_{k} − x_{k−1}) = ϵ(x_{n} − x_{0}) = ϵ(c − b) < ϵ(c − b + 1)

of

∑_{1≤k≤n} (f(x_{k}) − f(x_{k−1})) = f(x_{n}) − f(x_{0}) = f(c) − f(b)

as claimed. □

17. Integration rules

Theorem 17.1. Let f be a function. Let b ≤ c be real numbers. If ∫_{b}^{c} f = I then af has integral aI on [b, c] for any real number a.

In short ∫_{b}^{c} af = a ∫_{b}^{c} f if the right side is defined.

Proof. Pick ϵ > 0. Since ∫_{b}^{c} f = I, there is a gauge G on [b, c] such that Ball(I, ϵ) contains the Riemann sum for f on any tagged division of [b, c] inside G. The Riemann sum for af is exactly a times the Riemann sum for f, so it is inside Ball(aI, |a| ϵ) for a ≠ 0 or Ball(0, ϵ) for a = 0. □

Theorem 17.2. Let f and g be functions. Let b ≤ c be real numbers. If ∫_{b}^{c} f = I and ∫_{b}^{c} g = J then f + g has integral I + J on [b, c].

In short ∫_{b}^{c}(f + g) = ∫_{b}^{c} f + ∫_{b}^{c} g if the right side is defined.

Proof. Pick ϵ > 0. There is a gauge F on [b, c] such that Ball(I, ϵ) contains the Riemann sum for f on any tagged division of [b, c] inside F; and there is a gauge G on [b, c] such that Ball(J, ϵ) contains the Riemann sum for g on any tagged division of [b, c] inside G.

Define H(t) = F (t) ∩ G(t). Then H is a gauge on [b, c]. If x_{0}, …, x_{n} is a tagged division of [b, c] inside H, then x_{0}, …, x_{n} is also inside both F and G, so the Riemann sums for f and g on x_{0}, …, x_{n} are within ϵ of I and J respectively; thus the Riemann sum for f + g on x_{0}, …, x_{n} is within 2ϵ of I + J. □

Theorem 17.3. Let f be a function. Let a ≤ b ≤ c be real numbers. If ∫_{a}^{b} f = I and ∫_{b}^{c} f = J then f has integral I + J on [a, c].

In short ∫_{a}^{c} f = ∫_{a}^{b} f + ∫_{b}^{c} f if the right side is defined.

Proof. Pick ϵ > 0. There is a gauge G on [a, b] such that Ball(I, ϵ) contains the Riemann sum for f on any tagged division of [a, b] inside G; there is a gauge H on [b, c] such that Ball(J, ϵ) contains the Riemann sum for f on any tagged division of [b, c] inside H.

I define a new gauge as follows. For t < b define F (t) = {x ∈ G(t) : x < b}. For t = b define F (t) = G(t) ∩ H(t). For t > b define F (t) = {x ∈ H(t) : x > b}.

Say x_{0}, …, x_{n} is a tagged division of [a, c] inside F. Then b ∈ [x_{k−1}, x_{k}] ⊂ F (t_{k}) for some k; by construction of F, t_{k} must equal b. Now x_{0}, t_{1}, x_{1}, …, x_{k−1}, t_{k}, b is a tagged division of [a, b] inside F, hence inside G. Thus the Riemann sum (x_{1} − x_{0})f(t_{0}) + ⋯ + (b − x_{k−1})f(t_{k}) is within ϵ of I. Similarly the Riemann sum (x_{k} − b)f(t_{k}) + ⋯ + (x_{n} − x_{n−1})f(t_{n}) is within ϵ of J. Add: the Riemann sum (x_{1} − x_{0})f(t_{0}) + ⋯ + (x_{k} − x_{k−1}f(t_{k}) + ⋯ + (x_{n} − x_{n−1})f(t_{n}) is within 2ϵ of I + J. □

Theorem 17.4. Let f be a function. Let b ≤ c be real numbers. If f is nonnegative on [b, c] and ∫_{b}^{c} f = I then I is nonnegative.

Proof. Pick ϵ > 0. Select an appropriate gauge G. By Theorem 14.4, there is an appropriate tagged division of [b, c]. The corresponding Riemann sum is nonnegative, so I ≥ −ϵ. □

Part VI. Limits

18. Convergence and limits

Definition 18.1. Let f be a function. Then f converges to L at c if the function

x ↦ \{ \begin{matrix}L & if x = c \\ f(x) & if x ≠ c \end{matrix}

is continuous at c.

Equivalent terminology: f(x) converges to L as x approaches c.

By Theorem 2.2, there is at most one number L such that f converges to L at c. If this number exists, it is called the limit of f at c, or the limit of f(x) as x approaches c, written lim_{x→c} f(x). Note that f is continuous if and only if lim_{x→c} f(x) = f(c).

Example: cos(1/x) does not converge to 0 as x approaches 0.

19. Limits of sums, products, and compositions

Theorem 19.1. Let f and g be functions. If lim_{x→c} f(x) = L and lim_{x→c} g(x) = M then f(x) + g(x) converges to L + M as x approaches c.

In short lim_{x→c}(f(x) + g(x)) = lim_{x→c} f(x) + lim_{x→c} g(x) if the right side is defined.

Proof. Replace f(c) by L and g(c) by M to obtain new functions a and b. Then a and b are continuous, so a + b is continuous by Theorem 3.1. □

Theorem 19.2. Let f and g be functions. If lim_{x→c} f(x) = L and lim_{x→c} g(x) = M then f(x)g(x) converges to LM as x approaches c.

Proof. Theorem 3.2. □

Theorem 19.3. Let f and g be functions. If lim_{x→c} g(x) = L, and f is continuous at L, then f(g(x)) converges to f(L) as x approaches c.

In short lim_{x→c} f(g(x)) = f(lim_{x→c} g(x)) if the right side is defined, provided that f is continuous.

Proof. Theorem 3.3. □

20. L’Hôpital’s rule

Theorem 20.1. Let f and g be real-valued functions differentiable at c. If f(c) = g(c) = 0, and g′(c) ≠ 0, then f(x)/g(x) converges to f′(c)/g′(c) as x approaches c.

For example, lim_{x→0}(x/ sin x) = 1/1 = 1, since sin′ = cos and cos 0 = 1 ≠ 0.

Proof. By assumption f(x) = f(c) + (x − c)f_{1}(x) = (x − c)f_{1}(x) where f_{1} is continuous at c. Similarly g(x) = (x − c)g_{1}(x) where g_{1} is continuous at c. By assumption g_{1}(c) = g′(c) ≠ 0, so the function x ↦ f_{1}(x)/g_{1}(x) is continuous at c, with value f_{1}(c)/g_{1}(c). Finally f(x)/g(x) = f_{1}(x)/g_{1}(x) for x ≠ c. □

Theorem 20.2. Let f and g be differentiable real-valued functions. If f(c) = g(c) = 0, and lim_{x→c}(f′(x)/g′(x)) = L, then f(x)/g(x) converges to L as x approaches c.

Proof. Fix a ball E around L. There is a ball D around c such that f′(x)/g′(x) ∈ E for all x ∈ D with x ≠ c. In particular, g′(x) is nonzero for x ∈ D. By Theorem 12.1, g(y) is nonzero for y ∈ D.

I will show that f(y)/g(y) ∈ E for all y ∈ D with y ≠ c. Thus f(y)/g(y) converges to L as y approaches c.

Given y ∈ D, y ≠ c, consider the function h = (x ↦ f(x)g(y) − f(y)g(x)). Notice that h is differentiable, with h′(x) = f′(x)g(y) − f(y)g′(x).

Now h(c) = f(c)g(y) − f(y)g(c) = 0, and h(y) = f(y)g(y) − f(y)g(y) = 0, so there is some x between c and y with h′(x) = 0 by Theorem 12.1. Thus f′(x)g(y) = f(y)g′(x). Both g′(x) and g(y) are nonzero, so f(y)/g(y) = f′(x)/g′(x) ∈ E. □

Theorem 20.2 may be used repeatedly. For example:

lim_{x→0} \frac{1 − cos x}{x^{2}} = lim_{x→0} \frac{sin x}{2x} = lim_{x→0} \frac{cos x}{2} = \frac{1}{2}.

99. Expository notes

Common practice in calculus books is to define continuity using limits. I define limits using continuity; continuity is a simpler concept.

“An open ball around c” is substantially easier to read than “for some h > 0, the set of x such that |x − c| < h.”

I use Carathéodory’s definition of the derivative of f. The point is to give a name to the function x ↦ (f(x) − f(c))/(x − c). I learned about this from an article by Stephen Kuhn in the Monthly. It’s also used in the second edition of Apostol’s text.

My proof of Theorem 6.2 uses the formula h_{1}(x) = f_{1}(x)g(x)+f(c)g_{1}(x), which is shorter than the (more obvious) formula h_{1}(x) = f_{1}(x)g(c) + f(c)g_{1}(x) + (x − c)f_{1}(x)g_{1}(x). I was reminded of this simplification by a letter in the Monthly from Günter Pickert.

The Heine-Borel theorem follows immediately from Theorem 14.4. See Botsko’s 1987 Monthly article for this approach to all the basic completeness theorems. Thanks to Joe Buhler for the reference.

I follow the Kurzweil-Henstock approach to integration. The resulting integral is more general than the Lebesgue integral; it is equivalent to the integrals constructed by Denjoy and Perron. There is no need for any technical conditions in the fundamental theorem of calculus, Theorem 16.1; every derivative is integrable. I learned about this from advertisements by Robert G. Bartle in the Bulletin and the Monthly.