1. ## Heat equation

Hello,

it is
$\frac{\partial u}{\partial t} = k*\frac{\partial^2 u}{\partial x^2}$ (as known as heat equation)

Show that

$\frac{\partial^2 u}{\partial x^2} \approx \frac{u(t,x_{i+1})-2u(t,x_i) + u(t,x_{i-1})}{h^2}$

Anyone knows how to show this?

Best Regards,
Rapha

2. Originally Posted by Rapha
Show that

$\frac{\partial^2 u}{\partial x^2} \approx \frac{u(t,x_{i+1})-2u(t,x_i) + u(t,x_{i-1})}{h^2}$

Anyone knows how to show this?
For any twice differentiable function $f$, you have the asymptotic expansion: $f(x+h)=f(x)+f'(x)h+\frac{f''(x)}{2}h^2+o(h^2)$, and (substituting $-h$ for $h$): $f(x-h)=f(x)-f'(x)h+\frac{f''(x)}{2}h^2+o(h^2)$. Sum these expansions, and you get:
$f(x+h)+f(x-h)=2f(x)+f''(x)h^2+o(h^2)$,
and finally:
$f''(x)=\lim_{h\to 0}\frac{f(x+h)-2f(x)+f(x-h)}{h^2}$.

3. Originally Posted by Rapha
Hello,

it is
$\frac{\partial u}{\partial t} = k*\frac{\partial^2 u}{\partial x^2}$ (as known as heat equation)

Show that

$\frac{\partial^2 u}{\partial x^2} \approx \frac{u(t,x_{i+1})-2u(t,x_i) + u(t,x_{i-1})}{h^2}$

Anyone knows how to show this?

Best Regards,
Rapha
This is a forward difference approximation.

Read this: Solution of the Diffusion Equation by Finite Differences

4. Hi

thank you Laurent,

thank you mr fantastic