(2-1) Truncation Error and Taylor Series
(2-1) Truncation Error and Taylor Series
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Taylor Series
…nth order approximation…
f ' ( xi ) f " ( xi ) f ( n ) ( xi )
f ( xi +1 ) f ( xi ) + ( xi +1 − xi ) + ( xi +1 − xi ) + +
2
( xi +1 − xi ) n + Rn
1! 2! n!
The Reminder term, Rn, accounts for all terms from (n+1) to
infinity.
f ( n +1) ( ) ( n +1)
Rn = h
(n + 1)!
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Taylor Series
…nth order approximation…
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Taylor Series Example:
…nth order approximation… computing f(x) = ex using
Taylor Series expansion
f ' ( xi ) f " ( xi ) f ( n ) ( xi )
f ( xi +1 ) f ( xi ) + ( xi +1 − xi ) + ( xi +1 − xi ) + +
2
( xi +1 − xi ) n + Rn
1! 2! n!
As a result we get:
2 3 n
x x x Looks familiar?
e = 1 +x + + + ... +
x
Maclaurin series for ex
2! 3! n!
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Taylor Series Yet another example:
…nth order approximation… computing f(x) = cos(x) using
Taylor Series expansion
Choose x=xi+1 and xi=0 Then f(xi+1) = f(x) and (xi+1 – xi) = x
Derivatives of cos(x):
(1.) (cos(x) )’ = -sin(x) (2.) (cos(x) )” = -cos(x),
(3.) (cos(x) )”’ = sin(x) (4.) (cos(x) )”” = cos(x),
……
As a result we get:
x2 x4 x6
cos x = 1 − + − +
2! 4! 6!
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Taylor Series
…nth order approximation…
Notes on Taylor expansion:
Chapra, S. C. Applied Numerical Methods with MATLAB for Engineers and Scientists, 6th ed., McGraw-Hill: New York 2010
The Taylor Series
Numerical Methods for Graduate Students
Any Questions?
Comments? -End of Presentation-
Thank you for your attention!
IMAGE ATTRIBUTION:
1. Title Slide – [broen error fatal glitch], Jorge Mario Zuleta, Pexels License, available online at:
https://www.pexels.com/photo/broken-error-fatal-error-glitch-114831/ https://www.pexels.com/photo/broken-error-
fatal-error-glitch-114831/