It's been two days that I've been stuck on this problem:
Given a regular function $u$, and a non-uniform grid, where every node has a non-constant distance from another, I want to find $u'(x_i)$ and get some information about the error.
Here's a picture of the situation:
The standard way is to expand with Taylor in $x_i$. By doing this, I got this system, given from these four equations:
(i) $u(x_{i+1})=u(x_i) + u'(x_i)h_i + u''(x_i) (h_i)^2/2 + u'''(x_i)h_i^3/6 + u^{(4)}(z)h_i^4/24$
(ii) $ u(x_i)=u(x_i) $
(iii) $u(x_{i-1})=u(x_i) - u'(x_i)h_{i-1} + u''(x_i) h_{i-1}^2/2 - u'''(x_i)h_{i-1}^3/6 + u^{(4)}(z)h_{i-1}^4/24 $
(iv) $ u(x_{i+2})=u(x_i) + u'(x_i)(h_i+h_{i+1}) + u''(x_i) (h_i+h_{i+1})^2/2 + u'''(x_i)(h_i+h_{i+1})^3/6 + u^{(4)}(z)(h_i+h_{i+1})^4/24) $
Now, as done here, i do a linear combination of the equations, in order to get $u'(x_i)$. The unknown coefficients are $\alpha,\beta,\gamma,\delta$, while $h_{i-1},h_i,h_{i+1}$ are given.
I got this (linear) system:
(i) $\alpha+ \beta + \gamma +\delta=0$
(ii) $\alpha h_i + \delta(h_i + h_{i+1}) - \gamma h_{i-1}=1$ ($u'(x_i)$ coefficients)
(iii) $\alpha h_i^2/2 + \beta h_{i-1}^2 /2 + \delta (h_i + h_{i+1})^2/2 =0$
(iv) $\alpha h_i^3/6 - \gamma h_{i-1}^3/6+ \delta(h_i + h_{i+1})^3/6 =0$
It has a unique solution, but it's really ugly, and I computed it with Maxima or other numerical tools. I don't know how to proceed...any hint?