You are on page 1of 15

Applied Differential Calculus, lecture 5

Luis L. Bonilla
Departamento de Ciencia e Ingenierı́a de Materiales e Ingenierı́a Quı́mica,
Universidad Carlos III de Madrid,
Room 2.1.D17
Office hours: Tuesdays 11-13
bonilla@ing.uc3m.es,
http://scala.uc3m.es

1
I. EIGENVALUE PROBLEMS FOR SECOND ORDER LINEAR ODES

A. Separation of variables and eigenvalue problems for second order linear ODEs

A standard method to solve linear partial differential equations (PDEs) is separation


of variables. This method produces eigenvalue problems associated to linear homogeneous
ODEs with homogeneous boundary conditions. Typical example: Solve the homogeneous
heat equation for the temperature u(x, t) on a thin cylindrical metallic bar of length L with
Dirichlet boundary conditions at zero temperature, insulated lateral surface and an initial
temperature profile:

∂u ∂ 2u
= k 2 , 0 < x < L, t > 0,
∂t ∂x
u(0, t) = 0, u(L, t) = 0, t > 0,

u(x, 0) = f (x), 0 < x < L.

The constant k > 0 is the thermal diffusivity of the metal, the heat flux is q = −k ∂u
∂x
, and
the heat equation represents conservation of energy. We look for special solutions of the
form up (x, t) = X(x)T (t), that are products of functions of x and functions of t. We insert
this into the homogeneous heat equation and divide the result by up , thereby obtaining

T 0 (t) X 00 (x)
= .
k T (t) X(x)

The left hand side of this equation is a function of t and the right hand side is a function of
x. Then both sides are equal to a constant (because taking an x derivative of the equation,
X 00 (x)
the left hand side gives zero and therefore the x derivative of X(x)
is zero, therefore yielding
X 00 (x)
X(x)
= −λ, a constant). Then we get

X 00 (x) + λX(x) = 0, T 0 (t) = −λk T (t).

λ is called the separation constant.


The Dirichlet boundary conditions yield X(0) = 0 and X(L) = 0, so that the spatial
function X(x) satisfies the BVP:

X 00 (x) + λX(x) = 0, 0 < x < L,

X(0) = 0, X(L) = 0.

2
It is clear that X = 0 is a solution of this BVP but, for certain values of λ, we may find
nonzero (nontrivial) solutions. Let these solutions be Xn (x), n = 1, 2, . . . (we will see that
there are infinitely many solutions labelled by natural numbers n). We have found particular
solutions Xn (x)e−kλt and the superposition principle gives

X
u(x, t) = an Xn (x) e−kλt .
n=1

Inserting this into the initial condition, we find



X
an Xn (x) = f (x),
n=1

which can be used to determine the coefficients an .

B. Eigenvalue problems for second order linear ODEs

The eigenvalue problem sketched before is: Find the values of λ for which the following
BVP has non-zero solutions:

u00 + λu = 0, u(0) = 0, u(L) = 0.

This problem is easy to solve,


√ √
u(x) = c sin( λx), with λL = nπ (n = 1, 2, . . .)

Unless λn = (nπ/L)2 , the solution of the previous BVP is the trivial one, u = 0. These λn
are the eigenvalues and the associated solutions un (x) = sin nπx
L
are called eigenfunctions.
As explained before, we want to see whether it is possible to find a series of eigenfunctions
that converges to a given function:

X nπx
an sin = f (x).
n=1
L
In this case, the left hand side is a Fourier sine series and there are formulas for an and
properties of the series that we should study.

C. Fourier series

The simple eigenvalue problem

u00 + λu = 0, u(−L) = u(L), u0 (−L) = u0 (L),

3
(periodic boundary conditions at x = ±L) has eigenfunctions cos nπx
L
and sin nπx
L
associated
n2 π 2
to the eigenvalues λn = L2
with n = 0, 1, 2, . . .. As the boundary conditions are periodic,
the multiplicity of the eigenvalues is 2 and two eigenfunctions correspond to each eigenvalue
except for λ0 = 0.
A function that has a continuous derivative except on finitely many points of an interval is
called piecewise smooth if the jumps at the discontinuity points are finite. A given piecewise
smooth function f (x) can be expanded in Fourier series as
X∞ h  nπx   nπx i
f (x) ∼ a0 + an cos + bn sin , (1)
n=1
L L

with coefficients given by:


Z L
1
a0 = f (x)dx,
2L −L
1 L
Z  nπx 
an = f (x) cos dx, (2)
L −L L
1 L
Z  nπx 
bn = f (x) sin dx.
L −L L

As usual the ∼ symbol in (1) means that the Fourier series converges to [f (x+) + f (x−)]/2
(Fourier pointwise convergence theorem). To derive these formulas we have used the orthog-
onality relations

Z L


 0 n 6= m
nπx mπx 
cos cos dx = L n = m 6= 0 (3)
−L L L 

 2L n = m = 0


Z L  0 n 6= m
nπx mπx
sin sin dx = (4)
−L L L  L n = m 6= 0
Z L
nπx mπx
cos sin dx = 0, (5)
−L L L

that can be checked by using trigonometry.

1. Pointwise convergence theorem

If f (x) is piecewise smooth on the interval −L ≤ x ≤ L, then the Fourier series of f (x)
converges

4
1. to the periodic extension of f (x), where the periodic extension is continuous;

2. to the average of the two limits,


f (x+) + f (x−)
,
2
where the periodic extension has a jump discontinuity.

Here a piecewise smooth f (x) means that f and df /dx are both piecewise continuous, i.e.:
(i) they are continuous at all but a finite number of points in (−L, L); (ii) every discontinuity
in (−L, L) is a jump discontinuity; (iii) their limits as x → −L+ and as x → L− exist. The
following corollary is a direct consequence of the Fourier pointwise convergence theorem:

Corollary

1. If f : (−L, L) → R is continuous and piecewise smooth, then its periodic extension


is continuous everywhere except (possibly) at the points ±L, ±3L, . . .. It follows that
the Fourier series of f converges to f (x) for all −L < x < L.

2. If f : [−L, L] → R is continuous and piecewise smooth, and f (−L) = f (L), then


its periodic extension is continuous everywhere, and therefore the Fourier series of f
converges to f (x) for all −L ≤ x ≤ L (including the endpoints).

3. If f : [0, L] → R is continuous and piecewise smooth, then feven , the periodic extension
of its even extension, is continuous everywhere. It follows that the Fourier cosine series
of f converges to f (x) for all 0 ≤ x ≤ L (including the endpoints).

4. If f : [0, L] → R is continuous and piecewise smooth, then fodd , the periodic exten-
sion of its odd extension, is continuous everywhere except (possibly) at the points
0, ±L, ±2L, . . .. It follows that the Fourier sine series of f converges to f (x) for all
0 < x < L.

5. If f : [0, L] → R is continuous and piecewise smooth, and f (0) = f (L) = 0, then fodd
is continuous everywhere. It follows that the Fourier sine series of f converges to f (x)
for all 0 ≤ x ≤ L (including the endpoints).

It can be proved that when the periodic extensions of a piecewise smooth f (x), or of its
even or odd extensions, are continuous, the corresponding Fourier series converge uniformly

5
FIG. 1: Square wave in Example 1.

to f . Then the Fourier series can be differentiated term by term and the resulting series
converges to f 0 (x) whenever the derivative is continuous.
Example 1. Let 
 0, −L < x < 0,
f (x) =
 L, 0 < x < L,

and let f be defined outside this interval so that f (x + 2L) = f (x) for all x. We will
temporarily leave open the definition of f at the points x = 0, ±L. We shall now find the
Fourier series for this function and determine where it converges.
The Fourier coefficients are
Z L
1 L
Z Z L
1 L nπx
a0 = f (x)dx = dx = , an = cos dx = 0 (n 6= 0),
2L −L 2 0 2 0 L

Z L
nπx 2L 2L  1, n odd,
bn = sin dx = (1 − cos nπ) =
0 L nπ nπ  0, n even.

Therefore

L 2L X 1 (2m − 1)πx
f (x) = + sin . (6)
2 π m=1 2m − 1 L

At the points x = 0, ±nL, where the function f is not continuous, all terms in the series
after the first vanish and the sum is L/2. This is the mean value of the limits from the right
and left, as it should be. Thus we might as well define f at these points to have the value
L/2. If we choose to define it otherwise, the series still gives the value L/2 at these points,
since all of the preceding calculations remain valid. The series simply does not converge
to the function at those points unless f is defined to have the value L/2. This illustrates

6
FIG. 2: The partial sum s8 (x) in the Fourier series, Eq. (6), for the square wave.

the possibility that the Fourier series corresponding to a function may not converge to it at
points of discontinuity unless the function is suitably defined at such points.
The manner in which the partial sums
 
L 2L πx 1 (2n − 1)πx
sn (x) = + sin + ... + sin , n = 1, 2, . . . , (7)
2 π L 2n − 1 L

of the Fourier series (6) converge to f (x) is indicated in Figure 2, where L has been chosen
to be 1 and the graph of s8 (x) is plotted. The figure suggests that at points where f is
continuous the partial sums do approach f (x) as n increases. However, in the neighborhood
of points of discontinuity, such as x = 0 and x = L, the partial sums do not converge
smoothly to the mean value. Instead they tend to overshoot the mark at each end of the
jump, as though they cannot quite accommodate themselves to the sharp turn required at
this point. This behavior is typical of Fourier series at points of discontinuity and is known
as the Gibbs phenomenon.
Additional insight is attained by considering the error en (x) = f (x) − sn (x). Figure 3
shows a plot of |en (x)| for n = 8 and for L = 1. The least upper bound of |e8 (x)| is 0.5 and
is approached as x → 0 and as x → 1. As n increases, the error decreases in the interior
of the interval [where f (x) is continuous], but the least upper bound does not diminish
with increasing n. Thus we cannot uniformly reduce the error throughout the interval by
increasing the number of terms.

7
FIG. 3: A plot of the error |e8 (x)| versus x for the square wave.

2. Sketching Fourier series

We can sketch Fourier series by drawing the corresponding periodic extensions and mark-
ing with a cross the points at which the series converges at discontinuity points of the periodic
extension of f (x).

3. Term-by-term differentiation of Fourier series

If the periodic extension of a continuous function has a Fourier series with jump discon-
tinuities at the ends of the interval (−L, L), then it cannot be differentiated term by term.
To see why, take the Fourier series of f 0 (x):

X∞ h  nπx   nπx i
f 0 (x) ∼ A0 + An cos + Bn sin . (8)
n=1
L L

8
The Fourier coefficients can be calculated by integration by parts using (2) to simplify the
result:
Z L
1 f (L) − f (−L)
A0 = f 0 (x)dx = ,
2L −L 2L
1 L 0 f (L) − f (−L)
Z  nπx 
An = f (x) cos dx = cos(nπ) + nπbn , (9)
L −L L L
1 L 0
Z  nπx 
Bn = f (x) sin dx = −nπan .
L −L L

Clearly we need f (−L) = f (L) for term-by-term differentiation to hold.

4. Term-by-term integration of Fourier series

We can integrate term by term the Fourier series of a piecewise smooth function f (x) and
the result is a convergent series that always converges to the integral of f (x) for −L ≤ x ≤ L
even if the original Fourier series has jump discontinuities. The new series formed by term-
by-term integration is continuous, but it may not be a Fourier series. See a proof of this
statement in section 3.5 of [5].

9
II. SOME SOLVED PROBLEMS

1. In each of the following eigenvalue problems, determine the eigenvalues and the nor-
malized eigenfunctions.

(a) y 00 = λy, y(0) = 0, y(π/2) = 0.

(b) y 00 = λy, y(0) = 0, y 0 (L) = 0.

(c) y 00 = λy, y 0 (0) = 0, y 0 (L) = 0.

(d) y 00 + λy = 0, 2y(0) + y 0 (0) = 0, y(1) = 0.

(e) y 00 − 4y 0 + 4y = λy, y(0) = 0, y(π) = 0.


√ √ √
Solution. (a) y = sin( −λx) gives sin( π2 −λ) = 0, i.e., π
2
−λ = nπ, so that
λ = −4n2 with n = 1, 2, . . .. The normalized eigenfunctions are φn (x) = √2π sin(2nx).
√ √
(b) y = sin( −λx) gives cos(L −λ) = 0, i.e., λ = −(n−1/2)2 π 2 /L2 with n = 1, 2, . . ..
q
The normalized eigenfunctions are φn (x) = L2 sin (2n−1)πx
2L
.
√ √
(c) y = cos( −λx) gives sin(L −λ) = 0, i.e., λ = −n2 π 2 /L2 with n = 0, 1, 2, . . ..
q
The normalized eigenfunctions are φ0 (x) = √1L , φn (x) = L2 cos nπx
L
.
√ √ √ √
(d) y = sin( λ(x−1)) gives λ cos λ = 2 sin λ, i.e., λ = γn2 where γn , n = 1, 2, . . .,
γ
are the non-negative solutions of tan γ = 2
. The normalized eigenfunctions are
q 2
φn (x) = 2(γ n +4)
γ 2 +2
sin(γn (x − 1)) for n ≥ 1.
n

(e) Setting y = erx , we find (r − 2)2 = λ, i.e., r = 2 + i −λ. Then y =
√ √
e2x [c1 cos( −λx) + c2 sin( −λx)]. 0 = y(0) = c1 and y(π) = 0 gives λ = −n2 ,
n = 1, 2, . . .. The corresponding eigenfunction is φn (x) = Zn−1 e2x sin(nx), where Zn2 =
Rπ 2 q
π
pπ 2 2x
0
sin (nx) dx = 2
. Then Z n = 2
, φ n (x) = π
e sin(nx). Note that the scalar

product of two functions, f (x) and g(x), is, in this case, hf, gi = 0 f (x)g(x)e−4x dx.

2. In each of the following problems, find the coefficients in the eigenfunction expansion
P∞
n=1 an φn (x) of f (x) = 1, using the normalized eigenfunctions of the previous problem
RL
Solution. In this case, an = 0 φn (x) dx where L is the upper limit of the interval, and
we find for the cases (a)-(e) in Problem 1:

2
(a) an = √
n π
for odd n and an = 0 for even n.

(b) (−1)n+1 22n−1
2L
.

10

(c) Lδn0 ,

2− 4+γ 2
q
2 n
(d) 2 +2
γn γn
.
q
(e) 2 n
π n2 +4
[1 − (−1)n e−2π ].

eax
R
We have used eax eibx dx = a2 +b2
[a cos bx + b sin bx + i(a sin bx − b cos bx)].

3. Solve the BVP u00 + 2u = 2 − 4x, u0 (0) = 1, u(1) + u0 (1) = −2 by an appropriate


eigenfunction expansion. Check that the solution found by elementary methods is the
same one.
Solution. The corresponding eigenvalue problem is u00 + λu = 0, u0 (0) = 0,
u(1) + u0 (1) = 0. Its solutions are: λn = γn2 , with γn tan γn = 1, and the normal-
q 2
ized eigenfunction φn (x) = 2(1+γ 2
2+γn
n)
cos(γn x), n = 1, 2, . . ..
R1
The Green formula, 0 (φn u00 − uφ00n )dx = (φn u0 − uφ0n )|10 , and the boundary conditions
R1
give 0 [(2 − 4x)φn + (λn − 2)uφn ]dx = −2φn (1) − φn (0). We therefore get un ≡
R1 1
R1
0
uφ n dx = 2−γ 2 [2φn (1) + φn (0) + 0
(2 − 4x)φn dx]. Since
n

Z 1
2 4 4
(2 − 4x) cos γn x dx = sin γn − sin γn + 2 (1 − cos γn )
0 γn γn γn
!
2 2 3γn
= 2 (2 − 2 cos γn − cos γn ) = 2 2 − p ,
γn γn 1 + γn2
we obtain √
4 + γn2 p
 
2 2
6
un = p 1 + γn − ,
(2 − γn2 ) 2 + γn2 γn2 γn
from which,
∞ p
X 2[(4 + γn2 )(1 + γn2 ) − 6γn
γn2 + 1]
u(x) = cos(γn x).
n=1
γn2 (2 − γn2 )(2 + γn2 )
√ √
The general solution of the ODE is u(x) = 1−2x+a cos 2x+b sin 2x, which inserted
√ √ √
in the boundary conditions gives −2 + 2b = 1 and 1 − 2 − 2 + (a + b 2) cos 2 + (b −
√ √ √ √ √ √
a 2) sin 2 = −2. Then b = 3/ 2 and a = [1 − 3(cos 2 + 2−1/2 sin 2)]/(cos 2 −
√ √
2 sin 2), and the solution of the BVP is
√ √
1 − 3(cos 2 + 2−1/2 sin 2) √ 3 √
u(x) = 1 − 2x + √ √ √ cos 2x + √ sin 2x.
cos 2 − 2 sin 2 2
Expanding this solution in the eigenfunctions, we can show that it is the same function
we found before.

11
FIG. 4: From left to right and from top to bottom: (a) s5 (x), s10 (x), s20 (x) for f (x) = |x| on
(−2, 2) and period 4, (b) s5 (x), s10 (x), s20 (x) for f (x) = x on (−1, 1) and period 2.

4. In each of the following problems: (i) Sketch the graph of the given function for three
periods. (ii) Find the Fourier series for the given function. (iii) Plot sm (x) (partial
sum of Fourier series to order m) versus x for m = 5, 10, and 20. (iv) Describe how
the Fourier series seems to be converging.

(a) f (x) = |x| for −2 ≤ x < 2 with f (x + 4) = f (x).

(b) f (x) = x for −1 ≤ x < 1 with f (x + 2) = f (x).


P∞
Solution. (a) (i), (ii) f (x) = 1 − 8
n=1 (2n−1)2 π 2 cos (2n−1)πx
2
. (iii) See figure 4. (iv)
See figure 5. Notice that the error is uniformly small.
(−1)n 2
(b) (i), (ii) f (x) = − ∞
P
n=1 nπ sin(nπx). (iii) See figure 4. (iv) See figure 5. Notice

12
FIG. 5: |e(x)| = |f (x) − s20 (x)| for one period. (a) f (x) = |x| on (−2, 2) (period 4), (b) f (x) = x
on (−1, 1) (period 2).

that the error is about 1.17 at the discontinuity point x = 0 as it should be due to the
Gibbs phenomenon. Can we get rid of the Gibbs phenomenon? The answer is yes.
While the partial summation of the Fourier series exhibits the Gibbs phenomenon no
matter how many terms we keep, the Féjer sums defined as
n
1X
σn (x) = sj (x),
n j=1

converge to f (x) for all x 6= 0. (The Féjer sums of a continuous function f converge
uniformly to f (x)).

5. There are some things wrong in the following demonstration. Find the mistakes and
correct them.
In this problem we attempt to obtain the Fourier cosine coefficients of ex :

x
X nπx
e = A0 + An cos . (10)
n=1
L

Differentiating yields

x
X nπ nπx
e =− An sin ,
n=1
L L
the Fourier sine series of ex . Differentiating again yields

x
X n2 π 2 nπx
e =− An cos . (11)
n=1
L2 L

Since (10) and (11) give the Fourier cosine series of ex , they must be identical. Thus
we get A0 = 0 and An = 0, which is obviously wrong!

13
FIG. 6: (a) s5000 (x) and (b) σ5000 (x) for x close to 0. Notice that the Gibbs phenomenon (appre-
ciable only if we zoom on the region close to the discontinuity at x = 0) is eliminated for all x 6= 0
by plotting the Féjer sums and keeping enough terms.

By correcting the mistakes, you should be able to obtain A0 and An without having
RL
to do the integral An = (2/L) 0 ex cos(nπx/L)dx.

Solution. The even extension of the function ex is continuous on the interval


[−L, L] and therefore its differentiation term by term is correct. The resulting
function is the odd extension of ex which is not continuous at x = 0 and x = L. Thus
(11) is not correct. Let (ex )0 = B0 + ∞
P
n=1 Bn cos(nπx/L). Then

1 L x 0 eL − 1
Z
B0 = (e ) dx = ,
L 0 L
2 L x 0 2(eL (−1)n − 1) 2nπ L x
Z Z
nπx nπx
Bn = (e ) cos dx = + 2 e sin dx
L 0 L L L 0 L
2 nπ  nπ  2 n2 π 2
= [(−1)n eL − 1] + − An = [(−1)n eL − 1] − 2 An .
L L L L L

14
Comparison with (10) yields

eL − 1
A0 = B0 = ,
L
n2 π 2 2L[(−1)n eL − 1]
 
2
1 + 2 An = [(−1)n eL − 1] =⇒ An = .
L L n2 π 2 + L2

[1] M. Abramowitz & I. A. Stegun, Handbook of Mathematical Functions. Dover, N. Y., 1965.
[2] C. M. Bender & S. A. Orszag, Advanced Mathematical Methods for Scientists and Engineers.
McGraw Hill, N.Y. 1978. Chapter 3, sections 3.1 to 3.3.
[3] W.E. Boyce & R.C. Di Prima, Elementary differential equations and boundary value problems.
9th ed. John Wiley & Sons, N.Y. 2009. Chapters 5 and 11.
[4] M. S. Gockenbach, Partial differential equations. SIAM, 2002. Chapters 6 and 9. Proofs of
convergence of Fourier series and of eigenfunction expansions.
[5] R. Haberman, Elementary applied partial differential equations. 3rd ed. Prentice Hall, 1998.
Chapters 3 and 5.

15

You might also like