Finite Difference Approximation Using Taylor Series
Consider a function 𝑓(𝑥), and we want to approximate its value at 𝑥 + Δ𝑥 in
terms of its value at 𝑥.
The Taylor expansion of 𝑓(𝑥 + Δ𝑥) around 𝑥 is:
𝑓 ′′ 𝑥 2+
𝑓 ′′′ 𝑥
3
𝑓(𝑥 + Δ𝑥) = 𝑓(𝑥) + 𝑓′(𝑥)Δ𝑥 + Δ𝑥 Δ𝑥 +⋯
2! 3!
The Taylor expansion of 𝑓(𝑥 − Δ𝑥) around 𝑥 is:
𝑓 ′′ 𝑥 𝑓 ′′′ 𝑥
𝑓 𝑥 − Δ𝑥 = 𝑓 𝑥 − 𝑓 ′ 𝑥 Δ𝑥 + Δ𝑥 2− Δ𝑥 3 +⋯
2! 3!
Finite Differnece
𝑓 ′′ 𝑥 2
𝑓 ′′′ 𝑥 3
𝑓(𝑥 + Δ𝑥) = 𝑓(𝑥) + 𝑓′(𝑥)Δ𝑥 + Δ𝑥 + Δ𝑥 +⋯
2! 3!
′′
𝑓 𝑥 ′′′
𝑓 𝑥
′
𝑓 𝑥 − Δ𝑥 = 𝑓 𝑥 − 𝑓 𝑥 Δ𝑥 + Δ𝑥 2− Δ𝑥 3 +⋯
2! 3!
To get the 1st order derivative ,we need to approximate the previous expansion by neglecting the terms with high
order derivatives
𝑓 𝑥 + Δ𝑥 = 𝑓 𝑥 + 𝑓 ′ 𝑥 Δ𝑥 + Δ𝑥 2
𝑓 𝑥 − Δ𝑥 = 𝑓 𝑥 − 𝑓 ′ 𝑥 Δ𝑥 + 𝑂 Δ𝑥 2
• 1st Derivative (Forward Difference)
𝑓 𝑥 + Δ𝑥 − 𝑓 𝑥
𝑓′ 𝑥 = + 𝑂 Δ𝑥
Δ𝑥
• 1st Derivative (Backward Difference)
′
𝑓(𝑥) − 𝑓 𝑥 − Δ𝑥
𝑓 𝑥 = + 𝑂 Δ𝑥
Δ𝑥
• 1st Derivative (Central Difference)
𝑓(𝑥 + Δ𝑥) − 𝑓 𝑥 − Δ𝑥
𝑓′ 𝑥 = + 𝑂 Δ𝑥 2
2Δ𝑥
Finite Differnece
𝑓 ′′ 𝑥 2
𝑓 ′′′ 𝑥
𝑓(𝑥 + Δ𝑥) = 𝑓(𝑥) + 𝑓′(𝑥)Δ𝑥 + Δ𝑥 + Δ𝑥 3 + ⋯
2! 3!
′′ ′′′
𝑓 𝑥 𝑓 𝑥
𝑓 𝑥 − Δ𝑥 = 𝑓 𝑥 − 𝑓 ′ 𝑥 Δ𝑥 + Δ𝑥 2 − Δ𝑥 3 + ⋯
2! 3!
′′
𝑓 𝑥 2
𝑓 ′′′ 𝑥
𝑓(𝑥 + 2Δ𝑥) = 𝑓(𝑥) + 2𝑓′(𝑥)Δ𝑥 + 2Δ𝑥 + 2Δ𝑥 3 + ⋯
2! 3!
′′ ′′′
𝑓 𝑥 𝑓 𝑥
𝑓 𝑥 − 2Δ𝑥 = 𝑓 𝑥 − 2𝑓 ′ 𝑥 Δ𝑥 + 2Δ𝑥 2 − 2Δ𝑥 3 + ⋯
2! 3!
• 2nd Derivative (Central Difference)
′′
𝑓 𝑥 − Δ𝑥 − 2𝑓 𝑥 + 𝑓 𝑥 + Δ𝑥 2
𝑓 𝑥 = + 𝑂 Δ𝑥
Δ𝑥 2
• 2nd Derivative (Forward Difference)
′′
𝑓 𝑥 + 2Δ𝑥 − 2𝑓 𝑥 + Δ𝑥 + 𝑓 𝑥
𝑓 𝑥 = + 𝑂 Δ𝑥
Δ𝑥 2
• 2nd Derivative (Backward Difference)
𝑓 𝑥 − 2𝑓 𝑥 − Δ𝑥 + 𝑓 𝑥 − 2Δ𝑥
𝑓 ′′ 𝑥 = + 𝑂 Δ𝑥
Δ𝑥 2
Finite Differnece
Truncation Error
It is the difference between the original PDE and the approximate FDE
𝑇. 𝐸 = 𝑃𝐷𝐸 − 𝐹𝐷𝐸
Stability
The scheme is stable if the errors are not growing from step to another
Consistency
The Truncation error vanishes as the mesh is refined
Convergence
Convergence = Stability + Consistency
The solution of the FDE approaches the solution of the PDE
By: Mina Romany
For any further questions please contact me on
Whatsapp,
Or on e-mail: m_romanygad@eng.cu.edu.eg