<<

Math 360: and the

D. DeTurck

University of Pennsylvania

October 25, 2017

D. DeTurck Math 360 001 2017C: Integral/functions 1 / 28

We’ve gotten pretty far with our “primitive” integral of functions of . But not all continuous functions are BV (nor are all BV functions continuous), so we should define a more robust integral so that the set of integrable functions includes both cases. The setup is pretty much the same as for the integral we already have: To calculate b f (x) dx ˆa we partition the [a, b] with points

x0 = a < x1 < x2 < ··· < xn = b

– the new ingredient is how we choose to “sample” the f in the interval [xi−1, xi ]. When our functions were monotonic, we chose to evaluate f either the left or right endpoint, since that would give the maximum or minimum value of f on the subinterval.

D. DeTurck Math 360 001 2017C: Integral/functions 2 / 28 Riemann vs Darboux

There are two approaches to sampling: • Riemann: In the “” you choose a random ∗ xi in the interval [xi−1, xi ] for each i, and create the

n X ∗ RS(f , P) = f (xi )(xi − xi−1) i=1 If the of RS(f , P) as P becomes finer and finer (n → ∞ and |P| → 0) exists, then that is the Riemann integral. • Darboux: In the “” you make two sums: For the upper Darboux sum you sample [xi−1, xi ] by simply letting + fi be the supremum of f (x) on the interval [xi−1, xi ], and − you make the lower Darboux sum by letting fi be the infimum of f on the subinterval.

D. DeTurck Math 360 001 2017C: Integral/functions 3 / 28 Setup for the integral – upper and lower sums

This is going to look familiar (compare with slide set 4). Let f be any on [a, b], and P a partition of [a, b].

Definition: (upper and lower sums) The upper sum of f corresponding to the partition P is

n X + U(f , P) = fi (xi − xi−1) i=1 and the lower sum of f corresponding to the partition P is

n X − L(f , P) = f (xi − xi−1) i=1 Since f + = sup f (x) ≥ inf f (x) = f − for each i, i x∈[xi−1,xi ] x∈[xi−1,xi ] i we have U(f , P) ≥ L(f , P)

D. DeTurck Math 360 001 2017C: Integral/functions 4 / 28 Setup for the integral – definition

Since there’s always a common refinement P for any partitions P1 and P2, we have

L(f , P1) ≤ L(f , P) ≤ U(f , P) ≤ U(f , P2)

where P is a common refinement for P1 and P2. So for any pair of partitions P1 and P2 we have

L(f , P1) ≤ U(f , P2).

Therefore sup L(f , P) over all partitions P (which is called the lower Darboux integral is less than or equal to inf U(f , P)(the upper Darboux integral). If these are equal then we say the function f is integrable and their common value is called the integral: b f (x) dx ˆa

D. DeTurck Math 360 001 2017C: Integral/functions 5 / 28 Proving existence – regular partitions

To show that the integral exists, it is sufficient to find, for any ε > 0, a partition P such that

U(f , P) < L(f , P) + ε.

We did this before for monotonic functions, we can do this by using sufficiently fine regular partitions – these are partitions having the b − a x ’s evenly spaced (so x − x = for all i = 1,..., n). i i i−1 n b If f :[a, b] → R is monotonic, then f (x) dx exists. ˆa Proof: Given ε > 0, choose n so large that the regular partition P f (b) − f (a) with n steps, will have U(f , P) − L(f , P) = < ε. n

D. DeTurck Math 360 001 2017C: Integral/functions 6 / 28 Functions of bounded variation

Proposition (Greater generality) Then we extended the integral to functions of bounded variation: If f (x) can be written as the sum of two monotonic functions p(x) and q(x) with p increasing and q decreasing on [a, b] (such a function is called a function of bounded variation), then b b b f (x) dx exists and is equal to p(x) dx + q(x) dx. ˆa ˆa ˆa Now, the goal is to extend the whole thing to continuous functions.

D. DeTurck Math 360 001 2017C: Integral/functions 7 / 28 Basic properties

Because the upper and lower sums have these properties, it follows that the integral does: 1 : b b b αf (x) + βg(x) dx = α f (x) dx + β g(x) dx for ˆa ˆa ˆa constants α, β and f and g are integrable functions on [a, b]. 2 Monotonicity: If f (x) ≥ g(x) for all x ∈ [a, b] then b b a f (x) dx ≥ a g(x) dx. 3 If´ f (x) is integrable´ on [a, b], then so is |f (x)| and b b

f (x) dx ≤ |f (x)| dx. ˆa ˆa

D. DeTurck Math 360 001 2017C: Integral/functions 8 / 28 More basic properties

4 If a < b < c then

c b c f (x) dx = f (x) dx + f (x) dx. ˆa ˆa ˆb

5 If m ≤ inf{f (x) | x ∈ [a, b]} and M ≥ sup{f (x) | x ∈ [a, b]} then b (b − a)m ≤ f (x) dx ≤ (b − a)M. ˆa 6 for integrals: If f is continuous and integrable (soon we can remove this as an assumption) on [a, b] then there is a c with a < c < b such that

1 b f (c) = f (x) dx. b − a ˆa

D. DeTurck Math 360 001 2017C: Integral/functions 9 / 28 Fundamental Theorem – integrals of

Fundamental theorem of I: Integrals of derivatives Let F (x) be a differentiable function on [a, b] with F 0(x), and suppose F 0 is an integrable function on [a, b]. Then

b F 0(x) dx = F (b) − F (a). ˆa

For any interval (xi−1, xi ) in the partition P we have

0− F (xi ) − F (xi−1) 0+ Fi ≤ ≤ Fi xi − xi−1 by the mean value theorem (for derivatives), since the middle quantity is F 0(x) for some x in the interval.

D. DeTurck Math 360 001 2017C: Integral/functions 10 / 28 Fundamental Theorem – proof conclusion

But then

n 0 X 0− L(F , P) = Fi (xi − xi−1) i=1 n X ≤ F (xi ) − F (xi−1) i=1 n X 0+ 0 ≤ Fi (xi − xi−1) = U(F , P). i=1

But the middle sum telescopes to F (xn) − F (x0) = F (b) − F (a). Now F (b) − F (a) is trapped between sup L(F 0, P) and P b inf U(F 0, P), both of which are equal to the integral F 0(x) dx P ˆa because F 0 is integrable.

D. DeTurck Math 360 001 2017C: Integral/functions 11 / 28 Second fundamental theorem – derivatives of integrals

Fundamental theorem of calculus II: Derivatives of integrals Let f (x) be a continuous (and integrable) function on [a, b]. Define the function F (x) via

x F (x) = f (t) dt. ˆa Then F is differentiable and F 0(x) = f (x). First, if h > 0 we have

x+h F (x + h) − F (x) = f (t) dt = hf (c) ˆx for some c between x and x + h by properties 4 and 6 (mean value theorem for integrals).

D. DeTurck Math 360 001 2017C: Integral/functions 12 / 28 Second fundamental theorem – proof conclusion

Therefore the difference quotient

F (x + h) − F (x) = f (c) where x < c < x + h h But since f is continuous, f (c) → f (x) as h → 0+.

x For h < 0 we use that F (x + h) − F (x) = − f (t) dt = hf (c) ˆx+h for some c between x + h and x, and the proof goes through as for the h > 0 case.

D. DeTurck Math 360 001 2017C: Integral/functions 13 / 28 Uniform continuity

To show that continuous functions on closed intervals are integrable, we’re going to define a slightly stronger form of continuity: Definition (uniform continuity): A function f (x) is uniformly continuous on the domain D if for every ε > 0 there is a δ > 0 that depends only on ε and not on x ∈ D such that for every x, y ∈ D with |x − y| < δ, it is the case that |f (x) − f (y)| < ε. A uniformly continuous function is necessarily continuous, but on non-compact sets (i.e., sets that are not closed and bounded) a need not be uniformly so.

D. DeTurck Math 360 001 2017C: Integral/functions 14 / 28 Not uniformly continuous

To help understand the import of uniform continuity, we’ll reverse the definition: Definition (not uniformly continuous): A function f (x) is not uniformly continuous on D if there is some ε > 0 such that for every δ > 0, no matter how small, it is possible to find x, y ∈ D with |x − y| < δ but |f (x) − f (y)| > ε. For instance f (x) = x2 is not u.c. on the set [0, ∞) because we can choose ε = 1 and then for any δ > 0, we have (x + δ)2 − x2 = 2xδ + δ2 and we can choose x > 1/(2δ) so that 2xδ > 1. So there is no δ that works for every x in the infinite interval. Likewise, g(x) = 1/x is not u.c. on (0, 1] because, again using ε = 1, for any δ > 0 we’ll pick an integer n > 0 so that 1/n < δ Then let x = 1/n and y = 1/(n + 1) and |x − y| < δ but |1/x − 1/y| = 1.

D. DeTurck Math 360 001 2017C: Integral/functions 15 / 28 Integrating continuous functions

Our goal is: Theorem If f (x) is a continuous function on the closed, bounded interval [a, b], then f is integrable on [a, b]. We’ll accomplish this in two jumps: Lemma 1 If f (x) is a uniformly continuous function on the closed, bounded interval [a, b], then f is integrable on [a, b].

Lemma 2 If f (x) is continuous on the closed, bounded interval [a, b] then f is uniformly continuous on [a, b]. It’s easy to see how the theorem follows from the lemmas.

D. DeTurck Math 360 001 2017C: Integral/functions 16 / 28 Lemma 1

Lemma 1 If f (x) is a uniformly continuous function on the closed, bounded interval [a, b], then f is integrable on [a, b]. Proof: Given ε > 0, let δ > 0 be such that |f (x) − f (y)| < ε/(b − a) whenever x, y ∈ [a, b] and |x − y| < δ. Now choose n so that (b − a)/n < δ, and let P be the regular partition of [a, b] into n subintervals. We’ll have xi − xi−1 < δ for + − all i, so fi − fi < ε/(b − a) for all i. Then

n n X b − a X ε b − a U(f , P) − L(f , P) = (f + − f −) < = ε. i i n b − a n i=1 i=1 so U(f , P) < L(f , P) + ε, proving the integrability of f .

D. DeTurck Math 360 001 2017C: Integral/functions 17 / 28 Lemma 2

Lemma 2 If f (x) is continuous on the closed, bounded interval [a, b] then f is uniformly continuous on [a, b].

We (almost!) did the proof of this in using Bolzano-Weierstrass, so here’s the whole thing.

Proof by contrapositive: Assume that f is not uniformly continuous on [a, b], and we’ll find a point of discontinuity of f . To do it, recall that since f is not u.c., there is an ε > 0 such that for any δ > 0, no matter how small, there is a pair of points p, q ∈ [a, b] with |p − q| < δ but |f (p) − f (q)| > ε.

D. DeTurck Math 360 001 2017C: Integral/functions 18 / 28 Proof of lemma 2, continued

Construct two {pn} and {qn} where all of the points of each are in [a, b], and such that |pn − qn| < 1/n (so we’re making δ smaller and smaller) but |f (p) − f (q)| > ε. Since {pn} is contained in [a, b] it is bounded and by Bolzano Weierstrass it has

a convergent subsequence {pni }, with limit L ∈ [a, b].

Because |pn − qn| < 1/n, the subsequence {qni } must converge to L as well, since

|qni − L| < |qni − pni | + |pni − L|

and the first of these terms can be made arbitrarily small since it is

less than 1/ni and the second can be made small because pni → L.

D. DeTurck Math 360 001 2017C: Integral/functions 19 / 28 Proof of lemma 2, concluded

Now we’ll show that f is not continuous at L. If it were, then for any E > 0 there would be a D > 0 such that if x ∈ [a, b] with |x − L| < D, then |f (x) − f (L)| < E. Let E = ε/2, so we have the corresponding D > 0. We know that for i sufficiently large we will have

|pni − L| < D and |qni − L| < D because both (sub)sequences converge to L. But then

|f (pni ) − f (qni )| ≤ |f (pni ) − f (L)| + |f (qni ) − f (L)| < 2E < ε

contradicting the fact that |f (pn) − f (qn)| > ε for all n.

D. DeTurck Math 360 001 2017C: Integral/functions 20 / 28 Integration by substitution

We still have the substitution rule: Integration by subsitution Suppose f :[a, b] → R and g :[c, d] → R are integrable, and that the derivative of g exists and is bounded and continuous on (c, d). Further, assume that the of g :(c, d) → R is contained in the interval (a, b). Then

d g(d) f (g(x))g 0(x) dx = f (x) dx. ˆc ˆg(c) Proof: FTC to the function

x g(x) H(x) = f (g(t)) dt − f (t) dt. ˆc ˆg(c)

D. DeTurck Math 360 001 2017C: Integral/functions 21 / 28

Integration by parts Suppose f and g are differentiable functions on [a, b], with f 0 and g 0 continuous as well. Then

b b b 0 0 f (x)g (x) dx = f (x)g(x) − f (x)g(x) dx. ˆa x=a ˆa To prove this, consider the function x x x 0 0 H(x) = f (t)g (t) dt − f (t)g(t) + f (t)g(t) dt. ˆa t=a ˆa Using the fundamental theorem and the for derivatives, we have   H0(x) = f (x)g 0(x) − f (x)g 0(x) + f 0(x)g(x) + f 0(x)g(x) = 0 so H(x) is constant. But H(a) = 0, so the constant is zero. The fact that H(b) = 0 is the formula in the box.

D. DeTurck Math 360 001 2017C: Integral/functions 22 / 28

You probably recall the trapezoidal rule for estimating integrals from elementary calculus: Trapezoidal rule If f is a twice-differentiable function on [a, b], then

b h f (x) dx ≈ (f0 + 2f1 + 2f2 + ··· + 2fn−1 + fn) , ˆa 2

where fi = f (xi ), and xi = a + hi for i = 0,..., n and h = (b − a)/n We’ll derive the trapezoidal rule and then find an estimate for the error (difference between the approximation on the right side and the actual integral on the left).

D. DeTurck Math 360 001 2017C: Integral/functions 23 / 28 Derivation of the trapezoidal rule

To derive the trapezoidal rule, we’ll look at a single “panel” from xi−1 to xi . Via the x = xi−1 + t we can write

xi h f (x) dx = f (x + t) dt. ˆ ˆ i−1 xi−1 0 Now let 2 f (xi−1 + t) = c0 + c1t + c2t + ··· be the beginning of the Taylor expansion of f around the point t = 0 (which is x = xi−1). Then f (xi−1) = c0, 2 f (xi ) = c0 + c1h + c2h + ··· , and h h2 f (xi−1 + t) dt = c0h + c1 + ··· . ˆ0 2 Therefore, h h h2 Both (f (xi−1) + f (xi )) and f (xi−1 + t) dt = c0h + c1 + ··· 2 ˆ0 2

D. DeTurck Math 360 001 2017C: Integral/functions 24 / 28 Error in the trapezoidal rule

So we have h h f (xi−1 + t) dt − (f (xi−1) + f (xi )) = ··· ˆ0 2 where ··· hides terms that have powers of h beginning withh3 and derivatives of f beginning with f 00. So we would expect that the magnitude of this difference can be expressed in terms of these.

Also, when the trapezoidal rule is implemented withe many (n) “panels” or steps, the right endpoint of each panel is the left endpoint of the next. That’s where all the 2’s come from in the rule. In the worst case, the errors in each panel will reinforce each other rather than cancel, so the error will be n times something that involves h3 and f 00.

D. DeTurck Math 360 001 2017C: Integral/functions 25 / 28 Single-step error

We use integration by parts to estimate the error incurred in a single panel (u = f , dv = dt, say v = t + A for a tbd constant A):

h h h 0 f (xi−1+t) dt = (t + A)f (xi−1 + t) − (t+A)f (xi−1+t) dt ˆ0 t=0 ˆ0 First concentrate on h

(t + A)f (xi−1 + t) = (h + A)f (xi ) − Af (xi−1) t=0 We choose A = −h/2 so that this is the trapezoidal formula. So we have h h   h h 0 f (xi−1+t) dt− (f (xi−1)+f (xi )) = − t − f (xi−1+t) dt ˆ0 2 ˆ0 2

D. DeTurck Math 360 001 2017C: Integral/functions 26 / 28 Single-step error

So far, our expression for the single-step error is h   h 0 ET = − t − f (xi−1 + t) dt, so we integrate by parts ˆ0 2 again:

 2  h t h 0 ET = − − t + B f (xi−1 + t) 2 2 0 h  2  t h 00 + − t + B f (xi−1 + t) dt ˆ0 2 2 We want to choose B so that the term on the first line is zero. 0 0 That term, expanded, is B(f (xi−1) − f (xi )) so we should choose B = 0. And so now:

h 1 00 ET = (t(t − h))f (xi−1 + t) dt. ˆ0 2

D. DeTurck Math 360 001 2017C: Integral/functions 27 / 28 Single-step error h 1 00 So far, ET = (t(t − h))f (xi−1 + t) dt.. If we were to try and ˆ0 2 integrate by parts again, we would find that we cannot choose the integration constant for dv (i.e., the “C”) to make the first part zero again. So this expression is the best we can do.

Turn this into an estimate by letting M = max |f 00(x)|, so x∈[xi−1,xi ]

h h 3 1 00 M Mh |ET | ≤ | (t(t−h))||f (xi−1+t)| dt ≤ t(t−h) dt = ˆ0 2 2 ˆ0 12 This is the standard formula for the single-step error in the trapezoidal rule. Multiplying this by n for the global estimate, and recalling that h = (b − a)/n gives the standard global error:

3 (b − a) M 00 ET (f , [a, b]) ≤ where M = max |f (x)|. 12n2 x∈[a,b]

D. DeTurck Math 360 001 2017C: Integral/functions 28 / 28