math upper homework-Real analysis due 9 hours later

profiledddddddl
lecture23.pdf

MATH 105A - Fall 2018 - François Monard - UC Santa Cruz 96

Lecture 23 - 11/28 - Taylor Polynomials and approximations.

Second-order Taylor approximation. Back to the problem of locally approximating functions with polynomials, we have seen that if f is of class C1 in a neighbourhood of x0, then the function g(x) = f(x0) + f

′(x0)(x − x0) is the best linear approximation of f near x0 in the sense that f(x) −g(x) = (x−x0)ε(x) for some function ε satisfying limx→x0 ε(x) = 0.

When a function has a second-order derivative, we can consider approximating it with second- order polynomials. If such an approximation must hold generally for all functions, it must hold in particular for second-order polynomials. In this case, a direct calculation shows that if f(x) is a second-order polynomial, then for any x0 ∈ R and any x,

f(x) = f(x0) + f ′(x0)(x−x0) +

1

2 f ′′(x0)(x−x0)2.

This suggests that for a general function f such that f ′′(x0) exists at a point x0, the right-hand side above should be the best quadratic polynomial approximating f near x0. We denote it

T2[f,x0](x) := (x0) + f ′(x0)(x−x0) +

1

2 f ′′(x0)(x−x0)2.

the second-order Taylor polynomial of f at x0.

Theorem 87. If f is of class C2 in a neighborhood of x0, then one may write for x near x0

f(x) = T2[f,x0](x) + o((x−x0)2).

(equivalently, the last term could be written as (x−x0)2η(x), where limx→x0 η(x) = 0) Conversely, if a quadratic polynomial P(x) is such that f(x) = P(x) + o((x−x0)2) for x near x0, then P(x) = T2[f,x0].

Proof. Set F(x) := f(x) −T2[f,x0](x), and we must show that for every ε > 0 there exists δ > 0 such that |x − x0| < δ implies |F(x) − F(x0)| ≤ |x − x0|2ε. Note that by construction F(x0) = F ′(x0) = F

′′(x0) = 0.

Let ε > 0. Since F ′′ is continuous at x0, there exists δ such that |x−x0| < δ implies |F ′′(x)| < ε. Let x ∈ (x0 −δ,x0 + δ). Applying the Mean Value Theorem to F, we have

F(x) = F(x) −F(x0) = F ′(x1)(x−x0),

for some x1 between x and x0 (in particular, |x1 −x0| ≤ |x−x0|). Appling the MVT again to F ′, we have

F ′(x1) = F ′(x1) −F ′(x0) = F ′′(x2)(x1 −x0),

for some x2 between x and x0, in particular, x2 ∈ (x0 − δ,x0 + δ) so |F ′′(x2)| < ε. Piecing it all together, we have

|F(x)| = |F ′′(x2)||x1 −x0||x−x0| < ε|x−x0|2,

hence the proof.

We now prove the converse statement. Suppose P(x) is a quadratic polynomial such that f(x) = P(x) + o((x−x0)2) near x0. By the first part of the theorem, we can write

T2[f,x0](x) −P(x) = (T2[f,x0](x) −f(x)) + (f(x) −P(x)) = o((x−x0)2),

MATH 105A - Fall 2018 - François Monard - UC Santa Cruz 97

since we are summing two o((x−x0)2). Now since T2[f,x0](x)−P(x) is a quadratic polynomial, it can be written as a(x−x0)2 + b(x−x0) + c, and the only way that limx→x0

1 (x−x0)2

(T2[f,x0](x) − P(x)) = 0, is if all coefficients are zero. Therefore P = T2[f,x0].

Conversely, such formulas can be useful to compute derivatives in a fast way: if one can write (by any means other than computing derivatives),

f(x) = a + b(x−x0) + c(x−x0)2 + o((x−x0)2),

then f(x0) = a, f ′(x0) = b and f

′′(x0) = 2c.

Example 52. 1. Near x = 0, f(x) = 1 1−x2 = 1 + x

2 + o(x2). Therefore, f(0) = 1, f ′(0) = 0, and f ′′(0) = 2.

2. Near x = 0, we would like to compute the first two derivatives of f(x) = exp(x)(x + 2)2

at x = 0. Since exp(0) = exp′(0) = exp′′(0) = 1, we can immediately write exp(x) = 1 + x + 1

2 x2 + o(x2). Therefore,

f(x) = exp(x)(x + 2)2 = (1 + x + 1

2 x2 + o(x2))(4 + 4x + x2)

= 4 + 8x + 7x2 + o(x2),

and we can therefore read immediately that f(0) = 4, f ′(0) = 8 and f ′′(0) = 14.

Higher-order derivatives and Taylor polynomials. We can define differentiability k times as follows: we already treated k = 1, 2 and denote f(1) = f ′ and f(2) = f ′′. If f is k-times differentiable and f(k) is differentiable at x0, we say that f is k + 1 times differentiable at x0 and

call f(k+1)(x0) = (f (k))′(x0) = limh→0

f(k)(x0+h)−f(k)(x0) h

. If f(k)(x) exists for some k and for all x on an interval I, we say that f is k times continuously differentiable on I (or of class Ck on I).

When f is of class Ck in the neighborhood of x0, we define the n-th Taylor polynomial of f at x0, by

Tn[f,x0](x) := f(x0) + f ′(x0)(x−x0) + f ′′(x0)/2(x−x0)2 + · · · + f(n)(x0)/n!(x−x0)n

=

n∑ k=0

f(k)(x0)

k! (x−x0)k.

Theorem 88 (Taylor’s theorem). If f is of class Ck in a neighborhood of x0, then

f(x) = Tn[f,x0](x) + o((x−x0)n).

Conversely, if a polynomial P(x) of degree n is such that f(x) = P(x) + o((x − x0)n) for x near x0, then P(x) = Tn[f,x0].

Proof. The proof is a generalization of Theorem 87.

Note that if f is a polynomial, then for any x0 ∈ R and x ∈ R, f(x) = Tn[f,x0](x).

MATH 105A - Fall 2018 - François Monard - UC Santa Cruz 98

Example 53. 1. If f(x) = 3x2 + 2x− 5, then

T2[f, 1](x) = f(1) + f ′(1)(x− 1) +

f ′′(1)

2 (x− 1)2 = 8(x− 1) + 3(x− 1)2.

2. If f(x) = exp(x), then for any n ∈ N, f(n)(0) = exp(0) = 1. Therefore the Taylor polynomial is given by Tn[exp, 0](x) =

∑n k=0

xk

k! .

3. If f(x) = sin x,

T3[sin, 0](x) = sin 0 + (sin ′ 0(x)) +

sin′′ 0

2 x2 +

sin(3) 0

6 x3 = x−

x3

6 .

Taylor Expansions. While Taylor’s theorem gives us an explicit expression for the polynomial which best approximates a given function near x0, this does not mean that one should always compute it by computing derivatives. Many tricks are useful for such computations, a combination of known expansions and algebraic rules, none of which requiring to compute the derivatives of the full function.

Example 54. For each function below, find a Taylor expansion to order 2 at x0 = 0.

1. f(x) = (sin x)(x + 1)4. Knowing that sin 0 = sin′′ 0 = 0 and sin′ 0 = 1, we first write a Taylor expansion of sin x = x + o(x2), therefore we are left computing

f(x) = (sin x)(x + 1)4 = (x + o(x2))(1 + 4x + 6x2 + o(x2)) = x + 4x2 + o(x2),

after expanding and using the rules xpo(xq) = o(xp+q). Note that all the terms of the form o(x3) and up are all dumped into o(x2).

2. f(x) = 1 1−x. Here we know that for |x| < 1, the geometric series gives

1 1−x = 1 + x + x

2 + . . . In particular,

1

1 −x = 1 + x + x2 +

x3

1 −x = 1 + x + x2 + o(x2).

3. f(x) = ex 2+1. One could write the definition of the exponential ex

2+1 = ∑∞

k=0 (x2+1)k

k! , only

to realize that each term in the sum will have a contribution to T2[f, 0]. On the other hand, one could write

ex 2+1 = e ·ex

2 = e(1 + x2 + o(x2)),

and thus e + ex2 is the desired answer.

4. When x0 6= 0, note that writing a Taylor expansion of f(x) near x = x0 is the same as writing a Taylor expansion of the function h 7→ f(x0 + h) near h = 0. For example, to write a Taylor expansion of 1

x near x = 2 is the same as writing an expansion of 1

2+h near h = 0. For this

we exploit a geometric series again:

1

2 + h =

1

2

1

1 + h/2 =

1

2

( 1 −

h

2 + h2

4 + o(h2)

) ,

where in the last equality, we have used the formula 1 1+u

= 1−u + u 2

2 + . . . whenever |u| < 1.

Equivalently,

1

x =

1

2 − x− 2

4 +

(x− 2)2

8 + o((x− 2)2) near x = 2.

MATH 105A - Fall 2018 - François Monard - UC Santa Cruz 99

Exercises for Lecture 23:

1. Compute the Taylor expansions to order 3 for each of the following functions at the points x0 = 0 and x0 = 1:

(a) f(x) = (x2 + 1)25.

(b) f(x) = x x2+1

.

(c) f(x) = (1 + x + 2x2)(sin x)2.

(d) f(x) = √ x + 1.

2. Let f of class Cn near x0 with n ≥ 1. Show that (Tn[f,x0])′(x) = Tn−1[f ′,x0](x).

3. Reasoning on Taylor polynomials, prove Leibniz’ rule: given f,g of class Cn at x0, then f ·g is of class Cn at x0 and

(f ·g)(n)(x0) = n∑ k=0

( n

k

) f(k)(x0)g

(n−k)(x0).

[Hint: (f·g)(n)(x0) is n! times the coefficient of (x−x0)n in the product Tn[f,x0](x)Tn[g,x0](x)]

4. (a) Show that if f(x) = 1/(1 + x), then Tn[f, 0](x) = ∑n

k=0(−1) kxk.

(b) Deduce Tn[g, 0](x) for g(x) = ln(1 + x). [hint: g ′(x) = ?]

(c) Find Tn[g, 0](x) if g(x) = tan −1(x).

5. Let f(x) = exp(−1 x ) for x > 0 and f(x) = 0 for x < 0.

(a) Show that f can be extended into a continuous function at x = 0 with the value f(0) = 0.

(b) For x > 0, prove by induction that for any n ∈ N, there exists a polynomial Pn such that f(n)(x) = Pn(

1 x ) exp(−1

x ). Deduce that limx→0+ f

(n)(x) = 0 and therefore, f(n) can be extended continuously at x = 0 with the value 0.

(c) Deduce that Tn[f, 0](x) = 0 for any n ∈ N.