<<

Math 224: of One Variable Functions Northwestern University, Summer 2019

Shuyi Weng

Last Update: August 12, 2019 Contents

Lecture 1: and the Area Problem 1

Lecture 2: Definite 11

Lecture 3: The Fundamental Theorem of Calculus 19

Lecture 4: Substitution Rule and 26

Lecture 5: Trigonometric Integrals 32

Lecture 6: Partial Fractions 39

Lecture 7: Improper Integrals 47

Lecture 8: Areas, Volumes, and Arc Lengths 54

Lecture 9: Sequences and Limits 62

Lecture 10: 71

Lecture 11: 79

Lecture 12: 85

Lecture 13: Taylor and Maclaurin Series 92 Lecture 1: Antiderivatives and the Area Problem

Today: Introduction, Review of Math 220, Antiderivatives, The Area Problem

Welcome to Math 224! You have studied the idea of differentiation in your previous calculus course(s). We will steer our focus to integration in this course. Let’s start by reviewing some important ideas of differential calculus.

Review: Differential Calculus

The central idea in differential calculus is, of course, differentiation.

Definition. Given a f(x), we define the of f(x) by d f(x + h) − f(x) f 0(x) = f(x) = lim , dx h→0 h given any value of x for which this exists. If the limit exists for all x in the domain of definition of f(x), we say that f(x) is differentiable.

The following theorem includes some of the elementary differentiation rules.

Theorem 1. Some elementary differentiation rules: i. (Constant Function) If c is a constant, then d (c) = 0. dx ii. () If n is any real number, then d (xn) = nxn−1. dx iii. (Constant Multiple) If c is a constant and f(x) is a differentiable function, then d d [cf(x)] = c f(x). dx dx iv. (Sum and Difference) If f(x) and g(x) are differentiable functions, then d d d [f(x) ± g(x)] = f(x) ± f(x). dx dx dx v. (Sine and Cosine) d d (sin x) = cos x, (cos x) = − sin x. dx dx

1 vi. (Exponential and Logarithm) d d 1 (ex) = ex, (log |x|) = . dx dx x vii. () If f(x) and g(x) are differentiable functions, then d d d [f(x)g(x)] = f(x) [g(x)] + g(x) [f(x)]. dx dx dx viii. () If f(x) and g(x) are differentiable functions, then d d d hf(x)i g(x) [f(x)] − f(x) [g(x)] = dx dx dx g(x) [g(x)]2 ix. () If f and g are both differentiable and F = f ◦g is the composition defined by F (x) = f(g(x)), then F is differentiable, and its derivative is given by

F 0(x) = f 0(g(x)) · g0(x). Exercise. Find the derivative of tan x.

Use the quotient rule d d h sin x i (tan x) = dx dx cos x cos x · cos x − sin x · (− sin x) = (cos x)2 cos2 x + sin2 x = cos2 x 1 = . cos2 x Exercise. Find the derivative of xx.

Use the chain rule and the product rule d d d (xx) = [(eln x)x] = (ex ln x) dx dx dx d = ex ln x · (x ln x) dx  d d  = xx · x (ln x) + ln x (x) dx dx  1  = xx · x · + ln x · 1 x = xx(1 + ln x).

An important tool in differential calculus is graph sketching. We will continue to use graphs of functions in this course to understand integrals and related concepts. Here is a basic example.

2 Exercise. Sketch the graph of sin(x).

sin(x) 1

x 3π π π 3π -2π - -π - π 2π 2 2 2 2

-1

The curve shows the evaluation of sin(x) at each value of x, and the of the line at a point on the curve represents the derivative of sin(x) at this point.

Antiderivatives

In some cases, we would like to know the original function based on a known (or measured) derivative. For example, if the velocity of a car over a period of time is known, we might wish to know its position at a given time. The problem is to find a function F whose derivative is a known function f. If such a function F exists, it is called an of f.

Definition. A function F is called an antiderivative of f on an interval I if F 0(x) = f(x) for all x ∈ I.

The following theorem characterizes all antiderivatives of a function, given that an antideriva- tive exists.

Theorem 2. If F is an antiderivative of f on an interval I, then all antiderivatives of f are of the form F (x) + C, where C is an arbitrary constant.

Going back to the function sin(x), we know that its derivative is cos(x). So an antiderivative of cos(x) is sin(x). However, since constant functions have zero , we know that sin(x) + 1 also has derivative cos(x), and in fact, sin(x) + C for any constant C would have

3 derivative cos(x). The following figure shows some of these antiderivatives of cos(x).

sin(x)

2

1

x 3π π π 3π -2π - -π - π 2π 2 2 2 2

-1

-2

The following table gives some of the most elementary antiderivatives

Function Antiderivative Function Antiderivative

cf(x) cF (x) + C ex ex + C

f(x) + g(x) F (x) + G(x) + C cos(x) sin(x) + C

xn+1 xn (n 6= −1) + C sin(x) − cos(x) + C n + 1

x−1 ln |x| + C sec2(x) tan(x) + C

Exercise. If f(x) is a polynomial of degree n, we can write

2 n f(x) = a0 + a1x + a2x + ··· + anx , where a0, . . . , an are constants. Find all antiderivatives of f.

Use power rule and linearity, we get

a x2 a x3 a xn+1 F (x) = a x + 1 + 2 + ··· + n + C 0 2 3 n + 1

4 The Area Problem

We start our discussion by considering the area of regular shapes.

Question. What is the area of each of the following three shapes?

2 2 2

1 1 1

-2 -1 1 2 -1 1 2 -1 1 2

The area of the rectangle is

(length) × (width) = 4 × 2 = 8.

The area of the trapezoid is (base 1 + base 2) × (height) (1 + 2) × 3 9 = = . 2 2 2 The area of the triangle is (base) × (height) 3 × 2 = = 3. 2 2

Things get much more complicated in some cases. For example, we do not yet have the proper tools to find the area of shapes with curved boundary.

Question. What is the area of the shaded region?

(1,1)

y=x2

0 1

The shaded region has a curved side, namely the graph of the function f(x) = x2. It is not clear what the exact area of the region is. However, we can do some estimates. First of all, the area of the region must be between 0 and 1, because the region is contained in the square of side length 1.

5 We then divide the region in two parts by drawing a vertical line at x = 1/2. The area of the region is the sum of the area of these two parts. Call these two parts S1 and S2.

S2 S1

0 /2 11

Now we estimate the area of S1 and S2, respectively. The area of S1 is bounded below by zero, and is bounded above by the area of the rectangle whose base is the same as S1 and whose height is the same as the right edge of S1. The area of S2, however, is bounded below by the area of the rectangle whose base is the same as S2 and whose height is the same as the left edge of S2. An upper bound for the area of S2 would be the area of the rectangle whose base is the same as S2 and whose height is the same as the right edge of S2.

0 /2 11 0 /2 11

Thus we get a lower bound 1 1 1 Area = S + S > 0 + · = , 1 2 2 4 8 and an upper bound 1 1 1 5 Area = S + S < · + · 1 = . 1 2 2 4 2 8 So we know that the area of the shaded region must be between 1/8 and 5/8. This is a better estimate than 0 and 1. In order to find an even better estimate, we divide the region further into four vertical strips,

6 and repeat the same process.

0 1 0 1 0 1

The lower and upper bounds in this case can be computed by

1 12 1 12 1 32 7 Lower Bound = 0 + · + · + · = = 0.21875 4 4 4 2 4 4 32 1 12 1 12 1 32 1 15 Upper Bound = · + · + · + · 12 = = 0.46875 4 4 4 2 4 4 4 32 Once again, this gives a better estimate. We can repeat this process with a larger number n of strips. The following table shows the lower bound Ln and the upper bound Un for some large numbers n.

Number of Strips Lower Bound Upper Bound 10 0.285 0.385 20 0.30875 0.35875 50 0.3234 0.3434 100 0.32835 0.33835 1000 0.3328335 0.3338335

It appears that the area of the shaded region is somewhere near 1/3.

Proposition 3. The sum of the areas of the upper approximating rectangles for the shaded region approaches 1/3, that is 1 lim Un = . n→∞ 3 Proof. We need to make use of the formula for the sum of squares

n(n + 1)(2n + 1) 12 + 22 + 32 + ··· + (n − 1)2 + n2 = . 6

The upper bound Un is the sum of the areas of the n rectangles, each of which has base length 1/n and height the values of the function f(x) = x2 at the right endpoints 1/n, 2/n, . . . , n/n.

7 Thus 1  1 2 1  2 2 1  3 2 1 n − 12 1 n2 U = + + + ··· + + n n n n n n n n n n n 1 12 + 22 + 32 + ··· + (n − 1)2 + n2 = · n n2 1 = · (12 + 22 + 32 + ··· + n2) n3 Use the formula given above, we have

1 n(n + 1)(2n + 1) (n + 1)(2n + 1) U = · = n n3 6 6n2 Now we take the limit, and we get

(n + 1)(2n + 1) 1 n + 1 2n + 1 lim Un = lim = lim · · n→∞ n→∞ 6n2 n→∞ 6 n n 1 n + 1 2n + 1 = lim lim 6 n→∞ n n→∞ n 1 1 = · 1 · 2 = . 6 3

Proposition 4. The sum of the areas of the lower approximating rectangles for the shaded region approaches 1/3, that is 1 lim Ln = . n→∞ 3 Proof. Homework.

Now we are ready to give the precise definition of area under a curve.

Definition. The area A of the region that lies under the graph of a f between an interval [a, b] is the limit of the sum of the areas of approximating rectangles:

A = lim [f(x1)∆x + f(x2)∆x + · + f(xn)∆x], n→∞ where

a = x0 < x1 < ··· < xn−1 < xn = b are the endpoints of the subintervals, and b − a ∆x = n is the length of each subinterval.

8 Remark. Since we assume that the function f is continuous, it can be proved that the limit always exists. In fact, if we use the left endpoints

lim [f(x0)∆x + f(x1)∆x + · + f(xn−1)∆x], n→∞ the limit exists as well, and it agrees with our definition of area under the graph of the function. The proof of this claim is beyond the scope of this course.

Example. Find the area of the trapezoid.

2

1

-1 1 2

The trapezpoid is the region under the graph of the x + 4 f(x) = 3 over the interval [−1, 2]. If we subdivide the interval into n subintervals of equal length, the endpoints of these subintervals would be 3k x = − 1 k n for each integer k between 0 and n. Thus the area of the trapezoid can be computed by h 3  3  3  6  3 3n i A = lim · f − 1 + · f − 1 + ··· + · f − 1 n→∞ n n n n n n h 3  1  3  2  3 n i = lim · + 1 + · + 1 + ··· · + 1 n→∞ n n n n n n 3  1 + 2 + ··· + n = lim · n + n→∞ n n 3  n(n + 1) = lim · n + n→∞ n 2n  3(n + 1) = lim 3 + n→∞ 2n 3 9 = 3 + = . 2 2 This agrees with our traditional definition of the area of the trapezoid.

9 Big Sigma Notation

It is sometimes cumbersome and inconvenient to write a sum with many terms explicitly. Hence, we introduce the sigma notation for compact writing. For instance, the sum of the integers 1 through 100 can be denoted by

100 X n = 1 + 2 + 3 + ··· + 100. n=1 We write an indexing variable and the initial value below the Σ symbol. We put the final value on top of the Σ symbol. To the right of the Σ symbol, we write the terms to be summed in terms of the indexing variable.

Exercise. Write the definition of the area under a curve in sigma notation.

n X A = lim f(xi)∆x. n→∞ i=1 Exercise. Write the sum of squares formula in sigma notation.

n X n(n + 1)(2n + 1) k2 = 6 k=1

10 Lecture 2: Definite Integrals

Today: Riemann Sums, Definite Integrals, Evaluation Theorem, Indefinite Integrals

We defined the area under a curve in the last class. In today’s class, we will generalize this idea and introduce the definite integrals.

Riemann Sum and Definite Integral

Let’s start with a function f defined on an interval [a, b]. We divide the interval [a, b] into n smaller subintervals by choosing x1, x2, . . . , xn−1 so that

a = x0 < x1 < x2 < ··· < xn−1 < xn = b.

The resulting subintervals are

[x0, x1], [x1, x2],..., [xn−1, xn].

The choice does not guarantee that all the subintervals have the same length. We call this a partition P of [a, b].

Definition. A Riemann sum associated with a partition P and a function f with respect to right endpoints is the sum n X f(xk)∆xk, k=1 where ∆xk = xk − xk−1. Similarly, we can define the Riemann sum associated with a partition P and a function f with respect to left endpoints by the sum

n X f(xk−1)∆xk. k=1

The geometric interpretation of the Riemann sum is demonstrated in the following figure.

11 Notice that if f(xk) is negative, then the summand (xk − xk−1)f(xk) is negative. Thus it accounts for the negative area below the x-axis. In this case, the area of the rectangles colored in gray are subtracted to get the corresponding Riemann sum.

Example. Evaluate the Riemann sum with respect to right endpoints for the function f(x) = x2 − x over the interval [0, 3/2] and the partition into n = 6 subintervals of equal length.

When n = 6, the interval width is 3 1 ∆x = = , 2 · 6 4 and the endpoints are 1 1 3 5 3 x = 0, x = , x = , x = , x = 1, x = , x = 0 1 4 2 2 3 4 4 5 4 6 2 The approximating rectangles of this Riemann sum is shown in the following figure,

yx 2 -x

and the Riemann sum can be computed by

6 X 1 1 1 1 1 1 f(x )∆x = f(1/4) · + f(1/2) · + f(3/4) · + f(1) · + f(5/4) · + f(3/2) · k 4 4 4 4 4 4 k=1 1 h 1 1 1 1  9 3   25 5 9 3i = · − + − + − + 1 − 1 + − + − 4 16 4 4 2 16 4 16 4 4 2 1  3 4 3 5 12 = · − − − + 0 + + 4 16 16 16 16 16 1 7 7 = · = . 4 16 64

12 Definition (Definite Integral). If f is a function defined on an interval [a, b], the definite integral of f from a to b is the number n Z b X f(x) dx = lim f(xk)∆xk max ∆xk→0 a k=1 provided that the limit exists. If this limit exists, we say that f is integrable on [a, b]. Remark. The symbol R is an elongated letter “S”, and it was chosen by Leibniz because an integral is a limit of sums. The a and b are called the lower limit and upper limit, respectively. The function f(x) in the integral is called the integrand. The symbol dx tells us that the independent variable is x, and it represents the infinitesimal limit of ∆xk. R b Remark. The definite integral a f(x) dx is a number that does not depend on x. In fact, we can replace x by any other letter without changing the value of the definite integral: Z b Z b Z b f(x) dx = f(t) dt = f(θ) dθ. a a a The following theorem tells us that the most commonly occurring functions are integrable. We will not prove this theorem in this course. Theorem 5. If f is continuous on [a, b], or if f has finitely many jump discontinuities on [a, b], then f is integrable on [a, b].

The next theorem connects the integral back to the concept of area under a curve. In fact, it give a much simpler way to compute the integral rather than using the definition. Theorem 6. If f is integrable on [a, b], then n Z b X f(x) dx = lim f(xk)∆x. n→∞ a k=1 Example. Evaluate the definite integral Z 3/2 x2 − x dx. 0 We will need the following properties of the sigma notation for this computation, as well as throughout this course: n X c = cn k=1 n n X X cak = c ak k=1 k=1 n n n X X X (ak ± bk) = ak ± bk k=1 k=1 k=1

13 With n subintervals, we have 3 ∆x = 2n Thus 3 6 9 3k 3n 3 x = 0, x = , x = , x = , . . . , x = , . . . , x = = . 0 1 2n 2 2n 3 2n k 2n n 2n 2 Apply Theorem 6, we get

Z 3/2 n n 2 X X 3k   3  x − x dx = lim f(xk)∆x = lim f · n→∞ n→∞ 2n 2n 0 k=1 k=1 n 3 X h3k 2 3k i = lim − n→∞ 2n 2n 2n k=1 n n 3 X 3k 2 3 X 3k  = lim − lim n→∞ 2n 2n n→∞ 2n 2n k=1 k=1 n n  3 3 X   3 2 X  = lim k2 − lim k n→∞ 2n n→∞ 2n k=1 k=1 27 n(n + 1)(2n + 1) 9 n(n + 1) = lim · − lim · n→∞ 8n3 6 n→∞ 4n2 2 27 (n + 1)(2n + 1) 9 n + 1 = lim · − lim · n→∞ 48 n2 n→∞ 8 n 9  1  1  9  1  = lim · 1 + 2 + − lim · 1 + n→∞ 16 n n n→∞ 8 n 9 9 = · 2 − = 0 16 8

Properties of the Definite Integral

The following theorem demonstrates the basic properties of the definite integral. Some of them are analogous to the ones about derivatives, while the last one is unique to definite integrals.

Theorem 7. Suppose all the following integrals exists. i. (Constant) Z b c dx = c(b − a). a ii. (Sum and Difference)

Z b Z b Z b f(x) ± g(x) dx = f(x) dx ± g(x) dx. a a a

14 iii. (Constant Multiple) Z b Z b cf(x) dx = c f(x) dx. a a iv. (Interval Concatenation)

Z b Z c Z c f(x) dx + f(x) dx = f(x) dx. a b a Exercise. Use these properties to evaluate the definite integral

Z 1 (5 − 2x2) dx 0

Solution. Use properties i–iii, we get

Z 1 Z 1 Z 1 1 2 13 (5 − 2x2) dx = 5 dx − 2 x2 dx = 5 · (1 − 0) − 2 · = 5 − = . 0 0 0 3 3 3 Z 5 Z 4 Z 5 Exercise. If we know that f(x) dx = 10 and f(x) dx = 7, find f(x) dx. 1 1 4

Solution. By property iv, we have

Z 4 Z 5 Z 5 f(x) dx + f(x) dx = f(x) dx. 1 4 1 Thus Z 5 Z 5 Z 4 f(x) dx = f(x) dx − f(x) dx = 10 − 7 = 3. 4 1 1 The next theorem in this section gives a comparison of two integrals if their integrands satisfy some restrictive conditions.

Theorem 8 (Comparison Property). If f(x) ≤ g(x) for a ≤ x ≤ b, then

Z b Z b f(x) dx ≤ g(x) dx. a a

If we choose one of f and g to be a constant function, we can get the following upper and lower bounds for an integral:

Proposition 9. If m ≤ f(x) ≤ M for a ≤ x ≤ b, then

Z b m(b − a) ≤ f(x) dx ≤ M(b − a). a

15 Exercise. Find an upper bound and a lower bound for the following definite integrals. Z 10 Z 1 Z 1 (a) sin(x) dx, (b) ex dx, (c) x(1 − x) dx. 0 0 0

(a) On the interval [0, 10], we have −1 ≤ sin(x) ≤ 1. Thus Z 10 −10 = −1 · (10 − 0) ≤ sin(x) dx < 1 · (10 − 0) = 10. 0

(b) On the interval [0, 1], the function ex is monotone increasing, thus 1 = e0 ≤ ex ≤ e1 = e. It follows that Z 1 1 = 1 · (1 − 0) ≤ ex dx ≤ e · (1 − 0) = e. 0 (c) On the interval [0, 1], the function x(1 − x) attains its maximum 1/4 at x = 1/2, and attains its minimum 0 at the endpoints. Thus 0 ≤ x(1 − x) ≤ 1/4. Hence, Z 1 1 1 0 = 0 · (1 − 0) ≤ x(1 − x) dx ≤ · (1 − 0) = . 0 4 4

Evaluation Theorem

We have computed several definite integrals using limits of Riemann sums. Most of the procedure is tedious and difficult. However, back in the 17th century, Newton and Leibniz independently discovered the evaluation theorem, laying the foundation of modern calculus. The evaluation theorem provides a much simpler way to evaluate definite integrals. Theorem 10 (Evaluation Theorem). If f is continuous on the interval [a, b], then Z b f(x) dx = F (b) − F (a), a where F is an antiderivative of f.

We can use Evaluation Theorem to check some of our previous results. We know that the 2 x3 antiderivative of f(x) = x is F (x) = 3 , so the Evaluation Theorem tells us that the definite integral Z 1 13 03 1 x2 dx = F (1) − F (0) = − = . 0 3 3 3 This agrees with our previous computations through limit of Riemann sums, and is much simpler and more elegant. Evaluation Theorem is very powerful in computing area under the , as we can now take more complicated functions that were complicated or nearly impossible to compute via Riemann sums.

16 Example. (a) Find the area under the cosine curve between 0 and π/2.

1 cos(x)

π/2

(b) Evaluate the definite integral Z 1 ex dx. 0

(a) An antiderivative of cos(x) is sin(x). The area under the cosine curve can be written as the definite integral

Z π/2 cos(x) dx = sin(π/2) − sin(0) = 1 − 0 = 1. 0

(b) An antiderivative of f(x) = ex is F (x) = ex. Using the Evaluation theorem, we get

Z 1 ex dx = F (1) = F (0) = e1 − e0 = e − 1. 0 We showed in a previous example that the evaluation of this definite integral should be between 1 and e. Indeed, 1 ≤ e − 1 ≤ e.

Indefinite Integrals

The indefinite integral is a convenient notion that describes the collection of all antideriva- tives of a given function. We use the notion of Z f(x) dx

to represent an indefinite integral.

Remark. We need to clarify the difference between definite and indefinite integrals. A Z b definite integral f(x) dx is a value, which can be computed from a limit of Riemann a Z sums or the evaluation theorem. An indefinite integral f(x) dx is a function, or rather a collection of functions, whose derivative is the function f(x).

17 You should get familiar with the following table of indefinite integrals.

Z Z Z Z Z f(x) + g(x) dx = f(x) dx + g(x) dx cf(x) dx = c f(x) dx

Z xn+1 Z xn dx = + C (n 6= −1) x−1 dx = ln |x| + C n + 1 Z Z ax ex dx = ex + C ax dx = + C ln a Z Z sin(x) dx = − cos(x) + C cos(x) dx = sin(x) + C Z Z sec2(x) dx = tan(x) + C csc2(x) dx = − cot(x) + C Z Z sec(x) tan(x) dx = sec(x) + C csc(x) cot(x) dx = − csc(x) + C

Z 1 Z 1 dx = tan−1(x) + C √ dx = sin−1(x) + C 1 + x2 1 − x2 Exercise. Evaluate the following definite/indefinite integrals.

Z 10 Z 1 Z 3 5 (a) sin(x) dx, (b) 2x + 2 dx, (c) 12x − 2 sec(x) tan(x) dx. 0 0 1 + x

(a) Z 10 h i10 sin(x) dx = − cos(x) = − cos(10) + cos(0) = 1 − cos(10). 0 0 (b)

Z 1 1 3 h 2 −1 i 2x + 2 dx = x + 3 tan (x) 0 1 + x 0 = (1 + 3 tan−1(1)) − (0 + 3 tan−1(0)) = 1 + 3(π/2).

(c) Z x6 12x5 − 3 sec(x) tan(x) dx = 12 · − 3 · sec(x) + C = 2x6 − 3 sec(x) + C. 6

18 Lecture 3: The Fundamental Theorem of Calculus

Today: The Fundamental Theorem of Calculus, Leibniz Integral Rule, Mean Value Theo- rem

We defined the definite integral and introduced the Evaluation Theorem to help us evaluate definite integrals. In today’s class, we will explore the relation between two central ideas of calculus: differentiation and integration.

The Fundamental Theorem of Calculus

The fundamental theorem of calculus deals with functions of the form Z x F (x) = f(t) dt, a where f(x) is continuous on the interval [a, b] and x is taken on [a, b]. Recall that the definite integral is always a value that depends on the integrand, the upper and lower limits, but does not depend on the variable t of the integrand. If x is fixed, the value of the function F (x) is also fixed, and if we let x vary, the function F (x), defined as the definite integral above, would vary with x.

Example. Let f(x) = x + 1. Define Z x F (x) = f(t) dt. 0 (1) Sketch the graph of f(x) over the interval [0, 3]. (2) Evaluate F (0), F (1), F (2), and F (3). (3) Find a formula for F (x). (4) Calculate F 0(x).

The graph of f(x) is a straight line.

0 1 2 3 4 4

3 3

2 2

1 1

0 0 0 1 2 3

19 R 0 First, F (0) = 0 f(t) dt = 0. The values of F (x) at x = 1, 2, 3 could be computed by area of trapezoids:

Z 1 (1 + 2) · 1 3 F (1) = f(t) dt = = , 0 2 2 Z 2 (1 + 3) · 2 F (2) = f(t) dt = = 4, 0 2 Z 3 (1 + 4) · 3 15 F (3) = f(t) dt = = . 0 2 2 To find a formula for F (x), we could compute F (x) directly using the Evaluation Theorem:

Z x ht2 ix x2 F (x) = (t + 1) dt = + t = + x, 0 2 0 2 and its derivative is F 0(x) = x + 1.

Exercise. Let a be a fixed real number, and let f be a continuous function. Use the Evaluation Theorem to find the derivative of the function Z x F (x) = f(t) dt. a

Let’s assume F is an antiderivative of f, that is F 0(x) = f(x). By the Evaluation Theorem, we have Z x h ix F (x) = f(x) dx = F(t) = F(x) − F(a). a a Notice that F(a) is a constant, so it would vanish after we take one derivative. Therefore,

F 0(x) = F 0(x) − 0 = f(x).

The result of this exercise leads us to the first part of the Fundamental Theorem of Calculus.

Theorem 11 (The Fundamental Theorem of Calculus, Part 1). If f is continuous on [a, b], then the function F defined by Z x F (x) = f(t) dt a on the interval [a, b] is an antiderivative of f.

Proof. The proof of this theorem is surprisingly easy. It only uses the following facts about definite integrals: (1) If f is continuous on [a, b], then f is integrable on [a, b]. This is Theorem 5.

20 (2) If f is continuous on [a, b] and c ∈ [a, b], then

Z b Z c Z b f(t) dt = f(t) dt + f(t) dt. a a c This is the interval concatenation property of Theorem 7. (3) If m ≤ f(t) ≤ M on [a, b], then

Z b (b − a)m ≤ f(t) dt ≤ (b − a)M. a This is a corollary of the comparison property (Theorem 8). We start by taking a point x in the open interval (a, b). Then we take h > 0 small enough such that x + h is also in the open interval (a, b). By definition of F , we have

Z x+h Z x Z x+h F (x + h) − F (x) = f(t) dt − f(t) dt = f(t) dt. a a x So the difference quotient

F (x + h) − F (x) 1 Z x+h = f(t) dt. h h x Because f is continuous on the closed interval [x, x + h], the tells us that f attains its minimum and maximum on [x, x + h], i.e., there exist numbers u and v in [x, x + h] such that m = f(u), M = f(v), and m ≤ f(t) ≤ M for all t in [x, x + h]. By the comparison property, we get Z x+h f(u)h ≤ f(t) dt ≤ f(v)h. x Divide the inequalities through by h, we get

1 Z x+h f(u) ≤ f(t) dt ≤ f(v). h x Thus we have the upper and lower bounds on the difference quotient F (x + h) − F (x) f(u) ≤ ≤ f(v). h Now take h → 0. Then u → x and v → x since both u and v lie on the interval [x, x + h]. Thus lim f(u) = lim f(u) = f(x), and lim f(v) = lim f(v) = f(x). h→0+ u→x h→0+ v→x It follows from the Squeeze Theorem that F (x + h) − F (x) lim = f(x). h→0+ h

21 A similar argument can give the result

F (x + h) − F (x) lim = f(x). h→0− h By definition of the derivative, we obtain the desired result:

F (x + h) − F (x) F 0(x) = lim = f(x). h→0 h

The complete Fundamental Theorem of Calculus also includes the Evaluation Theorem as its Part 2.

Theorem 12 (The Fundamental Theorem of Calculus). Let f be a continuous function on the interval [a, b].

R x 0 (1) If F (x) = a f(t) dt, then F (x) = f(x). R b (2) a f(x) dx = F(b) − F(a), where F is any antiderivative of f.

Proof of Part 2. Consider the function F in Part 1. Then both F and F are continuous on [a, b] and differentiable on (a, b) with the same derivative F 0(x) = F 0(x) = f(x). By a corollary of the for derivatives, we know that F and F differs by a constant C, i.e., F(x) = F (x) + C. Thus

Z b Z b Z a f(x) dx = f(x) dx − f(x) dx a a a = F (b) − F (a) = (F (b) + C) − (F (a) + C) = F(b) − F(a)

Remark. If we use Leibniz notation for derivatives, we may write the first part of the Fundamental Theorem as d Z x f(t) dt = f(x), dx a where f is a continuous function. In words, this is saying that if we integrate f first and then differentiate the result, we get the original function f back.

Leibniz Integral Rule

We begin with some exercises regarding the Fundamental Theorem of Calculus.

22 Exercise. Find the derivative of the function Z x F (x) = et sin(t) dt. 0

Because the integrand et sin(t) is continuous, we can apply Part 1 of the Fundamental The- orem and get F 0(x) = et sin(t).

Exercise. Find the derivative of the function Z x2 g(x) = cos(t) dt. 1

Evaluate the definite integral

h ix2 g(x) = sin(t) = sin(x2) − sin(1). 1 Then use Chain Rule to evaluate its derivative

g0(x) = 2x · cos(x2) − 0 = 2x cos(x2)

Exercise. Find the derivative of the function Z cos(x) g(x) = (1 − t2)9 dt. sin(x)

The integrand is a polynomial. In principle, we could expand and evaluate the integral term by term. But this process would be tedious. The following is a simpler process using the Chain Rule and Part 1 of the Fundamental Theorem. Let f(t) = (1 − t2)9, u(x) = sin(x) and v(x) = cos(x). Then

Z cos(x) Z v(x) Z u(x) g(x) = (1 − t2)9 dt = f(t) dt − f(t) dt = F (v(x)) − F (u(x)). sin(x) 0 0 Using the Chain Rule and Part 1 of the Fundamental Theorem, we get

g0(x) = v0(x) · F 0(v(x)) − u0(x) · F 0(u(x)) = v0(x) · f(v(x)) − u0(x) · f(u(x)) = − sin(x) · (1 − cos2(x))9 − cos(x) · (1 − sin2(x))9 = − sin(x) · (sin2(x))9 − cos(x) · (cos2(x))9 = − sin19(x) − cos19(x).

The Leibniz Integral Rule tells us how to differentiate a definite integral whose upper and lower limits are differentiable functions.

23 Theorem 13 (Leibniz Integral Rule). Let f(t) be a continuous function, and let a(x) and b(x) be differentiable functions. Then d Z b(x) f(t) dt = b0(x) · f(b(x)) − a0(x) · f(a(x)). dx a(x)

Average Value of a Function

Question. How do we take the average value of a function, where the function has infinitely many possible inputs, and possibly gives infinitely many outputs? For example, how to compute the average temperature of a particular day?

We know how to take the average value of a finite collection of numbers x1, . . . , xn: n 1 X x = x ave n k k=1 In the old days, at small weather stations, people used to make four temperature measure- ments at 2 am, 8 am, 2 pm, and 8 pm, then compute the average value of these four data points to get the average temperature of the day. Of course, this is a crude estimate of the true average. We can improve the estimate by taking more data points. For example, we can take a total of 24 measurements every hour on the hour, and compute the average of these data points. We can further improve by taking a measurement every minute, resulting in a total of 1440 data points. The process described above is very similar to the limiting process of taking Riemann sums, and in fact, it is closely related to Riemann sums. Let’s say the function T (x) defined on the interval [a, b] describes the temperature of a certain period of time. Start by dividing the interval [a, b] into n subintervals of equal length, each with length ∆x = (b − a)/n. The we pick the right endpoints x1, . . . , xn of each subinterval and calculate the average n n n 1 X ∆x X 1 X f(x ) = f(x ) = f(x ) · ∆x n k b − a k b − a k k=1 k=1 k=1 If we let n → ∞, the right hand side above would become n 1 X 1 Z b lim f(xk) · ∆x = f(x) dx. n→∞ b − a b − a k=1 a Thus we have the following definition. Definition. The average value of an integrable function f on the interval [a, b] is 1 Z b fave = f(x) dx b − a a

24 Exercise. Find the average values of the function f(x) = sin(x) on the intervals [0, π/2], [0, π], and [0, 2π], respectively.

1 Z π/2 2 h iπ/2 2 2 sin(x) dx = − cos(x) = (− cos(π/2) + cos(0)) = . π/2 0 π 0 π π 1 Z π 1 h iπ 1 2 sin(x) dx = − cos(x) = (− cos(π) + cos(0)) = . π 0 π 0 π π 1 Z 2π 1 h i2π 1 sin(x) dx = − cos(x) = (− cos(2π) + cos(0)) = 0. 2π 0 2π 0 2π

We may wonder if there is a time of a day when the temperature is the same as the average

temperature of the day, or, in general, if there is a number c such that f(c) = fave. The following theorem tells us that the answer is affirmative for continuous functions.

Theorem 14 (Mean Value Theorem). If f is continuous on [a, b], then there exists a num- ber c in [a, b] such that Z b f(x) dx = f(c)(b − a). a

R x Proof. Let F (x) = a f(t) dt. By the Mean Value Theorem for derivatives, there exists a number c between a and b such that

F (b) − F (a) = F 0(c)(b − a).

By the Fundamental Theorem of Calculus, we get

Z b f(x) dx = f(c)(b − a). a

25 Lecture 4: Substitution Rule and Integration by Parts

Today: The Substitution Rule, Integration by Parts

If we want to evaluate a definite integral of a continuous function, the Fundamental Theorem tells us that all we need to do is to find its antiderivative and evaluate at the endpoints. However, our table of indefinite integrals only provide a limited collection of antiderivatives. We still do not know how to evaluate integrals such as Z 1 Z 1 e−2x dx or xex dx. 0 0 In the next three lectures, we will introduce several integration techniques to help us evaluate integrals that are not readily available in a table.

The Substitution Rule

We first recall the statement of the Chain Rule.

Theorem 15 (Chain Rule). If f and g are both differentiable and h = f ◦ g, then

h0(x) = f 0(g(x)) · g0(x).

If we have an integral of the form Z f(g(x))g0(x) dx, and assume that F is an antiderivative of f, that is, F 0 = f, then by the Chain Rule and the Fundamental Theorem of Calculus, we have Z Z f(g(x))g0(x) dx = F 0(g(x))g0(x) dx = F (g(x)) + C.

If we make the “substitution” u = g(x), then we have Z Z F (g(x)) + C = F (u) + C = F 0(u) du = f(u) du.

Hence, we obtain the Substitution Rule for indefinite integrals.

Theorem 16 (Substitution Rule for Indefinite Integrals). If u = g(x) is a differentiable function whose range is an interval I, and f is continuous on I, then Z Z f(g(x))g0(x) dx = f(u) du.

26 Remark. One way to remember the Substitution Rule is to think of the dx and du as differentials. If u = g(x), then du = g0(x) dx, and thus

f(u) du = f(g(x)) · g0(x) dx.

Adding the integral sign to both sides, we get the statement of the Substitution Rule.

Example. Evaluate the indefinite integral R e−2x dx. We make the substitution u = −2x. Then du = −2 dx, which means dx = −du/2. Thus

Z Z  du 1 Z eu e−2x e−2x dx = eu · − = − eu du = − + C = − + C. 2 2 2 2

Example. Evaluate the indefinite integral R x3 cos(x4 + 2) dx. We make the substitution u = x4 + 2. Then du = 4x3 dx, which means x3 dx = du/4. Thus

Z 1 Z sin(u) sin(x4 + 2) x3 cos(x4 + 2) dx = cos(u) du = + C = + C. 4 4 4

Example. Evaluate the indefinite integral R tan(x) dx. First, we write tangent as a quotient of sine and cosine: Z Z sin(x) tan(x) dx = dx. cos(x)

We make the substitution u = cos(x). Then du = − sin(x) dx, so sin(x) dx = −du. Thus

Z Z sin(x) Z du tan(x) dx = dx = − = − ln |u| + C = − ln | cos(x)| + C. cos(x) u

Logarithm has the property that − ln(a) = ln(1/a). Thus we can also write Z tan(x) dx = ln | sec(x)| + C.

Although we need to be cautious here because sec(x) is not a continuous function, so this indefinite integral only holds true for the domains of continuity of sec(x).

The Substitution Rule on Definite Integrals

When we have a definite integral that requires integration by substitution, we can always evaluate the indefinite integral first, and then apply the Evaluation Theorem to get the result. Alternatively, we could also change the limits of integration when the variable is substituted.

27 Theorem 17 (Substitution Rule for Definite Integrals). If g0 is continuous on [a, b] and f is continuous on the range of u = g(x), then Z b Z g(b) f(g(x))g0(x) dx = f(u) du. a g(a)

R 2 −2x Example. Evaluate the definite integral 1 e dx. We make the substitution u = −2x. Then du = −2 dx. Thus Z 2 1 Z u(2) 1 Z −4 1h i−4 e−4 − e−2 e−2 − e−4 e−2x dx = − eu du = − eu du = − eu = − = . 1 2 u(1) 2 −2 2 −2 2 2 R e ln(x) Example. Evaluate the definite integral 1 x dx. We make the substitution u = ln(x). Then du = dx/x, and thus Z e ln(x) Z u(e) Z 1 hu2 i1 1 dx = u du = u du = = . 1 x u(1) 0 2 0 2

R 1 3 Example. Evaluate the definite integral −1 sin(x ) dx. We split the first integral in two pieces Z 1 Z 0 Z 1 sin(x3) dx = sin(x3) dx + sin(x3) dx. −1 −1 0 In the first term, we make the substitution u = −x, then x = −u, du = −dx and dx = −du. Thus Z 0 Z u(0) Z 0 Z 1 sin(x3) dx = sin(−u3) · (−du) = sin(u3) du = − sin(x3) dx. −1 u(−1) 1 0 Adding on the second term, we get Z 1 sin(x3) dx = 0. −1

The last example above uses the fact that sine is an odd function, i.e., sin(−x) = − sin(x). In fact, we have the following theorem regarding definite integrals of symmetric functions over symmetric intervals. Theorem 18. Let a > 0 be a positive real number, and let f be continuous on [−a, a]. (1) If f is an odd function, i.e., f(−x) = −f(x) for all x ∈ [−a, a], then Z a f(x) dx = 0. −a (2) If f is an even function, i.e., f(−x) = f(x) for all x ∈ [−a, a], then Z a Z a f(x) dx = 2 f(x) dx. −a 0

28 Integration by Parts

We first recall the statement of the Product Rule.

Theorem 19 (Product Rule). If f and g are both differentiable, then

d [f(x)g(x)] = f 0(x)g(x) + f(x)g0(x). dx

If we integrate both sides with respect to x in the statement of the Product Rule, we would get Z d Z Z [f(x)g(x)] dx = g(x)f 0(x) dx + f(x)g0(x) dx. dx We can rearrange this equation to get the formula for integration by parts: Z Z f(x)g0(x) dx = f(x)g(x) − g(x)f 0(x) dx.

Remark. We can make the following substitutions to help with remembering the formula. Let u = f(x) and v = g(x). Then du = f 0(x) dx and dv = g0(x) dx, and the formula for integration by parts becomes Z Z u dv = uv − v du.

Example. Evaluate the indefinite integral R xex dx. We make the choice u = x, dv = ex dx. Then du = dx, v = ex. Thus by the integration by parts formula, Z Z xex dx = xex − ex dx = xex − ex + C = (x − 1)ex + C.

Remark. The idea of using integration by parts is to get a simpler integral than the one we started with. In the example above, we use integration by parts to transform the integral R xex dx to R ex dx, which we know how to integrate. When we make the choice of u and dv, we shall keep in mind that our goal is to get a v du that is simpler to integrate.

Example. Evaluate the indefinite integral R x2 sin(x) dx. We make the choice u = x2, dv = sin(x) dx.

29 Then du = 2x dx, v = − cos(x). By the integration by parts formula, Z Z Z x2 sin(x) dx = −x2 cos(x) − (− cos(x)) · 2x dx = −x2 cos(x) + 2 x cos(x) dx.

Now we need to use integration by parts again for the second integral. Choose

u = x, dv = cos(x) dx.

Then du = dx, v = sin(x).

Thus Z Z x cos(x) dx = x sin(x) − sin(x) dx = x sin(x) + cos(x) + C.

Combine with the first equation, we get, Z x2 sin(x) dx = −x2 cos(x) + 2(x sin(x) + cos(x)) + C = (2 − x2) cos(x) + 2x sin(x) + C.

Example. Evaluate the indefinite integral R sin(x)ex dx. Notice that neither sin(x) nor ex has a simpler derivative. Let’s try u = sin(x) and dv = ex dx. Then du = cos(x) dx, v = ex, and Z Z sin(x)ex dx = sin(x)ex − ex cos(x) dx.

Integrate by parts again on the second integral by choosing

u = cos(x), dv = ex dx; du = − sin(x) dx. v = ex.

Then Z Z Z ex cos(x) dx = cos(x)ex − ex · (− sin(x)) dx = cos(x)ex + ex sin(x) dx.

Combine the two equations together, we get Z Z sin(x)ex dx = sin(x)ex − cos(x)ex − ex sin(x) dx.

At this point, we can treat the integral R ex sin(x) dx as an unknown, and solve to get Z (sin(x) − cos(x))ex sin(x)ex dx = + C. 2

30 R 1 x Example. Evaluate the definite integral 0 xe dx. From the first example, we know that the indefinite integral Z xex dx = (x − 1)ex + C.

Apply the Evaluation Theorem, we get

Z 1 h i1 xex dx = (x − 1)ex = 0 · e − (−1) · 1 = 1. 0 0 Remark. If we combine the integration by parts formula with the Evaluation Theorem, we can evaluate definite integrals by parts in the following way:

Z b h ib Z b f(x)g0(x) dx = f(x)g(x) − g(x)f 0(x) dx. a a a

R 1 5 3 Example. Evaluate the definite integral 0 x sin(x ) dx. We first try the Substitution Rule with y = x3. Then dy = 3x2 dx, and x2 dx = dy/3. Thus

Z 1 Z y(1) dy 1 Z 1 x5 sin(x3) dx = y sin(y) = y sin(y) dy. 0 y(0) 3 3 0

Then we use integration by parts with the choice

u = y, dv = sin(y) dy; du = dy, v = − cos(y) dy.

Thus

Z 1 h i1 Z 1 h i1 h i1 y sin(y) dy = − y cos(y) − − cos(y) dy = − y cos(y) + sin(y) 0 0 0 0 0 = − cos(1) − 0 + sin(1) − 0 = sin(1) − cos(1).

Combine the two equations together, we get

Z 1 1 Z 1 sin(1) − cos(1) x5 sin(x3) dx = y sin(y) dy = . 0 3 0 3

31 Lecture 5: Trigonometric Integrals

Today: Trigonometric Integrals, Trigonometric Substitutions

We are going to continue our exploration of integration techniques. Today we look at integrals that can be simplified using some algebraic manipulations.

Trigonometric Integrals

We start with the following warm-up exercise.

Exercise. Evaluate the indefinite integrals: Z Z Z Z (a) cos(x) dx, (b) cos2(x) dx, (c) cos3(x) dx, (d) cos4(x) dx.

(a) This is from the integration table. Z cos(x) dx = sin(x) + C.

(b) Use the trigonometric identity cos(2x) = 2 cos2(x) − 1, we can rewrite Z Z cos(2x) + 1 Z cos(2x) Z 1 sin(2x) x cos2(x) dx = dx = dx + dx = + + C. 2 2 2 4 2 (c) Use the trigonometric identity cos2(x) + sin2(x) = 1, we can rewrite Z Z cos3(x) dx = 1 − sin2(x) cos(x) dx.

Then we use the Substitution Rule with u = sin(x) and du = cos(x) dx, and get

Z Z u3 sin3(x) 1 − sin2(x) cos(x) dx = (1 − u2) du = u − + C = sin(x) − + C. 3 3 (d) Use the trigonometric identity cos(2x) = 2 cos2(x) − 1 twice, we rewrite the integrand

cos(2x) + 12 cos2(2x) cos(2x) 1 cos4(x) = cos2(x)2 = = + + 2 4 2 4 1cos(4x) + 1 cos(2x) 1 cos(4x) cos(2x) 3 = + + = + + . 4 2 2 4 8 2 8 Thus Z Z cos(4x) cos(2x) 3 sin(4x) sin(2x) 3x cos4(x) dx = + + dx = + + + C. 8 2 8 32 4 8

32 We used the Pythagorean identity

sin2(x) + cos2(x) = 1 and the double-angle formula for cosine in the previous exercise. To be more concrete, the identity we used was the half-angle formula cos(2x) + 1 cos2(x) = . 2 The next few examples will shed light on the general strategy of integrating products of sines and cosines.

Example. Evaluate the indefinite integrals: Z Z Z (a) sin3(x) cos2(x) dx, (b) sin2(x) cos3(x) dx, (c) sin2(x) cos2(x) dx.

(a) Use the identity sin2(x) = 1−cos2(x), then substitute u = cos(x) and du = − sin(x) dx, we get Z Z Z sin3(x) cos2(x) dx = (1 − cos2(x)) cos2(x) sin(x) dx = − (1 − u2)u2 du Z u5 u3 cos5(x) cos3(x) = (u4 − u2) du = − + C = − + C. 5 3 5 3 (b) Use the identity cos2(x) = 1 − sin2(x), then substitute u = sin(x) and du = cos(x) dx, we get Z Z Z sin2(x) cos3(x) dx = sin2(1 − sin2(x)) cos(x) dx = u2(1 − u2) du

Z u3 u5 sin3(x) sin5(x) = (u2 − u4) du = − + C = − + C. 3 5 3 5 (c) Use the half-angle formulae 1 − cos(2x) 1 + cos(2x) sin2(x) = and cos2(x) = , 2 2 we can rewrite the integrand (1 − cos(2x))(1 + cos(2x)) 1 − cos2(2x) sin2(2x) sin2(x) cos2(x) = = = 4 4 4 1 1 − cos(4x) 1 − cos(4x) = · = . 4 2 8 Thus Z Z 1 − cos(4x) x sin(4x) sin2(x) cos2(x) dx = dx = − + C. 8 8 32

33 Remark. From the examples above, we summarize the following strategy: The indefinite integrals that we consider here are of the form Z sinn(x) cosm(x) dx.

(i) If the power of sin(x) (respectively, cos(x)) is odd, save one sin(x) (resp. cos(x)) factor, and use the Pythagorean identity sin2(x)+cos2(x) = 1 to express the remaining factors in terms of cos(x) (resp. sin(x)), then substitute with u = cos(x) (resp. u = sin(x)). (ii) If both powers are even, use the half-angle formulae 1 − cos(2x) 1 + cos(2x) sin(2x) sin2(x) = , cos2(x) = , or sin(x) cos(x) = , 2 2 2 then integrate term-by-term.

Remark. There exists a similar strategy for indefinite integrals of the form Z tann(x) secm(x) dx.

(i) If the power of sec(x) is even and at least 2, save a factor of sec2(x), and use sec2(x) = 1 + tan2(x) to express the remaining factors in terms of tan(x), then substitute with u = tan(x). (ii) If the power of tan(x) is odd and the power of sec(x) is at least 1, save a factor of sec(x) tan(x), and use tan2(x) = sec2(x) − 1 to express the remaining factors in terms of sec(x), then substitute with u = sec(x).

Example. Evaluate the indefinite integral Z tan3(x) sec2(x) dx.

Use the strategy described above, we have Z Z u4 tan4(x) tan3(x) sec2(x) dx = u3 du = + C = + C, 4 4 or equivalently, Z Z tan3(x) sec2(x) dx = (sec2(x) − 1) sec(x) · tan(x) sec(x) dx Z u4 u2 sec4(x) sec2(x) = (u2 − 1)u du = − + C = − + C. 4 2 4 2 Notice that tan4(x) (sec2(x) − 1)2 sec4(x) − 2 sec2(x) + 1 sec4(x) sec2(x) 1 = = = − + . 4 4 4 4 2 4 Thus these two forms are both antiderivatives of tan3(x) sec2(x).

34 However, we notice that this strategy cannot tell us the antiderivative for the product of some powers of tan(x) and sec(x). We have seen in the previous lecture that Z tan(x) dx = ln | sec(x)| + C

can be obtained by the Substitution Rule. The following trick gives the antiderivative of sec(x). Z Z sec(x) + tan(x) Z sec2(x) + sec(x) tan(x) sec(x) dx = sec(x) · dx = dx sec(x) + tan(x) sec(x) + tan(x) Substitute u = sec(x) + tan(x), then du = sec(x) tan(x) + sec2(x) dx. Thus Z Z du sec(x) dx = = ln |u| + C = ln | sec(x) + tan(x)| + C. u You will see more examples in this week’s homework.

Trigonometric Substitutions

We start our discussion with a relatively familiar example. x2 y2 Example. The following figure shows the ellipse described by + = 1. a2 b2

(0,b)

(a,0)

(a) Find the area of the shaded region. (b) Find a function whose graph agrees with the ellipse in the first quadrant. (c) Use a definite integral to express the area of the shaded region. (d) Evaluate this definite integral. The area of an ellipse is computed by A = πab, where a and b are the lengths of the major and minor axes, respectively. The shaded region is a quarter of the ellipse, thus πab A = . shaded 4 35 Solve the equation of the ellipse for y, we get b √ y = ± a2 − x2. a We pick plus sign in the first quadrant, thus the desired function is b √ f(x) = a2 − x2, a and the area could alternatively be expressed by the definite integral Z a b √ a2 − x2 dx. 0 a

Now the problem remains: we currently do not have the correct tool to find an antiderivative √ √ of a2 − x2. If the integrand were x a2 − x2, the substitution u = a2 −x2 would be effective. √ However, a2 − x2 by itself is more difficult to integrate. We need to appeal to trigonometric substitutions for the integration of some radical expressions. The following table shows the common trigonometric substitutions associated to some radical expressions.

Expression Substitution Differential Trigonometric Identity √ a2 − x2 x = a sin(θ) dx = a cos(θ) dθ 1 − sin2(θ) = cos2(θ) √ a2 + x2 x = a tan(θ) dx = a sec2(θ) dθ 1 + tan2(θ) = sec2(θ) √ x2 − a2 x = a sec(θ) dx = a tan(θ) sec(θ) dθ sec2(θ) − 1 = tan2(θ)

Now let’s evaluate the definite integral that is supposed to give the area of the quarter ellipse: b Z a √ a2 − x2 dx. a 0 To evaluate the integral, we substitute x = a sin(θ) and dx = a cos(θ) dθ. To change the limits of integration, notice that when x = a sin(θ) = 0, we must have θ = 0, and when x = a sin(θ) = a, we must have θ = π/2. Thus

b Z a √ b Z π/2 a2 − x2 dx = pa2 − a2 sin(θ) · a cos(θ) dθ a 0 a 0 2 b Z π/2 q Z π = a 1 − sin2(θ) · a cos(θ) dθ = ab cos2(θ) dθ a 0 0 hsin(2θ) θ iπ/2 πab = ab + = . 4 2 0 4 We indeed obtain the area of the quarter ellipse.

36 Example. Evaluate the following indefinite integrals with a > 0. Z √ Z 1 Z 1 (a) a2 − x2 dx, (b) √ dx, (c) √ dx x2 x2 + 4 x2 − 9 √ (a) Use the substitution x = a sin(θ), then dx = a cos(θ) dθ and a2 − x2 = a cos(θ). Thus

Z √ Z Z sin(2θ) θ  a2 − x2 dx = a cos(θ) · a cos(θ) dθ = a2 cos2(θ) dθ = a2 + + C 4 2 However, this is an indefinite integral. We need to convert this back to a function in x. We √ know that θ = sin−1(x/a), and a2 sin(2θ) = 2a sin(θ)a cos(θ) = x a2 − x2. Thus √ Z √ x a2 − x2 a2 sin−1(x/a) a2 − x2 dx = + + C. 2 2 √ (b) Use the substitution x = 2 tan(θ), then dx = 2 sec2(θ) dθ, and x2 + 4 = 2 sec(θ). Thus

Z 1 Z 2 sec2(θ) 1 Z cos(θ) √ dx = dθ = dθ. x2 x2 + 4 4 tan2(θ) · 2 sec(θ) 4 sin2(θ) Now use the substitution u = sin(θ) and du = cos(θ) dθ, we get

1 Z cos(θ) 1 Z du 1 1 dθ = = − + C = − + C. 4 sin2(θ) 4 u2 4u 4 sin(θ)

To help putting this back in terms of x, we draw the following right triangle.

x2 +4 x

θ 2

Thus the indefinite integral √ Z 1 1 x2 + 4 √ dx = − + C = − + C. x2 x2 + 4 4 sin(θ) 4x √ (c) Use the substitution x = 3 sec(θ), then dx = 3 tan(θ) sec(θ) dθ, and x2 − 9 = 3 tan(θ). Thus Z 1 Z 3 tan(θ) sec(θ) Z √ dx = dθ = sec(θ) dθ = ln | sec(θ) + tan(θ)| + C. x2 − 9 3 tan(θ)

37 To help putting this back in terms of x, we draw the following right triangle.

x x2 -9

θ 3

Thus the indefinite integral √ Z 1 x x2 − 9 √ dx = ln + + C x2 − 9 3 3 √ √ = ln |x + x2 − 9| − ln 3 + C = ln |x + x2 − 9| + C.

38 Lecture 6: Partial Fractions

Today: Rational Functions, Partial Fractions

We continue our exploration of integration techniques today.

Rational Functions

Another class of elementary functions that we often encounter is the rational functions.

Definition. A rational function is a function of the form P (x) f(x) = , Q(x) where both P (x) and Q(x) are polynomials. If the degree of P is less than the degree of Q, we call f a proper rational function.

A theorem in algebra tells us that if a rational function P (x)/Q(x) is not proper, that is, deg(P ) ≥ deg(Q), we can always find polynomials S(x) and R(x) such that deg(R) < deg(Q), and P (x) R(x) P (x) = S(x)Q(x) + R(x), or equivalently, = S(x) + . Q(x) Q(x) Here, the rational function R(x)/Q(x) is guaranteed to be proper.

Example. Write each rational function as the sum of a polynomial and a proper rational function. x2 + 1 x2 − 2x − 3 x3 − 1 x4 + 1 (a) , (b) , (c) , (d) . x3 + 3x2 + 3x + 1 x + 1 x + 1 x2 + 1

The technique for dividing polynomials to find S(x) and R(x) is long division. It is very similar to the long division for integers that we learned in elementary school. (a) This is already a proper rational function. (b) Perform long division x − 3 x + 1 x2 − 2x − 3 − x2 − x − 3x − 3 3x + 3 0

39 Thus S(x) = x − 3 and R(x) = 0, and we write x2 − 2x − 3 = x − 3. x + 1 (c) Perform long division x2 − x + 1 x + 1 x3 − 1 − x3 − x2 − x2 x2 + x x − 1 − x − 1 − 2 Thus S(x) = x2 − x + 1 and R(x) = −2, and we write x3 − 1 2 = x2 − x + 1 − . x + 1 x + 1 (d) Perform long division x2 − 1 x2 + 1 x4 + 1 − x4 − x2 − x2 + 1 x2 + 1 2 Thus S(x) = x2 − 1 and R(x) = 2, and we write x4 + 1 2 = x2 − 1 + . x2 + 1 x2 + 1 Exercise. Evaluate the indefinite integrals Z x2 + 1 Z x2 − 2x − 3 Z x3 − 1 Z x4 + 1 (a) dx, (b) dx, (c) dx, (d) dx. x3 + 3x2 + 3x + 1 x + 1 x + 1 x2 + 1

(a) Notice that the denominator x3 + 3x2 + 3x + 1 = (x + 1)3. Substitute u = x + 1, we get Z x2 + 1 Z x2 + 1 Z (u − 1)2 + 1 Z u2 − 2u + 2 dx = dx = du = du x3 + 3x2 + 3x + 1 (x + 1)3 u3 u3 Z 1 2 2 2 1 = − + du = ln |u| + − + C u u2 u3 u u2 2 1 = ln |x + 1| + − + C. x + 1 (x + 1)2

40 (b) The long division result tells us that

Z x2 − 2x − 3 Z x2 dx = (x − 3) dx = − 3x + C. x + 1 2

(c) The long division result tells us that

Z x3 − 1 Z  2  x3 x2 dx = x2 − x + 1 − dx = − + x − 2 ln |x + 1| + C. x + 1 x + 1 3 2

(d) The long division result tells us that

Z x4 + 1 Z  2  x3 dx = x2 − 1 + dx = − x + 2 arctan(x) + C. x2 + 1 x2 + 1 3

Partial Fractions

If we want to find the indefinite integral of a rational function, our first step would be to write it as the sum of a polynomial and a proper rational function. We know how to integrate a polynomial, so the remaining work is to find the integral of a proper rational function. A corollary of the Fundamental Theorem of Algebra tells us that any polynomial Q(x) can be factored as a product of linear factors of the form ax + b and irreducible quadratic factors of the form ax2 + bx + c (where the discriminant b2 − 4ac < 0).

Example. Factor the following polynomials

(a) x4 − 16 (b)2 x3 + 3x2 − 2x (c) x3 − x2 − x + 1

(a) Use the difference of squares formula twice:

x4 − 16 = (x2 + 4)(x2 − 4) = (x2 + 4)(x + 2)(x − 2).

(b) Factor an x first, then factor the remaining quadratic:

2x3 + 3x2 − 2x = x(2x2 + 3x − 2) = x(x + 2)(2x − 1).

(c) Factor an x − 1 first, then factor the remaining quadratic with difference of squares:

x3 − x2 − x + 1 = x2(x − 1) − (x − 1) = (x2 − 1)(x − 1) = (x + 1)(x − 1)2.

The next step is to express the proper rational function R(x)/Q(x) as a sum of partial fractions by the following algorithm.

41 Algorithm (Partial Fraction Decomposition). To find a partial fraction decomposition of a proper rational function R(x)/Q(x), follow these steps: (1) Factor the denominator Q(x) into linear and irreducible quadratic factors

2 k1 2 km `1 `n Q(x) = (a1x + b1x + c1) ··· (amx + bmx + cm) (d1x + e1) ··· (dnx + en) .

(2) If none of the factors above are repeated, i.e., if

k1 = ··· = km = `1 = ··· = `n = 1,

then there exist constants A1,A2,...,Am, B1,B2,...,Bm, and C1,C2,...,Cn such that m n R(x) X Aix + Bi X Cj = + . Q(x) a x2 + b x + c d x + e i=1 i i i j=1 j j (3) If one of the irreducible quadratic factors is repeated, for example, if Q(x) has the factor (ax2 + bx + c)k where k ≥ 2, then instead of the single partial fraction Ax + B , ax2 + bx + c we replace it by the sum A x + B A x + B A x + B 1 1 + 2 2 + ··· + k k . ax2 + bx + c (ax2 + bx + c)2 (ax2 + bx + c)k (4) If one of the linear factors is repeated, for example, if Q(x) has the factor (dx + e)` where ` ≥ 2, then instead of the single partial fraction C , dx + e we replace it by the sum C C C 1 + 2 + ··· + ` . dx + e (dx + e)2 (dx + e)` (5) Solve for all the undetermined constant coefficients.

Example. Perform partial fraction decomposition on the following proper rational functions.

16x − 64 x2 + 2x − 1 4x (a) (b) (c) x4 − 16 2x3 + 3x2 − 2x x3 − x2 − x + 1

(a) We know x4 − 16 = (x2 + 4)(x + 2)(x − 2) from the previous exercise. Thus the partial fraction decomposition has the form 16x − 64 Ax + B C D = + + . x4 − 16 x2 + 4 x + 2 x − 2

42 Multiply both sides by (x2 + 4)(x + 2)(x − 2), we get

16x − 64 = (Ax + B)(x + 2)(x − 2) + C(x2 + 4)(x − 2) + D(x2 + 4)(x + 2)

Expand the right-hand side and collect terms of the same power, we get

16x − 32 = (A + C + D)x3 + (B − 2C + 2D)x2 + (−4A + 4C + 4D)x + (−4B − 8C + 8D).

The coefficients on the left and right must match up, so we get the following system of equations:  A + C + D = 0   B − 2C + 2D = 0

−4A + 4C + 4D = 16  −4B − 8C + 8D = −64 Solve for the undetermined coefficients, we get

A = −2,B = 8,C = 3,D = −1.

So the partial fraction decomposition is 16x − 32 −2x + 8 3 1 = + − . x4 − 16 x2 + 4 x + 2 x − 2

(b) We know 2x3 + 3x2 − 2x = x(x + 2)(2x − 1) from the previous exercise. Thus the partial fraction decomposition has the form

x2 + 2x − 1 A B C = + + . 2x3 + 3x2 − 2x x x + 2 2x − 1 Multiply both sides by x(x + 2)(2x − 1) to get

x2 + 2x − 1 = A(x + 2)(2x − 1) + Bx(2x − 1) + Cx(x + 2).

Expand the right-hand side and collect terms of the same power, we get

x2 + 2x − 1 = (2A + 2B + C)x2 + (3A − B + 2C)x − 2A.

The coefficients on the left and right must match up, so we get the following system of equations:  2A + 2B + C = 1  3A − B + 2C = 2  −2A = −1

43 Solve for the undetermined coefficients, we get 1 1 1 A = ,B = − ,C = . 2 10 5 So the partial fraction decomposition is x2 + 2x − 1 1 1 1 1 1 1 = · − · + · . 2x3 + 3x2 − 2x 2 x 10 x + 2 5 2x − 1

(c) We know x3 − x2 − x + 1 = (x − 1)2(x + 1) from the previous exercise. Thus the partial fraction decomposition has the form 4x A B C = + + . x3 − x2 − x + 1 x − 1 (x − 1)2 x + 1 Multiply both sides by (x − 1)2(x + 1), we get

4x = A(x − 1)(x + 1) + B(x + 1) + C(x − 1)2.

Expand the right-hand side and collect terms of the same power, we get

4x = (A + C)x2 + (B − 2C)x + (−A + B + C).

The coefficients on the left and right must match up, so we get the following system of equations:  A + C = 0  B − 2C = 4  −A + B + C = 0 Solve for the undetermined coefficients, we get

A = 1,B = 2,C = −1.

So the partial fraction decomposition is 4x 1 2 1 = + − . x3 − x2 − x + 1 x − 1 (x − 1)2 x + 1

Integrals of Rational Functions

Now we have all the tools that enable us to find the indefinite integral of any rational function. We will start with some integrals of proper rational functions whose denominators are irreducible.

Example. Evaluate the indefinite integrals

44 Z 2 Z 1 Z x + 3 (a) dx (b) dx (c) dx x + 1 x2 + 4 x2 + 2x + 2

(a) Use a substitution u = x + 1, we can get

Z 2 dx = ln |x + 1| + C. x + 1

(b) Use an inverse substitution x = 2u, we can get

Z 1 1 Z 1 1 x dx = · 2 du = arctan + C. x2 + 4 4 u2 + 1 2 2

(c) This one requires a little bit more algebraic manipulation.

Z x + 3 Z x + 3 Z x + 1 Z 2 dx = dx = dx + dx. x2 + 2x + 2 (x + 1)2 + 1 (x + 1)2 + 1 (x + 1)2 + 1

Use the substitution u = x + 1 for both integrals, while use the substitution v = u2 + 1 again for the first integral, we get Z x + 3 1 Z dv Z du 1 dx = + 2 = ln |x2 + 2x + 2| + 2 arctan(x + 1) + C. x2 + 2x + 2 2 v u2 + 1 2 Example. Evaluate the indefinite integrals

Z 16x − 64 Z x2 + 2x − 1 Z x4 − 2x2 + 4x + 1 (a) dx (b) dx (c) dx x4 − 16 2x3 + 3x2 − 2x x3 − x2 − x + 1

(a) By partial fraction decomposition, we know that

Z 16x − 64 Z 2x Z 1 Z 1 Z 1 dx = − dx + 8 dx + 3 dx − dx x4 − 16 x2 + 4 x2 + 4 x + 2 x − 2 x = − ln |x2 + 4| + 4 arctan + 3 ln |x + 2| − ln |x − 2| + C. 2

(b) By partial fraction decomposition, we know that

Z x2 + 2x − 1 1 Z 1 1 Z 1 1 Z 1 dx = dx − dx + dx 2x3 + 3x2 − 2x 2 x 10 x + 2 5 2x − 1 1 1 1 = ln |x| − ln |x + 2| + ln |2x − 1| + C. 2 10 10

(c) The integrand in this example is not yet a proper rational function. We perform long

45 division to write this as the sum of a polynomial and a proper rational function.

x + 1 x3 − x2 − x + 1 x4 − 2x2 + 4x + 1 − x4 + x3 + x2 − x x3 − x2 + 3x + 1 − x3 + x2 + x − 1 4x

Thus x4 − 2x2 + 4x + 1 4x = x + 1 + . x3 − x2 − x + 1 x3 − x2 − x + 1 By the partial fraction decomposition, we know that

Z x4 − 2x2 + 4x + 1 Z Z 1 Z 2 Z 1 dx = (x + 1) dx + dx + dx − dx x3 − x2 − x + 1 x − 1 (x − 1)2 x + 1 x2 2 = + x + ln |x − 1| − − ln |x + 1| + C 2 x − 1 x2 2 x − 1 = + x − + ln + C. 2 x − 1 x + 1

46 Lecture 7: Improper Integrals

Today: Improper Integrals of Type I and Type II

We recall the statement of the Evaluation Theorem.

Theorem (Evaluation Theorem). If f is continuous on the interval [a, b], then

Z b f(x) dx = F (b) − F (a), a where F is an antiderivative of f.

In today’s class, we relax the condition on the Evaluation Theorem in two different ways, and introduce the improper integrals.

Improper Integrals of Type I: Infinite Intervals

First, we relax the condition on the finite interval by looking at the following example

Example. Find the area of the region that lies under the curve y = x−2, above the x-axis, and to the right of the line x = 1.

y

1 y x2

0 1 x

It may seem that the region would have infinite area because the region itself is infinite. But let’s take a closer look. If we want to know the area between x = 1 and x = 2, we can set up the definite integral

Z 2 h i2 1 1 x−2 dx = − x−1 = 1 − = . 1 1 2 2 Again, if we want to know the area between x = 1 and x = 3, we set up the definite integral

Z 3 h i3 1 2 x−2 dx = − x−1 = 1 − = . 1 1 3 3

47 Similarly, if we just draw an arbitrary vertical line x = t with t > 1, and want to know the area between x = 1 and x = t, the definite integral would tell us that the area is

Z t h it 1 t − 1 x−2 dx = − x−1 = 1 − = . 1 1 t t The following figures shows our computation results.

y y y

t-1 Area=1/2 Area=2/3 Area= t

0 1 2x 0 1 3x 0 1t x

Notice that if we take t → ∞, the area of the shaded region would approach t − 1 lim = 1. t→∞ t So we say that the area of the infinite region is equal to 1, and write that Z ∞ Z t t − 1 x−2 dx = lim x−2 dx = lim = 1. 1 t→∞ 1 t→∞ t

With this example in mind, we can define the integral of a function over an infinite interval in the following way.

R t Definition (, Type I). (a) If a f(x) dx exists for every number t ≥ a, then Z ∞ Z t f(x) dx = lim f(x) dx, a t→∞ a provided this limit exists (as a finite number). R b (b) If t f(x) dx exists for every number t ≤ b, then Z b Z b f(x) dx = lim f(x) dx, −∞ t→−∞ t provided this limit exists (as a finite number). We say an improper integral is convergent if the corresponding limit exists, and divergent if the limit does not exist. R ∞ R a (c) If both a f(x) dx and −∞ f(x) dx are convergent for a number a, then we define Z ∞ Z ∞ Z a f(x) dx = f(x) dx + f(x) dx. −∞ a −∞

48 Z ∞ 1 Example. (a) Determine whether the improper integral dx is convergent or divergent. 1 x Z ∞ 1 (b) For what values of p is the improper integral p dx convergent? 1 x (a) Use the definition, we have

Z ∞ 1 Z t 1 h it dx = lim dx = lim ln |x| = lim ln(t) = ∞. 1 x t→∞ 1 x t→∞ 1 t→∞ So the improper integral is divergent. (b) We know from part (a) that when p = 1, the integral is divergent. Now let’s assume that p 6= 1, then Z ∞ 1 Z t 1 h x1−p it t1−p − 1 p dx = lim p dx = lim = lim . 1 x t→∞ 1 x t→∞ 1 − p 1 t→∞ 1 − p Here we have two cases: Case 1. If p < 1, then 1 − p > 0, and

t1−p − 1 lim = ∞. t→∞ 1 − p Case 2. If p > 1, then 1 − p < 0, and

t1−p − 1 −1 1 lim = = . t→∞ 1 − p 1 − p p − 1

R ∞ 1 Thus the improper integral 1 xp dx is convergent if p > 1, and is divergent if p ≤ 1.

Example. Evaluate the improper integral Z ∞ 1 2 dx −∞ 1 + x

Let’s choose a = 0 to evaluate this improper integral.

Z ∞ 1 Z 0 1 Z ∞ 1 2 dx = 2 dx + 2 dx −∞ 1 + x −∞ 1 + x 0 1 + x Z 0 1 Z t 1 = lim 2 dx + lim 2 dx s→−∞ s 1 + x t→∞ 0 1 + x h i0 h it = lim arctan(x) + lim arctan(x) s→−∞ s t→∞ 0 = arctan(0) − lim arctan(s) + lim arctan(t) − arctan(0, ) s→−∞ t→∞

49 We look at the graph of y = arctan(x), and notice that there are two horizontal asymptotes at y = ±π/2.

π/2 y tan -1(x)

-π/2

Thus Z ∞ 1 π  π  2 dx = lim arctan(t) − lim arctan(s) = − − = π. −∞ 1 + x t→∞ s→−∞ 2 2 Z ∞ Exercise. Is the improper integral e−x dx convergent or divergent? 0 By definition of improper integral, Z ∞ Z t h it e−x dx = lim e−x dx = lim − e−x = lim (−e−t) − (−e0) = 1. 0 t→∞ 0 t→∞ 0 t→∞ Thus this improper integral is convergent.

Improper Integrals of Type II: Non-continuous Integrand

The first type of improper integrals concerns the area of a region that extends infinitely on the horizontal direction. We now introduce the second type of improper integral on functions that have vertical asymptotes. Definition (Improper Integral, Type II). (a) If f is continuous on [a, b) and is discontinuous at b, then Z b Z t f(x) dx = lim f(x) dx, − a t→b a provided that this limit exists (as a finite number). (b) If f is continuous on (a, b] and is discontinuous at a, then Z b Z b f(x) dx = lim f(x) dx, + a t→a t provided that this limit exists (as a finite number). R c R b (c) If f is continuous on [a, b] except at c ∈ (a, b), and both a f(x) dx and c f(x) dx are convergent, then we define Z b Z c Z b f(x) dx = f(x) dx + f(x) dx. a a c

50 Z 1 1 Example. (a) For what values of p is the integral p dx improper? 0 x Z 1 1 (b) For what values of p is the integral p dx divergent? 0 x (a) The only type of discontinuity on [0, 1] that could arise in the integrand is when xp = 0. However, we notice that when p ≤ 0, −p ≥ 0, and 1 = x−p xp is continuous throughout [0, 1]. When p > 0, the integrand is not continuous at 0. Thus the integral is improper if and only if p > 0. (b) We assume that p > 0 first. Then

Z 1 Z x1−p dx = x−p dx = + C. xp 1 − p Now we take the limit Z 1 1 h 1 t1−p i lim dx = lim − . + p + t→0 t x t→0 1 − p 1 − p

We shall notice that  0, if p < 1,  lim t1−p = 1, if p = 1, t→0+  ∞, if p > 1. However, when p = 1, the denominator 1 − p would be zero. Thus the improper integral is divergent if and only if p ≥ 1.

Exercise. Find the mistake in the following evaluation:

Z 2 1 h i2 dx = ln |x − 1| = ln(1) − ln(1) = 0. 0 x − 1 0

The integrand is discontinuous at x = 1, which is inside the range of integration. Thus this should be an improper integral

Z 2 1 Z 1 1 Z 2 1 dx = dx + dx. 0 x − 1 0 x − 1 1 x − 1 We know the second integral is divergent from the previous example, thus this integral should also be divergent.

51 Comparison Test

The following theorem sometimes helps us determine if an improper integral is convergent or divergent.

Theorem 20 (Comparison Test for Improper Integrals). Suppose that f and g are continuous functions with f(x) ≥ g(x) ≥ 0 for x ≥ a. R ∞ R ∞ (a) If a f(x) dx is convergent, then a g(x) dx is convergent. R ∞ R ∞ (b) If a g(x) dx is divergent, then a f(x) dx is divergent.

The idea of this theorem could be presented in the following figure.

f(x) g(x)

a x

If the graph of f(x) stays above the graph of g(x) to the right of x = a, then we should expect to have Z ∞ Z ∞ f(x) dx ≥ g(x) dx a a R ∞ R ∞ Surely, if a g(x) dx is divergent, being larger than this quantity, a f(x) dx must also be R ∞ R ∞ divergent, and if a f(x) dx is convergent, being smaller than this quantity, a g(x) dx must also be convergent.

R ∞ Remark. The converse of these two statements may not hold true. If a g(x) dx is con- R ∞ vergent, it does not tell use whether a f(x) dx is convergent or divergent. Similarly, if R ∞ R ∞ a f(x) dx is divergent, we do not know whether a g(x) dx is convergent or divergent. Z ∞ Example. Show that e−x2 dx is convergent. −∞

Proof. We first write

Z ∞ Z −1 Z 1 Z ∞ e−x2 dx = e−x2 dx + e−x2 dx + e−x2 dx. −∞ −∞ −1 1

52 Notice that the second integral is an ordinary definite integral, which should always evaluate to a finite number. For the other two integrals, we use the fact that x2 ≥ |x| always holds true whenever |x| ≥ 1, and therefore e−x2 ≤ e−|x| on these two infinite intervals (see figure below). y

yⅇ -x2

yⅇ -x

-1 1x

We know from a previous exercise that Z ∞ Z ∞ e−|x| dx = e−x dx 1 1 is convergent. Thus Z ∞ Z ∞ e−x2 dx ≤ e−|x| dx 1 1 must also be convergent. By a similar argument, the other improper integral is also conver- gent. Thus the original improper integral over the whole real line is convergent.

53 Lecture 8: Areas, Volumes, and Arc Lengths

Today: Areas between Curves, Cylindrical Volumes, Volumes of Rotation, Arc Lengths

In our first class, we have studied the areas under a curve, and used the area to introduce the definite integrals. Today we are going to use the definite integrals to find areas in a more generic setting.

Areas between Curves

We start by looking at the following example.

Example. Find the area of the region enclosed by the curves y = x2 and y = 2 − x2. We know both curves are parabolas. One is concave up, and the other is concave down. Let’s find the points of intersection first. Solve for x in x2 = 2 − x2, and we get x = ±1. Thus the two intersection points of the parabolas are at (−1, 1) and (1, 1). In fact, the curve y = 2 − x2 is above of y = x2 if and only if −1 ≤ x ≤ 1 (See figure below).

yx 2

(-1,1) (1,1)

-1 1

y1-x 2

The region enclosed by the curves, highlighted in light blue, is the difference between the area under the curve y = 2 − x2 and the area under the curve y = x2. These two areas are computed by the definite integrals

Z 1 Z 1 2 2 A1 = (2 − x ) dx and A2 = x dx, −1 −1 and thus the area of the region enclosed by the curves is

Z 1 Z 1 Z 1 3 1 2 2 2 h 2x i 8 A = A1 − A2 = (2 − x ) dx − x dx = (2 − 2x ) dx = 2x − = . −1 −1 −1 3 −1 3

From the example above, we can now define the area of a region bounded between curves.

54 Definition. The area of the region bounded by the curves y = f(x), y = g(x), and the lines x = a, x = b, where f and g are continuous functions and f(x) ≥ g(x) for all x ∈ [a, b], is defined by the definite integral Z b [f(x) − g(x)] dx. a Example. Find the area enclosed by the line y = x − 1 and the parabola y2 = 2x + 6.

1 2 If we regard x as a function of y, we have the expression x = y + 1 and x = 2 y − 3. Solve for the points of intersections, we get (−1, −2) and (5, 4).

(5,4)

y2 2x+6

yx-1

(-1,-2)

Thus we can compute the area of the shaded region by Z 4 y2  hy2 y3 i4  64   8  (y + 1) − − 3 dy = − + 4y = 8 − + 16 − 2 + − 8 = 18. −2 2 2 6 −2 6 6 Exercise. Find the area enclosed by the line y = x and y = x3. Solve for the points of intersection, we found three such points: (−1, −1), (0, 0), and (1, 1). Upon further inspection, we see that the region enclosed by these two curves have two components. On the interval [−1, 0], we have x3 ≥ x, while on the interval [0, 1], we have x ≥ x3. (1,1)

yx

yx 3

(-1,-1)

Thus the area is the sum of two definite integrals Z 0 Z 1 hx4 x2 i0 hx2 x4 i1 1 1 1 (x3 − x) dx + (x − x3) dx = − + − = + = . −1 0 4 2 −1 2 4 0 4 4 2

55 Cylindrical Volumes

Definition. A cylinder is a simply type of solid with a planar region as its two bases and a wall perpendicular to the bases. Example. A cube, a triangular prism, and a filled circular tube are all examples of cylinders.

Definition. The volume of a cylinder is defined to be the product of its base area and its height, i.e., V = A · h, where A is the base area and h is the height. Example. Let’s say we have a cone with base radius 1 and height 1. We can approximate its volume by 5 cylinders as shown in the following figures.

The base of the first cylinder would have radius 1, same as the base of the cone. Each successive cylinder would have linearly decreasing radius, corresponding to the decreasing horizontal cross-sectional area of the cylinder. The total volume of these five cylinders can be represented by the sum 5 X  k − 12 1 π 1 − · 5 5 k=1

56 If, instead of using 5 cylinders to approximate the volume, we use n cylinders, the total volume of the cylinders would then be represented by the sum n X  k − 12 1 π 1 − · n n k=1 This is in the form of a Riemann sum. If n is taken to approach infinity, the Riemann sum becomes a definite integral n X  k − 12 1 Z 1 lim π 1 − · = π(1 − x)2 dx. n→∞ n n k=1 0 We can then evaluate this definite integral Z 1 Z 0 Z 1 hu3 i1 π π(1 − x)2 dx = −π u2 du = π u2 du = π = , 0 1 0 3 0 3 and we take this number as the volume of the cone with base radius 1 and height 1. Question. What is the volume of a cone with base radius r and height h? Definition. Let S be a solid that lies between the horizontal planes z = a and z = b. We

may define a function A(z) on [a, b] such that A(z0) is the cross-sectional area of the solid S

at the plane z = z0. Then the volume of S is n X Z b V = lim A(zk)∆z = A(z) dz. n→∞ k=1 a Example. Now let’s consider the unit sphere (the sphere of radius 1 centered at the origin).

z

r

We start by looking at the horizontal cross-section of the sphere. Each horizontal cross- section is a circle, and the radius of the circle depends on the height of the cross-section. Upon closer observation, we notice that the radius changes with height following the function √ r(z) = 1 − z2

in the range −1 ≤ z ≤ 1. Thus we can set up the volume of the unit sphere to be Z 1 Z 1 Z 1 h z3 i1 4π V = A(z) dz = πr(z)2 dz = π (1 − z2) dz = π z − = . −1 −1 −1 3 −1 3

57 Volumes of Rotation

In the previous two cases, both solids can be constructed by rotating a planar shape about the y-axis: If we rotate the semicircle along its flat edge, we obtain the unit sphere. If we rotate the isosceles right triangle along one of its sides about the right angle, we obtain the cone in our first example.

Now let’s consider the region A bounded by the graph of y = x2, the horizontal line y = 1, and the y-axis.

A

Example. Find the volume of the solid obtained by rotating the region A about the y-axis. The resulting shape is a paraboloid. Each horizontal cross-section of this solid is a circle. The radius of each cross-sectional circle depends on the height of the cross-section.

r h √ h ( ) r(h) = h, A(h) = πr(h)2 = πh.

The solid lies between h = 0 and h = 1, so its volume is

Z 1 Z 1 hh2 i1 π V = A(h) dh = πh dh = π = . 0 0 2 0 2

58 Example. Find the volume of the solid obtained by rotating the region A about the x-axis. First, let’s think of the solid as if it is laid down on its side. Then each cross-section at a specific height of this solid is an annulus. The outer radius of each annulus is 1, while the inner radius changes with the height of the cross-section.

2 rin(h) = h , 2 2 4 rin(h) A(h) = πrout(h) − πrin(h) = π − πh .

h The solid lies between h = 0 and h = 1, so its volume is Z 1 Z 1 h h5 i1 4π V = A(h) dh = (π − πh4) dh = π h − = . h=0 h=0 5 h=0 5 In this example, each cross-section is an annulus, and we integrate over the area of annuli to find the volume of revolution. We call this the washer method for volumes of revolution. Alternatively, we can regard this solid as if it is patches together by concentric cylindrical shells (think about toilet paper rolls). The layer that is at distance r away from the rotation axis has a height of h(r) and a circumference 2πr. Thus this cylindrical shell has area 2πrh(r).

h r √ r ( ) h(r) = r, A(r) = 2πrh(r) = 2πr3/2.

We integrate over all possible radii of these cylindrical shells to get the volume of this solid of rotation: Z 1 Z 1 hr5/2 i1 4π V = A(r) dr = 2π r3/2 dr = 2π = . r=0 r=0 5/2 r=0 5 Instead of cross-sections, we think of this solid of revolution as rolled-up by cylindrical shells of different heights. We call this the cylindrical shell method for volumes of revolution. Definition. The volume of the solid obtained by rotating about the y-axis the region between x = a and x = b under the curve y = f(x) is Z b V = 2πxf(x) dx, a where 0 ≤ a < b.

59 Arc Lengths

We know how to compute the length of a line segment. If the endpoints of a line segments

are (x1, y1) and (x2, y2), the length of this line segment is the distance between its endpoints

p 2 2 ` = (x2 − x1) + (y2 − y1) .

We also know how to compute the length of a polygonal chain, which is a finite sequence of connected line segments. In this case, we compute the length of each individual line segment, and sum them up to get the total length. We will use this idea to figure out the correct notion of length for a smooth curve. Suppose that a curve C is defined by y = f(x) for x ∈ [a, b], where f 0 is continuous on [a, b]. We obtain a polygonal approximation to C by dividing the interval [a, b] into n subintervals b − a of equal length ∆x = . n

a x1 x2 xk xn-1 b x

We can compute the total length of this polygonal chain by

n n q X p 2 2 X 2 2 Ln = (xk − xk−1) + (yk − yk−1) = ∆x + f(xk) − f(xk−1) k=1 k=1 n n r 2 r 2 X hf(xk−1) − f(xk−1 + ∆x)i X b − a hf(xk−1) − f(xk−1 + ∆x)i = ∆x 1 + = 1 + . ∆x n ∆x k=1 k=1 This is in the form of a Riemann sum. Now if we take the limit as n → ∞, we have ∆x → 0, and the Riemann sum becomes the definite integral

Z b q L = 1 + f 0(x)2 dx. a This is the formula. If we employ Leibniz notation for derivatives, it can also be written as r Z b dy 2 L = 1 + dx. a dx

60 x2 Example. Find the length of the curve y = from (0, 0) to (1, 1). 2 Compute the derivative y0 = x. Use the arc length formula,

Z 1 √ L = 1 + x2 dx. 0 Upon checking the integral table, we have √ √ √ √ h 1 + x2 ln(1 + 1 + x2)i1 2 ln(1 + 2) L = + = + ≈ 1.15 2 2 0 2 2 Example. Find the length of the curve y = ln(sec(x)) for 0 ≤ x ≤ π/4 Notice that the derivative y0 = tan(x). Use the arc length formula, we have

Z π/4 q Z π/4 h iπ/4 √ L = 1 + tan2(x) dx = sec(x) dx = ln | sec(x) + tan(x)| = ln(1 + 2) 0 0 0 Remark. Because of the presence of the square root, arc length computations often involve integrals that are very difficult, if not impossible, to evaluate analytically. The examples above are well-chosen so that we are able to obtain closed-form expressions for the arc lengths.

61 Lecture 9: Sequences and Limits

Today: Sequences, Limits, Convergence, Subsequences, Boundedness, Monotonicity

When physicists study complex functions, they often employ Newton’s idea of representing functions as infinite sums of elementary functions. In the next few lectures, we will study the exact meaning of taking infinite sums, as well as writing a complex function as an infinite sum of elementary functions. We start our discussion with the basic concepts of sequences and limits.

Sequences and Limits

Definition. A sequence is an infinite list of numbers written in a definite order:

{a1, a2, a3, . . . , an,... }

The number a1 is called the first term; the number a2 is the second term. In general, we call the number an the n-th term. The sequence {a1, a2, a3, . . . , an,... } can also be ∞ denoted by {an}n=1, or simply {an} when there is no confusion in the context. Example. Some sequences can be defined by giving a formula for the n-th term. For example, (a) The simplest sequence {1, 1, 1, 1,... } of repeating 1’s, can be described by

{an}, where an = 1.

(b) The sequence {1, 2, 3, 4,... } of consecutive integers, can be described by

{an}, where an = n.

Remark. In the examples above, we have a corresponding number an for every positive integer n. It is sometimes helpful to define a sequence as a function f whose domain is the ∞ set of positive integers. In this way, a sequence of numbers can be written as {f(n)}n=1. Example. A sequence does not need to be all integers. In fact, we can use complicated functions to define a sequence of numbers. Additionally, the index of a list does not need to start at 1. For example,

∞ (a) {2/n}n=1 is a list of rational numbers. If we write out the terms of this sequence, we get n 2 1 2 1 2 o 2, 1, , , , , ,... . 3 2 5 3 7

62 √ ∞ (b) { n}n=0 is a list of real numbers that are square roots of integers. If we write out the terms of this sequence we get √ √ √ √ {0, 1, 2, 3, 2, 5, 6 ... }

∞ (c) {sin(nπ/4)}n=2 is a list of numbers that follows the value of sine. If we write out the terms of this sequence, we get √ √ √ √ n 2 2 2 2 o 1, , 0, − , −1, − , 0, , 1,... 2 2 2 2 Example. Some sequences are very difficult to be described by a simple defining function.

∞ (a) The sequence {bn}n=0, where bn is the number of babies born in the United States on the n-th day after January 1, 1970. ∞ (b) The sequence {pn}n=1, where pn is the n-th digit of π in decimal after the decimal point. If we write out the terms of this sequence, we get

{1, 4, 1, 5, 9, 2, 6,... }

∞ (c) The Fibonacci sequence {fn}n=1 can be defined recursively by

f1 = 1, f2 = 1, fn = fn−1 + fn−2 for n ≥ 3.

The first few terms of the Fibonacci sequence are

{1, 1, 2, 3, 5, 8, 13, 21,... }.

∞ A sequence such as {2/n}n=1 can be plotted on a number line.

a4 a3 a2 a1

0 1 2

It can also be plotted as the graph of a function.

2

1 2 3 4 5 6 7 8

From both figures, we can see that the terms of the sequence an = 2/n are approaching 0 as n gets large. In fact, the difference between each term and 0, 2 2 |a − 0| = − 0 = , n n n 63 can be made as small as possible by taking n sufficiently large. We hereby introduce the .

Definition. A sequence {an} has the limit L if we can make the terms an as close to L as we like by taking n sufficiently large. In this case, we write

lim an = L, or an → L as n → ∞. n→∞ If a sequence has a limit, we say that the sequence converges (or is convergent). Otherwise, we say that the sequence diverges (or is divergent).

A more precise definition of limit is given by

Definition. A sequence {an} has the limit L if for every  > 0, there exists an integer N

such that if n ≥ N, then |an − L| < .

This definition can be illustrated by the following figure.

L+ϵ L L-ϵ

1 2 3 4 5 6 7 8

No matter how small we choose the value of  > 0, the graph of the sequence must eventually be enclosed between the horizontal lines y = L +  and y = L − , although usually a small choice of  would require a large N for this to happen. In the case of a divergent sequence, we may have the special case of diverging to infinity. Here is the precise definition.

Definition. We say that a sequence {an} diverges to ∞ if for every number M ≥ 0, there exists an integer N such that if n ≥ N, then an ≥ M. We denote this by

lim an = ∞. n→∞

Similarly, we say that a sequence {an} diverges to −∞ if for every number M ≤ 0, there exists an integer N such that if n ≥ N, then an ≤ M. We denote this by

lim an = −∞. n→∞

64 Properties of Limits

The usual limit laws for functions holds for sequences.

Theorem 21. If {an} and {bn} are convergent sequences, and c is a constant, then

(a) lim (an ± bn) = lim an ± lim bn. n→∞ n→∞ n→∞

(b) lim can = c lim an. n→∞ n→∞

(c) lim anbn = lim an · lim bn. n→∞ n→∞ n→∞ p p h i (d) If an > 0 and p > 0, then lim an = lim an . n→∞ n→∞

lim an an n→∞ (e) If lim bn 6= 0, then lim = . n→∞ n→∞ bn lim bn n→∞

Theorem 22 (Squeeze Theorem). If an ≤ bn ≤ cn for n ≥ N, and lim an = lim cn = L, n→∞ n→∞ then

lim bn = L. n→∞

Theorem 23 (Absolute Value). lim |an| = 0 if and only if lim an = 0. n→∞ n→∞

The concept of sequences is closely related to functions, as well as their limits.

Theorem 24. If {an} is a sequence defined by a function an = f(n), and if lim f(x) = L, x→∞ then

lim an = L. n→∞

Theorem 25 (Continuity and Convergence). If lim an = L and the function f is continuous n→∞ at L, then

lim f(an) = f(L). n→∞ Example. Find the following limits, if exist.

n n (a) lim , ln(n) (−1) (d) lim cos(nπ). (b) lim , (c) lim , n→∞ n→∞ n + 1 n→∞ n n→∞ n (a) We have multiple ways to evaluate this limit now. For example, n  1  1 lim = lim 1 − = lim 1 − lim = 1 − 0 = 1, n→∞ n + 1 n→∞ n + 1 n→∞ n→∞ n + 1 or, n 1 lim 1 1 lim = lim = n→∞ = = 1. n→∞ n + 1 n→∞ 1 + 1 lim 1 + lim 1 1 + 0 n n→∞ n→∞ n

65 (b) We cannot apply Theorem 21 because both the numerator and the denominator diverge ln(n) to ∞. However, if we consider the function f(x) = , we can apply L’Hˆopital’s n Rule to obtain the limit 1/x lim f(x) = lim = 0. x→∞ x→∞ 1 By Theorem 24, we conclude that ln(n) lim = 0. n→∞ n (c) We know that (−1)n 1 lim = lim = 0. n→∞ n n→∞ n Thus by Theorem 23, we have (−1)n lim = 0. n→∞ n (d) Notice that this is the limit of the sequence {−1, 1, −1, 1, −1, 1,... }. The terms oscil- lates between 1 and −1 infinitely without approaching any value. Thus this limit does not exist.

Example. Find the following limits, if exist.

(a) lim cos(π/n) n! n→∞ (b) lim n→∞ nn (a) We notice that lim π/n = 0 and cos(x) is continuous at x = 0. By Theorem 25, we n→∞ have   lim cos(π/n) = cos lim π/n = cos(0) = 1. n→∞ n→∞ (b) Both the numerator and the denominator diverge to ∞ as n approaches ∞. On top of that, we do not have a good continuous function to describe the numerator n!, so we cannot apply L’Hˆopital’sRule. We have to proceed by the definition of n!, which is the product of positive integers up to n. Thus one term of this sequence can be written as n! 1 × 2 × 3 × · · · × n 1 2 × 3 × · · · × n = = · . nn n × n × n × · · · × n n n × n × · · · × n Notice that the second quantity is always at most 1. Thus n! 1 0 ≤ ≤ . nn n 1 But we also know that lim = 0. By the Squeeze Theorem, we conclude that n→∞ n n! lim = 0. n→∞ nn

66 Convergence of Sequences

When we handle a sequence of numbers, the first question to consider is whether the sequence converges or diverges. It is sometimes helpful to pass the same question to the level of subsequences.

∞ ∞ Definition. Let {an}n=1 be a sequence of numbers, and let {nk}k=1 be a sequence of integers such that

n1 < n2 < n3 < ··· < nk−1 < nk < nk+1 < ···

∞ ∞ Then the sequence {ank }k=1 is called a subsequence of {an}n=1.

Example. (a) The sequence of fractions {1/2n} is a subsequence of {1/n}. (b) The constant sequence {1, 1, 1,... } is a subsequence of the alternating sequence {(−1)n}. (c) The sequence of odd integers {1, 3, 5, 7, 9,... } is a subsequence of the sequence of integers {1, 2, 3, 4, 5,... }.

Theorem 26. If a sequence {an} converges to L, then every subsequence of {an} converges ∞ ∞ to the same limit L. Conversely, if a subsequence {ank }k=1 of a sequence {an}n=1 diverges, ∞ then we can conclude that the sequence {an}n=1 also diverges.

Example. For what values of r is the sequence {rn} convergent? Consider the function f(x) = rx defined on the interval [1, ∞). We know that when r > 1, this is an increasing , so f(x) → ∞ as x → ∞; when 0 < r < 1, this is a decreasing exponential function, so f(x) → 0 as x → ∞. When r = 0, the function f(x) is the constant zero function, and when r = 1, the function f(x) is the constant 1 function. Thus  0, if 0 ≤ r < 1,  lim rx = 1, if r = 1, x→∞  ∞, if r > 1. Using Theorem 24, we have  0, if 0 ≤ r < 1,  lim rn = 1, if r = 1, n→∞  ∞, if r > 1.

Now if −1 < r < 0, we have lim |rn| = lim |r|n = 0 n→∞ n→∞

67 from the previous result. If r = −1, the sequence alternates between ±1, thus diverges. Finally, if r < −1, then r2 > 1, and we know that

lim |r2n| = lim (r2)n = ∞ n→∞ n→∞ from the previous result. By Theorem 26, we can conclude that {rn} diverges. Therefore, the sequence {rn} is convergent if and only if −1 < r ≤ 1.

Monotonicity of Sequences

Definition. A sequence {an} is called

• increasing if an ≤ an+1 for all n;

• strictly increasing if an < an+1 for all n;

• decreasing if an ≥ an+1 for all n;

• strictly decreasing if an > an+1 for all n. A sequence is monotone if it is either increasing or decreasing.

Example. We take a look at some of the previous examples in this topic. • The constant sequence {1, 1, 1, 1,... } is both increasing and decreasing. • The sequence of positive integers {1, 2, 3, 4,... } is strictly increasing. • The sequence {1/n} is strictly decreasing. • The alternating sequence {(−1)n} is neither increasing nor decreasing. • The sequence {rn} is – increasing if r = 0 or r ≥ 1; – strictly increasing if r > 1; – decreasing if 0 ≤ r ≤ 1; – strictly decreasing if 0 < r < 1.

Exercise. Show that the sequence

n n + 1 o∞ n2 + 1 n=1 is decreasing. We notice that all the terms in this sequence are positive. In general, there are two ways to show a sequence of positive numbers is decreasing (resp. increasing). If the difference

an+1 − an of consecutive terms is non-positive, or if the ratio an+1/an of consecutive terms is less than or equal to 1, then we can say that the sequence {an} is decreasing.

68 Difference. The difference of consecutive terms is (n + 1) + 1 n + 1 −n2 − 3n − = ≤ 0. (n + 1)2 + 1 n2 + 1 (n2 + 1)[(n + 1)2 + 1] Thus the sequence is decreasing. Ratio. The ratio of consecutive terms is (n + 1) + 1  n + 1 (n + 1) + 1 n2 + 1 n3 + 2n2 + n + 2 = · = ≤ 1. (n + 1)2 + 1 n2 + 1 (n + 1)2 + 1 n + 1 n3 + 3n2 + 4n + 2 Thus the sequence is decreasing.

Definition. A sequence {an} is

• bounded above if there exists a number M such that an ≤ M for all n; we say M is

an upper bound of {an}.

• bounded above if there exists a number m such that an ≥ m for all n; we say m is

a lower bound of {an}. A sequence is bounded if it is both bounded above and bounded below.

Example. Once again, we look at some of our previous examples. • The constant sequence {1, 1, 1, 1,... } is bounded. • The sequence of positive integers {1, 2, 3, 4,... } is bounded below but not above. • The sequence {1/n} is bounded. • The alternating sequence {(−1)n} is bounded. • The sequence {rn} is – bounded if −1 ≤ r ≤ 1; – bounded below but not above if r > 1; – neither bounded above nor bounded below if r < 1; – never bounded above but not below.

We state one form of the Completeness Axiom of the set of real numbers R here.

Axiom 1 (Least Upper Bound Property of R). If S is a non-empty set of real numbers, and if it has an upper bound M ∈ R, then it has a least upper bound ` ∈ R, which means • ` is an upper bound of S; • If m ∈ R is an upper bound of S, then ` ≤ m.

The statement of the next theorem is equivalent to the least upper bound property.

Theorem 27 (Monotone Convergence Theorem). Every bounded monotone sequence of real numbers is convergent.

69 This theorem will be very important in the next topic, when we discuss the convergence criteria of series.

Remark. The converse of this theorem only holds partially. A convergent sequence must be bounded, but it does not need to be monotone (e.g. {(−1)n/n}). On the other hand, if we remove any assumptions of this theorem, the theorem does not hold any more. A bounded sequence does not necessarily converge (e.g. {(−1)n}); a monotone sequence does not necessarily converge, either (e.g. {n}).

70 Lecture 10: Series

Today: Series, Convergence and , First Divergence Test, The Integral Test, , p-Series

We talked about infinite sequences in the last lecture. Today we will study sums of infinite sequences, in order to work towards our final goal of understanding the infinite sums of functions.

Basic Definitions of Series

∞ Definition. Let {an}n=1 be a sequence. The infinite sum

a1 + a2 + a3 + a4 + ··· + an + ··· is a series. We usually denote this series by the relatively concise notation

∞ X an. n=1

Our first question would be: does it even make sense to talk about the sum of infinitely many numbers? The answer is obvious in some cases. For example, consider the series

∞ X 0. n=1 The sum of however many zeros is always zero. Therefore, the value of this infinite sum is zero. Another straightforward example would be the series

∞ X 1. n=1 When we sum up an infinite number of ones, the sum would not be any finite number. Thus there is no finite value for this series. Generically, the answer to the question when an infinite sum makes sense is not straightfor- ward. We need to consider finite sums in order to help us understand an infinite sum.

∞ P Definition. Let an be a series. We define its k-th partial sum by the finite sum n=1

k X sk = an = a1 + a2 + ··· + ak. n=1

71 ∞ Consider the sequence {sk}k=1 of partial sums. If the sequence is convergent, so its limit ∞ P lim sk = S exists, then we say that the series an is convergent, and we write k→∞ n=1

∞ k X X an = lim an = lim sk = S. k→∞ k→∞ n=1 n=1

∞ The number S is called the sum of the series. If the sequence {sk}k=1 is divergent, we say ∞ P that the series an is divergent. n=1 Example (Telescoping Series). Determine whether the series

∞ X 1 n(n + 1) n=1 is convergent or divergent. If it converges, find its sum; if it diverges, explain why. We first take a look at each individual term. The n-th term 1 1 1 a = = − . n n(n + 1) n n + 1

Thus the k-th partial sum

k k X X  1 1  s = a = − k n n n + 1 n=1 n=1  1 1 1 1 1 1 1  1 = 1 − + − + − + ··· + − = 1 − . 2 2 3 3 4 k k + 1 k + 1 Take the limit as k → ∞, we have

∞ X 1 1 = lim sk = 1 − lim = 1. n(n + 1) k→∞ k→∞ k + 1 n=1

Convergence and Divergence of Series

∞ P It is now natural to ask the following question: given a generic series an, how do we tell n=1 whether it is convergent or divergent? The following theorem gives us a sufficient condition for divergence.

∞ P Theorem 28 (First Divergence Test). If lim an 6= 0, then the series an is divergent. n→∞ n=1

72 ∞ P Proof. We prove the contrapositive: if the series an is convergent, then lim an = 0. n=1 n→∞ n P Let sn = ak be the n-th partial sum. Assume that lim sn = S. Then we have k=1 n→∞

n n−1 X X an = ak − ak = sn − sn−1. k=1 k=1 Take the limit, and we get

lim an = lim sn − lim sn−1 = S − S = 0. n→∞ n→∞ n→∞

Remark. The converse of the First Divergence Test is not true. If lim an = 0, we cannot n→∞ ∞ P tell, in general, whether the series an is convergent or divergent. As we will see in later n=1 examples, there are divergent series whose individual terms converge to zero.

∞ This theorem provides another way to show that the series P 1 is divergent, as the individual n=1 terms of this series converge to 1. The following is a less obvious example

Example. Show that the series ∞ X n2 3n2 + 2n + 1 n=1 is divergent. Take the limit of individual terms,

n2 1 1 lim = lim = . n→∞ 2 n→∞ 2 1 3n + 2n + 1 3 + n + n2 3 So the series diverges by the First Divergence Test.

Example. Show that the series ∞ X rn, n=1 where |r| ≥ 1, is divergent.

n We know from the previous lecture that the limit of the sequence an = r depends on the value of r in the following way: • If |r| < 1, the limit is 0; • If r = 1, the limit is 1;

73 • If r ≤ −1 or r > 1, the sequence is divergent. Therefore, when |r| ≥ 1, either the limit of individual terms is 1 or it just does not exist. So by the First Divergence Test, the series is divergent.

Remark. This example is what we call a geometric series.A geometric series is of the form ∞ X arn, n=0 where a 6= 0 and r 6= 0. Each term is obtained from the preceding one by multiplying it by the common ratio r.

Notice that the First Divergence Test does not tell us whether the geometric series is con- vergent or divergent when |r| < 1. The next theorem will take care of this case, as well as the convergence of many other series.

Theorem 29 (The Integral Test). Suppose f is a continuous, non-negative, and monotone ∞ decreasing function defined on the interval [N, ∞) for some positive integer N. Let {an}n=1 ∞ P be the sequence defined by an = f(n). Then the series an is convergent if and only if the n=N improper integral Z ∞ f(x) dx N is convergent.

Proof. We will not cover details of this proof. However, the figures below can serve as “proofs without words” for the case N = 1. y y  f (x)

1 2 3 4 5x areaf(1) areaf(2) areaf(3) areaf(4) areaf(5)

74 y y  g(x)

1 2 3 4 5x areag(1) areag(2) areag(3) areag(4)

R ∞ R ∞ If the improper integral 1 f(x) dx is convergent and 1 g(x) dx is divergent, the pictures ∞ ∞ above shows us that the series P f(n) is convergent and that P g(n) is divergent. n=1 n=1 Example (Geometric Series). Show that the series

∞ X rn, n=0 where |r| < 1, is convergent. When 0 < r < 1, the function rx is continuous, non-negative, and monotone decreasing on the interval [0, ∞). The improper integral

Z ∞ Z ∞ heln(r)x it 1 rt rx dx = eln(r)x dx = lim = − lim . 1 0 t→∞ ln(r) x=0 ln(r) t→∞ ln(r) Because |r| < 1, we know that lim rt = 0. Thus the improper integral is convergent. By the t→∞ ∞ Integral Test, the series P rn is convergent when 0 < r < 1. n=0 We know the series is convergent when r = 0 from the very first example of this lecture. We will show that the series is convergent when −1 < r < 0 by evaluating the sum of this series in a later example.

Example (p-Series). For what values of p is the series

∞ X 1 np n=1 convergent? We usually call this special series the p-series. When p ≤ 0, we know that 1 lim 6= 0. n→∞ np

75 Thus the series is divergent. When p > 0, the function f(x) = 1/xp is continuous, non-negative, and monotone decreasing on the interval [1, ∞). We consider the improper integral

 t h 1 i 1  1−p 1 ∞  lim = lim t − , if p 6= 1, Z 1 t→∞ (p − 1)xp−1 x=1 p − 1 t→∞ p − 1 p dx = 1 x  h it  lim ln(x) = lim ln(t), if p = 1. t→∞ x=1 t→∞ We can see from here that the improper integral is divergent if 0 < p ≤ 1, and is convergent if p > 1. We summarize our results about p-series into the following lemma.

Lemma 30 (p-Series). The p-series ∞ X 1 np n=1 is convergent if p > 1, and is divergent if p ≤ 1.

Evaluating Sums of Series

Our first example of evaluation will again be the geometric series.

Example (Geometric Series). We know that the geometric series

∞ X arn n=0 is divergent when |r| ≥ 1. Now we will evaluate the sum of this series when 0 < |r| < 1.

Consider the k-th partial sum sk. By definition,

2 3 k sk = a + ar + ar + ar + ··· + ar 2 3 k k+1 rsk = ar + ar + ar + ··· + ar + ar

Subtracting the equations and dividing by 1 − r, we get

a − ark+1 s = k 1 − r Now take the limit a − ark+1 a lim sk = lim = . k→∞ k→∞ 1 − r 1 − r The last equality holds because 0 < |r| < 1. We summarize our results about geometric series into the following lemma.

76 Lemma 31 (Geometric Series). The geometric series ∞ X arn, n=0 where a 6= 0 and r 6= 0, is convergent if |r| < 1, and its sum is ∞ X a arn = . 1 − r n=0 It is divergent if |r| ≥ 1. Example. Determine whether the series ∞ X (−2)2n−1 · 5−n n=1 is convergent or divergent. We notice that this is a geometric series, and we can rewrite the series ∞ ∞ ∞ ∞ X X (−2)2n 1 X ((−2)2)n 1 X 4n (−2)2n−1 · 5−n = = − = − . (−2) · 5n 2 5n 2 5 n=1 n=1 n=1 n=1 Because 0 < 4/5 < 1, the geometric series is convergent. We can even evaluate the sum of this geometric series: ∞ ∞ 1 X 4n 1 X 4 4n 1 4 1 − = − · = − · · = −2. 2 5 2 5 5 2 5 1 − 4 n=1 n=0 5 Example. Write the repeating decimal 0.72 as a ratio of integers. We rewrite the repeating decimal step-by-step into the sum of a geometric series 7 2 7 2 7 2 0.72 = + + + + ··· + + + ··· 101 102 103 104 102n−1 102n 72 72 72 = + + ··· + + ··· 1001 1002 100n ∞ ∞ X 72 X 72  1 n = = · 100n 100 100 n=1 n=0 72 1 72 100 8 = · 1 = · = . 100 1 − 100 100 99 11 The following theorem is a corollary of the corresponding limit laws for sequences, since the sum of a series is essentially a limit of the sequence of partial sums. ∞ ∞ ∞ P P P Theorem 32. Let c be a constant. If an and bn are convergent, then the series can n=1 n=1 n=1 ∞ P and (an ± bn) are convergent as well, and their sums are n=1

77 ∞ ∞ ∞ ∞ ∞ X X X X X • can = c an; • (an ± bn) = an ± bn. n=1 n=1 n=1 n=1 n=1

Example. Find the sum of the series

∞ X h 3 i (−2)2n−1 · 5−n + . n(n + 1) n=1

From previous examples, we have evaluated the sums

∞ ∞ X X 1 (−2)2n−1 · 5−n = −2, and = 1. n(n + 1) n=1 n=1 Thus

∞ ∞ ∞ X h 3 i X X 1 (−2)2n−1 · 5−n + = (−2)2n−1 · 5−n + 3 = −2 + 3 · 1 = 1. n(n + 1) n(n + 1) n=1 n=1 n=1

78 Lecture 11: Convergence Tests

Today: Comparison Test, , Test, Absolute Con- vergence Test,

In the last lecture, we gave the basic definition of series, and learned two theorems to help us determine the convergence of a series: The First Divergence Test and the Integral Test. Today, we will put more tools in our toolbox to help us determine if a given series is convergent or divergent.

Comparison Test and Limit Comparison Test

The Comparison Test is a corollary of the Monotone Convergence Theorem. ∞ ∞ P P Theorem 33 (Comparison Test for Series). Suppose that an and bn are series with n=1 n=1 positive terms. ∞ ∞ P P (i) If an is convergent and bn ≤ an for all terms, then bn is also convergent; n=1 n=1 ∞ ∞ P P (ii) If an is divergent and bn ≥ an for all terms, then bn is also divergent. n=1 n=1

Proof. We will only prove the first statement. The second statement is left as an exercise. ∞ P (i) Assume that an is convergent. Let n=1

∞ k k X X X S = an, sk = an, tk = bn. n=1 n=1 n=1

Since both series have positive terms, the sequences {sk} and {tk} are both monotone in- creasing. By definition of convergent series, sk → S as k → ∞. Thus sk ≤ S for all k.

Because bn ≤ an, we have the partial sum tk ≤ sk ≤ S. Thus {tk} is a bounded monotone sequence, and therefore is convergent by the Monotone Convergence Theorem.

In some circumstances, it may be more useful to apply the Limit Comparison Test. ∞ ∞ P P Theorem 34 (Limit Comparison Test). Suppose that an and bn are series with pos- n=1 n=1 itive terms. If a lim n = C, n→∞ bn ∞ ∞ P P where C > 0 is a finite number, then an is convergent if and only if bn is convergent. n=1 n=1

79 Proof. Let m and M be positive numbers such that m < C < M. Then there exists an

integer N such that m < an/bn < M for all n ≥ N. Thus mbn < an < Mbn for all n ≥ N. ∞ ∞ ∞ P P P If bn is convergent, so is Mbn. By the Comparison Test, an is also convergent. If n=1 n=1 n=1 ∞ ∞ ∞ P P P bn is divergent, so is mbn. By the Comparison Test, an is also divergent. n=1 n=1 n=1

Let’s use the Comparison Test and the Limit Comparison Test to determine the convergence of some series.

Example. Determine whether the following series is convergent or divergent.

∞ ∞ ∞ ∞ X 1 X 1 X ln(n) X (a) (b) (c) (d) sin(1/n) 2n + 1 2n − 1 n n=1 n=1 n=1 n=1 ∞ P 1 (a) Use the Comparison Test to compare with the convergent geometric series n , n=1 2 1 1 ≤ for all n ≥ 1. 2n + 1 2n

∞ P 1 Therefore, n is also convergent. n=1 2 + 1 ∞ P 1 (b) Use the Limit Comparison Test to compare with the convergent geometric series n , n=1 2 1 . 1 2n 1 lim = lim = lim = 1. n→∞ 2n + 1 2n n→∞ 2n + 1 n→∞ 1 + 2−n

∞ P 1 Therefore, n is also convergent. n=1 2 − 1 ∞ 1 (c) Use the Comparison Test to compare with the harmonic series P , n=1 n ln(n) 1 ≥ for all n ≥ 3. n n ∞ ln(n) The harmonic series is divergent, so is the series P . n=1 n ∞ 1 (d) Use the Limit Comparison Test to compare with the harmonic series P , n=1 n

sin(1/n) sin(1/x) cos(1/x) · (−x−2) lim = lim = lim = lim cos(1/x) = 1. n→∞ 1/n x→∞ 1/x x→∞ −x−2 x→∞

∞ Therefore, the series P sin(1/n) is also divergent. n=1

80 Alternating Series

Definition. An alternating series is a series whose terms are alternately positive and negative.

Example. Some examples of alternating series include: X 1 − 1 + 1 − 1 + 1 − 1 + ··· = (−1)n n=0 ∞ 1 1 1 1 1 X (−1)n−1 1 − + − + − + ··· = 2 3 4 5 6 n n=1

∞ P Remark. An alternating series an is often of the form n=1

n−1 n an = (−1) bn or an = (−1) bn, where bn ≥ 0. ∞ P Theorem 35 (). If an is an alternating series that satisfies n=1

(i) There exists a positive integer N such that |an+1| ≤ |an| for all n ≥ N;

(ii) lim an = 0, or equivalently, lim |an| = 0. n→∞ n→∞ Then the series is convergent.

Proof. Without loss of generality, assume that the even terms are negative and the odd terms are positive. Because |a2n+1| ≤ |a2n| ≤ |a2n−1|, and because the series is alternating, we have a2n−1 + a2n ≥ 0 and a2n + a2n+1 ≤ 0. Then we have the following relation among the even partial sums:

s2n = s2n−2 + (a2n−1 + a2n) ≥ s2n−2. Thus

0 ≤ s2 ≤ s4 ≤ s6 ≤ · · · ≤ s2n ≤ · · · On the other hand, we can also write

s2n = a1 + (a2 + a3) + (a4 + a5) + ··· + (a2n−2 + a2n−1) + a2n ≤ a1.

Therefore, the sequence {s2n} is a bounded monotone sequence, so it is convergent by the Monotone Convergence Theorem. Let

S = lim s2n. n→∞

81 Now we consider the odd partial sums

lim s2n+1 = lim (s2n + a2n+1) = lim s2n + lim a2n+1 = S + 0 = S. n→∞ n→∞ n→∞ n→∞ Because both the even and the odd partial sums converge to the same limit S, the alternating series is convergent. ∞ (−1)n−1 Example. The alternating harmonic series P satisfies n=1 n (−1)n 1 1 (−1)n−1 (i) = ≤ = for all n ≥ 1; n + 1 n + 1 n n (−1)n−1 1 (ii) lim = lim = 0. n→∞ n n→∞ n Therefore, it is convergent by the Alternating Series Test.

∞ n P (−1) n Example. Consider the alternating series 2 . It is not completely obvious whether n=1 n + 1 the terms of the series are eventually decreasing in absolute value. So we need to verify that: n + 1 n |a | − |a | = − = 1 − n − n2 ≤ 0 n+1 n (n + 1)2 + 1 n2 + 1 for all n ≥ 1. It is not hard to verify the limit 1 n n lim |an| = lim = lim = 0. n→∞ n→∞ n2 + 1 n→∞ 1 1 + n2 Therefore, the series is convergent by the Alternating Series Test.

Remark. Both conditions must be verified in order to apply the Alternating Series Test. There are examples of divergent alternating series that fails either the first condition or the second condition.

Absolute Convergence

An important class of series is absolutely convergent series. ∞ ∞ P P Definition. A series an is absolutely convergent if the series |an| is convergent. A n=1 n=1 series is conditionally convergent if it is convergent but not absolutely convergent.

Example. The alternating harmonic series

∞ X (−1)n−1 1 1 1 1 1 = 1 − + − + − + ··· n 2 3 4 5 6 n=1

82 is convergent but not absolutely convergent because its corresponding series of absolute values ∞ ∞ X (−1)n−1 X 1 = n n n=1 n=1 is the harmonic series, which we know is divergent. Therefore, it is conditionally convergent.

Example. The series ∞ X (−1)n n2 n=1 is absolutely convergent, because its corresponding series of absolute values

∞ ∞ X (−1)n X 1 = n2 n2 n=1 n=1 is a convergent p-series with p = 2. ∞ P Theorem 36 (Absolute Convergence Test). If a series an is absolutely convergent, then n=1 it is convergent.

∞ P Proof. Use (|an| + an) for Comparison Test. Details will be left as an exercise. n=1

Ratio Test

The geometric series is a relatively large family of series whose convergence behavior is well-understood. The ratio test takes advantage of the geometric series and let us test the convergence of a larger family of series. ∞ P Theorem 37 (Ratio Test). Consider the series an. n=1 ∞ an+1 P (i) If lim = L < 1, then the series an is absolutely convergent. n→∞ an n=1 ∞ an+1 P (ii) If lim = L > 1, then the series an is divergent. n→∞ an n=1 ∞ an+1 P (iii) If lim = 1, the Ratio Test cannot tell whether the series an is convergent n→∞ an n=1 or divergent.

∞ 3 P n Example. Test the series n for convergence. n=1 3 Use the Ratio Test,

a (n + 1)3 · 3n (n + 1)3 1 n + 13 1 n+1 lim = lim n+1 3 = lim 3 = lim = < 1. n→∞ an n→∞ 3 · n n→∞ 3n 3 n→∞ n 3

83 ∞ 3 P n Thus the series n is convergent. n=1 3 ∞ nn Example. Test the series P for convergence. n=1 n! Use the Ratio Test,

a (n + 1)n+1 · n! (n + 1)(n + 1)n n + 1n  1 n n+1 lim = lim n = lim n = lim = lim 1+ . n→∞ an n→∞ (n + 1)! · n n→∞ (n + 1)n n→∞ n n→∞ n By definition, this limit is e, and e > 1. Thus the series is divergent. a Remark. It must be pointed out that when lim n+1 = 1, the series can be convergent n→∞ an ∞ 1 or divergent. For example, if we test the harmonic series P with Ratio Test, which we n=1 n know is divergent, we would get a n lim n+1 = lim = 1. n→∞ an n→∞ n + 1

∞ P 1 If we test the convergent p-series 2 with Ratio Test, we would also get n=1 n

2 an+1 n lim = lim 2 = 1. n→∞ an n→∞ (n + 1)

84 Lecture 12: Power Series

Today: Power Series, Radius of Convergence, Term-by-Term Differentiation and Integra- tion, Power Series of Specific Functions

We are now ready to sum up infinitely many functions.

Power Series and Radius of Convergence

Definition. A power series is a series of the form

∞ X n 2 3 n cnx = c0 + c1x + c2x + c3x + ··· + cnx + ··· n=0 where x is a variable and the cn’s are constants. We call the constants cn the coefficients of the power series. More generally, a power series centered at a, or simply, a power series at a, is a series of the form

∞ X n 2 3 n cn(x − a) = c0 + c1(x − a) + c2(x − a) + c3(x − a) + ··· + cn(x − a) + ··· n=0 Remark. We adopt the special treatment of (x − a)0 ≡ 1 even when x = a.

Example. Consider the power series centered at x = 2

∞ X (x − 2)n. n=0 There is no reason to expect this power series to converge for all values of x. For example, when x = 0, this is a geometric series with common ratio −2, which is divergent. We also notice that this is simply a geometric series with common ratio x − 2, so it is convergent whenever |x − 2| < 1, or equivalently, 1 < x < 3.

Example. Now consider the power series centered at x = 2

∞ X (x − 2)n n n=0 We use the Ratio Test to determine the values of x such that it converges. (x − 2)n+1 (x − 2)n (x − 2)n+1 n |x − 2| · n lim = lim · = lim = |x − 2| n→∞ n + 1 n n→∞ (x − 2)n n + 1 n→∞ n + 1 Thus the power series is convergent when |x − 2| < 1, or equivalently, 1 < x < 3; it is divergent when |x − 2| > 1, or equivalently, x < 1 or x > 3. The Ratio Test is inconclusive

85 when x = 1 or x = 3, so we need to discuss these two cases separately. When x = 3, the power series is the harmonic series, which diverges. When x = 1, the power series is the alternating harmonic series, which converges. In conclusion, the power series converges when 1 ≤ x < 3.

∞ Exercise. For what values of x is the series P en2 xn convergent? n=0 We use the Ratio Test to determine the values of x such that it converges.

e(n+1)2 xn+1 en2+2n+1 2n+1 lim 2 = lim 2 · |x| = lim e |x| n→∞ en xn n→∞ en n→∞ This limit diverges to ∞ when x 6= 0. Thus the given series converges only when x = 0.

Exercise. Recall the Bessel’s differential equation

d2f df x2 + x + (x2 − α2)f = 0. dx2 dx

The Bessel functions of the first kind, denoted by Jα(x), are solutions to Bessel’s differential equation. For this exercise, we will only take α to be non-negative integers. In this case, the

Bessel function Jα(x) is given by

∞ X (−1)n J (x) = · x2n+α. α 22n+α · n!(n + α)! n=0

Find the domain of the Bessel function of the first kind Jα(x).

Let an be the coefficients. Then a x2n+α+2 (−1)n+1 22n+α · n!(n + α)! x2n+α+2 n+1 lim 2n+α = lim 2n+α+2 · n · 2n+α n→∞ anx n→∞ 2 · (n + 1)!(n + α + 1)! (−1) x 22n+α · n!(n + α)! = lim · x2 n→∞ 22n+α+2 · (n + 1)!(n + α + 1)! x2 = lim = 0 n→∞ 4(n + 1)(n + α + 1)

for all x. Thus the Ratio Test tells us that the series converges for all values of x ∈ R. In another word, the domain of the Bessel function of the first kind Jα(x) is (−∞, ∞).

From these examples above, we expect that given a power series centered at x = a, there is an interval (possibly degenerate) around the point a on which the power series is convergent. The following theorem summarizes all possible scenarios for this to happen, and therefore leads to the definition of radius of convergence.

86 ∞ P n Theorem 38. Given a power series cn(x − a) . Exactly one of the following three cases n=0 holds: (1) The series converges only if x = 1; (2) The series converges for all x ∈ R; (3) There exists a positive real number R such that the series converges if |x − a| < R and diverges if |x − a| > R. Definition. The number R in case (3) of the previous theorem is called the radius of convergence of the power series. By convention, the radius of convergence is R = 0 for case (1) and R = ∞ for case (2). The interval of convergence of a power series is the interval that consists of all values of x for which the series is convergent. Remark. For a power series centered at a with radius of convergence R, the interval of convergence is not necessarily (a − R, a + R). Indeed, the theorem tells us that the power series is convergent on (a − R, a + R) and is divergent on (−∞, a − R) and (a + R, ∞), but it does not tell us the convergence at the endpoints a ± R. The endpoints must be checked individually with other convergence tests. ∞ n P x Example. Find the radius of convergence and interval of convergence of the series n . n=0 e Compute the ratio of consecutive terms xn+1 xn xn+1en |x| |x| lim = lim = lim = . n→∞ en+1 en n→∞ xnen+1 n→∞ e e By the Ratio Test, the series is convergent if |x|/e < 1, or equivalently, |x| < e. It is divergent if |x|/e > 1, or equivalently, |x| > e. Thus the radius of convergence is R = e. To find the interval of convergence, we need to look at the endpoints ±e. When x = e, the series becomes P 1, thus diverges. When x = −e, the series becomes P(−1)n, thus also diverges. Therefore, we conclude that the interval of convergence is (−e, e). ∞ n P x Example. Find the radius of convergence and interval of convergence of the series n . n=1 ne Compute the ratio of consecutive terms xn+1  xn nxn+1en n |x| |x| lim = lim = lim · = . n→∞ (n + 1)en+1 nen n→∞ (n + 1)xnen+1 n→∞ n + 1 e e By the Ratio Test, the series is convergent if |x|/e < 1, or equivalently, |x| < e. It is divergent if |x|/e > 1, or equivalently, |x| > e. Thus the radius of convergence is R = e. To find the interval of convergence, we need to look at the endpoints ±e. When x = e, the series becomes the harmonic series, thus diverges. When x = −e, the series becomes the alternating harmonic series, thus converges. Therefore, the interval of convergence is [−e, e).

87 Term-by-Term Differentiation and Integration

The following theorem provide us with the powerful tool of term-by-term differentiation and integration within the radius of convergence of a power series. Theorem 39 (Term-by-Term Differentiation and Integration). Let ∞ X n cn(x − a) n=0 be a power series centered at a with radius of convergence R > 0. Then the function f(x) defined by ∞ X n f(x) = cn(x − a) n=0 on the interval (a − R, a + R) is differentiable (hence continuous). Furthermore,

∞ Z ∞ n+1 X X cn(x − a) (i) f 0(x) = nc (x − a)n−1, (ii) f(x) dx = C + , n n + 1 n=1 n=0

and the radii of convergence of the power series in these two equations are both R.

We will not prove this theorem. But we shall use this theorem to find power series expressions for specific functions. Example. Take the Bessel function of the first kind of order 0 ∞ X (−1)n J (x) = · x2n. 0 22n · n! · n! n=0 The power series is convergent on all of R. Thus its derivative can be computed term-by-term ∞ ∞ X (−1)n · 2n X (−1)n· J 0 (x) = · x2n−1 = · x2n−1 0 22n · n! · n! 22n−1 · (n − 1)!n! n=1 n=1 ∞ X (−1)n+1· = · x2n+1 = −J (x). 22n+1 · n!(n + 1)! 1 n=0

Representing Functions as Power Series

We have seen the sum of convergent geometric series. ∞ 1 X = xn (1) 1 − x n=0 for |x| < 1. We will use this formula to find the power series expressions for a variety of functions.

88 1 Example. We first try to find the power series representation of and its interval of 1 + x2 convergence. Notice that ∞ ∞ 1 1 X X = = (−x2)n = (−1)nx2n. 1 + x2 1 − (−x2) n=0 n=0 This is a geometric series with common ratio −x2. Thus it converges if | − x2| < 1, or equivalently, |x| < 1. Therefore, its interval of convergence is (−1, 1). 1 Example. Now we try to find the power series representation of and its interval of x + 2 convergence. We factor a 2 from the denominator to write it in the form of the left-hand side of equation (1). ∞ ∞ 1 1 1 1 1 X  xn X (−1)nxn = = · = − = x + 2 2(1 + x ) 2 1 − (− x ) 2 2 2n+1 2 2 n=0 n=0 This is a geometric series with common ratio −x/2. Thus it converges if | − x/2| < 1, or equivalently, |x| < 2. Therefore, its interval of convergence is (−2, 2). x2 Exercise. Find a power series representation of and determine its interval of conver- 1 + x2 gence. We may notice that ∞ ∞ x2 1 X X = 1 − = 1 − (−1)nx2n = 1 + (−1)n+1x2n 1 + x2 1 + x2 n=0 n=0 ∞ X = 1 − 1 + x2 − x4 + x6 − x8 + ··· = (−1)n+1x2n. n=1 Another way is to notice that ∞ ∞ x2 1 X X = x2 · = x2 (−1)nx2n = (−1)nx2n+2. 1 + x2 1 + x2 n=0 n=0 Both series are geometric with common ratio −x2. Thus they converge if | − x2| < 1, or equivalently, |x| < 1. Therefore, the interval of convergence is (−1, 1).

In these three cases, we transformed the given functions into the form 1 , 1 − u then use the sum of convergent geometric series to write them into power series. The next several examples uses term-by-term differentiation and integration on the equation ∞ 1 X = xn (1) 1 − x n=0 to find power series.

89 Example. Differentiating each side of the equation ∞ 1 X = xn, 1 − x n=0 we get ∞ 1 X = nxn−1. (1 − x)2 n=1 By Theorem 39, the radius of convergence R = 1 does not change. Example. Integrating both sides of the the equation ∞ 1 X = (−1)nxn, 1 + x n=0 we get ∞ ∞ X (−1)n X (−1)n−1 ln(1 + x) = C + · xn+1 = C + · xn. n + 1 n n=0 n=1 To determine what the value of C is, let x = 0, then ln(1 + 0) = C. Thus C = 0 and ∞ X (−1)n−1 ln(1 + x) = · xn. n n=1 By Theorem 39, the radius of convergence R = 1 does not change. Exercise. Find a power series representation for arctan(x), and determine its interval of convergence. We know that Z 1 dx = arctan(x) + C. 1 + x2 Thus ∞ X (−1)n arctan(x) = C + · x2n+1. 2n + 1 n=0 To find C, let x = 0, then we get arctan(0) = C. Thus C = 0, and therefore ∞ X (−1)n arctan(x) = · x2n+1. 2n + 1 n=0 By Theorem 39, the radius of convergence R = 1 does not change. To find the interval of convergence, we need to inspect the endpoints x = ±1. Notice that (±1)2n+1 = (±1)2n · (±1) = ±1. Thus the convergence at the endpoints are the same. Let’s look at x = 1. Then the power series becomes ∞ X (−1)n , 2n + 1 n=0 which is convergent by the Alternating Series Test. The interval of convergence is [−1, 1].

90 Example. Besides giving power series representations of known functions, we may also use term-by-term differentiation and integration to determine the function corresponding to a given power series. For example, we know from a homework problem that the power series

∞ X xn n! n=0

∞ n P x is convergent for all x ∈ R. Now define f(x) = . Then its derivative n=0 n!

∞ ∞ ∞ X nxn−1 X xn−1 X xn f 0(x) = = = = f(x). n! (n − 1)! n! n=1 n=1 n=0 However, we know all functions that satisfies f 0(x) = f(x) are of the form

f(x) = Cex.

To find the value of C, let x = 0, then we have 1 0 0 f(0) = Ce0 = C, and f(0) = + + + ··· = 1. 0! 1! 2! Thus C = 1 and f(x) = ex. Therefore, we get the power series representation of the exponential function ∞ X xn ex = . n! n=0 The radius of convergence of this power series is ∞. Thus the equality above holds for all x ∈ R. In particular, if we take x = 1, we get the following expression for the number e as a sum of an infinite series: ∞ X 1 1 1 1 e = = 1 + + + + ··· n! 1! 2! 3! n=0 In some context, this expression is adopted as the definition of the number e.

91 Lecture 13: Taylor and Maclaurin Series

Today: Taylor’s Theorem, , Maclaurin Series

Let’s start our discussion with a function that can be represented by a power series. Suppose that ∞ X n 2 3 f(x) = cn(x − a) = c0 + c1(x − a) + c2(x − a) + c3(x − a) + ··· n=0 We first notice that

f(a) = c0. Now by Theorem 39, we can find the derivative of f(x) by differentiating the individual terms of the power series. ∞ 0 X n−1 f (x) = ncn(x − a) n=1 Notice that the derivative is also a power series, so we can proceed to compute all of its higher derivatives.

∞ 00 X n−2 f (x) = n(n − 1)cn(x − a) n=2 ∞ 000 X n−3 f (x) = n(n − 1)(n − 2)cn(x − a) n=3 ······ ∞ (k) X n−k f (x) = n(n − 1) ··· (n − k + 1)cn(x − a) n=k When we evaluate the derivatives at a, we get the constant term in each power series

0 00 000 (k) f (a) = 1 · c1, f (a) = 2 · 1 · c2, f (a) = 3 · 2 · 1 · c3, . . . f (a) = k! · ck

Solving the equation for the k-th coefficient ck, we get

f (k)(a) c = k k! We have proved the following theorem.

Theorem 40. If f has a power series expansion at a with radius of convergence R > 0, that is, ∞ X n f(x) = cn(x − a) for all |x − a| < R, n=0

92 then its coefficients are given by the formula

f (n)(a) c = . n n! Remark. Substituting thiss formula back into the series, we see that if f has a power series expansion at a, then it must be of the form

∞ X f (n)(a) f(x) = (x − a)n n! n=0 f 0(a) f 00(a) f 000(a) = f(a) + (x − a) + (x − a)2 + (x − a)3 + ··· 1! 2! 3! Definition. The series ∞ X f (n)(a) (x − a)n n! n=0 is called the Taylor series of the function f at a. When a = 0, the series becomes

∞ X f (n)(0) xn, n! n=0 and is given the special name Maclaurin series.

Example. We have seen in the previous lecture that

∞ X xn ex = . n! n=0 is a power series expansion of the exponential function f(x) = ex. The power series is centered at 0. The derivatives f (k)(x) = ex, so f (k)(0) = e0 = 1. So the Taylor series of the function f at 0, or the Maclaurin series of f, is

∞ X xn , n! n=0 which agrees with the power series definition of the exponential function.

Definition. If f(x) is the sum of its Taylor series expansion, it is the limit of the sequence of partial sums n X f (k)(a) T (x) = (x − a)k. n k! k=0 We call the n-th partial sum the n-th-degree Taylor polynomial of f at a.

93 One important application of Taylor series is to approximate a function by its Taylor poly- nomials. This is very useful in physics and engineering, where people only need a good approximation for most scenarios, and polynomials are usually much easier to deal with than a transcendental function. The following theorem justifies the use of Taylor polynomi- als for function approximation.

Theorem 41 (Taylor’s Theorem). Let n ≥ 1 be an integer, and let a ∈ R be a point. If f(x) is a function that is n times differentiable at the point a, then there exists a function hn(x) such that n f(x) = Tn(x) + hn(x)(x − a) , where lim hn(x) = 0. x→a The term n Rn(x) = f(x) − Tn(x) = hn(x)(x − a) is called the Peano form of the remainder.

Sometimes we would like a better estimate on the remainder term, so that we could have a better understanding of how good the Taylor polynomials approximate the original functions. However, we can only do this under stronger regularity assumptions on f(x).

Theorem 42 (Lagrange Form of the Remainder). Let n ≥ 1 be an integer, and let a ∈ R be a point. If f(x) is a function that is n + 1 times differentiable on an open interval I containing a, then for all x ∈ I, there exists a number z strictly between a and x such that f (n+1)(z) R (x) = (x − a)n+1 n (n + 1)! This is the Lagrange form of the remainder. Example. Find the Maclaurin series for f(x) = sin(x), and show that its sum equals sin(x). First, we need to find the derivatives of f(x) at 0: f(x) = sin(x), f(0) = 0, f 0(x) = cos(x), f 0(0) = 1, f 00(x) = − sin(x), f 00(0) = 0, f 000(x) = − cos(x), f 000(0) = −1, f (4)(x) = sin(x), f (4)(0) = 0, ······ ······ The derivatives repeat in a 4-cycle, so we can write the Maclaurin series as f 0(0) f 00(0) f 000(0) f (4)(0) f(0) + x + x2 + x3 + x4 + ··· 1! 2! 3! 4! ∞ x3 x5 x7 X (−1)n = x − + − + ··· = x2n+1. 3! 5! 7! (2n + 1)! n=0

94 Use Ratio Test to find its radius of convergence:

n+1 2n+3  n 2n+1 2 (−1) x (−1) x |x| lim = lim = 0 n→∞ (2n + 3)! (2n + 1)! n→∞ (2n + 3)(2n + 2) for all x ∈ R. Thus the radius of convergence R = ∞. To show that the sum of the Maclaurin series equals to the function f(x) = sin(x), we consider the n-th remainder term in Lagrange form

f (n+1)(z) R (x) = xn+1, n (n + 1)! where z is a number strictly between 0 and x. Notice that f (n+1)(z) is a sine function or a cosine function, so |f (n+1)(z)| ≤ 1. Then we have

xn+1 xn+1 − ≤ R (x) ≤ (n + 1)! n (n + 1)!

However, we know that xn+1 lim = 0 n→∞ (n + 1)! for all x ∈ R, so by Squeeze Theorem,

lim Rn(x) = 0 n→∞

for all x ∈ R. But since Rn(x) = f(x) − Tn(x), this implies that the Taylor polynomials converges to f(x) for all x ∈ R, i.e., the sum of the Maclaurin series equals f(x) = sin(x).

Example. Find the Taylor series for f(x) = ex at a = 1. All derivatives of f(x) are ex, so f (n)(1) = e for all n ≥ 0. Thus its Taylor series at 1 is

∞ X e (x − 1)n n! n=0 with radius of convergence R = ∞. The following transformation verifies that we found the right expression for the Taylor series:

∞ ∞ X (x − 1)n X e ex = e · ex−1 = e = (x − 1)n. n! n! n=0 n=0 Exercise. Find the Maclaurin series of f(x) = cos(x).

95 First, we find the derivatives of f(x) at 0:

f(x) = cos(x), f(0) = 1, f 0(x) = − sin(x), f 0(0) = 0, f 00(x) = − cos(x), f 00(0) = −1, f 000(x) = sin(x), f 000(0) = 0, f (4)(x) = cos(x), f (4)(0) = 1, ······ ······

The derivatives repeat in a 4-cycle, so we can write the Maclaurin series as

f 0(0) f 00(0) f 000(0) f (4)(0) f(0) + x + x2 + x3 + x4 + ··· 1! 2! 3! 4! ∞ x2 x4 x6 X (−1)n = 1 − + − + ··· = x2n. 2! 4! 6! (2n)! n=0 We can verify by Ratio Test to see that its radius of convergence is R = ∞. We can use the Lagrange form of the remainder to prove that the Maclaurin series converges to the function f(x) = cos(x) for all x ∈ R. The detail is left as an exercise.

Example. Find the Maclaurin series for f(x) = x cos(x). We know that the Maclaurin series for cos(x) is

∞ X (−1)n cos(x) = x2n (2n)! n=0 Thus ∞ ∞ X (−1)n X (−1)n f(x) = x cos(x) = x x2n = x2n+1. (2n)! (2n)! n=0 n=0

Example. Find the Maclaurin series for f(x) = e−x2 . We know that the Maclaurin series for the exponential function eu is

∞ X un eu = n! n=0

Substitute u = −x2 in the expression above, we get

∞ 2 n ∞ n 2 X (−x ) X (−1) e−x = = x2n. n! n! n=0 n=0

96 Remark. The Taylor series / Maclaurin series of a infinitely differentiable function does not necessarily equal to the original function. A proof is required to show that they are equal (or not equal) for a function under consideration. We used the Lagrange form of the remainder to prove it for sin(x) and used the differential equation method to prove it for ex.

We collect the following table of important Maclaurin series for reference.

Function Maclaurin Series

∞ 1 X xn = 1 + x + x2 + x3 + ··· R = 1 1 − x n=0 ∞ X xn x x2 x3 ex = 1 + + + + ··· R = ∞ n! 1! 2! 3! n=0 ∞ X (−1)n x3 x5 x7 sin(x) x2n+1 = x − + − + ··· R = ∞ (2n + 1)! 3! 5! 7! n=0 ∞ X (−1)n x2 x4 x6 cos(x) x2n = 1 − + − + ··· R = ∞ (2n)! 2! 4! 6! n=0 ∞ X (−1)n x3 x5 x7 arctan(x) x2n+1 = x − + − + ··· R = 1 (2n + 1) 3 5 7 n=0 ∞ X (−1)n−1 x2 x3 x4 ln(1 + x) xn = x − + − + ··· R = 1 n 2 3 4 n=1

One application of Taylor series is to justify the use of L‘Hˆopital’sRule. sin(x) Example. Find the limit lim . x→0 x We could evaluate the limit with L‘Hˆopital’sRule, but let’s use the Maclaurin series instead.

x3 x5 x7 sin(x) x − + − + ···  x2 x4 x6  lim = lim 3! 5! 7! = lim 1 − + − + ··· = 1. x→0 x x→0 x x→0 3! 5! 7! The result agrees with the answer we get from L‘Hˆopital’sRule:

sin(x) cos(x) cos(0) lim = lim = = 1. x→0 x x→0 1 1

Another important application of Taylor series is that they enable us to integrate functions that we previous could not handle.

97 Z Example. Evaluate e−x2 dx as an infinite series.

We know the Maclaurin series for the integrand is

∞ n 2 X (−1) e−x = x2n n! n=0 with radius of convergence R = ∞. Using term-by-term integration, we get

Z ∞ n 2 X (−1) e−x dx = C + x2n+1 n!(2n + 1) n=0 with radius of convergence R = ∞.

98