# LV038:LV-Uebersicht/SS10/Arbeitsbereiche/Solving ODEs with Power Series Approach

### Aus Wiki der Fakultät für Physik Universität Wien

Diese Seite befindet sich im Namensraum der LV: Unterstützung zu M1 mit Schwerpunkt Computeralgebra und Wiki

## Inhaltsverzeichnis |

# Solving differential equations with power series approaches

## Problem

We consider an ordinary differential equation

with boundary conditions

.

We try to find an (hopefully convergent) approximative solution with a power series approach.

## Naive method

In the above equation we make the ansatz , where *N* is the order of the approximation (if the boundarys are given at a point *x*_{c} instead of 0, this may be generalized by replacing *x*^{n} with (*x* − *x*_{c})^{n}). The first derivation yields and accordingly for higher derivations. We can now simply insert this into our differential equation and compare the coefficients, which means "collecting" terms of equal order (i.e. all terms proportional to *x*, all terms proportional to *x*^{2} and so on). Therefore, any non-polynomial terms have to be expanded in power-series.

There is no way to justify this approach in terms of conversion questions. We just have to try it out and see, if it converges (which it does in most relevant cases).

The examples given below have also been solved step-by-step in this Mathematica file.

### Example 1

We want to solve the differential equation

with boundarys *y*(0) = 0 and *y*'(0) = 1. As described above, we use the ansatz . Inserting this into the boundary conditions yields

From insterting the ansatz into the differential equation, we get

where we start with comparing all coefficients of order (0th order) to get 2*a*_{2} − *a*_{1} − *a*_{0} = − 1, so *a*_{2} = 0.

Next comes order , which gives us 6*a*_{3} − 2*a*_{2} = 6, so *a*_{3} = 1.

And in order we get 12*a*_{4} + 3*a*_{2} − 3*a*_{3} = − 3, so *a*_{4} = 0.

The last order we compute is , where we have 20*a*_{5} − 4*a*_{4} + 8*a*_{3} = 8, so *a*_{5} = 0.

This gives us a specific solution of this example around 0, up to order :

.

In this example, we can even go further: Since only terms with *a*_{4} and higher *a*_{n} are going to appear in the next orders, whereas the right-hand-side of the original equation will always be zero in those higher orders, we get *a*_{n} = 0 for all *n* > 3. So in this specific (very artificial) example, the solution we got by a power series approach is actually *exact* up to any order:

*y*(*x*) = *x* + *x*^{3}.

### Example 2

We want to approximate the solution for the differential equation with boundary condition *y*(0) = 1. Insertion of the boundary condition into the power series ansatz for *y*(*x*) immediately gives us *a*_{0} = 1. Since now we have a non-polynomial inhomogenity, we also need to expand *e*^{x} into a power series:

.

We insert the ansatz, the derivative and the power series for the exponential into the differential equation, and, to simplify things, reorder all terms into a single sum (account the index shift in the *y*'-term):

.

The zeroth order gives us *a*_{0} + *a*_{1} − 1 = 0, so *a*_{1} = 0. From first order we have *a*_{1} + 2*a*_{2} − 1 = 0, so *a*_{2} = 1 / 2. In second order, it is *a*_{2} + 3*a*_{3} − 1 / 2 = 0, so *a*_{3} = 0. Following this pattern, we arrive at

.

From recognizing the pattern, we also arrived at an exact solution for this example. However, keep in mind that we did not proove convergence of anything here, so writing

with *a*_{n} as above

would require some more work to be strictly correct in a mathematical sense. We may actually evaluate this sum by taking out the zero terms (all terms with odd *n* vanish) and writing

where the last equality comes directly from the definition of the *c**o**s**h* function.

## Frobenius method

### Introduction

The naive method described above only works for differential equations with analytic solutions around *x* = 0, but the following example shows that some very simple equations don't satisfy this requirement:

### Example 3

Consider the equation

The linearity of this equation implies the existence of two linearly independent solutions. To find them, we'll assume that *y* is given by

for some real coefficients *c*_{k}.

Plugging this ansatz into our equation gives us the following condition on our power series:

where we set *c*_{ − 2} = *c*_{ − 1} = 0.

By comparing the coefficients of *x*^{0} and *x*^{1}, we find that *c*_{0} = 0 and is a free parameter.

The equation for *k* = 2 can be reduced to , and we see that all further coefficients are completely determined by . This means that we can only impose one boundary condition on *y*(*x*), so our naive method missed one solution.

### Frobenius method

We previously observed that our approach only works for analytic solutions around our critical point. The simplest ansatz that includes singularities is

where m is an arbitrary real constant and . This is called the **Frobenius method**.

### Example 3 (cont.)

Plugging this into our equation and reordering terms leads to:

.

Comparing coefficients of the lowest-order monomial, *x*^{m}, gives us

.

Because , we find two possible values for m:

.

We already found a series solution for *m* = 1, so our second, linearly independent solution has the form

The same procedure as above lets us determine the coefficients *c*_{k}, and we get:

So our general solution to the differential equation is:

where *c*_{1} and *c*_{2} are arbitrary constants.

## Asymptotic analysis

It is often nearly impossible to find a closed form for the coefficients in the power series that solves a given differential equation. Sometimes the solution does not have a closed form at all, or it is a complicated expression involving many different functions. In the latter case, a very helpful method is an ansatz involving the equation's asymptotic behavior, as seen in the following example:

### Example 4

An important equation in quantum mechanics (describing the harmonic oscillator) has the following form:

,

with the condition that

As , the (2*n* + 1)-term in the equation is negligible, and the equation in the same limit approaches

In the limit , the equation has asymptotic solutions of the form , i.e.

for arbitrary integers m.

Because only one of the above functions fulfills the boundary condition, it's reasonable to look for solutions of the form This transformation changes the differential equation to:

We will now try to find a power series representation for u:

The values of *c*_{0} and *c*_{1} can be chosen arbitrarily, so we will set *c*_{0} = 0,*c*_{1} = 1 if n is odd, and *c*_{0} = 1,*c*_{1} = 0 if n is even. This means that the functions *u*_{n}(*x*) are polynomials of order n, they are called *Hermite polynomials*.

## References

- Frobenius method
- M. Tenenbaum and H. Pollard.
*Ordinary Differential Equations*. Dover Publications, New York, 1985. ISBN 0486649407.

- M. Tenenbaum and H. Pollard.
- Asymptotic analysis
- D. J. Griffiths.
*Introduction to Quantum Mechanics (2nd Edition)*. Benjamin Cummings, San Francisco, 2004. ISBN 0131118927. - R. Shankar.
*Principles of Quantum Mechanics*. Plenum Press, New York, 1994. ISBN 0306447908.

- D. J. Griffiths.