I'm trying to learn more about finite difference methods here.

Theorically using the taylor series $u(x)=\sum_{n=0}^{\infty}\frac{(x-x_i)^n}{n!}(\frac{d^nu}{dx^n})_i $ you can get the forward/backward/central difference methods, which are:

forward: $(\frac{du}{dx})_i\approx\frac{u_{i+1}-u_i}{\Delta x}$

backward: $(\frac{du}{dx})_i\approx\frac{u_{i}-u_{i-1}}{\Delta x}$

central: $(\frac{du}{dx})_i\approx\frac{u_{i+1}-u_{i-1}}{2\Delta x}$

But I'm having a rough time trying to understand how the above taylor series is being expanded to obtain the difference methods. The fact of not having very clear how taylor works and that subindex notation is confusing me. In the lecture says that $u_i \approx\ {u(x_i)}$ and $x_i=i\Delta x$

Also, the lecture I'm following introduces FDM saying that:

$\frac{\delta u}{\delta x}(x)=\lim_{x\to 0} \frac{u(x+\Delta x) - u(x)}{\Delta x} = \lim_{x\to 0} \frac{u(x)-u(x-\Delta x)}{\Delta x} = \lim_{x\to 0} \frac{u(x+\Delta x)-u(x-\Delta x)}{2\Delta x} $

But how can i prove those equations are equals, any idea?


The index notation just means on the derivative just means evaluated at $x_i$,

$$ u(x) = u(x_i) + \left.\frac{du}{dx}\right|_{x = x_i}(x - x_i) + \frac{1}{2!}\left.\frac{d^2u}{dx^2}\right|_{x = x_i}(x - x_i)^2 + \cdots $$


Take $x = x_{i + 1}$

$$ u(x_{i +1}) \approx u(x_i) + \left.\frac{du}{dx}\right|_{x_i}(x_{i+1} - x_{i}) + \frac{1}{2}\left.\frac{d^2u}{dx^2}\right|_{x_i}(x_{i+1} - x_{i})^2 + \cdots \tag{1} $$

up to first order in $\Delta x = (x_{i+1}-x_i)$ this becomes

$$ \left.\frac{du}{dx}\right|_{x_i} \approx \frac{u(x_{i +1}) - u(x_{i})}{\Delta x} $$


Same deal as before, just use the point $x_{i-1}$ instead

$$ u(x_{i -1}) \approx u(x_i) + \left.\frac{du}{dx}\right|_{x_i}(x_{i-1} - x_{i}) + \frac{1}{2}\left.\frac{d^2u}{dx^2}\right|_{x_i}(x_{i-1} - x_{i})^2 + \cdots \tag{2} $$

truncating at first order and solving for the derivative:

$$ \left.\frac{du}{dx}\right|_{x_i} \approx \frac{u(x_{i }) - u(x_{i-1})}{\Delta x} $$


If you subtract Eq (2) from Eq (1) you get

$$ \left.\frac{du}{dx}\right|_{x_i} \approx \frac{u(x_{i+ 1}) - u(x_{i-1})}{2\Delta x} $$

  • $\begingroup$ Thank you very much! using that notation really helped , usually in all explanations i've seen from Taylor the notation used was $ f(x) = \sum_{i=0}^{\infty}\frac{f^{(i)}(a)}{i!}(x-a)^{i} $ , but now i realize $a=x_i$ . Before validating your answer, do you have any explanation about the 2nd part of my question about proving those limits are equal ones? +1 in the meantime $\endgroup$ – BPL Oct 11 '17 at 22:38
  • $\begingroup$ @BPL You can see from the three equations I posted that they are valid when $\Delta x \to 0$, and all of them approach the value of the first derivative $\endgroup$ – caverac Oct 11 '17 at 22:42
  • $\begingroup$ Mmmm, I kind of understand what you're saying. But is that obvious? I mean... take a look to the first page of this lecture, over there is stating those 3 limits are strictly equal ones, so I'm wondering, is that true (formal proof)? For instance, let's say we got $f(x)=|x|$ . Instead using the taylor equivalences, can't be proved than those 3 limits are equal ones using other type of properties? $\endgroup$ – BPL Oct 11 '17 at 22:51
  • $\begingroup$ @BPL You're right, but also remember that for these expressions to be true, you need the function to be $C^\infty$, and $|x|$ is not around 0. Also, note that that these equations can be written as $u(x) = a_0 + u'(x_i) \Delta x + a_2 \Delta^2 x + a_3 \Delta^3 x + \cdots $, so in the limit the high order terms vanish faster than the one with the first order derivative. Hope it makes more sense now $\endgroup$ – caverac Oct 11 '17 at 22:57
  • $\begingroup$ Mmm, you're completely right, the counterexample wasn't valid because it wasn't infinitely differentiable. In any case, by saying in the limit the high order terms vanish faster than the one with first derivative? What do you mean mathematically speaking? Any property of limits you're omitting? $\endgroup$ – BPL Oct 11 '17 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.