Subsections

### 5.1 A simple example

The method of separation of variables shall first be demonstrated for a simple example. The method as described here will work as long as the spatial region is finite and has homogeneous boundary conditions.

#### 5.1.1 The physical problem

The problem is to find the unsteady pressure field in a pipe with one end closed and the other open to the atmosphere:

#### 5.1.2 The mathematical problem

• There is a finite domain given by
• There is an unknown pressure to be found from the wave equation

• The constant is the speed of sound . The equation is only valid for normal acoustics in which the gas velocities are much less than the speed of sound.
• This equation is second order in time so it needs two initial conditions. They are:

• This equation is second order in space so it needs two boundary conditions. Given are one homogeneous Neumann boundary condition at and one homogeneous Dirichlet condition at .

#### 5.1.3 Outline of the procedure

We will try to find a solution of this problem in the form

Here the will be cleverly chosen functions called eigenfunctions.'' The are coefficients, depending on time, that are found from plugging the expression for into the partial differential equation and the initial conditions.

There are two big reasons why the must be the eigenfunctions, rather than the :

• You want the independent variable in the eigenfunction to have a finite range. That applies for , but the time runs from zero to infinity.
• The time coordinate has initial conditions at . You want the independent variable in the eigenfunctions to have boundary conditions that apply at two different points. In this example, there is one boundary condition at and the other at .

(If the spatial range is infinite or semi-infinite, you may be able to use a Fourier transform. Alternatively, you may be able to use a Laplace transform in time.)

#### 5.1.4 Step 1: Find the eigenfunctions

The first step is to find the eigenfunctions .

The eigenfunctions are found from requiring that each individual term of the form is capable of satisfying the homogeneous partial differential equation and the homogeneous boundary conditions.

In this particular example the partial differential equation is homogeneous. But even if it is not, i.e. if the partial differential equation was something like

with a given function of and , then still in this step you would use the homogeneous equation

By convention, is usually written as and as in this step. To see when satisfies the homogeneous partial differential equation, plug it in:

where primes indicate derivatives of the function with respect to its argument.

The trick is now to take the terms containing time to one side of the equation and the terms containing to the other side.

This trick is why this solution procedure is called the “method of separation of variables.”

While the right hand side, , does not depend on , you would think that it would depend on the position ; both and change when changes. But actually, does not change with ; after all, if we change , it does nothing to , so the left hand side does not change. And since the right hand side is the same, it too does not change. So the right hand side does not depend on either or ; it must be a constant. By convention, we call the constant :

If we also require to satisfy the same homogeneous boundary conditions as . In this case, that means that at , its -derivative is zero, and that at , itself is zero. So we get the following problem for :

This is a boundary value problem involving an ordinary differential equation. Not a partial differential equation.

Note that the problem is completely homogeneous: satisfies both the partial differential equation and the boundary conditions. This is similar to the eigenvalue problem for vectors , which is certainly always true when . But for the eigenvalue problem, we are interested in nonzero vectors for which . That only occurs for special values of .

Similarly, we are interested only in nonzero solutions X(x) of the above ordinary differential equation and boundary conditions. Eigenvalue problems for functions such as the one above are called “Sturm-Liouville problems.” The biggest differences from matrix eigenvalue problems are:

• There are infinitely many eigenvalues and corresponding eigenfunctions , , rather than just eigenvalues and eigenvectors.
• We cannot write a determinant to find the eigenvalues. Instead we must solve the problem using our methods for solving ordinary differential equations.

Fortunately, the above ordinary differential equation is simple: it is a constant coefficient one, so we write its characteristic polynomial:

We must now find all possible eigenvalues and all corresponding eigenfunctions that satisfy the required boundary conditions. We must look at all possibilities, one at a time.

1. Case :

Since

We try to satisfy the boundary conditions:

So ; there are no nontrivial solutions for .

2. Case :

Since we have a multiple root of the characteristic equation, and the solution is

We try to satisfy the boundary conditions again:

So ; there are again no nontrivial solutions.

3. Case :

Since , the solution of the ordinary differential equation is after cleanup:

We try to satisfy the first boundary condition:

Since we are looking at the case , this can only be true if . So, we need

We now try to also satisfy the second boundary condition:

For a nonzero solution, may not be zero, so the cosine must be zero. For positive argument, a cosine is zero at , so that our eigenvalues are

The same as for eigenvectors, for our eigenfunctions we must choose the one undetermined parameter . Choosing each , we get the eigenfunctions:

The eigenvalues and eigenfunctions have been found. If we want to evaluate them on a computer, we need a general formula for them. You can check that it is:

Just try a few values for . We have finished finding the eigenfunctions.

#### 5.1.5 Should we solve the other equation?

If you look back to the beginning of the previous subsection, you may wonder about the function . It satisfied

Now that we have found the values for from the -problem, we could solve this ordinary differential equation too, and find functions .

However, it is far more straightforward not to do so. Now that the eigenfunctions have been found, the general expression for the solution,

can simply be plugged into the partial differential equation and its initial conditions to find the , completing the solution.

However, most people do solve for the corresponding to each eigenvalue . If you want to follow the crowd, please keep in mind the following:

1. The values of can only be found from the Sturm-Liouville problem for . The problem for is not a Sturm-Liouville problem and cannot produce the correct values for .
2. The functions do not satisfy the same initial conditions at time as does. That is unlike the which must satisfy the homogeneous boundary conditions.
3. Finding is useless if the partial differential equation is inhomogeneous; it simply does not work. Unless you add still more artificial tricks to the mix, as the book does.

#### 5.1.6 Step 2: Solve the problem

Now that the eigenfunctions are known, the problem may be solved. To do so, everything needs to be written in terms of the eigenfunctions. And that means everything, including the partial differential equation and the initial conditions.

We first write our solution in terms of the eigenfunctions:

The coefficients are called the “Fourier coefficients” of . The complete sum is called the “Fourier series” for .

We know our eigenfunctions , but not yet our Fourier coefficients . In fact, the are what is still missing; if we know the , we can find the solution that we want by doing the sum above. On a computer probably, if we want to get high accuracy. Or just the first few terms by hand, if we accept some numerical error.

Next we write the complete partial differential equation, , in terms of the eigenfunctions:

This equation will always simplify; that is how the method of separation of variables works. Look up the differential equation for in the second last subsection; it was

Using this expression for , we can get rid of the -derivatives in the partial differential equation to get

Now if two functions are equal, all their Fourier coefficients must be equal, so we have, for any value of ,

That no longer contains at all. The partial differential equation has become a set of ordinary differential equations in only. And those are much easier to solve than the original partial differential equations. Getting rid of is really what the method of separation variables does for us.

The above ordinary differential equations can be solved easily. For each value of it is a constant coefficient equation. So you write the characteristic equation . That give . Then the solution is

or after cleaning up,

So, we have already found our pressure a bit more precisely:

but we still need to figure out what the integration constants and are.

To do so, we also write the initial condition and in terms of the eigenfunctions:

Sometimes, when or is a simple function, like function 1, students do not write a Fourier series for it. But that does not work.

Using the Fourier series for , , and above, the two initial conditions become

The Fourier coefficients must again be equal, so we conclude that the coefficients we are looking for are

The Fourier series for becomes now

where

So, if we can find the Fourier coefficients and of functions and , we are done.

Now and are, supposedly, given functions, but how do we find their Fourier coefficients? The answer is the following important formula:

This is called the “orthogonality relation”. Even if is some simple function like , we still need to do those integrals. Only if we can immediately say that each Fourier coefficient is zero. The same for :

(These formulae work as long as the ordinary differential equation for the is of the form . What you do for more general differential equations will be covered later.)

We are done! Or at least, we have done as much as we can do until someone tells us the actual functions and . If they do, we just do the integrals above to find all the and , (maybe analytically or on a computer), and then we can sum the expression for for any and that strikes our fancy.

Note that we did not have to do anything with the boundary conditions and . Since every eigenfunction satisfies them, the expression for above automatically also satisfies these homogeneous boundary conditions.