Professional Documents
Culture Documents
Taylor series
If a function f (x) and all its derivatives exist at a point x = x 0, the function f (x) can
be represented by a power series in powers of (x - x 0).
(x - x 0 ) 2 (x - x 0 ) n
f (x) = f (x 0 ) + (x - x 0 ) f ' (x 0 ) + f ' ' (x 0 ) + ... + f (n)
(x 0 ) + R
2! n!
(x - x 0 ) n +1 (n +1)
R= f ( ξ)
(n + 1) !
Set x – x0 = ∆ x :
(∆x)n+1
R = f (n+1) (ξ )
(n + 1) !
Taylor series
h2 hn (n)
f (x)= f (x 0 ) + h f '(x 0 ) + f ''(x 0 ) + ... + f (x 0 ) + R
2! n!
hn+1
R = f (n+1) (ξ )
(n + 1) !
h2 hn (n)
f (x 0 + h)= f (x 0 ) + h f '(x i ) + f ''(x i ) + ... + f (xi ) + R
2! n!
hn+1
R = f (n+1) (ξ )
(n + 1) !
Prof. Dr. Faruk Arınç Spring 2010
ME – 310 NUMERICAL METHODS
f(x)
f(x)
Three terms
f(x0+h) = f(x0) + h f ’(x0) + h2/2 f ’’(x0)
Two terms
f(x0+h) = f(x0) + h f ’(x0)
One term
f(x0+h) = f(x0)
x0 x0+h x
h
Prof. Dr. Faruk Arınç Spring 2010
ME – 310 NUMERICAL METHODS
Example
1
Consider the function: f (x) =
1- x
(x - x 0 )2 (x - x 0 )3
f (x) =+
f (x 0 ) (x - x 0 ) f '(x 0 ) + f ''(x 0 ) + f '''(x 0 ) + ...
2! 3!
(x - x 0 )n (n) (x - x 0 )n+1 (n+1)
... + f (x 0 ) + f (ξ ) , x0 < ξ < x
n! (n + 1) !
1 2
Derivatives: f ' (x 0 ) = f ' ' (x 0 ) =
(1 - x 0 ) 2 (1 - x 0 ) 3
Approximations to f(x):
1
One term, f (x) ≅ Error = (x - x 0 ) f ' (ξ )
First Order 1- x0
1 (x - x 0 ) (x - x 0 ) 2
Two terms, f (x) ≅ + Error = f ' ' (ξ )
Second Order 1 - x 0 (1 - x 0 ) 2 2!
Three terms, 1 (x - x 0 ) (x - x 0 ) 2 (x - x 0 ) 3
f (x) ≅ + 2
+ Error = f ' ' ' (ξ )
Third Order 1 - x 0 (1 - x 0 ) (1 - x 0 ) 3 3!
Example: x0 = 1.6. Estimate f(2) and find true and estimated errors
f(x) - P1(x)
True Relative Error: Etrue = *100 in percent
f(x)
-0.5
-1
-1.5
-2
-2.5
-3
-3.5
-4 1/(1-x)
-1/0.6
-1/0.6+(x-1.6)/0.6**2
-4.5 -1/0.6+(x-1.6)/(0.6)**2+(x-1.6)**2/(-0.6)**3
-5
-5.5
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
∂f ∂f
f (x,y) =
f (x 0 ,y0 ) + (x - x 0 ) + (y - y0 ) +
∂x x0 ,y 0 ∂y x0 ,y 0
1 2 ∂ f
2
∂ 2f ∂ 2f
(x - x 0 ) + (y - y0 ) 2
+ 2 (x - x 0 ) (y - y0 )
2! ∂x 2 ∂y 2 ∂x ∂y x ,y
x0 ,y 0 x0 ,y 0 0 0
+ ...