Approximation of Functions by Polynomials

advertisement

Approximation of Functions by Polynomials

Dr. Bruce Dearden, University of North Dakota

I. Introduction

In many respects the rational functions are the simplest functions in analysis. They are formed by a finite number of applications of the ordinary operations of arithmetic; hence they are essentially ratios of polynomials. Every other function, more or less, involves a concealed passage to the limit from rational functions. Moreover, in practice, rational functions are the only kind with which general calculations can be made. The questions of whether and how a given function can be expressed approximately by rational functions, in particular by polynomials, are therefore of great theoretical and especially practical importance.

II. Approximation by Polynomials

Given a function f ( x ), we wish to approximate f ( x ) “near” some particular point x = a . What criteria should we use to pick a good local approximation? We’ll try to make our polynomial behave exactly like the function does at x = a , and hope this leads to a good, but less than perfect approximation near x = a . We assume the value of f ( x ) and its derivatives f

′ x , f

′′ x K at x = a determines its behavior at x = a.

Example : Let’s approximate f x

= e x

near x = 0 by polynomials of various degrees.

1st Order : Find the polynomial ( )

= a

0

+ a x of 1st degree that best agrees with f x

= e x

near x = 0. By our criteria we must find the coefficients a

0

and a

1

so that

( )

= f 0 and p

1

That is, a

0

= e 0 = 1 and a

1

= e 0 = 1.

Thus, the best fit for a line to e x

at x = 0 is y = x + 1.

Check It Out

Use X(PLORE) to graph e x

and y = x + 1 to see how well we’ve done.

Window(–2, 2, –1, 2)

Graph(exp(x), x)

Graph(1 +x, x)

Notice that the approximation is good close to x = 0, but rapidly deteriorates as we move away from x = 0.

39

2nd and 3rd Order : Find ( )

= b

0

+ b x

+ b x

2

and

( )

= c

0

+ c x

+ c x

2 + c x

3

that best fit ( )

= e x

near x = 0.

For p

2

( x ) we require

( )

= f 0 , p

1

0 f 0 and p

2

.

We must stop there since any higher derivatives of p

2

( x ) are zero while f x

Hence, we find b

0

, b

1

, b

2

such that b

0

= e

0

= 1, b

1

= e

0

= 1, 2 b

2

= e

0

= 1.

Hence, p x 1 1 x

1

2 x

2

. Notice that this subsumes p

1

( x ) in the first two terms.

Check It Out

Add p

2

( x ) to the graphs of f ( x ) and p

1

( x ).

Graph(1 + x + 0.5

x^2, x)

Notice that the interval about x = 0 for which the approximation is fairly good has increased in size.

Exercise : Compute the 3rd order approximation p

3

( x ) and graph it along with the previous approximations.

Observe that:

(1) The higher degree polynomial we use the larger the interval of good approximation appears.

(2) Successive approximating polynomials subsume the previous ones. Hence we need only compute the new last coefficient.

(3) The conditions on the coefficients c

0

, c

1

, ... form a simple pattern.

Where n !

c

0

= f 0 c

1

= ′

0 c

2

=

2 f

′′

0 c

3

= ⋅ f

′′′

( ) , . . .

. . . c n

= n f ( ) n ( n 1 ) ( 2 ) L 2 1 is the factorial function.

Thus we have the Taylor–Maclaurin polynomial of f ( x ) near x = 0 of degree n . It is: p n x

= f 0

+ ′

0 x f

2 x

2 + L + f n !

x n

.

40

Check It Out

X(PLORE) can calculate the form of this polynomial for us:

ExactOn

Sum( dif( f(t), t = 0, I)

x^i/i!, i = 0 to 4)

This will compute p

4

( x ) symbolically. We can then enter p

4

( x ) by this pattern.

Exercise : Compute and plot the approximations p

1

( x ), p

2

( x ), p

3

( x ) to f x

=

1

1

+

= 0. x

near x

Notice that, as before, that with increasing degree the interval of “good” approximation gets longer. But, for this function, the polynomials can never approximate the vertical asymptote at x = –1; hence the interval of “good” approximation must always have radius less than one.

III. “Goodness” of Approximation

From our plots we can see that over any interval centered at x = 0, the difference between the functions and the approximating polynomial varies. The maximum absolute difference over the interval measures the error incurred by using the polynomial rather than the function over the interval.

Exercise : Plot the absolute difference between f x

=

1

( 1

+ x )

and p

2

( x ) over

[

1

2

, 1

2

] and use the cursor to estimate the maximum error.

Can we get an estimate for the error over an interval theoretically? In some cases we can find our polynomial approximations with error estimate at the same time.

Example : By long division, we have, for x

1, x

1

1

1 x x

2 + L +

where r n

= x n

1

− x

=

1

1

− x x n

1 + r n

,

− p n

1 x

On the interval

[

1

2

, 1

2

]

, we may find an upper bound for the error by maximizing r n

=

1 x n

− x

. That is,

41

r n

= x n

1

− x

≤ x n

=

2 x n

.

1

2

Since for

− ≤ ≤

2 x

1

, we have 1

2

− ≥ 1

2

. Hence, max

{ r n

:

1

2 x

1

2

2 n

=

2 n

1

1

.

Exercise : Plot f x

=

1

1

( − x

)

and p

5

( x ). To see the behavior of the error function, reset the window and plot ( f ( x ) – p

5

( x )) over

[

1

2

, 1

2

]

. Notice how the error behaves like Ax

4

for some constant A .

42

Exercises for Approximations of Functions by Polynomials

1. Consider the formula ln( 1

+ x )

= ∫

0 x

1

1

+ t dt .

1

(a) Show that

1

+ t

1 t t

2 L

( ) n

1 t n

1 + r n

, where r n

= −

1

1 )

+ t

(b) Substituting in the integral, show that

(*) ln( 1

+ x ) x x

2

+ x

3

− x

2 3 4

4

+ L

( 1 ) n n

1 x n where R n

= ∫

0 x r dt n

= −

1 ) n

0 x

1 t

+ n t dt .

+

R n ,

The polynomial part of (*) must be p n

( x ).

(c) Use X(PLORE) to compute p

6

(

− 1

2

) 2 .

.

In practice we should find an analytic upper bound for R n

, but for now we’ll use X(PLORE).

(d) Use X(PLORE) to estimate R

6

( ) ( ) n ∫

0

− 1

2 t 6

1

+ t dt , the error in the approximation from (c). How many places of accuracy should we keep for our answer in (c)?

What is X(PLORE)’s value for ln and how does it compare to p

6

( )

?

2. (a) Substitute x = – t

2

in (

1

1

− x

) 1 x x

2 + L + x n

1 + r n

and show that

43

arctan( ) x x

3

+ x

3 5

5

− L ( 1 ) n

1 x

2 n

1

2 n

1

+

R n

, where R n

= −

1 ) n

0 x

1 t 2 n

+ t 2 dt .

Prove that for –1

x

1,

R n

≤ x

2 n

+

1

2 n

+

1

.

(b) Use X(PLORE) to plot the actual absolute error function ( ) and the upper estimate x

2 n

+

1

for n = 2, 4, 6, 8.

2 n

+

1

Comment on how well the analytic estimate seems to approximate the true absolute error function.

44

Download