# Finite Difference - Forward Difference with 2nd order Accuracy: What to do at the boundary?

I implemented a BVP using a first-order finite difference scheme after the shooting method did not work reliably. Its the first time I have worked with this. The code works but I would like to move to a more accurate scheme in order to reduce computational time.

I have $N$ points, $[1, N]$. If I use a second order forward finite difference scheme,

$u'(x_n) \approx \frac{1}{2h} \left[ - 3 u(x_n) + 4u(x_{n+1}) - u(x_{n+2}) \right]$

How do I evaluate at $x_{N-1}$? I don't have any point at $x_{N+1}$. At $x_{N}$ I impose a boundary condition, so do not need to evaluate the derivative.

Can I use another integration scheme? First-order accurate forward difference? 2nd order accurate central difference scheme?

How would those 2 choices affect my global error?

• I don't see any reason not to use the centered difference $u'(x_i)\approx \frac{1}{2h} (u_{i+1}-u_{i-1})$. If I understand correctly, you are not marching forward, but rather setting up a linear system to be solved as a whole thing. The symmetric difference leads to a more convenient linear system to solve. Caveat: I know very little about this stuff. You may consider asking at Computational Science. – user147263 Aug 26 '14 at 0:35