Fourth order finite difference I am studying fourth order central finite difference (CFD) for space discretization of the Black Scholes PDE.
I understood that the standard fourth order  CFD for $N-1$ points is given by
$$\frac{\partial V_{i}}{\partial S}=\frac  {-V_{i+2}+8V_{i+1}-8V_{i-1}+V_{i-2}}{12h} $$
and
$$\frac{\partial ^2 V_{i}}{\partial S^2}=\frac  {-V_{i+2}+16V_{i+1}-30V_{i}+16V_{i-1}-V_{i-2}}{12h^2} $$
both for i between and including $2$ and $N-2$.
However, using the above, the approximation for the first point $V_{1}$ and last point $V_{N-1}$ is not obtained.
The author of the paper I am reading says that a "backward difference method or a unilateral method" is used to obtain  :
$$\frac{\partial V_{1}}{\partial S}=\frac  {-3V_{0}-10V_{1}+18V_{2}-6V_{3}+V_{4}}{12h}$$
and
$$\frac{\partial ^2 V_{1}}{\partial S^2}=\frac  {10V_{0}-15V_{1}-4V_{2}+14V_{3}-6V_{4}+V_{5}}{12h^2} $$
He also gave the derivative for the last point $N-1$ as
$$\frac{\partial V_{N-1}}{\partial S}=\frac  {-3V_{N}-10V_{N-1}+18V_{N-2}-6V_{N-3}+V_{N-4}}{12h}$$
and
$$\frac{\partial ^2 V_{N-1}}{\partial S^2}=\frac  {10V_{N}-15V_{N-1}-4V_{N-2}+14V_{N-3}-6V_{N-4}+V_{N-5}}{12h^2} $$
I did not understand how he used backward difference method to reach the expressions for the derivative at $V_{1}$ or $V_{N-1}$. I tried looking on the web but in vain. If someone could help I'd be grateful.
 A: I will only show the derivation for
$$\frac{\partial V_{N - 1}}{\partial S} \approx \frac{-3V_N - 10V_{N - 1} + 18V_{N - 2} - 6V_{N - 3} + V_{N - 4}}{12h}$$
since a similar procedure can be used to derive all of these formulas.
I will assume the grid is evenly spaced, since that seems to give the results he obtained. WLOG, assume the $V_{N - 1}$ point is at $x = 0$. Then the problem is to approximate $f'(0)$ using function values at $-h, 0, h, 2h, 3h$. Assume the approximation will take the form
$$D_h(f) = \frac{w_1f(-h) + w_2f(0) + w_3f(h) + w_4f(2h) + w_5f(3h)}{h}.$$
From polynomial interpolation theory, we know the approximation can be made exact for $f = 1, x, x^2, x^3, x^4$, and that this uniquely determines the weights (and that the error is $O(h^4)$). Thus we just need to solve the linear system
\begin{align}
&D_h(1) = 0 \\
&D_h(x) = 1 \\
&D_h(x^2) = 0 \\
&D_h(x^3) = 0 \\
&D_h(x^4) = 0. \\
\end{align}
Putting this in a matrix gives (notice the pattern)
$$
\begin{pmatrix}
1 & 1 & 1 & 1 & 1\\
-1 & 0 & 1 & 2 & 3 \\
1 & 0 & 1 & 4 & 9 \\
-1 & 0 & 1 & 8 & 27 \\
1 & 0 & 1 & 16 & 81 \\ 
\end{pmatrix}
\begin{pmatrix}
w_1 \\
w_2 \\
w_3 \\
w_4 \\
w_5 \\
\end{pmatrix}
=
\begin{pmatrix}
0 \\
1 \\
0 \\
0 \\
0 \\
\end{pmatrix}.
$$
The solution is
$$
\begin{pmatrix}
w_1 \\
w_2 \\
w_3 \\
w_4 \\
w_5 \\
\end{pmatrix}
=
\begin{pmatrix}
-\frac{1}{4} \\
-\frac{5}{6} \\
\frac{3}{2} \\
-\frac{1}{2} \\
\frac{1}{12} \\
\end{pmatrix},
$$
which matches the formula given.
