## Implicit Central Difference Method

The implicit central difference method is an implicit second order method for approximating the solution of the second order differential equation*y''(x) = f(x, y, y')*with initial conditions

*y(x*,

_{0}) = y_{0}*y'(x*.

_{0}) = y'_{0}The algorithm for the implicit central difference method is derived by using the central difference approximations for y'(x) and y''(x):

*y'(x) = (y(x+h) - y(x-h) ) / 2h*,

and

*y''(x) = (y(x+h) - 2y(x) + y(x-h)) / h*.

^{2}Let

*x*,

_{n}= x_{0}+ nh*y*be the approximation to

_{n}*y(x*, and

_{n})*f*, the procedure proceeds recursively via the implicit equation for y

_{n}= f(x_{n}, y_{n}, (y_{n + 1}- y_{n - 1}) / 2h )_{n + 1}as follows:

*y*.

_{n + 1}= 2 y_{n}- y_{n - 1}+ h^{2}f_{n}In order to begin the recursion, two successive starting values of

*y*are required, one of which is

*y*and the other starting value

_{0}*y*is approximated by

_{1}y

_{1}= h y'(x_{0}) + h^{2}f(x_{0}, y_{0}, y'(x_{0}) ) / 2.Particular classes of problems may have a more accurate estimate for

*y*.

_{1}### Function List

- void Implicit_Central_Difference_Method( double f0, double (*g)(double,double,double,double), double y[], double x0, double c, double h, int number_of_steps )

This function uses the Implicit Central Difference method to estimate the solution of the initial value problem,*y'' = f(x,y); y(x0) = y[0] and y'(x0) = c*, at*x0 + nh*where for*n = 1, …, number_of_steps*and*h*is the step size. The argument*f0*is the value of the function*f(x,y,y')*evaluated at*x0, y[0], c*. The function*g(x[n],y[n],y[n - 1],h)*returns the implicit value of*y[n + 1]*so that*y[n + 1] = 2 y[n] - y[n - 1] + h^2] f[n]*. On input,*y[0]*is the value of*y(x)*at*x = x0*. On output*y[n]*is the value of*y(x)*at*x = x0 + n h*for*n = 0, …, number_of_steps*.

*C* Source Code

- The file, implicit_central_difference.c, contains a version of Implicit_Central_Difference_Method( ) written in
*C*.