# The Shooting Method

## Required Reading

- Ordinary Differential Equations
- Root Finding

## Solving Boundary Value Problems with the Shooting Method

Consider a second order ordinary differential equation,

\begin{equation} \frac{d^2 f}{dx^2} = g(x, f, \frac{df}{dx})\text{.} \label{dirichlet} \end{equation}

Given $f_a = f(a)$ and $f_b = f(b)$ (as in a Dirichlet BVP), the shooting method is as follows.

Guess a starting value $\alpha$ in order to turn equation \eqref{dirichlet} into an IVP with conditions $x = a$, $f = f_a$ and $\frac{df}{dx} = \alpha$. Integrate using an ODE solver, such as the Runge-Kutta method, to find $f_\beta$ at $x=b$.

Unless the initial guess $\alpha$ was very good, it is unlikely that $f_\beta = f_b$. In order to find the correct value for $\alpha$, $f_\beta$ and $f_b$ must be equal.

\begin{equation} f_\beta(\alpha) - f_b = 0\text{.} \label{root-problem} \end{equation}

The problem now reduces to a root finding problem. Root finders such as the Newton-Raphson or secant methods will usually converge quickly toward the solution.