Chapter 2
Introduction to Finite Difference
Methods
Finite difference methods are a class of numerical techniques used to approximate so-
lutions to differential equations. They achieve this by discretizing the problem domain
and approximating derivatives using difference quotients.
2.1 General Principle
Finite difference methods approximate the differential operator by replacing derivatives
with difference quotients. The continuous domain is discretized into a grid of points in
space and (potentially) time. The solution is then approximated at these grid points.
This principle is analogous to numerical methods for solving ordinary differential equa-
tions.
2.2 Key Concepts
• Grid Discretization: The continuous domain is divided into a discrete set of
points, forming a grid. These points are called nodes or grid points. The spacing
between grid points is crucial and often denoted by ∆x (or ∆t for time).
• Derivative Approximation: Derivatives of the unknown function are approxi-
mated using differences between function values at neighboring grid points. Differ-
ent approximations (forward, backward, central) offer varying levels of accuracy.
• Consistency, Stability, and Convergence: A finite difference method must
be:
– Consistent: The difference quotient approximation must approach the true
derivative as the grid spacing decreases. More formally, an approximation of
4
the derivative u′ (x) at point x is of order p (p > 0) if there exists a constant
C > 0, independent of h, such that the error between the derivative and its
approximation is bounded by Chp (i.e., it is O(hp )).
– Stable: Errors introduced during the computation should not grow
unboundedly.
– Convergent: The numerical solution should approach the exact solution
as the grid is refined (i.e., ∆x → 0). The Lax Equivalence Theorem states
that for a well-posed linear initial value problem, stability is equivalent to
convergence if the method is consistent.
2.3 Derivation of Finite Difference Approximations
Consider a function u(x) defined on a discrete grid with points x0 , x1 , . . . , xn , where the
grid spacing is ∆x = xi+1 − xi . We aim to approximate the derivatives of u(x) at these
grid points.
2.3.1 First Derivative
The first derivative of u(x) at xi is defined as:
du u(xi+1 ) − u(xi )
= lim
dx xi
∆x→0 ∆x
We can approximate this limit using the following difference quotients:
• Forward Difference:
du u(xi+1 ) − u(xi )
≈ + O(∆x)
dx xi ∆x
This is a first-order approximation.
• Backward Difference:
du u(xi ) − u(xi−1 )
≈ + O(∆x)
dx xi ∆x
Also a first-order approximation.
• Central Difference:
du u(xi+1 ) − u(xi−1 )
≈ + O(∆x2 )
dx xi 2∆x
5
This is a second-order approximation, generally more accurate than forward or
backward differences.
2.3.2 Second Derivative
The second derivative of u(x) at xi can be approximated using the central difference
method:
• Central Difference:
d2 u u(xi+1 ) − 2u(xi ) + u(xi−1 )
≈ + O(∆x2 )
dx2 xi (∆x) 2
This is a second-order approximation and widely used.
2.4 Taylor Series and Finite Difference Approxima-
tions
The Taylor series provides a crucial link between the continuous derivatives and their
discrete approximations. It allows us to analyze the accuracy of the finite difference ap-
proximations.
Suppose the function u(x) is sufficiently smooth (e.g., C 2 or C 3 for the first derivative
approximations and C 4 for the second derivative approximation) in the neighborhood of
xi . Then, we can expand u(xi+1 ) and u(xi−1 ) using Taylor series about xi :
(∆x)2 ′′ (∆x)3 ′′′ +
u(xi+1 ) = u(xi ) + ∆xu′ (xi ) + u (xi ) + u (ξi )
2! 3!
(∆x)2 ′′ (∆x)3 ′′′ −
u(xi−1 ) = u(xi ) − ∆xu′ (xi ) + u (xi ) − u (ξi )
2! 3!
where ξi+ ∈ [xi , xi+1 ] and ξi− ∈ [xi−1 , xi ].
2.4.1 First Derivative
Using the Taylor expansion for u(xi+1 ) and rearranging, we obtain the forward differ-
ence approximation and its error term:
u(xi+1 ) − u(xi ) ∆x ′′ + u(xi+1 ) − u(xi )
u′ (xi ) = − u (ξi ) = + O(∆x)
∆x 2 ∆x
The approximation of du
dx
at point xi is said to be consistent and first-order accurate.
The error term is proportional to ∆x.
6
We can express the consistency more formally as:
u(xi+1 ) − u(xi ) h ′′ +
− u′ (xi ) = u (ξi )
h 2
u(xi+1 ) − u(xi ) h
− u′ (xi ) ≤ sup u′′ (ξi+ )
h 2 ξ+ ∈[xi ,xi+1 ]
i
≤ Ch
supξ+ ∈[x |u′′ (ξi+ )|
where h = ∆x, and C = i i ,xi+1 ]
2
Definition 1. The approximation of the derivative u′ at point x is of order p
(p > 0) if there exists a constant C > 0, independent of h, such that the error
between the derivative and its approximation is bounded by Chp (i.e., it is O(hp )).
2.4.2 Second Derivative
Adding the Taylor expansions for u(xi+1 ) and u(xi−1 ) and rearranging yields the central
difference approximation for the second derivative:
u(xi+1 ) − 2u(xi ) + u(xi−1 ) (∆x)2 ′′′′ +
u′′ (xi ) = u (ξi ) + u′′′′ (ξi− )
2
−
(∆x) 12
u(xi+1 ) − 2u(xi ) + u(xi−1 )
= + O(∆x2 )
(∆x)2
2.5 Learning Outcomes
1. Deriving Finite Difference Approximations:
• Derive finite difference approximations for first and second derivatives using
Taylor series expansions.
• Explain the order of accuracy of forward, backward, and central difference
approximations.
2. Understanding the Role of Taylor Series:
• Explain how the truncated Taylor series forms the basis for deriving finite
difference approximations.
• Relate the truncation error to the order of accuracy of the method.