# Math Help - Numerical differentiation

1. ## Numerical differentiation

Hello,
I'm having "big" issue recalling formula for numerical differentiation... using front differences $(y[n+1]-y[n])$... and can't find any of my old textbooks... so if anyone could guide me a little bit, i would be very grateful

let's say i have function given like :

 xi -2 -1 0 1 2 f(xi) -3 -1 0 -1 0
and i need to get formula for numerical differentiation using front differences (or back)... and get approximate value of derivate at point x=-2....

well...
i assume this...

$f'(x) = \frac{f(x)}{x[i+1]- x[i]}$

it's probably wrong, but even if it's correct i don't know what to do next ... because I think need only two points from this table to determine the value of the derivate?

P.S. i don't see why do i get latex error

edit:
or i have to use table of front differences ?

 img.top {vertical-align:15%;} $y_1$ img.top {vertical-align:15%;} $\Delta y_1$ img.top {vertical-align:15%;} $y_2$ img.top {vertical-align:15%;} $\Delta^2 y_1$ img.top {vertical-align:15%;} $\Delta y_2$ img.top {vertical-align:15%;} $\Delta^3 y_1$ img.top {vertical-align:15%;} $y_3$ img.top {vertical-align:15%;} $\Delta^2 y_2$ img.top {vertical-align:15%;} $\Delta^4 y_1$ img.top {vertical-align:15%;} $\Delta y_3$ img.top {vertical-align:15%;} $\Delta^3 y_2$ img.top {vertical-align:15%;} $y_4$ img.top {vertical-align:15%;} $\Delta^2 y_3$ img.top {vertical-align:15%;} $\Delta y_4$ img.top {vertical-align:15%;} $y_5$

2. ## Re: Numerical differentiation

First, no, the formula is NOT $\frac{f(x)}{x[i+1]- x[i]}$ because "f(x)" is not a numerical value. The simplest formula is $\frac{f(x[i+1])- f(x[i])}{x[i]- x[i]}$ but that is not very accurate and there is, of course, no way to make it more accurate. My personal preference would be to do as you suggest- use a difference table. By Newton's divided difference formula, that function can be approximated by
$y1+ \Delta y1 (x- x_1)+ \Delta^2 y_1(x- x_1)(x- x_2)/2+ \Delta^3 y_1(x- x_1)(x- x_2)(x- x_3)/6+ \Delta^4 y_1(x- x_1)(x- x_2)(x- x_3)(x- x_4)/24$.

You can then differentiate that polynomial and evaluate the derivative at $x= x_1$.

3. ## Re: Numerical differentiation

thanks
That interpolated polynomial you wrote there .... would be the same thing if u use back difference, it would be something like this.... (with different table) ?
$\Delta y_5 (x-x_1) + \Delta^2 y_5 (x-x_1)(x-x_2)/2 ....$
and so on and those $\Delta y_i$ are just values that i calculate based on those tables ?

(i know it's silly question but... )