Numerical Analysis Anzar Lec 07 15102022 035138am
Numerical Analysis Anzar Lec 07 15102022 035138am
Numerical
Analysis
Chapter 4
Taylor Series
1
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter – 4
Truncation Errors and the Taylor Series
Truncation errors are those that result from using an approximation in place of an
exact mathematical procedure.
For example, in Chap. 1 we approximated the derivative of velocity of a falling
parachutist by a finite-divided-difference equation of the form [Eq. (1.11)]
2
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
THE TAYLOR SERIES: Taylor’s theorem (Box 4.1) and its associated formula, the
Taylor series, is of great value in the study of numerical methods. In essence, the Taylor
series provides a means to predict a function value at one point in terms of the function
value and its derivatives at another point. In particular, the theorem states that any
smooth function can be approximated as a polynomial. A useful way to gain insight into
the Taylor series is to build it term by term. For example, the first term in the series is:
𝑥 𝑥−𝑡 𝑛 (𝑛+1)
𝑅𝑛 = 𝑎
𝑓 𝑡 𝑑𝑡 (𝐵4.1.2)
𝑛!
4
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
𝑓(𝑥𝑖+1 ) ≅ 𝑓(𝑥𝑖 ) + 𝑓′(𝑥𝑖 )(𝑥𝑖+1 − 𝑥𝑖 ) (4.3)
Although Eq. (4.3) can predict a change, it is exact only for a straight-line, or linear, trend.
Therefore, a second-order term is added to the series to capture some of the curvature that
the function might exhibit:
𝑓′′(𝑥𝑖 )
𝑓(𝑥𝑖+1 ) ≅ 𝑓(𝑥𝑖 ) + 𝑓′(𝑥𝑖 )(𝑥𝑖+1 − 𝑥𝑖 ) + (𝑥𝑖+1 − 𝑥𝑖 )2 (4.4)
2!
In a similar manner, additional terms can be included to develop the complete Taylor
series expansion:
𝑓′′(𝑥𝑖 )
𝑓(𝑥𝑖+1 ) = 𝑓(𝑥𝑖 ) + 𝑓′(𝑥𝑖 )(𝑥𝑖+1 − 𝑥𝑖 ) + (𝑥𝑖+1 − 𝑥𝑖 )2 +
2!
𝑓(3) (𝑥𝑖 ) 𝑓(𝑛) (𝑥𝑖 )
(𝑥𝑖+1 − 𝑥𝑖 )3 + ∙∙∙∙∙∙ + (𝑥𝑖+1 − 𝑥𝑖 )𝑛 + Rn (4.5)
3! 𝑛!
Note that because Eq. (4.5) is an infinite series, an equal sign replaces the
approximate sign that was used in Eqs. (4.2) through (4.4). A remainder term is
included to account for all terms from n +1 to infinity:
𝑓 (𝑛+1) ) (ξ )
Rn = (𝑥𝑖+1 − 𝑥𝑖 )𝑛+1 (4.6)
𝑛+1 !
Here, ξ is a value of x that lies somewhere between xi and xi+1
5
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
It is often convenient to simplify the Taylor series by defining a step size
h = (𝑥𝑖+1 − 𝑥𝑖 ) and expressing Eq. (4.5) as
𝑓 (𝑛+1) ) (ξ )
𝑅𝑛 = ℎ𝑛+1 (4.8)
𝑛+1 !
6
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
𝑓′′(𝑥𝑖 ) 2 𝑓(3) (𝑥𝑖 ) 3 𝑓(𝑛) (𝑥𝑖 )
𝑓(𝑥𝑖+1 ) = 𝑓(𝑥𝑖 ) + 𝑓′(𝑥𝑖 )ℎ + ℎ + ℎ + ∙∙∙ + ℎ𝑛 +𝑅𝑛 (4.7)
2! 3! 𝑛!
7
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
𝑓′′(𝑥𝑖 ) 2 𝑓(3) (𝑥𝑖 ) 3 𝑓(𝑛) (𝑥𝑖 )
𝑓(𝑥𝑖+1 ) = 𝑓(𝑥𝑖 ) + 𝑓′(𝑥𝑖 )ℎ + ℎ + ℎ + ∙∙∙ + ℎ𝑛 +𝑅𝑛 (4.7)
2! 3! 𝑛!
8
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
𝑓′′(𝑥𝑖 ) 2 𝑓(3) (𝑥𝑖 ) 3 𝑓(𝑛) (𝑥𝑖 )
𝑓(𝑥𝑖+1 ) = 𝑓(𝑥𝑖 ) + 𝑓′(𝑥𝑖 )ℎ + ℎ + ℎ + ∙∙∙ + ℎ𝑛 +𝑅𝑛 (4.7)
2! 3! 𝑛!
= 𝟎. 𝟗𝟓
= 0.45
= 0.3
= 0.2
11
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.