01542298119 4 6 1 004005698601 2180293062 6 sin4

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: − π )6 ) 2 8 15 Before you can plot the Taylor approximation, you must convert it from a series to a polynomial. > poly := convert( %, polynom ); poly := 1 − x + π + 1 1 1 (x − π )2 − (x − π )4 + (x − π )5 2 8 15 Plot the function f along with poly. > plot( [f(x), poly], x=0..10, view=[0..10, 0..3] ); 3 2.5 2 1.5 1 0.5 0 2 4 6 8 10 x The expression (1/6!)f (6) (ξ )(x − a)6 gives the error of the approximation, where ξ is some number between x and a. The sixth derivative of f is > diff( f(x), x$6 ); −sin(x) esin(x) + 16 cos(x)2 esin(x) − 15 sin(x)2 esin(x) + 75 sin(x) cos(x)2 esin(x) − 20 cos(x)4 esin(x) − 15 sin(x)3 esin(x) + 45 sin(x)2 cos(x)2 esin(x) − 15 sin(x) cos(x)4 esin(x) + cos(x)6 esin(x) The use of the sequence operator $ in the previous command allows you to abbreviate the calling sequence. Otherwise, you are required to 7.1 Introductory Calculus • 223 enter , x six times to calculate the sixth derivative. Define the function f 6 to be that derivative. > f6 := unapply( %, x ); f6 := x → −sin(x) esin(x) + 16 cos(x)2 esin(x) − 15 sin(x)2 esin(x) + 75 sin(x) cos(x)2 esin(x) − 20 cos(x)4 esin(x) − 15 sin(x)3 esin(x) + 45 sin(x)2 cos(x)2 esin(x) − 15 sin(x) cos(x)4 esin(x) + cos(x)6 esin(x) The following is the error in the approximation. > err := 1/6! * f6(xi) * (x - a)^6; err := 1 (−sin(ξ ) esin(ξ) + 16 cos(ξ )2 esin(ξ) − 15 sin(ξ )2 esin(ξ) 720 + 75 sin(ξ ) cos(ξ )2 esin(ξ) − 20 cos(ξ )4 esin(ξ) − 15 sin(ξ )3 esin(ξ) + 45 sin(ξ )2 cos(ξ )2 esin(ξ) − 15 sin(ξ ) cos(ξ )4 esin(ξ) + cos(ξ )6 esin(ξ) )(x − π )6 The previous plot indicates that the error is small (in absolute value) for x between 2 and 4. > plot3d( abs( err ), x=2..4, xi=2..4, > style=patch, axes=boxed ); 0.16 0 2 xi 44 x 2 To find the size of the error, you need a full analysis of the expression err for x between 2 and 4 and ξ between a and x, that is, on the two closed regions bounded by x = 2, x = 4, ξ = a, and ξ = x. The curve command from the plottools package can illustrate these two regions. 224 • Chapter 7: Solving Calculus Problems > with(plots): with(plottools): Warning, the name changecoords has been redefined Warning, the name arrow has been redefined > display( curve( [ [2,2], [2,a], [4,a], [4,4], [2,2] ] ), > labels=[x, xi] ); 4 3.5 xi 3 2.5 2 2 2.5 3 x 3.5 4 The partial derivatives of err help you find extrema of err inside the two regions. Then you must to check the four boundaries. The two partial derivatives of err are > err_x := diff(err, x); err _x := 1 (−sin(ξ ) esin(ξ) + 16 cos(ξ )2 esin(ξ) 120 − 15 sin(ξ )2 esin(ξ) + 75 sin(ξ ) cos(ξ )2 esin(ξ) − 20 cos(ξ )4 esin(ξ) − 15 sin(ξ )3 esin(ξ) + 45 sin(ξ )2 cos(ξ )2 esin(ξ) − 15 sin(ξ ) cos(ξ )4 esin(ξ) + cos(ξ )6 esin(ξ) )(x − π )5 > err_xi := diff(err, xi); err _xi := 1 (−cos(ξ ) esin(ξ) − 63 sin(ξ ) cos(ξ ) esin(ξ) 720 + 91 cos(ξ )3 esin(ξ) − 210 sin(ξ )2 cos(ξ ) esin(ξ) + 245 sin(ξ ) cos(ξ )3 esin(...
View Full Document

This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.

Ask a homework question - tutors are online