# Revision history [back]

### How to define finite difference approximation for first order derivative

I need to define

$y1(k)=\frac{y_{k+1}-y_{k-1}}{2*h}$


in sage so that sage can differ between symbolic $$y_{k+1}$$ and $$y_{k}$$.

 2 No.2 Revision tmonteil 27203 ●31 ●198 ●511 http://wiki.sagemath.o...

### How to define finite difference approximation for first order derivative

I need to definedefine $$y1(k)=\frac{y_{k+1}-y_{k-1}}{2*h}$$

$y1(k)=\frac{y_{k+1}-y_{k-1}}{2*h}$


in sage so that sage can differ between symbolic $$y_{k+1}$$ and $$y_{k}$$.

I need to define $$y1(k)=\frac{y_{k+1}-y_{k-1}}{2*h}$$
in sage so that sage can differ between symbolic $$y_{k+1}$$ and $$y_{k}$$.