Solution Methods.

This discussion closely follows the reference Numerical
Recipes by Press *et al*.

Suppose that a given *n*-th order differential equation is written * D(x)y(x)=ly(x)*, where

For example, suppose that then two boundary conditions are required for a solution. If (say)

y(xand_{1})=0y'(xare given then it is an initial value problem solved by step-by-step numerical integration across the interval from_{1})=2xto_{1}x. But if the conditions are given as_{2}y(xand_{1})=0y(x=0 then it is a two point boundary value problem._{2})

An *n*-th order problem can always be reduced to a system of *n*
first-order problems. This is done by introducing functions *y _{1}(x) = dy/dx,
..., y_{n}(x) = d^{n}y/dx^{n}* which satisfy coupled first
order equations ,

In the preceding example, the new functions are

yso that the coupled first order equations become where the second equation comes from the original second order DE. [In this case,_{1}=y(x), y_{2}=dy_{1}/dxf'and_{1}(x,y_{1},y_{2})=y_{2}f'.]_{2}(x,y_{1},y_{2})=-ly_{1}

If it is an initial value problem, with y1(x1) and y2(x1) given, then there are several
standard numerical methods of solution such as Runge-Kutta methods and the Bulirsch-Stoer
method. These methods employ small but finite steps *dx*,
*dy _{1}*, and

If it is a two-point boundary value problem, then there are two classes of numerical methods to solve the problem.

The "shooting method" resembles the problem of hitting a target by adjusting
the aim of an artillery piece. We imagine doing this by guessing (perhaps randomly) values
for the functions *y _{i}* at the initial point (those "free"

Relaxation methods use a different approach. These methods are preferred over shooting method when the solutions are smooth and not highly oscillatory. The authors of "Numerical Recipes" (self confessed notorious computer gunslingers) advise us to "always shoot first, and only then relax".

As is the case for the example introduced above, the boundary value problem may contain
a parameter, denoted there by l. Then solutions may not be
possible for arbitrary values of l. A slight modification of
the procedure is then made using the following trick. Introduce a new dependent variable, *y _{n+1}
= l*, and a differential equation

At the initial point there are *n+1* initial values to be specified but only *n _{1}*
of them are known initial conditions. That leaves

Now, the coupled DEs are numerically integrated from *x _{1}* to

For an example of the application of this method, see the mathcad example for the particle in a box with central well.

W. H. Press, B. P. Flannery, S. A. Teukolsky, W. T. Vetterling, *Numerical Recipes* [Cambridge University Press, 1986]

Created or up-dated 08/03/99
by R.D. Poshusta