<<

1

Lecture 18

Linear approximation & Taylor’s formula

Layali Al-Mashhadani E-post: [email protected]

MAA149, Spring 2019 Mälardalen University 14 Mars, 2019

Contents of the lecture 1. Linear Approximations 1.1 Error Analysis 2. Taylor and Maclaurin Polynomials

2

3. Linear Approximations

Linear Approximation (or Line Approximation): To estimate the value of a near a certain known point, x =a, on its graph by substituting its tangent line in its place. Such a simplification is usually good only for a small interval around the given point, that is, when x is close to a.

Suppose given a function 푓(푥), and suppose (푥표 , 푦표) = (푎, 푓 (푎)) is a known point on the graph of 푓(푥). Then the line tangent to the graph 푦 = 푓 (푥) at a has = 푓 ′(푎). Therefore, the point-slope form of the of tangent line is

푓(푥) = 푓 (푎) + 푓 ′(푎) (푥 − 푎)

That is, when x is near a , 푓 (푥) ≈ 푓 (푎) + 푓 ′(푎) (푥 − 푎).

The expression

퐿(푥) = 푓 (푎) + 푓 ′(푎) (푥 − 푎) is called the linearization of 푓 (푥) at a.

In the picture, the tangent line to 푦 = 푥1/3 at 푥 = 8 is viewed as an approximation to the original curve.

푦 = 퐿(푥) is the equation of the tangent line.

The error is the difference 퐿(푥) − 푥1/3 between the approximate and correct values

푬풓풓풐풓 (푬(풙)) = 풕풓풖풆 풗풂풍풖풆 – 풂풑풑풓풐풙풊풎풂풕풆 풗풂풍풖풆

Theorem Suppose that 푦 = 푓 (푥) is a differentiable curve at 푥 = 푎. Then the tangent line at 푥 = 푎 has equation 푦 = 푓(푥) = 푓 (푎) + 푓 ′(푎) (푥 − 푎)

3

We call the above equation the linear approximation or linearization of 푦 = 푓 (푥) at the point (푎, 푓 (푎)) and write

푓 (푥) ≈ 퐿(푥) = 푓 (푎) + 푓 ′(푎) (푥 − 푎). Example 1

Consider the cube root function above: 푦 = 푓 (푥) = 3√푥. We approximate near 푥 = 8.

We have

1 1 푓(8) = 2, and 푓′(푥) = 푥−2/3 ⇒ 푓′(8) = 3 12

The linear approximation is

퐿(푥) = 푓 (8) + 푓 ′(8) (푥 − 8).

This can be used, for example, to approximate cube roots without using a calculator: e.g.

3√8 = 2 + 0.00833 = 2.00833

Example 2

Find an approximation to √15

Solution

Since 15 is much closer to 16 than to 9, we expect that the approximation 3.875 is the superior estimate. Using the calculator, √15 = 3.873

Errors The error in an approximation 푓 (푥) _ 퐿푎(푥) is the difference 퐸푎(푥) = 퐿푎(푥) − 푓 (푥). In the above example, the errors using the two approximations, are

4

퐸9(15) = 0.127, and 퐸16(15) = 0.002

1.1 Error Analysis

For any approximation error = true value − approximate value

The error in approximating f(x) by its linearization L(x) about x = a is denoted E1(x)

퐸1(푥) = 푓(푥) − 퐿(푥) = 푓(푥) − 푓(푎) − 푓′(푎)(푥 − 푎):

It is the vertical distance at x between the graph of f and the tangent line to that graph at x = a, as shown in the figure:

5

Theorem

(An error formula for linearization)

If 푓 ′′(푡) exists for all 푡 in an interval containing 푎 and 푥, then there exists some point 푋 between 푎 and 푥 such that the error 퐸1(푥) = | 푓(푥) − 퐿(푥)| in the linear approximation

푓(푥) ≈ 퐿(푥) = 푓(푎) + 푓 ′ (푎)(푥 − 푎)

Satisfies

푓′′(푋) 퐸(푥) = (푥 − 푎)2 2

The following three corollaries are consequences of the last theorem:

6

Example 3

i. Use the linearization for √푥 about 푥 = 25 to find an approximate value for √26

ii. Determine the sign and estimate the size of the error in the approximation √26 solution

i.

ii.

7

2. Taylor’s formula

The tangent line approximation of 푓 (푥) for 푥 near 푎 is called the first degree Taylor Polynomial of 푓 (푥) and is: 푃1(푥) = 퐿(푥) = 푓 (푎) + 푓 ′(푎) (푥 − 푎)

We can obtain even better approximation to 푓(푥) by using quadratic or higher degree polynomials at 푥 = 푎, if 푓(푥) is twice differentiable near 푥 = 푎, then the polynomial is

푓′′(푎) 푃 (푥) = 푓 (푎) + 푓′(푎)(푥 − 푎) + (푥 − 푎)2 2 2

Taylor polynomial of the third degree is given by:

푓′′(푎) 푓′′′(푎) 푃 (푥) = 푓 (푎) + 푓′(푎)(푥 − 푎) + (푥 − 푎)2 + (푥 − 푎)3 3 2 3

In general if 푓(푥) be a function with of all orders throughout some interval containing 푎 as an interior point. Then the at 푥 = 푎 is given by:

푓′(푎) 푓′′(푎) 푃 (푥) = 푓 (푎) + (푥 − 푎)1 + (푥 − 푎)2 푛 1! 2!

푓′′′(푎) + (푥 − 푎)3 + …. 3!

푓푛(푎) + (푥 − 푎)푛 푛!

The error 퐸푛(푥) = 푓(푥) − 푃푛(푥) in the approximation 푓(푥) ≈ 푃푛(푥) is called the Error bound or Lagrange Remainder and given by:

푓(푛+1)(푋) 퐸 (푥) = (푥 − 푎)푛+1 푛 (푛 + 1)!

Where X is some between a and x

Examples 4

Find the following Tylor polynomial:

(a) 푃2(푥) for 푓(푥) = √푥 about 푥 = 25, then use it to approximate √26 and estimate the size of the error, and then specify the interval that you can be sure contains √26.

(b) 푃3(푥) for 푓(푥) = ln 푥 about 푥 = 푒

8

Solution

푓′(25) 푓′′(25) (a) 푃 (푥) = 푓 (25) + (푥 − 25)1 + (푥 − 25)2 2 1! 2!

푓 (25) = √25 = 5

1 1 1 푓′ (푥) = 푓′ (25) = = 2 √푥 2 √25 10

3 1 − 1 1 1 1 1 1 1 푓′′ (푥) = − 푥 2 푓′′ (25) = − = − . = − . = − 4 4 3 4 3 4 125 500 푥2 (52)2 So, 1 1 − 푃 (푥) = 5 + (푥 − 25)1 + 500 (푥 − 25)2 2 10 2!

1 1 푃 (푥) = 5 + (푥 − 25)1 + (푥 − 25)2 2 10 1000

The required approximation is then:

1 1 √26 = 푓(26) ≈ 푃 (26) = 5 + (26 − 25)1 + (26 − 25)2 = 5.099 2 10 1000

The error in a Taylor approximation 풇(ퟐퟔ) ≈ 푷ퟐ(ퟐퟔ) is given by:

푓′′′(25) 퐸 (26) = (26 − 25)3 2 3!

3 3 3 3 푓′′′ (푥) = 푥−5/2 푓′′′ (25) = (25)−5/2 = = 8 8 8 × 55 8 × 3125

3 3 퐸 (26) = |푓′′′ (푋)| ≤ = = 0.00002 푓표푟 25 < 푋 < 26 2 8 × 3125 50,000

The interval that contains √ퟐퟔ is:

(5.099 − 0.00002, 5.099 + 0.00002) = (5.09898, 5.09902)

푓′(푒) 푓′′(푒) 푓′′′(푒) (b) 푃 (푥) = 푓 (푒) + (푥 − 푒)1 + (푥 − 푒)2 + (푥 − 푒)3 3 1! 2! 3!

푓 (푒) = ln 푒 = 1

1 1 푓′ (푥) = 푓′ (푒) = 푥 푒

1 1 푓′′ (푥) = − 푓′′ (푒) = − 푥2 푒2

1 1 푓′′′ (푥) = 2 푓′′′ (푒) = 2 푥3 푒3 9

So, 푓′(푒) 푓′′(푒) 푓′′′(푒) 푃 (푥) = 푓 (푒) + (푒 − 푎)1 + (푥 − 푒)2 + (푥 − 푒)3 3 1! 2! 3!

1 1 1 1 푃 (푥) = + (푒 − 푎)1 − (푥 − 푒)2 + (푥 − 푒)3 3 푥 푒 2푒2 3푒3

2. Taylor and Maclaurin Polynomials

Some Common Maclaurin Series with Errors in Big -O Form

As 푥 → 0:

1 = 1 + 푥 + 푥2 + 푥3 + ⋯ + 푥푛 + 푂(푥푛+1) 1 − 푥

1 1 = = 1 − 푥 + 푥2 − 푥3 + ⋯ + (−1)푛+2푥푛 + 푂(푥푛+1) 1 + 푥 1 − (−푥)

푥2 푥3 푥푛 ln(1 + 푥) = 푥 − + − ⋯ + (−1)푛−1 + 푂(푥푛+1) 2 3 푛

푥2 푥3 푥푛 ln(1 − 푥) = ln(1 − (−푥)) = − 푥 − − − ⋯ + − + 푂(푥푛+1) 2 3 푛

푥2 푥3 푥푛 푒푥 = 1 + 푥 + + + ⋯ + + 푂(푥푛+1) 2! 3! 푛!

푒푎푥 = 푒푎(푥−1+1) = 푒푎. 푒푎(푥−1) =

(푎(푥 − 1))2 (푎(푥 − 1))3 (푎(푥 − 1))푛 푒푎[1 + 푎(푥 − 1) + + + ⋯ + + 푂(푥푛+1) 2! 3! 푛!

푥3 푥5 푥(2푛+1) sin 푥 = 푥 − + − ⋯ + (−1)푛 + 푂(푥2푛+3) 3! 5! (2푛 + 1)!

푥2 푥4 푥2푛 cos 푥 = 1 − + − ⋯ + (−1)푛 + 푂(푥2푛+2) 2! 4! (2푛)!

푥3 푥5 푥(2푛+1) tan−1 푥 = 푥 − + − ⋯ + (−1)푛 + 푂(푥2푛+3) 3 5 2푛 + 1

10

Big-O Notation

Suppose you have a function 푓(푥) with 푓(푎) = 0 and you want to consider how quickly the function goes to zero around 푎. Then ideally you would want to find a simple function 푔 (for example 푔(푥) = (푥 − 푎)푛 ) which also vanishes at a such that 푔 and 푓 are almost equal around a. The big-O notation tries to express something like this, but only states that 푓 goes to zero faster than 푔.

Definition

We write 푓(푥) = 푂( 푢(푥) ) as 푥 → 푎 (read is big -Oh of 푢(푥) as x approaches a) provided that |푓(푥)| ≤ 퐾|푢(푥)| holds for some constant K on some open interval containing 푥 = 푎.

Similarly, 푓(푥) = 푔(푥) + 푂( 푢(푥) ) as 푥 → 푎 if 푓(푥) − 푔(푥) = 푂( 푢(푥) ) as 푥 → 푎, that is, if

|푓(푥) − 푔(푥)| ≤ 퐾|푢(푥)| 푛푒푎푟 푥 = 푎

For example 푠푖푛 푥 = 푂(푥) as 푥 → 0 because |푠푖푛 푥| ≤ |푥| near 0.

Another Example 푥3 푠푖푛 푥 − 푥 = 푂(푥3) 푎푠 푥 → 0 since 푃 (푥) for 푠푖푛 푥 is 푥 − , 3 3! Thus, we write 푠푖푛 푥 = 푥 + 푂(푥3) as 푥 → 0. 푥3 Using 푃 (푥) we get 푠푖푛 푥 = 푥 − + 푂(푥5) as 푥 → 0. 5 3!

The following properties of the big-O notation

1. If 푓(푥) = 푂( 푢(푥)) as 푥 → 푎, then 퐶푓(푥) = 푂( 푢(푥) ) as 푥 → 푎 for any value of the constant C.

2. If 푓(푥) = 푂( 푢(푥) ) as 푥 → 푎 and 푔(푥) = 푂( 푢(푥) ) as 푥 → 푎, then f(푥) ± 푔(푥) = 푂 ( 푢(푥) ) as 푥 → 푎.

3. If 푓(푥) = 푂( (푥 − 푎)푘 푢(푥) ) as 푥 → 푎, then 푓(푥)/(푥 − 푎)푘 = 푂( 푢(푥)) as 푥 → 푎 for any constant 푘.

(푛+1) Taylor's Theorem says that if 푓 (푡) exists on an interval containing 푎 and 푥, and if 푃푛 is the nth- order Taylor polynomial for 푓 at 푎,

푛+1 then, as 푥 → 푎, 푓(푥) = 푃푛(푥) + 푂( (푥 − 푎) )

This is a statement about how rapidly the graph of the Taylor polynomial 푃푛(푥) approaches that of 푓(푥) as 푥 → 푎.

11

Examples 5

(a) Write the indicated case of Taylor’s formula and find the Lagrange Remainder of

푓(푥) = sin 푥 푎 = 0, 푛 = 7

Solution

푥3 푥5 푥7 sin 푥 = 푥 − + − + 푅 (푥) 3! 5! 7! 7

The Lagrange remainder for some c between 0 and x is:

푓8(푐) 푓8(푐) 푅 (푥) = (푥 − 0)8 = 푥8 7 8! 8!

(b) Approximate cos(1) using a fourth-degree Maclaurin polynomial, and find the associated Lagrange remainder (error bound), 푎 = 0.

푥2 푥4 cos 푥 = 1 − + + 푅 (푥) ≈ 0.99500416667 + 푅 (푥) 2! 4! 4 4

Now, the associated Lagrange remainder after 푛 = 4 (denoted 푅4(푥)) for some c between 0 and 1:

푓′(푥) = − sin 푥

푓′′(푥) = − cos 푥

푓′′′(푥) = sin 푥

푓4(푥) = cos 푥

푓5(푥) = − sin 푥

At any point c between 0 and 1. The reminder is:

푓5(푐) 푅 (푥) = (푥 − 푎)5 4 5!

– 푠푖푛 푐 푅 (1) = (1 − 0)5 4 5!

We need – 푠푖푛 푐 to be as large as possible. The largest value of – 푠푖푛 푐 is 1. By assuming −푠푖푛 푐 is the largest possible value, we are creating the largest possible error; so, plug in 1 for – 푠푖푛 푐. The actual remainder will be less that this largest possible value.

(1). 15 푅 (1) = = .0000000833 4 5!

Therefore, our approximation of .99500416667 is less than .0000000833.

12

Evaluating Limits of Indeterminate Forms

Taylor and Maclaurin polynomials provide us with another method for evaluating limits of indeterminate forms of type [0/0]. For some such limits this method can be considerably easier than using l'Hopital's Rule:

Examples 6

Evaluate

2 sin 푥−sin(2푥) (a) lim 푥 →0 2푒푥 −2−2푥−푥2

ln 푥 (b) lim 푥 → 1 푥2−1

Solution

(a)

Both the numerator and denominator approach 0 as 푥 → 0. Let us replace the trigonometric and exponential functions with their degree 3 Maclaurin polynomials plus error terms written in big-O notation.

We need to use McLaurin series of degree at least 3 because all lower terms cancel out in the numerator and the denominator.

(b) This is also of type [0/0]. We begin by substituting 푥 = 1 + 푡. Note that 푥 → 1 corresponds to 푡 → 0. We can use a known Maclaurin polynomial for 푙푛(1 + 푡). For this limit even the degree 2 1 polynomial 푃1(푡) = 푡 with error 푂(푡 ) will do. Thus