HW NO: 3 Let f ′′( xi ) = αf ( xi ) + βf ( xi −1 ) + γf ( xi +1 ) ∆xi ≠ ∆xi +1 Find the order of truncation error.

Solution f ′′( xi ) = αf ( xi ) + βf ( xi − ∆xi ) + γf ( xi + ∆xi +1 ) Using Taylor series expansion, ∆xi ∆x f ′′( xi ) − i f ′′′( xi ) + ........ 2! 3! 2 3 ∆x ∆x f ( xi + ∆xi +1 ) = f ( xi ) + ∆xi +1 f ′( xi ) + i +1 f ′′( xi ) + i +1 f ′′′( xi ) + ........ 2! 3! For the given expression to be valid, the following conditions must be satisfied f ( xi − ∆xi ) = f ( xi ) − ∆xi f ′( xi ) +
2 3

α + β +γ = 0
− β∆xi + γ∆xi +1 = 0 ∆x ∆x β i + γ i +1 = 1 2! 2! Solving (1) , (2) and (3) −2 α= ∆xi ∆xi +1
2 2

(1) (2) (3)

β=

2 ∆xi ( ∆xi + ∆xi +1 ) 2 ∆xi +1 ( ∆xi + ∆xi +1 ) −2 2 2 f ( xi + ∆xi +1 ) f ( xi ) + f ( xi − ∆xi ) + ∆xi ∆xi +1 ∆xi ( ∆xi + ∆xi +1 ) ∆xi +1 ( ∆xi + ∆xi +1 )

γ =

f ′′( xi ) =

On expanding and simplifying, f ′′( xi ) = f ′′( xi ) + 1 f ′′′( xi ) [ ∆xi +1 − ∆xi ] + ............ 3

The 1st term is the exact term and the remaining terms give the truncation error. Order of truncation error =1