Classroom Tips and Techniques:
Eigenvalue Problems for ODEs - Part 3
Robert J. Lopez Emeritus Professor of Mathematics and Maple Fellow Maplesoft
Initializations
Introduction
In Part 1 of this series of articles on solving eigenvalue problems for ODEs, we discussed equations for which the general solution readily yielded eigenvalues and eigenfunctions without the need for detailed knowledge of any of the special functions of applied mathematics. In Part 2 of this series, we examined the solution of Laplace's equation in a cylinder. Separation of variables in cylindrical coordinates leads to a singular Sturm-Liouville eigenvalue problem whose differential equation is the Bessel equation.
In Part 3 of this series, we will examine the solution of Laplace's equation in a sphere. Separation of variables in spherical coordinates leads to a singular Sturm-Liouville eigenvalue problem in which the differential equation is Legendre's equation. Reasoning from a general solution of Legendre's equation to the bounded solutions needed to solve the eigenvalue problem is a significantly greater challenge than it was for the parallel case of Bessel's equation. Our discussion will highlight the contributions Maple can make to this process.
Steady-State Temperatures in a Sphere
At steady state, the temperature in a sphere satisfies Laplace's equation and some conditions on the boundary of the sphere, which we describe in spherical coordinates by In addition to the conditions prescribed on the surface the physical properties of the system demand the solution be continuous. This requirement will be the most important, and most difficult condition to impose.
If the temperature on the surface of the sphere is prescribed, we say that a Dirichlet condition has been imposed. If the prescribed temperature on the surface is a function of alone, the temperature in the sphere will exhibit azimuthal symmetry so that Alternatively, if this prescribed temperature is then the temperature in the sphere will exhibit azimuthal asymmetry so that
If the surface of the sphere is insulated so the net heat flux across this surface is zero, we say that a homogeneous Neumann condition has been imposed. The flux across the surface is the normal derivative given by evaluated at where is the radius of the sphere. The net flux would be the surface integral of this derivative. However, if the net heat flux across the surface of a homogeneous sphere is zero, the steady-state temperature in the sphere will be constant.
Spherical Coordinates in Maple
From our statement of the problem above, our definition of spherical coordinates can be inferred. However, because there are two different usages prevalent in the literature, we will explicitly define our system according to the notation in most mathematics texts. In such texts, is the distance from the origin; measured from the positive -axis and around the -axis, lies in the range ; and measured downward from the positive -axis, lies in the range The equations connecting these spherical coordinates with Cartesian coordinates appear on the left in Table 1.
Spherical coordinates in texts for physics, engineering, and the applied sciences tend to interchange the names and The equations connecting these spherical coordinates with Cartesian coordinates appear on the right in Table 1.
Math Texts
Angle measured down from -axis
Science Texts
Table 1 Spherical coordinates as defined in math texts (left) and science texts (right)
Finally, note that in Maple's VectorCalculus package, commands that use spherical coordinates assume that the "middle" coordinate in the triple is the angle measured down from the -axis. Unfortunately, in a number of plot commands in the plots package, this convention is not respected. Maple is currently struggling with this quandary, especially so, given its commitment to backward compatibility.
We set the ambient coordinate system via the command
Laplace's Equation in Spherical Coordinates
In a sphere, the steady-state temperature satisfied Laplace's equation This equation is given in Maple as
Maple can determine if the partial differential equation is variable separable:
The return of "0" indicates that the equation is indeed separable because the separability conditions are identically satisfied.
Azimuthal Symmetry
Separation of Variables
Under the assumption that the steady-state temperatures are symmetric about the -axis, dependence on angle can be dispensed with. Hence, and a Maple-generated variable-separation is obtained with
Equation <$/-I%diffGF$6$-F96$F..." align="center" border="0"> shows that a variable separation solution of the form
exists, and provides the ordinary differential equations the functions and must satisfy. We now proceed to obtain these same results from first principles.
Under the separation assumption, Laplace's equation assumes the simpler form
Moving all terms in to the right, we then have
Introduction of Bernoulli's separation constant then leads to the ordinary differential equations
We are primarily interested in the second of these equations - it will become Legendre's equation after a mild rearrangement and change of variables. First, write the equation in the form
and then
Now, make the change of variables with becoming This is done in Maple with
Further simplifying, we have
which is the standard form of Legendre's equation, the self-adjoint form of which would be
The Sturm-Liouville Eigenvalue Problem
The eigenvalue problem that embeds Legendre's equation is singular. The boundary conditions are simply that must be continuous on the interval Passage from the general solution
to the eigenfunctions is surprisingly more difficult than it was for Bessel's equation. Because we are in extended typesetting mode, the functions and are displayed as and respectively. (Were we in extended typesetting mode during our earlier discussion of Bessel's equation, Maple would have displayed as )
When solving Laplace's equation in the cylinder, it was relatively easy to use continuity to restrict the general solution to just , the Bessel function bounded on the interval and to determine the eigenvalues from the zeros of We began the process by ruling out the Bessel function of the second kind because we could tell from a graph that all such functions were unbounded at the origin.
We will try to rule out the function in a similar way, but we will find the process more difficult than it was for the Bessel function. For example, consider
from which it is clear that the function is unbounded at the endpoints because of the logarithms. But this is obvious for , an integer. It is a bit more difficult to divine the endpoint behavior for general values of . For example, we can calculate the values
which suggest may indeed be unbounded at for general values of . Figure 1 contains graphs of the real and imaginary parts of with in the open interval and in the interval .
Figure 1 Real and imaginary parts of for suggesting is unbounded on
From Figure 1(a) especially, we conclude that is unbounded for general values of . On the basis of this conclusion, we set to zero in the general solution of Legendre's equation, and turn our attention to the Legendre function of the first kind.
We first show that for general (real) values of is unbounded. Sample calculations include
To illustrate this behavior for multiple values of , we define the following piecewise function.
If is large, then a graph of will show a point at for that value of . If is "not large" then a graph of will show the value of
We can control the evaluation points for a graph of if we define the uniform random variable via
then create a uniform but random sample of -values that includes the integers in the interval .
The graph of in Figure 2 shows that virtually all evaluations of are large in magnitude.
Figure 2 Stylized graph of for
However, it also suggests that for integer . For noninteger , is unbounded so that the bounded solutions of Legendre's equation
will be the eigenfunctions with
an integer. Hence, the eigenvalues will be
that is, The first few eigenfunctions are
which are the Legendre polynomials normalized so that These polynomials are graphed in Figure 3.
Figure 3 The Legendre polynomials
That the function reduces to the polynomial for can be seen from the following calculations.
For noninteger , we first obtain the formal power series expansion of via
then extract the general term in the first series with
The pochhammer symbol
or "rising factorial" for complex generalizes to
for complex If is a nonpositive integer, then
Making this transformation and setting in the general term of the first series for gives the general coefficient
For large this coefficient is asymptotic to
suggesting that is unbounded since the series under consideration will behave like the harmonic series at . We can confirm this behavior by comparing the general coefficient with for large . In the limit we find the ratio tends to
which is finite for not an integer. To see that for integer the series for reduces to a polynomial, examine the recursion formula for its coefficients. This is most efficiently obtained in Maple via
from which it becomes clear that when Hence, Therefore, is a polynomial of degree for .
Orthogonality of the Eigenfunctions
The classical proof of the orthogonality of the eigenfunctions of Legendre's equation is based on integration by parts. The self-adjoint form of the equation, namely,
is written once for an eigenfunction and once for The first equation is multiplied by and the second, by , and the difference of the two products is integrated over . Integration by parts is applied to the terms containing the derivatives, which then vanish as we can see from the following sketch. Integrals of the terms containing the derivatives can be written as
Integration by parts and subtraction then lead to
What remains is If the eigenvalues and are different, then which implies orthogonality of and .
Thus, for as we see for via the matrix of evaluations below.
From this matrix we also infer that , a result Maple cannot show in general, as we see from
Fourier-Legendre Series
An integrable function can be represented by the Fourier-Legendre series where
The coefficients for the Fourier-Legendre series of the function
are
A partial sum of the Fourier-Legendre series itself is given by
or better still, by
Figure 4 compares graphs of and the partial sum of its Fourier-Legendre series.
Figure 4 Graphs of (in black) and a partial sum of its Fourier-Legendre series (in red)
The function has for its Fourier-Legendre coefficients the numbers
and for a partial sum of its Fourier-Legendre series, the polynomial
Figure 5 compares graphs of and the partial sum of its Fourier-Legendre series.
Figure 5 Graphs of (in black) and a partial sum of its Fourier-Legendre series (in red)
Azimuthal Asymmetry
Without symmetry, so the separated form of the solution of Laplace's equation would be
Maple provides the following ODEs governing these three functions.
We proceed to obtain these results from first principles.
Upon division by and multiplication by Laplace's equation becomes
If the terms containing are moved to the right, we have
Introducing the separation constant leads to the two equations
The resulting -equation can be put into the form
Continuity requires the imposition of the periodic boundary conditions
thus forming a Sturm-Liouville eigenvalue problem for which the solution is Thus, . Making this change in the companion equation, and dividing by we have
Isolating the terms in yields the separated equation
and introduction of the separation constant leads to the two ODEs
The -equation can be manipulated to the form
from which we see that it is an Euler equation solvable in powers of .
The remaining ODE is the associated Legendre equation, which we cast in the form
by bringing all terms to the left and multiplying through by The same change of variables that was used for Legendre's equation is applied, leading to
after suitable rearrangement. A slightly better form for this equation can be obtained with the command
but the form typically seen for Legendre's associated equation is
The general solution of Legendre's associated equation is
a linear combination of the two associated Legendre functions, and (In extended typesetting mode, Maple writes these functions as and respectively.) These are imaginatively called associated Legendre functions of the first and second kinds, respectively. From Legendre's associated equation we can see that and
In the complex plane, a branch cut for a function is a line or line segment across which the function has a jump discontinuity. In Maple, there are two cut-regimes for the Legendre functions. The default regime imposes a cut on the real line coincident with the interval Alternatively, the real intervals and comprise a second cut regime. The environment variable _EnvLegendreCut is used to fix the cut regime by assigning it either of the expressions -1..1 or 1..infinity.
To solve Laplace's equation in the interior of a sphere, the associated Legendre functions that arise must have their branch cut outside of the interval that is, opposite to the default regime. Hence, when working in Maple, the branch cut must be shifted via a proper assignment to the environment variable. However, commands such as evalf or simplify, commands that will most likely be invoked in the context of the solution process, have a remember table, which stores the value assigned to the environment variable. Reassigning a new value to the environment variable will not change the cut regime unless something is done to modify the remember tables in commands such as evalf and simplify. This is done by applying the forget command to these operators before changing the assignment to the environment variable.
For the sake of completeness, we illustrate these issues below.
With the default cut in place, the function is discontinuous across the line segment coincident with the real interval a discontinuity we sample at with the evaluations
Another way to see the discontinuity across this cut is symbolically, with
Careful inspection shows that for , the term will be the square root of a negative number, from whence the discontinuity
arises. Now, if we attempt to shift the branch cut with
it can appear that the behavior of simplify is erratic; simplify may or may not reflect the change in the branch cut, depending on the internal state of Maple. Here, we see
Thus, it is possible that we could have obtained exactly the same result as when the branch cut is along The reason for the uncertainty lies in the remember table attached to the simplify command. Although reassignment to the environment variable is immediate, because of the remember table simplify will not immediately access the new value unless an internal event causes the table to be cleared. To force the remember table to access the new setting, use
the effect of which we test via
In either event, notice that now the term is real for and there will not be a jump across as we see from
Relating Maple to the Literature
The associated Legendre function of the first kind appears in the literature with two different symbols. For example, in the Handbook of Mathematical Functions by Abramowitz and Stegun (Dover Publications), we find the following two formulas relating these functions to Legendre polynomials.
By the obvious experiment, we can conclude that in Maple
Indeed, we construct as
and compare it to in the form
On , the radicals appearing in both expressions are equivalent, as demonstrated by the graphs in Figure 6.
Figure 6 Graphs of (red) and (black)
The orthogonality relation for the associated Legendre functions of the first kind is
a relation Maple can instantiate, but not easily establish from first principles. For example, Table 2 lists some integrals for which while Table 3 lists some for which comparing the computed and formulaic values of the integral.
Table 2 for
Table 3 For compared to
The functions together with the functions form a complete set on the rectangle Consequently, a function can be expanded in a Fourier-Legendre series of the form
where
and
For example, take as
a function whose graph is seen in Figure 7.
Figure 7 Graph of
It is also useful to define the function
whose values appear in the denominators of the expressions for the series coefficients. The computation of these coefficients is slightly simplified by recognizing that all the are zero by symmetry. Then, the first few are given by
and the first few are given by
A partial sum of the Fourier-Legendre series for is then
the graph of which can be seen in Figure 8.
Figure 8 Graph of partial sum of the Fourier-Legendre series for
To estimate the accuracy of this approximation, the difference is plotted in Figure 9.
Figure 9 Graph of as an estimate of the accuracy of the partial sum
Legal Notice: The copyright for this application is owned by Maplesoft. The application is intended to demonstrate the use of Maple to solve a particular problem. It has been made available for product evaluation purposes only and may not be used in any other context without the express permission of Maplesoft.