MATHEMATICA TUTORIAL for the Second Course in Differential
Equations. Part V: Orthogonal Expansions
Vladimir Dobrushkin
Preface
This tutorial was made solely for the purpose of education and it was designed
for students taking Applied Math 0340. It is primarily for students who
have some experience using Mathematica. If you have never used
Mathematica before and would like to learn more of the basics for this computer algebra system, it is strongly recommended looking at the APMA
0330 tutorial. As a friendly reminder, don't forget to clear variables in use and/or the kernel. The Mathematica commands in this tutorial are all written in bold black font, while Mathematica output is in regular fonts.
Finally, you can copy and paste all commands into your Mathematica notebook, change the parameters, and run them because the tutorial is under the terms of the GNU General Public License
(GPL). You, as the user, are free to use the scripts for your needs to learn the Mathematica program, and have
the right to distribute and refer to this tutorial, as long as
this tutorial is accredited appropriately. The tutorial accompanies the
textbookApplied Differential Equations.
The Primary Course by Vladimir Dobrushkin, CRC Press, 2015; http://www.crcpress.com/product/isbn/9781439851043
Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part V of the course APMA0340
Introduction to Linear Algebra with Mathematica
When separation of variable method (see next chapter) is applied to partial differential equations, it leads to a corresponding Sturm--Liouville problem. However, it is only one part in constructing the solution to the (initial) boundary value problem. The second important part is representation of a function as a series over eigenfunctions. In many problems for second order partial differential equations, the series representing a function is orthogonal and coefficients could be calculated explicitly. In the majority of higher than two equations, eigenfunctions are not orthogonal and, therefore, separation of variable approach is not successful. Nevertheless, we are going to treat a wide class of partial differential equations of the second order for which separation of variables reduces the problems under consideration to the Sturm--Liouville problems where eigenfunctions are orthogonal. We are forced to remind some definitions.
Two functions f(x) and g(x) defined on some interval [a,b] are called orthogonal, if the integral of the product of functions over the interval is zero:
is called the inner product of functions f and g. It is assumed that all integrals exist.
Recall that the integral of a function over an interval [a,b] does not depend on the values of the function at discrete number of points because they do not affect the integral to compute. Therefore, when one integrate a function over [a,b], it does not matter what are the values of the function at the end points and even whether the function is defined at these points. When we don't care about end points, we use a special and convenient notation: |a,b| which represent one of the following cases:
There are significant differences between the behavior of Fourier- and power-series expansions. A power series is essentially an expansion about a point, using only information from that point about the function to be expanded (including, of course, the values of its derivatives). We already know that such expansions only converge within a radius of convergence defined by the position of the nearest singularity. However, a Fourier series (or any expansion in orthogonal functions) uses information from the entire expansion interval, and therefore can describe functions that have “nonpathological” singularities within that interval. However, we also know that the representation of a function by an orthogonal expansion is only guaranteed to converge in the mean. This feature comes into play for the expansion of functions with discontinuities, where there is no unique value to which the expansion must converge. However, for Fourier series, it can be shown that if a function f(x) satisfying the Dirichlet conditions is discontinuous at a point x_{0}, its Fourier series evaluated at that point will be the arithmetic average of the limits of the left and right approaches.
Consider the collection of cosine functions { 1, cos(x), cos(2x), cos(3x), … } on an interval of length 2π, which we know from the previous sections is orthogonal. We have
An orthogonal system of functions \( \displaystyle \left\{ f_k (x) \right\}_{k\ge 0} \) defined on an interval (finite or not) |a,b| is said to be complete relative to a class of functions if there is no nontrivial function that is orthogonal to each member of the collection of the functions. In other words, if f(x) on |a,b| satisfies
\( \langle f, f_k \rangle =0 \) for all k ≥ 0 implies that f(x) ≡ 0 on [a,b], or, more precisely, that \( \displaystyle \| f \|^2 = \int_a^b \left\vert f^2 (x) \right\vert {\text d}x =0 . \)
Considered previously the collection of cosine functions { 1, cos(x), cos(2x), cos(3x), … } on an interval of length 2π in not complete, but it is orthogonal. Indeed, if f is any odd function (for instance, x or sinx), then \( \displaystyle f(-x) = -f(x) . \) Calculations show that \( \langle f, \cos (kx) \rangle =0 \) because the product of odd function and an even function is an odd function. ■
Theorem:
If \( \displaystyle \left\{ f_k (x) \right\}_{k\ge 0} \) is a complete orthogonal system of functions on the interval |a,b|, then every (piecewise continuous or, more generally, square integrable) function f(x) on |a,b| has the expansion
The orthogonal expansion \( \displaystyle f(x) \sim \sum_{n\ge 0} c_n f_n (x) \) for a complete orthogonal system on [a,b], holds in L^{2} sense, but not necessarily pointwise, i.e. for a fixed x∈[a,b] the series on the right hand side
might not necessarily converge and, even if it does, it might not converge to f(x).
Theorem:
Let f_{1}, f_{2}, …, f_{n}, … be the normalized eigenfunctions of the self-adjoint Sturm--Liouville problem
converges to \( \displaystyle \frac{1}{2} \left[ f(x+0) + f(x-0) \right] \) at each point in the open interval (0,ℓ).
There are known other orthogonal and complete sets of functions that are used in other than differential equations areas. In particular, Li--Torney system of step function is very useful in computer science. The collection of Walsh functions form a complete orthogonal set of functions that can be used to represent any discrete function---just like trigonometric functions can be used to represent any continuous function in Fourier analysis. These functions as well as the Walsh--Hadamard code are named after the American mathematician Joseph L. Walsh (1895--1973). Applications of the Walsh functions can be found wherever digit representations are used, including speech recognition, medical and biological image processing, and digital holography. The Haar wavelet is a sequence of rescaled "square-shaped" functions which together form a wavelet family or basis. Wavelet analysis is similar to Fourier analysis. The Haar sequence was proposed in 1909 by the Hungarian mathematician Alfréd Haar (1885--1933).
The Faber–Schauder system is a Schauder basis for the space C([0, 1]) of continuous functions on [0, 1]. The Franklin system is obtained from the Faber--Schauder system by the Gram–Schmidt orthonormalization procedure.
where E[f] is known as the energy of the 2ℓ-periodic function f ∈ L²[-ℓ,ℓ].
Theorem (Parseval):
If a square integrable function has a Fourier series on the interval of length 2π given by
\( \displaystyle f(x) \sim \frac{a_0}{2} + \sum_{n\ge 1} \left[ a_n \cos \cos (nx) + b_n \sin (nx) \right] \) or a complex Fourier series, \( \displaystyle f(x) \sim \sum_{n=-\infty}^{\infty} c_n e^{{\bf j} nx} , \) then the following identity holds:
This theorem originated in the 1799 work of the French mathematician
Marc-Antoine Parseval (1755--1836). It is also known as Rayleigh's energy theorem, or Rayleigh's Identity because the integral \( \displaystyle E[f] = \frac{1}{\ell} \int_{-\ell}^{\ell} \left\vert f (x) \right\vert^2 {\text d}x = \| f \|^2 / \ell \) usually represents the energy in applications. Therefore, the Parseval theorem could be interpreted as the energy in f equals the energy in its Fourier coefficients. The function space formed by all functions with finite energy (= square integrable, is usually denoted by L²) fill so called the Hilbert space.
Example. Expand the function
\[
f(x) =x, \qquad 0\le x \le 1,
\]
in terms of the normalized eigenfunctions { φ_{n} } of the Sturm--Liouville problem
This problem occurs, for instance, in the heat conduction problem in a bar or rod of unit length. The boundary condition at x = 0 corresponds to a rate of heat flow that is proportional to the temperature, and units are chosen so that the constant of proportinality is 1. The boundary condition at x = 1 corresponds to a perfect insulation there.
The solution of the differential equation \( y'' + \lambda\,y =0 \) may have one of three forms, depending on λ, so it is necessary to consider these cases. Let us start with λ = 0, the general solution becomes a linear function
\[
y = a+ b\,x ,
\]
with some constants a and b. The boundary conditions require that
\[
a-b =0 \qquad\mbox{and}\qquad b=0,
\]
respectively. The only solution is a = b = 0; hence, the boundary value problem has only trivial solution. So λ = 0 is not an eigenvalue.
If λ is negative, we can let λ = -μ² so that μ > 0. Then the differential equation for y becomes
Huaien Li and David C. Torney, A complete system of orthogonal step functions, Proceedings of the American Mathematical Society132 No 12, 2004, 3491--3502.
J. L. Walsh, A closed set of normal orthogonal functions,
American Journal of Mathematics, 45, (1923), 5--24.
Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions