<<

Lecture 18: Taylor’s approximation revisited

Some time ago, we proved

Theorem Let f be a on an interval [a, b] and c a point in the interior of the interval. Suppose that f is n−2 times continuously differentiable on [a, b], that the n−1st of f exists everywhere on the interior of (a, b) and that the nth derivative of f exists at c. Then f (n)(c) f(x) = f(c) + f 0(c)(x − c) + ... + (x − c)n + o((x − c)n). n!

With the fundamental theorem of in hand, the proof is much easier to give, so we review it.

Proof We prove this by induction on n, the base case being n = 2. We know from the definition of the derivative f 00)(c) of f 0 that f 0(x) = f 0(c) + (x − c)f 00(c) + o(x − c). Now, we use the fundamental theorem of calculus to obtain f(x) − f(c) Z x f 0(y)dy c Z x . (f 0(c) + (y − c)f 00(c)(y − c) + o(y − c))dy c f 00(c) = f 0(c)(x − c) + (x − c)2 + o((x − c)2) 2

Having obtained the base case, we are now ready to do the induction. We assume the theorem for n − 1. Now under the hypotheses, we can Taylor approximate the first derivative n−1 X f (j+1)(c) f 0(x) = (x − c)j + o((x − c)n−1). j! j=0 Now, we repeat the proof of the base case, with this new information f(x) − f(c) Z x f 0(y)dy c n−1 Z x X f (j+1)(c) ( (y − c)j + o((y − c)n−1).)dy j! c j=0 n−1 X f (j+1)(c) = (x − c)j+1 + o((x − c)n). (j + 1)! j=0

1 (n) 0 f (c) n The expression in the Theorem, f(c) + f (c)(x − c) + ... + n! (x − c) is referred to as the Taylor of f at c. It is, of course, a polynomial of degree n which approximates f at c. We know that the error is o((x − c)n) so that it is getting small quite fast as x approaches c. But, of course, the definition of o(.) involves a , and we don’t know how fast that limit converges. We saw an application where we might need that information last time. We used Taylor’s approximation to develop numerical methods of integration, but we don’t know yet exactly what the errors depend on, so we don’t yet have a good method of predicting what step size we would need to get a respectable approximation of the . We rectify this now. We will need to use integration by parts. Lemma Let f and g be once continuously differentiable functions on the interval [a, b] then Z b (f 0(x)g(x) + f(x)g0(x))dx = f(b)g(b) − f(a)g(a). a

Proof Just apply the to convert the integral to

Z b d (f(x)g(x))dx, a dx and apply the fundamental theorem of calculus.

Theorem (Taylor’s theorem with remainder) Assume f is n + 1 times continu- ously differentiable in the interval [a, b] having c in the interior. Then for every x ∈ [a, b] we have n X f (j)(c) f(x) = (x − c)j + R (x), j! n j=0 with Z x 1 n (n+1) Rn(x) = (x − y) f (y)dy. n! c

Here the expression Rn(x) is referred as the remainder in the nth Taylor approximation of f at a. Proof We will prove this, of course, by induction. The base case, n = 0 is nothing more than the fundamental theorem of calculus, so we will assume that

Z x 1 n (n+1) Rn(x) = (x − y) f (y)dy, n! c and we will try to calculate Rn+1 under the assumption that f has n + 2 continuous . We observe that as long as the result holds

f (n+1)(c) R (x) = R (x) − (x − c)n+1. n+1 n (n + 1)!

2 Now we combine this with the induction hypothesis, taking the n + 1 factor from the n+1 n+1 (x−c) R x n denominator to turn (x−c) into an integral from c to x, namely n+1 = c (x−y) dy

Rn+1(x) 1 Z x f (n+1)(c) Z x = (x − y)nf (n+1)(y)dy − (x − y)ndy n! c n! c 1 Z x = (x − y)n(f (n+1)(y) − f (n+1)(c))dy n! c 1 Z x = (x − y)n+1f (n+2)(y)dy. (n + 1)! c

Here, the last is by integration by parts. We integrate (x − y)n and differentiate f (n+1)(y) − f (n+1)(c). Note that the boundary terms vanish since (x − y)n vanishes at y = x and f (n+1)(y) − f (n+1)(c) vanishes at y = c.

Having this remarkable formula for Rn, we look for a way to apply it. We first write down a general result about of continuous functions which is in analogy with the .

Theorem (Mean Value theorem for integrals) Let f and g be continuous func- tions on [a, b]. Assume that g never changes sign on [a, b]. Then there is c ∈ (a, b) so that Z b Z b f(x)g(x)dx = f(c) g(x)dx. a a

Proof Let R b f(x)g(x)dx M = a . R b a g(x)dx Suppose that every on (a, b), we have that f(x) < M. Then

Z b Z b f(x)g(x)dx < M g(x)dx, a a which is a contradiction. Similarly, it is not the case that f(x) > M for every x in (a, b). Then since f is continuous, by the intermediate value theorem, there must be c so that f(c) = M.

We now apply this mean value theorem for integrals to our expression for the remainder in Taylor’s approximation. Z x 1 n (n+1) Rn(x) = (x − y) f (y)dy. n! c

3 Observe that 1 Z x 1 (x − y)ndy = (x − c)n+1. n! c (n + 1)! Thus we observe that there is some d between c and x so that

f (n+1)(d)(x − c)n+1 R (x) = . n (n + 1)!

We conclude

n X f (j)(c) f (n+1)(d)(x − c)n+1 f(x) = (x − c)j + . j! (n + 1)! j=0

If, as last time, we begin with an a priori estimate for the (n + 1)st derivative, we obtain an estimate for the error term.

4