27
Taylor and Maclaurin Series P. Sam Johnson March 28, 2019 P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 1 / 27

Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

  • Upload
    others

  • View
    16

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Taylor and Maclaurin Series

P. Sam Johnson

March 28, 2019

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 1 / 27

Page 2: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Overview

In this lecture we see how functions that are infinitely differentiablegenerate power series called Taylor series.

In many cases, these series can provide useful polynomialapproximations of the generating functions.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 2 / 27

Page 3: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Series Representations

We know that within its interval of convergence the sum of a power seriesis a continuous function with derivatives of all orders.

But what about the other way around?

If a function f (x) has derivatives of all orders on an interval I , can itbe expressed as a power series on I ?

And if it can, what will its coefficients be?

We can answer the last question readily if we assume that f (x) is the sumof a power series

f (x) =∞∑n=0

an(x − a)n

= a0 + a1(x − a) + a2(x − a)2 + · · ·+ an(x − a)n + · · ·

with a positive radius of convergence.P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 3 / 27

Page 4: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Series Representations

By repeated term-by-term differentiation within the interval ofconvergence I we obtain

f ′(x) = a1 + 2a2(x − a) + 3a3(x − a)2 + · · ·+ nan(x − a)n−1 + · · ·f ′′(x) = 1.2a2 + 2.3a3(x − a) + 3.4a4(x − a)2 + · · ·f ′′′(x) = 1.2.3a3 + 2.3.4a4(x − a) + 3.4.5a5(x − a)2 + · · ·

With the nth derivate, for all n, being

f (n)(x) = n!an + a sum of terms with (x − a) as a factor.

Since these equations all hold at x = a,we have

f ′(a) = a1

f ′′(a) = 1.2a2

f ′′′(a) = 1.2.3a3....

f (n)(a) = n!an.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 4 / 27

Page 5: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Series Representations

These formulas reveal a pattern in the coefficient of any power series

∞∑n=0

an(x − a)n

that converges to the values of f on I (“represents f on I ”). If there issuch series (still an open question), then there is only one such series andits nth coefficient is

an =f (n)(a)

n!.

If f has a series representation, then the series must be

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

2!(x−a2)+ · · ·+ f (n)(a)

n!(x−a)n + · · · (1)

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 5 / 27

Page 6: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Series Representations

But if we start with an arbitrary function f that is infinitely differentiableon an interval I centered at x = a and use it to generate the series inEquation (1), will the series then converge to f (x) at each x in the interiorof I ?

The answer is maybe – for some functions it will but for other functions itwill not, as we will see.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 6 / 27

Page 7: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Taylor and Maclaurin Series

Definition 1.

Let f be a function with derivatives of all orders throughout some intervalcontaining a as an interior point. Then the Taylor series generated by fat x = a is

∞∑k=0

f (k)(a)

k!(x − a)k = f (a) + f ′(a)(x − a) +

f ′′(a)

2!(x − a)2 + · · ·+

f (n)(a)

n!(x − a)n + · · ·

The Maclaurin series generated by f is

∞∑k=0

f (k)(0)

k!xk = f (0) + f ′(0)x +

f ′′(0)

2!x2 + · · ·+ f (n)(0)

n!xn + · · · ,

the Taylor series generated by f at x = 0.

The Maclaurin series generated by f is often just called the Taylor series off .

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 7 / 27

Page 8: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding a Taylor Series

Example 2.

Find the Taylor series generated by f (x) = 1/x at a = 2. Where, ifanywhere, does the series converge to 1/x?

We need to find f (2), f ′(2), f ′′(2), · · · . Taking derivatives we get

f (x) = x−1, f (x) = 2−1 = 12,

f ′(x) = −x−2, f ′(2) = − 122,

f ′′(x) = 2!x−3,f ′′(2)3!

= 2−3 = 123,

f ′′′(x) = −3!x−4,f ′′′(2)

3!= − 1

24,

......

f n)(x) = (−1)nn!x−(n+1),f (n)(2)

n!= (−1)n

2n+1 .

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 8 / 27

Page 9: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding a Taylor Series

The Taylor series is

f (2) + f 6′(2)(x − 2) + f ′′(2)2! (x − 2)2 + · · ·+ f (n)(2)

n! (x − 2)2 + · · ·

= 12 −

(x−2)22

+ (x−2)223− · · ·+ (−1)n (x−2)n

2n+1 + · · · .

This is a geometric series with first term 1/2 and ratio r = −(x − 2)/2. Itconverges absolutely for |x − 2| < 2 and its sum is

1/2

1 + (x − 2)/2=

1

2 + (x − 2)=

1

x.

In this example the Taylor series generated by f (x) = 1/x at a = 2converges to 1/x for |x − 2| < 2 or 0 < x < 4.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 9 / 27

Page 10: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Taylor Polynomials

The linearizion of a differentiable function f at a point a is the polynomialof degree one given by

P1(x) = f (a) + f ′(a)(x − a).

If f has derivatives of higher order at a, then it has higher-orderpolynomial approximations as well, one for each available derivative.

These polynomials are called the Taylor polynomials of f .

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 10 / 27

Page 11: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Taylor Polynomial of order n

Definition 3.

Let f be a function with derivatives of order k for k = 1, 2, . . . ,N in someinterval containing a as an interior point. Then for any integer n from 0through N, the Taylor polynomial of order n generated by f at x = a isthe polynomial

Pn(x) = f (a) + f ′(a)(x − a) +f ′′(a)

2!(x − a)2 + · · ·+

f (k)(a)

k!(x − a)k + · · ·+

f (n)(a)

n!(x − a)n.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 11 / 27

Page 12: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Taylor Polynomial of order n

We speak of a Taylor polynomial of order n rather than degree n becausef (n)(a) may be zero.

The first two Taylor polynomials of f (x) = cos x at x = 0, for example, areP0(x) = 1 and P1(x) = 1.

The first-order Taylor polynomial has degree zero, not one.

Just as the linearization of f at x = a provides the best linearapproximation of f in the neighborhood of a, the higher-order Taylorpolynomials provide the best polynomial approximations of thier respectivedegrees.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 12 / 27

Page 13: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Example 4 (Finding Taylor Polynomials for ex).

Find the Taylor series the Taylor polynomials generated by f (x) = ex atx = 0.

Solution : Since f (x) = ex , f ′(x) = ex , . . . , f (n)(x) = ex , . . . , wehave f (0) = e0 = 1, f ′(0) = 1, . . . , f (n)(0) = 1, . . ..

The Taylor series generated by f at x = 0 is

f (0) + f ′(0)x +f ′′(0)

2!+ · · ·+

f (n)(0)

n!xn + · · · = 1 + x +

x2

2+ · · ·+

xn

n!+ · · ·

=∞∑k=0

xk

k!.

This is also the Maclaurin series for ex . We will later see that theseries converges to ex at every x .

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 13 / 27

Page 14: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

The Taylor polynomial of order n at x = 0 is

Pn(x) = 1 + x +x2

2+ · · ·+ xn

n!.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 14 / 27

Page 15: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding Taylor Polynomials for cos x

Example 5.

Find the Taylor series and Taylor polynomials generated by f (x) = cos x atx = 0.

Solution : The cosine and its derivatives are

f (x) = cos x , f ′(x) = − sin x ,

f ′′(x) = − cos x , f (3)(x) = sin x ,

f (2n)(x) = (−1)n cos x , f (2n+1)(x) = (−1)n+1 sin x .

At x = 0, the cosines are 1 and the sines are 0, so

f (2n)(0) = (−1)n, f (2n+1)(0) = 0.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 15 / 27

Page 16: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding Taylor Polynomials for cos x

The Taylor series generated by f at 0 is

f (0) + f ′(0)x + f ′′(0)2! x2 + f ′′′(0)

3! x3 + · · ·+ f (n)(0)n! xn + · · ·

= 1 + 0.x − x2

2! + 0.x3 + x4

4! + · · ·+ (−1)n x2n

(2n)! + · · ·

=∞∑k=0

(−1)kx2k

(2k)!

This is also the Maclaurin series for cos x. We will see that the seriesconverges to cos x at every x .

Because f (2n+1)(0) = 0, the Taylor polynomials of orders 2n and 2n + 1are identical:

P2n(x) = P2n+1(x) = 1− x2

2! + x4

4! − · · ·+ (−1)n x2n

(2n)! .

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 16 / 27

Page 17: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding Taylor Polynomials for cos x

The following figure shows how well these polynomials approximatef (x) = cos x near x = 0. Only the right-hand portions of the graphs aregiven because the graphs are symmetric about the y-axis.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 17 / 27

Page 18: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

A Function f Whose Taylor Series Converges at Every xbut Converges to f (x) Only at x = 0

The following example shows that there is a function f whose Taylor seriesconverges at every x but converges to f (x) only at x = 0.

Example 6.

It can be shown (though not easily) that

f (x) =

{0, x = 0

e−1/x2, x 6= 0

has derivatives of all orders at x = 0 and that f (n)(0) = 0 for all n.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 18 / 27

Page 19: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

A Function f Whose Taylor Series Converges at Every xbut Converges to f (x) Only at x = 0

This means that the Taylor series generated by f at x = 0 is

f (0) + f ′(0)x +f ′′(0)

2!x2 + · · ·+

f (n)(0)

n!xn + · · · = 0 + 0.x + 0.x2 + · · ·+ 0.xn + · · · = 0.

The series converges for every x (its sum is 0) but converges to f (x) onlyat x = 0.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 19 / 27

Page 20: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Some questions

Two questions still remain

1. For what values of x can we normally expect a Taylor series toconverge to its generating function?

2. How accurately do a function’s Taylor polynomials approximate thefunction on a given interval?

The answers are provided by a theorem of Taylor, which will be discussednext.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 20 / 27

Page 21: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding Taylor Polynomials

Exercise 7.

In the following exercises, find the Taylor polynomials of orders 0, 1, 2, and3 generated by f at a.

1. f (x) = ln x . a = 1

2. f (x) = 1/(x + 2), a = 0

3. f (x) = sin x , a = π/4

4. f (x) =√

x , a = 4

5. f (x) =√

x + 4, a = 0

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 21 / 27

Page 22: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding Taylor Series at x=0 (Maclaurin Series)

Exercise 8.

Find the Maclaurin series for the function in the following exercises.

1. e−x

2. 11−x

3. sin x2

4. 7 cos(−x)

5. sinh x = ex−e−x

2

6. x4 − 2x3 − 5x + 4

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 22 / 27

Page 23: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Finding Taylor Series

Exercise 9.

In the following exercises, find the Taylor series generated by f at x = 0.

1. f (x) = x3 − 2x + 4, a = 2

2. f (x) = x4 + x2 + 1, a = −2

3. f (x) = 3x5 − x4 + 2x3 + x2 − 2, a = −1

4. f (x) = x/(1− x), a = 0

5. f (x) = ex , a = 2

6. f (x) = 2x , a = 1

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 23 / 27

Page 24: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Exercise

Exercise 10.

(a) Use the Taylor series generated by ex at x = a to show that

ex = ea[1 + (x − a) +

(x − a)2

2!+ · · ·

].

(b) Find the Taylor series generated by ex at x = 1. Compare your answerwith the formula in the above exercise.

(c) Let f (x) have derivatives through order n at x = a. Show that theTaylor polynomial of order n and its first n derivatives have the samevalues that f and its first n derivatives have at x = a.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 24 / 27

Page 25: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Of all polynomials of degree ≤ n, the Taylor polynomial oforder n gives the best approximation

Exercise 11.

Suppose that f (x) is differentiable on an interval centered at x = a andthat g(x) = b0 + b1(x − a) + · · ·+ bn(x − a)n is a polynomial of degree nwith constant coefficient b0, . . . , bn. Let E (x) = f (x)− g(x). Show that ifwe impose on g conditions

(a) E (a) = 0 (the approximation error is zero at x = a )

(b) limx→aE(x)

(x−a)n = 0 (the error is negligible when compare to (x − a)n)

then

g(x) = f (a) + f ′(a)(x − a) +f ′′(a)

2!(x − a)2 + · · ·+ f (n)(a)

n!(x − a)n.

Thus, the Taylor polynomial Pn(x) is the only polynomial of degree lessthan or equal to n whose error is both zero at x = a and negligible whencompared with (x − a)n.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 25 / 27

Page 26: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

Quadratic Approximations

Exercise 12.

The Taylor polynomial of order 2 generated by a twice-differentiablefunction f (x) at x = a is called the quadratic approximation of f atx = a. Find the

(a) linearizion (Taylor polynomial of order 1) and

(b) quadratic approximation of f at x = 0.

in the following exercises.

1. f (x) = ln(cos x)

2. f (x) = esin x

3. f (x) = 1/√

1− x2

4. f (x) = cosh x

5. f (x) = sin x

6. f (x) = tan x

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 26 / 27

Page 27: Taylor and Maclaurin Series - National Institute of Technology … and Maclaurin... · Overview In this lecture we see how functions that are in nitely di erentiable generate power

References

1. M.D. Weir, J. Hass and F.R. Giordano, Thomas’ Calculus, 11thEdition, Pearson Publishers.

2. N. Piskunov, Differential and Integral Calculus, Vol I & II (Translatedby George Yankovsky).

3. S.C. Malik and Savitha Arora, Mathematical Analysis, New AgePublishers.

4. R. G. Bartle, D. R. Sherbert, Introduction to Real Analysis, WileyPublishers.

P. Sam Johnson (NIT Karnataka) Taylor and Maclaurin Series March 28, 2019 27 / 27