next up previous
Next: Runge-Kutta Methods Up: Differential Equations - Evolution Previous: Heun's Method

Taylor Series Method

The methods discussed above have depended on the use of the Taylor series truncated after first order, either directly or in the evaluation of the mean slope on an interval. It is often desirable to avoid this truncation, so that we are free to use higher order terms from the Taylor series. If we again consider the differential equation $y^{\prime}(x) = f(x,y)$, with the initial condition y(x = x0) = y0, it is clear that we can develop the Taylor series for y(x) about the point x0. Since we need the higher order derivatives of y(x), and we have an explicit function for $y^{\prime}(x)$, it is straightforward to differentiate f(x,y) with respect to x, noting that y is also a function of x, to obtain those higher derivatives. The total derivative of a function g(x,y) of both x and y, with respect to x, as indicated by $g^{\prime}$, is given by:

\begin{displaymath}
g^{\prime}(x,y) = \left( \frac{\partial g}{\partial x}\right...
...( \frac{\partial g}{\partial y}\right)_{\!x} \frac{dy}{dx} \,,
\end{displaymath}

where the subscript on the partial derivatives indicates the variable to be held constant in each differentiation. The second term in this sum uses the ``chain'' rule to include the fact that g(x,y) depends on y, while y is itself a function of x. Thus it is straightforward, though frequently quite tedious, to compute all the derivatives required in the Taylor series to any desired order.

We can illustrate the Taylor method by considering the differential equation:

\begin{displaymath}
y^{\prime}(x) = \frac{x - y}{2}\,.
\end{displaymath}

It is straightforward to show that:

\begin{displaymath}
y^{\prime\prime}(x) = -\frac{x-y-2}{4}\,,\,\,\,\,
y^{\prime\prime\prime}(x) = \frac{x-y-2}{8}\,,\,\,\,\,\ldots
\end{displaymath}

and that higher derivatives repeat this pattern with y(i+1) = -y(i)/2. The derivatives beyond the first derivative can thus be written as:

\begin{displaymath}
y^{(n)}(x) = - \left ( -\frac{1}{2} \right )^n (x - y - 2) \,\,\,\,\,
{\rm for}\,\,\, n \ge 2 \,.
\end{displaymath}

On defining h = x - x0, the Taylor series about x = x0 becomes:

\begin{displaymath}
y(x_0 + h) = y_0 + \frac{h}{2} (x_0 - y_0)
- (x_0 - y_0 - 2...
...c{1}{4!} \left ( -\frac{h}{2} \right )^4 + \cdots \right \}\,.
\end{displaymath}

If we are given the initial condition that y(x0) = y0, the value of y at the end of the interval, where x = x0 + h, can be obtained to chosen order in h by direct substitution of x0, y0, and h into the series given here.

In fact, inspection shows that this series actually contains all the terms for the Taylor series for the function e-h/2 except for the first two terms, that is except for the expression 1 - h/2, so that after some simplification, we have:

\begin{displaymath}
y(x_0 + h) = x_0 - 2 + h - (x_0 - y_0 - 2) e^{-h/2}\,.
\end{displaymath}

It is interesting to note that we can now obtain the exact solution for y by noting first that the above expression is true for all h, x0, and y0, since all the terms of the Taylor series are included, so that we can choose x0 = 0, and replace h by x, with the result that:

\begin{displaymath}
y(x) = x - 2 + (y_0 + 2) e^{-x/2}\,,
\end{displaymath}

where it is clear that y0 is the value of y when x = 0. This form of the solution illustrates the family of curves y(x) whose slopes are given by the direction field f(x,y) = (x - y)/2, for varying y-intercept y0. For example, consider the case of the curve which has y = 1 at x = 0. The solution for y(x) can then be written:

\begin{displaymath}
y(x) = x - 2 + 3 e^{-x/2}\,.
\end{displaymath}

We can now use the above results to build an iteration scheme to evaluate the solution of the differential equation. Again consider an interval [xi,xi+1] of length h, where we know the value yi at the beginning of the interval, that is, at x = xi. The iterative step is then given by:

\begin{displaymath}
y_{i+1} = y_i + \frac{h}{2} (x_i - y_i)
- (x_i - y_i - 2) \...
...c{1}{4!} \left ( -\frac{h}{2} \right )^4 + \cdots \right \}\,.
\end{displaymath}

The initial condition that y(x0) = x0 is implemented by starting the iterative scheme with i = 0, using these x and y values.

While in this case, we were fortunate enough to be able to recognize that the exponential series form was present, it is usually the case that a straightforward application of the Taylor series to some appropriate order is all that is possible. Even in that case, the advantages of the Taylor series approach are clear. The truncation error can be controlled by evaluating the derivatives to appropriate order. This is always possible, but frequently grows cumbersome for the higher derivatives, since the successive derivatives for many functions become progressively more complicated. Nevertheless, the Taylor series method provides the standard against which other methods can be evaluated, and forms the theoretical basis for other methods.


next up previous
Next: Runge-Kutta Methods Up: Differential Equations - Evolution Previous: Heun's Method
Charles Dyer
2002-04-24