# Advanced Mathematics for Engineers and Scientists/Finite Difference Method

## Finite Difference Method

The finite difference method is a basic numeric method which is based on the approximation of a derivative as a difference quotient. We all know that, by definition:

${\displaystyle u'(x)=\lim _{\Delta x\to 0}{\frac {u(x+\Delta x)-u(x)}{\Delta x}}}$

The basic idea is that if ${\displaystyle \Delta x}$ is "small", then

${\displaystyle u'(x)\approx {\frac {u(x+\Delta x)-u(x)}{\Delta x}}}$

Similarly,

${\displaystyle u''(x)=\lim _{\Delta x\to 0}{\frac {u(x+\Delta x)-2u(x)+u(x-\Delta x)}{\Delta x^{2}}}}$
${\displaystyle u''(x)\approx {\frac {u(x+\Delta x)-2u(x)+u(x-\Delta x)}{\Delta x^{2}}}}$

It's a step backwards from calculus. Instead of taking the limit and getting the exact rate of change, we approximate the derivative as a difference quotient. Generally, the "difference" showing up in the difference quotient (ie, the quantity in the numeriator) is called a finite difference which is a discrete analog of the derivative and approximates the ${\displaystyle n^{\text{th}}}$ derivative when divided by ${\displaystyle \Delta x^{n}}$.

Replacing all of the derivatives in a differential equation ditches differentiation and results in algebraic equations, which may be coupled depending on how the discretization is applied.

For example, the equation

${\displaystyle {\frac {\partial u}{\partial t}}={\frac {\partial ^{2}u}{\partial x^{2}}}}$

may be discretized into:

${\displaystyle {\frac {u(x,t+\Delta t)-u(x,t)}{\Delta t}}={\frac {u(x+\Delta x,t)-2u(x,t)+u(x-\Delta x,t)}{\Delta x^{2}}}}$
${\displaystyle {\Big \Downarrow }}$
${\displaystyle u(x,t+\Delta t)=u(x,t)+{\frac {\Delta t}{\Delta x^{2}}}(u(x+\Delta x,t)-2u(x,t)+u(x-\Delta x,t))}$

This discretization is nice because the "next" value (temporally) may be expressed in terms of "older" values at different positions.