You are on page 1of 126

Contents

1 Classification of Differential Equations


2 Models in one dimension
2.1 Heat Flow in a bar; Fouriers law . . . .
2.2 The hanging bar . . . . . . . . . . . . .
2.3 The wave equation for a vibrating string
2.4 Advection; kinematic waves . . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

3
3
4
5
5

3 Essential Linear Algebra


3.1 Linear systems as linear operator equations . . . . .
3.2 Existence and uniqueness of solutions to Ax = b . .
3.3 Basis and dimension . . . . . . . . . . . . . . . . . .
3.4 Orthogonal bases and projections . . . . . . . . . . .
3.5 Eigenvalues and eigenvectors of a symmetric matrix

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

7
7
9
10
11
12

4 Essential Ordinary Differential Equations


4.1 Background . . . . . . . . . . . . . . . . . . .
4.2 Solutions to some simple ODEs . . . . . . . .
4.3 Linear systems with constant coefficients . . .
4.4 Numerical methods for initial value problems
4.5 Stiff systems of ODEs . . . . . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

15
15
17
19
21
23

5 Boundary Value Problems in Statics


5.1 The analogy between BVPs and linear algebraic systems
5.2 Introduction to the spectral method; eigenfunctions . . .
5.3 Solving the BVP using Fourier series . . . . . . . . . . .
5.4 Finite element methods for BVPs . . . . . . . . . . . . .
5.5 The Galerkin method . . . . . . . . . . . . . . . . . . .
5.6 Piecewise polynomials and the finite element method . .

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

25
25
27
29
32
33
35

6 Heat Flow and Diffusion


6.1 Fourier series methods for the heat equation . . . . . . .
6.2 Pure Neumann conditions and the Fourier cosine series .
6.3 Periodic boundary conditions and the full Fourier series
6.4 Finite element methods for the heat equation . . . . . .
6.5 Finite elements and Neumann conditions . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

39
39
41
44
47
49

7 Waves
7.1 The homogeneous wave equation without boundaries
7.2 Fourier series methods for the wave equation . . . .
7.3 Finite element methods for the wave equation . . . .
7.4 Resonance . . . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

53
53
54
57
58

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.

ii

CONTENTS
7.5

Finite difference methods for the wave equation . . . . . . . . . . . . . . . . . . . . . . . . . . .

61

8 First-order PDEs and the Method of Characteristics


8.1 The simplest PDE and the method of characteristics . . . . . . . . . . . . . . . . . . . . . . . .
8.2 First-order quasilinear PDEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.3 Burgerss equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

63
63
65
67

9 Greens Functions
9.1 Greens functions for BVPs in ODEs: Special cases . . . .
9.2 Greens functions for BVPs in ODEs: the symmetric case
9.3 Greens functions for BVPs in ODEs: the general case . .
9.4 Introduction to Greens functions for IVPs . . . . . . . . .
9.5 Greens functions for the heat equation . . . . . . . . . . .
9.6 Greens functions for the wave equation . . . . . . . . . .

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

71
71
72
75
76
79
80

10 Sturm-Liouville Eigenvalue Problems


10.2 Properties of the Sturm-Liouville operator . . . . . . .
10.3 Numerical Methods for Sturm-Liouville problems . . .
10.4 Examples of Sturm-Liouville problems . . . . . . . . .
10.5 Robin boundary conditions . . . . . . . . . . . . . . .
10.6 Finite element methods for Robin boundary conditions
10.7 The theory of Sturm-Liouville problems: an outline . .

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

83
83
84
85
85
86
88

11 Problems in Multiple Spatial Dimensions


11.1 Physical models in two or three spatial dimensions . . . . . .
11.2 Fourier series on a rectangular domain . . . . . . . . . . . . .
11.3 Fourier series on a disk . . . . . . . . . . . . . . . . . . . . . .
11.4 Finite elements in two dimensions . . . . . . . . . . . . . . . .
11.5 The free-space Greens function for the Laplacian . . . . . . .
11.6 The Greens function for the Laplacian on a bounded domain
11.7 Greens function for the wave equation . . . . . . . . . . . . .
11.8 Greens functions for the heat equation . . . . . . . . . . . . .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

89
89
90
94
96
100
102
107
109

12 More about Fourier Series


12.1 The complex Fourier series . . . . . . . . . . .
12.2 Fourier series and the FFT . . . . . . . . . . .
12.3 Relationship of sine and cosine series to the full
12.4 Pointwise convergence of Fourier series . . . . .
12.5 Uniform convergence of Fourier series . . . . .
12.6 Mean-square convergence of Fourier series . . .
12.7 A note about general eigenvalue problems . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

111
111
113
116
116
117
117
119

. . . . .
. . . . .
methods
. . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

121
121
122
124
124

.
.
.
.
.
.

.
.
.
.
.
.

. . . . . . . .
. . . . . . . .
Fourier series
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .

13 More about Finite Element Methods


13.1 Implementation of finite element methods . . . . . . .
13.2 Solving sparse linear systems . . . . . . . . . . . . . .
13.3 An outline of the convergence theory for finite element
13.4 Finite element methods for eigenvalue problems . . . .

Chapter 1

Classification of Differential Equations


1.

(a) First-order, homogeneous, linear, nonconstant-coefficient, scalar ODE.


(b) Second-order, inhomogeneous, linear, constant-coefficient, scalar PDE.
(c) First-order, nonlinear, scalar PDE.

3.

(a) Second-order, nonlinear, scalar ODE.


(b) First-order, inhomogeneous, linear, constant-coefficient, scalar PDE.
(c) Second-order, inhomogeneous, linear, nonconstant-coefficient, scalar PDE.

5.

(a) No.
(b) Yes.
(c) No.

7. There is only one such f : f (t) = t cos (t).


9. For any constant C 6= 1, the function w(t) = Cu(t) is a different solution of the differential equation.

Chapter 2

Models in one dimension


2.1

Heat Flow in a bar; Fouriers law

1. The units of are energy per length per time per temperature, for example, J/(cm s K) = W/(cm K).
3. The units of Acux are
g J
Kcm = J.
cm2
cm3 g K
r
5. u
(`, t) = A
, t > t0 .
x
7. Measuring x in centimeters, the steady-state temperature distribution is u(x) = 0.1x + 20, the solution of

d2 u
= 0, u(0) = 20, u(100) = 30.
dx2

The heat flux is

du
(x) = 0.802 0.1 = 0.0802 W/cm2 .
dx
.
Since the area of the bars cross-section is cm2 , the rate at which energy is flowing through the bar is 0.0802 =
0.252 W (in the negative direction).
9. Consider the right endpoint (x = `). Let the temperature of the bath be u` , so that the difference in temperature
between the bath and the end of the bar is u(`, t) u` . The heat flux at x = ` is, according to Fouriers law,

u
(`, t),
x
so the statement that the heat flux is proportional to the temperature flow is written

u
(`, t) = (u(`, t) u` ) ,
x
where > 0 is a constant of proportionality. This can be simplified to

u(`, t) +

u
(`, t) = u` .
x

The condition at the right end is similar:


u
(0, t) = u0 .
x
(The sign change appears because, at the left end, a positive heat flux means that heat flows into the bar, while
at the right end the opposite is true.)
11. The IBVP is
2u
u
D 2 = f (x, t), 0 < x < `, t > t0 ,
t
x
u(x, t0 ) = (x), 0 < x < `,
u
(0, t) = 0, t > t0 ,
x
u
(`, t) = 0, t > t0 .
x
u(0, t)

CHAPTER 2. MODELS IN ONE DIMENSION


13.

(a) The rate is


u u 
0
`
.
`
(b) The rate of mass transfer varies inversely with ` and directly with the square of r.
r2 D

2.2

The hanging bar

1. The sum of the forces on the cross-section originally at x = ` must be zero. As derived in the text, the internal
(elastic) force acting on this cross-section is
du
Ak(`) (`),
dx
while the external traction results in a total force of pA (force per unit area times area). Therefore, we obtain
Ak(`)

du
(`) + pA = 0,
dx

or
k(`)
3.

du
(`) = p.
dx

The other boundary condition, of course, is u(0) = 0.


(a) The stiffness is the ratio of the internal restoring force to the relative change in length. Therefore, if a bar
of length ` and cross-sectional area A is stretched to a length of 1 + p (0 < p < 1) times `, then the bar will
pull back with a force of 195pA gigaNewtons. Equivalently, this is the force that must be applied to the end
of the bar to stretch the bar to a length of (1 + p)`.
(b) 196/195 m, or approximately 1.005 m.
(c) The BVP is

d2 u
= 0, 0 < x < 1,
dx2
u(0) = 0,
9 du
(1) = 109 .
195 10
dx
It is easy to show by direct integration that the solution is u(x) = x/195, and therefore u(1) = 1/195. Since
u is the displacement (in meters), the final position of the end of the bar is 1 + 1/195 m, that is, the stretched
bar is 196/195 m.
5. The wave equation is
2
 2u
11  u
7.9 103

1.95

10
= f (x, t), 0 < x < 1.
t2
x2
3
The units of f are N/m (force per unit volume). The units of the first term on the left are
195 109

kgm/s2
kg m
N
=
= 3,
3
2
m s
m3
m
and the units of the second term on the left are
N 1
N
= 3.
m2 m
m
7.

(a) We have
2u
(x, t) = c2 2 u(x, t),
t2
while

2u
(x, t) = 2 u(x, t).
x2

Therefore,
2
2u
2 u

c
= c2 2 u + c2 2 u = 0.
t2
x2
(b) Regardless of the value of , u(0, t) = 0 holds for all t. The only way that u(`, t) = 0 can hold for all t is if

sin (`) = 0,
so must be one of the values
=

n
, n = 0, 1, 2, . . . .
`

2.3. THE WAVE EQUATION FOR A VIBRATING STRING

2.3

The wave equation for a vibrating string

1. Units of acceleration (length per time squared).


3. Units of velocity (length per time).
5. The internal force acting on the end of the string at, say, x = `, is
T

u
(`, t).
x

(2.1)

If this end can move freely in the vertical direction, force balance implies that (2.1) must be zero.
7. If u(x, t) = f (x ct), then
v
(x, t)=f 0 (x ct),
x
v
(x, t)= cf 0 (x ct),
t

2v
(x, t)=f 00 (x ct),
x2
2v
(x, t)=c2 f 00 (x ct),
t2

Therefore,
2u
2u
(x, t) c2 2 (x, t) = c2 f 00 (x ct) c2 f 00 (x ct) = 0,
2
t
x
as desired. Similarly, if v(x, t) = f (x + ct), then
v
(x, t)=f 0 (x + ct),
x
v
(x, t)=cf 0 (x + ct),
t
and hence

2.4

2v
(x, t)=f 00 (x + ct),
x2
2v
(x, t)=c2 f 00 (x + ct),
t2

2
2v
2 v
(x,
t)

c
(x, t) = c2 f 00 (x + ct) c2 f 00 (x + ct) = 0.
t2
x2

Advection; kinematic waves

1. The solution u of
u
u
+c
= 0, 0 < x < `, t > 0,
t
x
u(x, 0) = u0 (x), 0 < x < `,
u(0, t) = (t), t > 0.
can be found by reasoning similar to that used to solve the pure IVP (see (2.23) and following in the text). The
cross-section at point x at time t was ct units to the left at time t = 0. If x ct > 0, then the value of u(x, t)
is given by the initial condition: u(x, t) = u0 (x ct). If x ct < 0, then u(x, t) is determined by the boundary
condition u(0, t) = (t), and we must ask: At what time was the cross-section, now at point x at time t, found at
x = 0? The answer is t0 , where c(t t0 ) = x, that is, t0 = t (1/c)x. Thus u(x, t) = (t (1/c)x) if x ct < 0.
It is easy to verify by a direct calculuation that

u0 (x ct),
x ct > 0,

u(x, t) =
t 1c x , x ct < 0
solves the given IBVP.
3. Suppose u solves
u
u
+c
= 0, < x < , t > 0,
t
x
u(x, 0) = (x), < x < ,
where c > 0, and suppose that (x) = 0 for all x a. The solution is u(x, t) = (x ct), so u(x, t) = 0 if
x ct a, that is, if t > (x a)/c.

Chapter 3

Essential Linear Algebra


3.1

Linear systems as linear operator equations

1. A function of the form f (x) = ax + b is linear if and only if b = 0. Indeed, if f : R R is linear, then f (x) = ax,
where a = f (1).
3. Let f : R2 R2 be defined by

f (x) =

x21 + x22
x2 x21

If we take x = (1, 1), then f (x) = (2, 0), while 2x = (2, 2) and hence f (2x) = (8, 2) 6= 2f (x). Thus f is not
linear.
5.

(a) Vector space (subspace of C[0, 1]).


(b) Not a vector space; does not contain the zero function. (Subset of C[0, 1], but not a subspace.)
(c) Vector space (subspace of C[0, 1]).
(d) Vector space.
(e) Not a vector space; does not contain the zero polynomial. (Subset of Pn , but not a subspace.)

7. Suppose u C 1 [a, b] is any nonzero function. Then


L(2u) = 2

du
du
+ (2u)3 = 2
+ 8u3 ,
dx
dx

while
2Lu = 2

du
+ 2u3 .
dx

Since L(2u) 6= 2Lu, L is not linear.


9. Define K : C 2 [a, b] C[a, b] by
Ku = x2

du
d2 u
2x
+ 3u.
dx2
dx

Then K is linear:
d2
d
(u) 2x (u) + 3(u)
dx2
dx
du
d2 u
= x2 2 2x
+ 3u
dx
dx


d2 u
du
= x2 2 2x
+ 3u = Ku,
dx
dx

K(u) = x2

d2
d
(u + v) 2x (u + v) + 3(u + v)
dx2
dx
 2



d u
d2 v
du
dv
= x2
+

2x
+
+ 3(u + v)
dx2
dx2
dx
dx

 

d2 u
du
d2 v
dv
= x2 2 2x
+ 3u + x2 2 2x
+ 3v = Ku + Kv.
dx
dx
dx
dx

K(u + v) = x2

CHAPTER 3. ESSENTIAL LINEAR ALGEBRA


Notice how we used the linearity of the derivative operator.
11. Let , c, and be constants, and define L : C 2 (R2 ) C(R2 ) by
Lu = c

u
2u
2.
t
x

We prove that L is linear as follows:


L(u) = c

L(u + v) = c

13.



2
u
2u
u
2u

(u) 2 (u) = c
2 = c
2 = Lu,
t
x
t
x
t
x



 2

2
u
v
u

2v
(u + v) 2 (u + v) = c
+

+
t
x
t
t
x2
x2

 

2
u
u
2v
v
= c
2 + c
2 = Lu + Lv.
t
x
t
x

(a) The proof is a direct calculation:




A(x + z)

=
=
=
=
=
=

 



x1
z1

+
x2
z2



a11 a12
x1 + z1
a21 a22
x2 + z2


a11 (x1 + z1 ) + a12 (x2 + z2 )
a21 (x1 + z1 ) + a22 (x2 + z2 )


(a11 x1 + a12 x2 ) + (a11 z1 + a12 z2 )
(a21 x1 + a22 x2 ) + (a21 z1 + a22 z2 )




a11 x1 + a12 x2
a11 z1 + a12 z2

+
a21 x1 + a22 x2
a21 z1 + a22 z2
a11
a21

a12
a22

Ax + Az.

This shows that the operator defined by A is linear.


(b) We have
(A(x + y))i =

n
X

aij (xj + yj )

j=1

and
(Ax + Ay)i =

aij xj +

j=1

n
X

aij yj .

j=1

Now,
(A(x + y))i

n
X

aij (xj + yj )

j=1

n
X

(aij xj + aij yj )

j=1

n
X

aij xj +

j=1

n
X
j=1

n
X

aij yj

j=1

aij xj +

n
X

aij yj

j=1

(Ax + Ay)i ,

as desired. The third equality follows from the commutative and associative properties of addition, while
the fourth equality follows from the distributive property of multiplication over addition.

3.2. EXISTENCE AND UNIQUENESS OF SOLUTIONS TO AX = B

3.2

Existence and uniqueness of solutions to Ax = b

1. The range of A is
{(1, 1) : R} ,
which is a line in the plane. See Figure 3.1.
3

x2

3
3

0
x

Figure 3.1: The range of A (Exercise 3.2.1).


3.

(a) A is nonsingular.
(b) A is nonsingular.
(c) A is singular. Every vector in the range is of the form



1 1
x1
Ax =
1 1
x2


x1 + x2
=
.
x1 + x2
That is, every y R2 whose first and second components are equal lies in the range of A. Thus, for example,
Ax = b is solvable for


1
b=
,
1
but not for


1
b=
.
2

5. The solution set is not a subspace, since it cannot contain the zero vector (A0 = 0 6= b).
7. The null space of L is the set of all first-degree polynomials:
N (L) = {u : [a, b] R : u(x) = mx + c for some m, c R} .
9.

(a) The only functions in C 2 [a, b] that satisfy


d2 u
=0
dx2
are functions of the form u(x) = C1 x + C2 . The Neumann boundary condition at the left endpoint implies
that C1 = 0, and the Dirichlet boundary condition at the right endpoint implies that C2 = 0. Therefore,
only the zero function is a solution to Lm
u = 0, and so the null space of Lm
is trivial.
2
(b) Suppose f C[a, b] is given and u Cm
[a,
b]
satisfies

d2 u
(x) = f (x), a < x < b.
dx2
Integrating once yields, by the fundamental theorem of calculus,
Z x 2
Z x
d u

(s)
ds
=
f (s) ds
2
a dx
a
Z
x
du
du
(x) +
(a) =
f (s) ds
dx
dx
a
Z x
du

(x) =
f (s) ds.
dx
a

10

CHAPTER 3. ESSENTIAL LINEAR ALGEBRA


The last step follows from the Neumann condition at x = a. We now integrate again:
Z x
du
f (s) ds
(x) =
dx
a
Z b
Z bZ z
du

(z) dz =
f (s) ds dz
x dx
x
a
Z bZ z
u(b) u(x) =
f (s) ds dz
Z aZ z x a
f (s) ds dz.
u(x) =
x

This shows that Lm


u = f has a unique solution for each f C[a, b].
11. By the fundamental theorem of calculus,
x

Z
u(x) =

f (s) ds
a

satisfies Du = f . However, this solution is not unique; for any constant C,


Z x
u(x) =
f (s) ds + C
a

is another solution.

3.3
1.

Basis and dimension


(a) Both equal (14, 4, 5).
P
(b) Both equal n
j=1 (vj )i xj .

3. The given set is not a basis. If A is the matrix whose columns are the given vectors, then N (A) is not trivial.
5. There is a typo in the problem statement; the given polynomials are linearly independent:
c1 (1 x + 2x2 ) + c2 (1 2x2 ) + c3 (1 3x + 7x2 ) = 0
(c1 + c2 + c3 ) + (c1 3c3 )x + (2c1 2c2 + 7c3 )x2 = 0

c1 + c2 + c3
c1 3c3
2c1 2c2 + 7c3

= 0,
= 0,
= 0.

A direct calculation (using Gaussian elimination) shows that this last system of equations has only the trivial
solution, and hence the three polynomials form a linearly independent set.
7. We know that P2 has dimension 3, and therefore it suffices to show either that the given set of three vectors spans
P2 or that it is linearly independent. If p P2 , then we write
c1 = p(x1 ), c3 = p(x3 ), c3 = p(x3 )
and define the polynomial
q(x) = c1 L1 (x) + c2 L2 (x) + c3 L3 (x).
Then
q(x1 ) = c1 L1 (x1 ) + c2 L2 (x1 ) + c3 L3 (x1 ) = c1 1 + c2 0 + c3 0 = c1 = p(x1 ),
and, similarly, q(x2 ) = p(x2 ), q(x3 ) = p(x3 ). But then p and q are second-degree polynomials that agree at three
distinct points, and three points determine a quadratic (just as two points determine a line). Therefore,
p(x) = c1 L1 (x) + c2 L2 (x) + c3 L3 (x),
and we have shown that every p P2 can be written as a linear combination of L1 , L2 , L3 . This completes the
proof.

3.4. ORTHOGONAL BASES AND PROJECTIONS

11

2
9. Let L : CN
[a, b] C[a, b] be the second derivative operator. We wish to find a basis for the null space of L. A
2
function u CN
[a, b] belongs to the null space of L if and only if it satisfies

du
d2 u
du
(0) =
(`) = 0.
(x) = 0 for all x [a, b],
dx2
dx
dx
The only functions satisfying the differential equation are first-degree polynomials, u(x) = mx + c. Moreover, the
boundary conditions are satisfied if and only if the slope m is zero. Thus u belongs to the null space of L if and
only if u(x) = c for some c R, that is, if and only if u is a constant function. A basis is therefore the set {u1 },
where u1 (x) = 1 for all x [a, b].

3.4
1.

Orthogonal bases and projections


(a) The verification is a direct calculation of vi vj for the 6 combinations of i, j. For example,
v1 v1

=
=

v1 v2

=
=

1 1
1 1
1 1
+ +
3 3
3 3
3 3
1
1
1
+ + = 1,
3
3
3
1 1
1
1
+ 0+
3 2
3
3
1
1
= 0,
6
6

and so forth.
(b)
x

=
=

(v1 x)v1 + (v2 x)v2 + (v3 x)v3




4
2
v1 + 0v2 +
v3 .
3
6

3. We have
kx + yk2

(x + y, x + y)

(x, x + y) + (y, x + y)

(x, x) + (x, y) + (y, x) + (y, y)

(x, x) + 2(x, y) + (y, y)

kxk2 + 2(x, y) + kyk2 .

Therefore,
kx + yk2 = kxk2 + kyk2
if and only if (x, y) = 0.
5. First of all, if
(y, z) = 0 for all z W,
then since wi W for each i, we have, in particular,
(y, wi ) = 0, i = 1, 2, . . . , n.
Suppose, on the other hand, that
(y, wi ) = 0, i = 1, 2, . . . , n.
If z is any vector in W , then, since {w1 , w2 , . . . , wn } is a basis for W , there exist scalars 1 , 2 , . . . , n such that
z=

n
X
i=1

i wi .

12

CHAPTER 3. ESSENTIAL LINEAR ALGEBRA


We then have
(y, z)

y,

n
X

!
i wi

i=1
n
X

i=1
n
X

i (y, wi )
i 0

i=1

0.

This completes the proof.


7. The best approximation to the given data is y = 2.0109x 0.0015151. See Figure 3.2.
6
5.5
5
4.5
y

4
3.5
3
2.5
2
1

1.5

2
x

2.5

Figure 3.2: The data from Exercise 3.4.7 and the best linear approximation.
9. The projection of g onto P2 is

or

2 5( 2 12)
2
q1 (x) + 0q2 (x) +
q3 (x)

3
10( 2 12)
2
2 12
2 12 2
+
60
x + 60
x .
3
3

See Figure 3.3.


1

0.5

y=sin( x)
quadratic approx.
0.5
0

0.2

0.4

0.6

0.8

Figure 3.3: The function g(x) = sin (x) and its best quadratic approximation over the interval [0, 1] (see
Exercise 3.4.9).

3.5

Eigenvalues and eigenvectors of a symmetric matrix

1. The eigenvalues of A are 1 = 200 and 2 = 100, and the corresponding (normalized) eigenvectors are




0.8
0.6
u1 =
, u2 =
,
0.6
0.8

3.5. EIGENVALUES AND EIGENVECTORS OF A SYMMETRIC MATRIX

13

respectively. The solution is


x=

b u2
b u1
u1 +
u2 =
1
2

1
1

3. The eigenvalues and eigenvectors of A are 1 = 2, 2 = 1, 3 = 1 and

u1 =

3
1
3
1
3

, u2 =

0
, u3 =

12

1
6
26
1
6

The solution of the Ax = b is

3/2
b u1
b u2
b u3
x=
u1 +
u2 +
u3 = 1/2 .
1
2
3
5/2
5. The computation of ui b/i costs 2n operations, so computing all n of these ratios costs 2n2 operations.
Computing the linear combination is then equivalent to another n dot products, so the total cost is
2n2 + n (2n 1) = 4n2 n = O(4n2 ).
7.

(a) For k = 2, 3, . . . , n 1, we have




1
( sin ((k 1)jh) + 2 sin (kjh) sin ((k + 1)jh))
Ls(j)
=
h2
k
1
( sin (kjh) cos (jh) + cos (kjh) sin (jh) + 2 sin (kjh)
=
h2
sin (kjh) cos (jh) cos (kjh) sin (jh))
1
=
(2 2 cos (jh)) sin (kjh)
h2
1
(j)
=
(2 2 cos (jh)) sk .
h2
Thus



1
(j)
Ls(j) = 2 (2 2 cos (jh)) sk , k = 2, 3, . . . , n 1.
h
k

Similar calculations show that this formula holds for k = 1 and k = n also. Therefore, s(j) is an eigenvector
of L with eigenvalue
2 2 cos (jh)
.
j =
h2
(b) The eigenvalues j are all positive and are increasing with the frequency j.
(c) The right-hand side b can be expressed as






b = s(1) b s(1) + s(2) b s(2) + + s(n) b s(n) ,
while the solution x of Lx = b is
x=

s(1) x (1) s(2) x (2)


s(n) x (n)
s +
s + +
s .
1
2
n

Since j increases with j, this shows that, in producing x, the higher frequency components of b are
dampened more than are the lower frequency components of b. Thus x is smoother than b.

Chapter 4

Essential Ordinary Differential


Equations
4.1

Background

1. Define
x1 = u, x2 =

du
.
dt

Then
dx1
dt
dx2
dt
3. Define
x1 = u, x2 =

x2 ,

1
x1 .
2

du
d2 u
d3 u
, x3 = 2 , x4 = 3 .
dt
dt
dt

Then
dx1
dt
dx2
dt
dx3
dt
dx4
dt

x2 ,

x3 ,

x4 ,

2x3 x1 + sin t.

5. Define

dp
dq
, x3 = q, x4 =
.
dt
dt

x1 = p, x2 =
Then the first-order system is
dx1
dt
dx2
m1
dt
dx3
dt
dx4
m2
dt

x2 ,

f1 (x1 , x3 , x2 , x4 ),

x4 ,

f2 (x1 , x3 , x2 , x4 ).

7. Let u1 (t) = et , u2 (t) = e2t .

15

16

CHAPTER 4. ESSENTIAL ORDINARY DIFFERENTIAL EQUATIONS


(a) We have
du1
d 2 u1
(t) = et ,
(t) = et ,
dt
dt2
and therefore
du1
d 2 u1
(t) + 3
(t) + 2u(t) = et 3et + 2et = 0.
dt2
dt
Similarly,
du2
d 2 u2
(t) = 2e2t ,
(t) = 4e2t ,
dt
dt2
and thus
d2 u2
du2
(t) + 3
(t) + 2u(t) = 4e2t 6e2t + 2e2t = 0.
dt2
dt
(b) The Wronskian of u1 , u2 is

u2 (t) et
=
du2
(t) et
dt


u1 (t)
W (t) = du1
(t)
dt


e2t
= e3t .
2e2t

Since W (t) 6= 0 for all t, we see that {u1 , u2 } is linearly independent.


9.

(a) Let u1 , u2 be two functions defined on an interval, let t0 be a point in that interval, and suppose

u1 (t0 )
du
1

(t0 )
dt


u2 (t0 )
6 0.
=
du2
(t0 )
dt

We wish to prove that {u1 , u2 } is linearly independent. We argue by contradiction, and suppose {u1 , u2 } is
linearly dependent. Then there exist c1 , c2 R such that c1 u1 +c2 u2 = 0. This means that c1 u1 (t)+c2 u2 (t) =
1
2
0 for all t in the given interval, which in turn implies that c1 du
(t) + c2 du
(t) = 0 for all t. But then, taking
dt
dt
t = t0 , we obtain
c1 u1 (t0 ) + c2 u2 (t0 ) = 0,
du2
du1
(t0 ) + c2
(t0 ) = 0.
c1
dt
dt
In matrix-vector form, this system is


u1 (t0 )
du1
(t0 )
dt

u2 (t0 )
du2
(t0 )
dt



c1
c2


=

0
0


.

Since (c1 , c2 ) 6= (0, 0), this implies that the matrix




u1 (t0 )
du1
(t0 )
dt

u2 (t0 )
du2
(t0 )
dt

is singular, contradicting the assumption that its determinant is nonzero. This contradiction completes the
proof.
(b) Let u1 (t) = cos (t), u2 (t) = cos (2t). Then

u1 (t)
du
1

(t)
dt

u2 (t)
du2
(t)
dt


cos (t)
=
sin (t)


cos (2t)
= cos (2t) sin (t) 2 cos (t) sin (2t).
2 sin (2t)

We see that W (/2) = 1 6= 0, and hence, by part (a), {u1 , u2 } is linearly independent. Nevertheless,
W (0) = 0, which shows that the fact that {u1 , u2 } is linearly independent does not imply that W (t) 6= 0 for
all t, unless u1 and u2 are both solutions to the same second-order linear differential equation.

4.2. SOLUTIONS TO SOME SIMPLE ODES

4.2
1.

17

Solutions to some simple ODEs


(a) We first note that the zero function is a solution of (4.9), so S is nonempty. If u, v S and , R, then
w = u + v satisfies
a

d2 w
dw
+ cw
+b
dt2
dt

=
=
=
=

d2
d
[u + v] + b [u + v] + c(u + v)
dt2
dt
 2



dv
d u
d2 v
du
+
a 2 + 2 +b
+ c(u + v)
dt
dt
dt
dt

 2

 2
d u
du
d v
dv
a 2 +b
+ cu + a 2 + b
+ cv
dt
dt
dt
dt
0 + 0 = 0.
a

Thus w is also a solution of (4.9), which shows that S is a subspace.


(b) As explained in the text, no matter what the values of a, b, c (a 6= 0), the solution space is spanned by two
functions. Thus S is finite-dimensional
and it has dimension
it is easy to see that each


at most
 2. Moreover,
of the sets {er1 t , er2 t } (r1 6= r2 ), et cos (t), et sin (t) , and ert , tert is linearly independent, since a
set of two functions is linearly dependent if and only if one of the functions is a multiple of the other. Thus,
in every case, S has a basis with two functions, and so S is two-dimensional.
3. Suppose that the characteristic polynomial of (4.9) has a single, repeated root r = b/(2a) (so b2 4ac = 0).
Then, as shown in the text,
u(t) = c1 ert + c2 tert
is a solution of (4.9) for each choice of c1 , c2 . We wish to show that, given k1 , k2 R, there is a unique choice of
c1 , c2 such that u(0) = k1 , du/dt(0) = k2 . We have
du
(t) = rc1 ert + c2 ert + rc2 tert .
dt
Therefore, the equations u(0) = k1 , du/dt(0) = k2 simplify to


1 0
c = k.
r 1
Since the coefficient matrix is obviously nonsingular (regardless of the value of r), there is a unique solution c1 , c2
for each k1 , k2 .
5.

(a) The only solution is u(x) = 0.


(b) The only solution is u(x) = 0.
(c) The function u(x) = sin (x) is a nonzero solution. It is not unique, since any multiple of it is another
solution.

7. By the product rule and the fundamental theorem of calculus,


Z t

 Z t

d
d
a(ts)
at
as
e
f (s) ds =
e
e
f (s) ds
=
dt t0
dt
t0

aeat

eas f (s) ds + eat eat f (t)

t0

Z
=

ea(ts) f (s) ds + f (t).

a
t0

Therefore, with
u(t) = u0 ea(tt0 ) +

ea(ts) f (s) ds,


t0

we have
du
(t)
dt

au0 ea(tt0 ) + a

ea(ts) f (s) ds + f (t)


t0

au(t) + f (t).

Thus u satisfies the differential equation. We also have


Z t0
u(t0 ) = u0 ea(t0 t0 ) +
ea(ts) f (s) ds = u0 + 0 = u0 ,
t0

so the initial condition holds as well.

18

CHAPTER 4. ESSENTIAL ORDINARY DIFFERENTIAL EQUATIONS


9. u(t) =

1
2

11. u(t) =

1
2

13.

sin2 (t)
et + cos (t) + sin (t)

(a) The solution is x(t) = et

/2

(b) The solution is x(t) = (1 + cos (1) cos (t))/t3 .


2

(c) The solution is y(t) = 1/2 + (1/2)et .


15. Suppose we substitute u(t) = c1 (t)u1 (t) + c2 (t)u2 (t) into
a

du
d2 u
+b
+ cu = f (t),
dt2
dt

where u1 , u2 are solutions of the homogeneous version of this ODE, and assume that
dc1
dc2
u1 +
u2 = 0.
dt
dt
We then have
du1
du2
du
= c1
+ c2
,
dt
dt
dt
d2 u
d 2 u1
d 2 u2
dc2 du2
dc1 du1
+
.
= c1 2 + c2 2 +
2
dt
dt
dt
dt dt
dt dt
Substituting into the ODE, we obtain




d 2 u2
du1
du2
d 2 u1
dc1 du1
dc2 du2
+
+ b c1
+ c2
+ c(c1 u1 + c2 u2 ) = f (t)
a c1 2 + c2 2 +
dt
dt
dt dt
dt dt
dt
dt
 2

 2



dc1 du1
d u1
d u2
dc2 du2
du1
du2
c1 a 2 + b
+ cu1 + c2 a 2 + b
+ cu2 + a
+
= f (t)
dt
dt
dt
dt
dt dt
dt dt


dc2 du2
dc1 du1
+
= f (t)
a
dt dt
dt dt
dc2 du2
dc1 du1
+
= a1 f (t),

dt dt
dt dt
as desired. Notice that we have used the fact that u1 , u2 solve the homogenous ODE:
a

d 2 u1
du1
d 2 u2
du2
+b
+ cu1 = 0, a 2 + b
+ cu2 = 0.
2
dt
dt
dt
dt

17. Let us define v(s) = u(es ); then u(t) = v(ln (t)). It follows that
1 d2 v
1 dv
du
1 dv
d2 u
(t) =
(ln (t)),
(t) = 2 2 (ln (t)) 2
(ln (t)).
2
dt
t ds
dt
t ds
t ds
It follows that
du
d2 u
(t) + at (t) + bu(t) = 0
dt2
dt
d2 v
dv
dv
2 (ln (t))
(ln (t)) + a (ln (t)) + bv(ln (t)) = 0
ds
ds
ds
d2 v
dv
2 (ln (t)) + (a 1) (ln (t)) + bv(ln (t)) = 0
ds
ds
d2 v
dv
2 (s) + (a 1) (s) + bv(s) = 0.
ds
ds
t2

Thus the change of variables t = es transforms the Euler equation into a constant coefficient ODE.

4.3. LINEAR SYSTEMS WITH CONSTANT COEFFICIENTS

4.3

19

Linear systems with constant coefficients

1. The solution is
x(t)

1
1
u1 et u2 +
3
2
1
1 t

e
+ 16 e2t
3
2

1
13 e2t

1
3

1
e2t u3
6

+ 12 et + 16 e2t

3. The general solution is



x(t) =

c1 et + c2 et
c1 et c2 et


.

5. x0 must be a multiple of the vector (1, 1).


7.

9.

55 3e2t 45et + 20t 7 cos (t) 11 sin (t)


1

10 + 6e2t + 20t 16 cos (t) 8 sin (t)


x(t) =
60
2t
t
5 3e
+ 45e + 20t 37 cos (t) + 19 sin (t)
(a) The solution is
3
1
3 t 1 3t
e + e , y(t) = et e3t .
2
2
2
2
The population of the first species (x(t)) increases exponentially, while the population of the second species
(y(t)) goes to zero in finite time (y(t) = 0 at t = ln (3)/4). Thus the second species becomes extinct, while
the first species increases without bound.
x(t) =

(b) If the initial populations are x(0) = r, y(0) = s, then the solution to the IVP is
x(t) =



1
1
(r + s)et + (r s)e3t , y(t) =
(r + s)et + (s r)e3t .
2
2

Therefore, if r = s, both populations decay to zero exponentially; that is, both species die out.
11. Assume v(t; s) satisfies
d2 v
dv
(0; s) = 0
+ 2 v = 0, v(0; s) = 0,
dt2
dt
for all s, and define
t

v(t s; s) ds.

u(t) =
0

Then
du
(t) = v(0; t) +
dt

dv
d2 u
(t) =
(0; t) +
dt2
dt
(using the fact that v(0; t) = 0 and

Z
0

dv
(t s; s) ds =
dt
t

Z
0

dv
(t s; s) ds,
dt
Z t 2
d2 v
d v
(t

s;
s)
ds
=
f
(t)
+
(t s; s) ds
2
dt2
0 dt
0

dv
(0; t)
dt

= 0 for all t). We then have


Z t 2
Z t
d2 u
d v
(t) + 2 u(t) = f (t) +
(t s; s) ds + 2
v(t s; s) ds
2
2
dt
0 dt
0

Z t 2
d v
2
= f (t) +
(t

s;
s)
+

v(t

s;
s)
ds
dt2
0
= f (t)

since

d2 v
(t s; s) + 2 v(t s; s) = 0 for all s.
dt2

Also,
Z 0
du
dv
(t) =
(t s; s) ds = 0,
dt
0
0 dt
and thus u satisfies both the differential equations and the initial conditions.
Z

u(t) =

v(t s; s) ds = 0,

20

CHAPTER 4. ESSENTIAL ORDINARY DIFFERENTIAL EQUATIONS

13. Suppose that, for all s, v(t; s) satisfies the ODE


dk u
dk1 u
du
+ ak1 (t) k1 + + a1 (t)
+ a0 (t)u = 0
k
dt
dt
dt
and also the initial conditions
dk2 u
dk1 u
du
(s) = 0, . . . ,
(s)
=
0,
(s) = f (s).
dt
dtk2
dtk1

u(s) = 0,
Define

v(t; s) ds.

u(t) =
0

Then

Z t
Z t
dv
dv
du
(t) = v(t; t) +
(t; s) ds =
(t; s) ds
dt
dt
0
0 dt
(since v(t; t) = 0 for all t). Similarly,
Z t 2
Z t 2
d v
d2 u
dv
d v
(t;
t)
+
(t)
=
(t;
s)
ds
=
(t; s) ds,
2
2
dt2
dt
dt
0
0 dt
..
.
Z t k1
Z t k1
dk1 u
dk2 v
d
v
d
v
(t)
=
(t;
t)
+
(t;
s)
ds
=
(t; s) ds
k1
k1
dtk1
dtk2
dt
dt
0
0
and finally
dk u
dk1 v
(t)
=
(t; t) +
dtk
dtk1

Z
0

dk v
(t; s) ds = f (t) +
dtk

Z
0

dk v
(t; s) ds.
dtk

We then see that


dk u
dk1 u
du
+ a0 (t)u
+ ak1 (t) k1 + + a1 (t)
dtk
dt
dt

Z t k
d v
dk1 v
dv
=f (t) +
(t;
s)
+
a
(t)
(t;
s)
+

+
a
(t)
(t;
s)
+
a
(t)v(t;
s)
ds
1
0
k1
dtk
dtk1
dt
0
=f (t),
since

dk1 v
dv
dk v
(t; s) + ak1 (t) k1 (t; s) + + a1 (t) (t; s) + a0 (t)v(t; s) = 0
k
dt
dt
dt

by assumption. Also,
dj u
(0) =
dtj

Z
0

dj v
(t; s) ds = 0, j = 0, 1, . . . , k 1.
dtj

15. The solution to


d2 u
du
+3
+ 2u = 0,
dt2
dt
u(0) = 0,
du
(0) = f (s)
dt
is given by v(t; s) = (et e2t )f (s). Therefore, by Duhamels principle, the solution of
d2 u
du
+3
+ 2u = f (t),
dt2
dt
u(0) = 0,
du
(0) = 0
dt
is

Z
v(t s; s) ds =

u(t) =
0



e(ts) e2(ts) f (s) ds.

4.4. NUMERICAL METHODS FOR INITIAL VALUE PROBLEMS

4.4
1.

21

Numerical methods for initial value problems


(a) Four steps of Eulers method yield an estimate of 0.71969.
(b) Two steps of the improved Euler method yield an estimate of 0.80687.
(c) One step of the RK4 method yields an estimate of 0.82380.
Eulers method gives no correct digits, the improved Euler method gives one correct digit, and RK4 gives three
correct digits. Each of the methods evaluated f (t, u) four times.

3.

(a) Let u1 = x, u2 = dx/dt, u3 = y, u4 = dy/dt. Then the system is


du1
dt
du2
dt
du3
dt
du4
dt

u2 ,

u1 + 2u4

u4 ,

2u2 + u3

2 (u1 + 1 )
1 (u1 2 )

,
r1 (u1 , u3 )3
r2 (u1 , u3 )3

2 u 3
1 u 3

.
r1 (u1 , u3 )3
r2 (u1 , u3 )3

(b) The routine ode45 from MATLAB (version 5.3) required 421 steps to produce a graph with the ending
point apparently coinciding with the initial value. The graph of y(t) versus x(t) is given in Figure 4.1. The
graphs of x(t) and y(t), together with the times steps, are given in Figure 4.2. They show, not surprisingly,
that the time step is forced to be small precisely when the coordinates are changing rapidly.
1
0.8
0.6
0.4
0.2

0
0.2
0.4
0.6
0.8
1
1.5

0.5

0
x

0.5

1.5

Figure 4.1: The orbit of the satellite in Exercise 4.4.3.

x(t)

2
0

y(t)

2
0
1

3
4
Step index

1
0
0.15

Time step

3
t

0.1
0.05
0
0

Figure 4.2: The coordinates of the satellite in Exercise 4.4.3 (top two graphs) with the step lengths taken
(bottom graph).
(c) The minimum step size taken by ode45 was 3.28 104 , and using this step length over the entire interval
of [0, T ] would require almost 19000 steps. This is to be compared to the 421 steps taken by the adaptive
algorithm. (Note: The exact results for minimum step size, etc., will differ according to the algorithm and
tolerances used.)

22

CHAPTER 4. ESSENTIAL ORDINARY DIFFERENTIAL EQUATIONS


5.

(a) We first note that a + (t1 t0 ) t b + (t1 t0 ) if and only if a t (t1 t0 ) b, so the function v is
well-defined. In fact,
{v(t) : t [a + (t1 t0 ), b + (t1 t0 )]}
=

{u(t (t1 t0 )) : t [a + (t1 t0 ), b + (t1 t0 )]}

{u(t) : t [a, b]}

(just replace t (t1 t0 ) by t in the last step).


We have
dv
(t)
dt

d
[u(t (t1 t0 ))]
dt
du
(t (t1 t0 ))
dt
f (u(t (t1 t0 )))

f (v(t)),

=
=

so v satisfies the ODE. Finally,


v(t1 ) = u(t1 (t1 t0 )) = u(t0 ) = u0 .
Therefore v is a solution to the given IVP.
(b) Consider the IVP
du
dt
u(0)

t,

1,

t,

which has solution u(t) = t2 /2 + 1. The IVP


dv
dt
v(1)
has solution v(t) = t2 /2 + 1/2, which is not equal to
u(t (1 0)) = u(t 1) =

1
(t 1)2 + 1.
2

7. The exact solution is



x(t) =

2 2et ,
1 t
e,
2

0 < t < ln 2,
t > ln 2.

(a) The following errors were obtained at t = 0.5:


t
1/4
1/8
1/16
1/32
1/64
1/128

Error
2.4332e-05
1.3697e-06
8.1251e-08
4.9475e-09
3.0522e-10
1.8952e-11

By inspection, we see that as t is cut in half, the error is reduced by a factor of approximately 16, as
expected for O(t4 ) convergence.
(b) The following errors were obtained at t = 2.0:

4.5. STIFF SYSTEMS OF ODES

23
t
1/4
1/8
1/16
1/32
1/64
1/128

Error
5.0774e-03
3.2345e-03
3.1896e-04
1.0063e-04
8.9026e-06
3.4808e-06

The error definitely does not exhibit O(t4 ) convergence to zero. The reason is the lack of smoothness
of the function 1 + |x 1|; the rate of convergence given in the text only applies to ODEs defined by
smooth functions. When integrating from t = 0 to t = 0.5, the nonsmoothness of the right-hand side is not
encountered since x(t) < 1 on this interval. This explains why we observed good convergence in the first
part of this problem.

4.5
1.

Stiff systems of ODEs


(a) The exact solution is
x(t) =

1
2

et + et
et et


.

(b) The norm of the error is approximately 0.089103.


(c) The norm of the error is approximately 0.10658.
3. The largest value is t = 0.04.
5. (a) Applying the methods of Section 4.3, we find the solution


1 3et e100t
x(t) =
.
2 3et + e100t
(b) By trial and error, we find that t 0.02 is necessary for stability. Specifically, integrating from t = 0 to
t = 1, n = 49 (i.e. t = 1/49) yields
kx49 k > kx0 k ,
while n 50 yields
kxn k kx0 k .
(i)

(c) With xi+1 = xi + tAxi and y1 = u1 xi , we have


u1 xi+1 = u1 xi + tu1 Axi
(i+1)

= y1 + t(Au1 ) xi

(i+1)

= y1 + t1 u1 xi

(i+1)

= y1 + t1 y1

y1

y1

y1

(i+1)
y1

(i)

(i)

(i)

= (1 +

(i)

(i)
t1 )y1 .

A similar calculation shows that


(i+1)

y2

(i)

= (1 + t2 )y2 .

For stability, we need


|1 + t1 |

1,

|1 + t2 |

1.

Since the eigenvalues of A are 1, 100, it is not hard to see that the upper bound for t is t 0.02, just
as was determined by experiment.
(d) For the backward Euler method, a similar calculation shows that
y1

(i+1)

(1 t1 )1 y1 ,

(i+1)
y2

(1 t2 )1 y2 .

(i)

Stability is guaranteed for any t, since


|1 ti |1 < 1
for every t > 0.

(i)

Chapter 5

Boundary Value Problems in Statics


5.1
1.

The analogy between BVPs and linear algebraic systems


(a) Since MD is linear, it suffices to show that the null space of MD is trivial. If MD u = 0, then, du/dx = 0,
that is, u is a constant function: u(x) = c. But then the condition u(0) = 0 implies that c = 0, and so u is
the zero function. Thus N (MD ) = {0}.
1
[0, `] and MD u = f , then we have
(b) If u CD

du
(x) = f (x), 0 < x < ` and u(0) = 0,
dx
which imply that
x

Z
u(x) =

f (s) ds.
0

But we also must have u(`) = 0, which implies that


`

f (s) ds = 0.
0

If f C[0, `] does not satisfy this condition, then it is impossible for MD u = f to have a solution.
3.

(a) If v, w S are both solutions of Lu = f , then Lv = Lw, or (by linearity) L(v w) = 0. Therefore
v w N (L). But, since S is a subspace, v w is also in S. If the only function in both N (L) and S is the
zero function, then v w must be the zero function, that is, v and w must be the same function. Therefore,
if N (L) S = {0}, then Lu = f can have at most one solution for any f .
(b) We have already seen that Lu = f has a solution for any f C[0, `] (see the discussion immediately preceding
Example 5.1). We will use the result from the first part of this exercise to show that the solution is unique.
The null space of L is the space of all first degree polynomials:
N (L) = {u : [0, `] R : u(x) = ax + b for some a, b R} .
i. Suppose u N (L) S. Then u(x) = ax + b for some a, b R and
du
dx

 
`
= 0 a = 0.
2

Then u(x) = b, and


Z

u(x) dx = 0 b` = 0 b = 0.
0

Therefore u is the zero function, and so N (L) S = {0}. The uniqueness property then follows from
the first part of this exercise.

25

26

CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS


ii. Suppose u N (L) S. Then u(x) = ax + b for some a, b R and
u(0) = 0 b = 0.
Then u(x) = ax, and
du
(`) = 0 a = 0.
dx
Therefore u is the zero function, and so N (L) S = {0}. The uniqueness property then follows from
the first part of this exercise.
5. The condition

Z
0

du
(x)
dx

2
dx = 0

(5.1)

implies that du/dx is zero, and hence that u is constant. The boundary conditions on u would then imply that
u is the zero function. But, by assumption, u is nonzero (we assumed that (u, u) = 1). Therefore, (5.1) cannot
hold.
7.

(a) If Lm
u = 0, then u has the form u(x) = ax + b. The first boundary condition, du/dx(0) = 0, implies that
a = 0, and then the second boundary condition, u(`) = 0, yields b = 0. Therefore, u is the zero function
and N (Lm
) is trivial.
(b) For any f C[0, `], the function
Z

u(x) =

f (s) ds dz
x

2
belongs to Cm
[0, `] and satisfies

d2 u
(x) = f (x), 0 < x < `.
dx2
This shows that Lm
u = f has a solution for any f C[0, `], and therefore R(Lm
) = C[0, `].

2
(c) Suppose u, v Cm
[0, `]. Then

=
=
=
=
=
=

d2 u
(x)v(x) dx
2
0 dx

` Z `
du
dv
du

(x)v(x) +
(x) (x) dx
dx
dx
dx
0
0
Z `
du
dv
(x) (x) dx (since v(`) = 0, du/dx(0) = 0)
dx
0 dx

` Z `
d2 v
dv
u(x) 2 (x) dx
u(x) (x)
dx
dx
0
0
Z `
2
d v

u(x) 2 (x) dx (since u(`) = 0, dv/dx(0) = 0)


dx
0
(u, Lm
v).
Z

(Lm
u, v)

Thus Lm
is symmetric.
(d) Suppose is an eigenvalue of Lm
with corresponding eigenfunction u, and assume that u has been normalized
so that (u, u) = 1. Then
= (u, u) = (u, u)

=
=
=
=
>

(Lm
u, u)
Z ` 2
d u

(x)u(x) dx
2
0 dx

` Z ` 
2
du
du

(x)u(x) +
(x)
dx
dx
dx
0
0


Z `
2
du
(x)
dx (since u(`) = 0, du/dx(0) = 0)
dx
0
0.

2
The last step follows because every nonzero function in Cm
[0, `] has a nonzero derivative.

5.2. INTRODUCTION TO THE SPECTRAL METHOD; EIGENFUNCTIONS

27

9. Define u(x) = x(1 x), v(x) = x2 (1 x). Then a direct calculation shows that
(M u, v) =

7
,
30

(u, M v) =

4
.
15

but

11.

2
(a) Suppose u, v CR
[0, `]. Then
`

d2 u
(x)v(x) dx
2
0 dx
`

Z `
du
dv
du
(x) (x) dx
(x)v(x) +
dx
dx
0 dx
0

` 
`
Z `
du
dv
d2 v
(x)v(x) + u(x) (x)
u(x) 2 (x) dx
dx
dx
dx
0
0
0
du
du
dv
(`)v(`) + (0)v(0) + u(`) (`)
dx
dx
dx
dv
u(0) (0) + (u, LR v).
dx
Z

(LR u, v)

=
=
=
=

Applying the boundary conditions on u, v, we obtain


du
du
dv
dv
(`)v(`) + (0)v(0) + u(`) (`) u(0) (0)
dx
dx
dx
dx
u(`)v(`) + u(0)v(0) u(`)v(`) u(0)v(0) = 0,

so (LR u, v) = (u, LR v), as desired.


(b) If LR u = 0, then u must be a first degree polynomial: u(x) = ax + b. The boundary conditions imply that
a and b must satisfy the following equations:
a + b

0,

(` + )a + b

0.

The determinant is computed as follows:





` +



= (2 + `) < 0.

The only solution is a = b = 0, that is, u = 0, so N (LR ) is trivial.

5.2

Introduction to the spectral method; eigenfunctions

1. If n 6= m, then
`

Z
(un , um )

 nx 

sin

 mx 

dx
`
`




(n + m)x
(n m)x
cos
dx
cos
`
`
0




`
(n m)x
(n + m)x
`
`
sin

sin
.
(n m)
`
(n + m)
`
0
sin

1
2

1
2

`

This last expression simplifies to four terms, each including the sine function evaluated at an integer multiple of
, and hence each equal to zero. Thus (un , um ) = 0 for n 6= m.
3. The eigenpairs are
(2n 1)2 2
, cos
4`2


(2n 1)x
, n = 1, 2, 3, . . . .
2`

28

CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS


5. The characteristic polynomial is r2 r + ( 5), so the characteristic roots are

1 + 21 4
1 21 4
, r2 =
.
r1 =
2
2

(5.2)

Case 1: = 21/4. In this case, the characteristic roots are r = 1/2, 1/2 and the general solution of the ODE is
u(x) = c1 ex/2 + c2 xex/2 .
The boundary condition u(0) = 0 yields c1 = 0, and then the boundary condition u(1) = 1 implies that c2 = 0.
Thus there is no nonzero solution to the BVP, and = 21/4 is not an eigenvalue.
Case 2: < 21/4. In this case, the characteristic roots, given by (5.2), are real and distinct. The general solution
of the ODE is
u(x) = c1 er1 x + c2 er2 x .
The boundary conditions lead to the system
c1 + c2

0,

c1 r1 er1 + c2 r2 er2

0.

This system has the unique solution c1 = c2 = 0, so there is no nonzero solution for < 21/4. Hence no < 21/4
is an eigenvalue.
Case 3: > 21/4. In this case, the roots are complex conjugate:

1
4 21
1
r1 = i, r2 = + i, =
.
2
2
2
The general solution of the ODE is
u(x) = (c1 cos (x) + c2 sin (x)) ex/2 .
The boundary condition u(0) = 0 yields c1 = 0, so any eigenfunction is of the form
u(x) = sin (x)ex/2 .
The Neumann condition at x = 1 is equivalent to the equation
tan () = 2, > 0.
Although this equation cannot be solved explicitly, a simple graph shows that there are infinitely many solutions
0 < 1 < 2 < , with


2k 1 2k + 1
k
,
, k = 1, 2, . . . .
2
2
Define k by

4k 21
k =
,
2
that is,
21
k = k2 +
, k = 1, 2, . . . .
4
Then k , k = 1, 2, . . ., are eigenvalues, and the corresponding eigenfunctions are
vk (x) = sin (k x)ex/2 .
Using Newtons method, we find that
which yields

.
.
1 = 1.8366, 2 = 4.8158,
.
.
1 = 8.6231, 2 = 28.4423.

The eigenfunctions are v1 , v2 , as given by the above formula.


A direct calculation shows that
.
(v1 , v2 ) = 0.2092,
so v1 and v2 are not orthogonal.

5.3. SOLVING THE BVP USING FOURIER SERIES


7.

(a)

2(1)n+1
n

sin (nx)

(b)

4 sin n
2
n2 2

sin (nx)

(c)

n=1

n=1

n+1

n=1

12(1)
n3 3

29

sin (nx)

720(1)n+1
n=1
n5 5

(d)
sin (nx)
The errors in approximating the original functions using 10 terms of the Fourier sine series are graphed in Figure
5.1.
1

0.03
0.02

0.5
0.01
0
0
0.5
0

0.5
x

0.01
0

1.5

0.5
x

0.5
x

x 10

x 10

1
0.5
0
0
0.5
1
0

0.5
x

5
0

Figure 5.1: Errors in approximating four functions by


10 terms of their Fourier sine series (see Exercise
5.2.7). Top left: g(x) = x; Top right: h(x) = 21 x 21 ; Bottom left: m(x) = x x3 ; Bottom right:
k(x) = 7x 10x3 + 3x5 .
9. sin (3x) (That is, all of the Fourier sine coefficients are zero, except the third, which is one.)
11. The series have the form


an cos

n=1


(2n 1)x
,
2

where
n

(2n1))
(a) an = 4(2+(1)
;
2 (2n1)2

(b) an =

32 cos ((2n1)/4) sin2 ((2n1)/8)


;
2 (2n1)2

(c) an =

8(24+12(1)n (2n1)+(2n1)2 2 )
4 (2n1)4

(d) an =

8(5760+2880(1) (2n1)+240(2n1)2 2 +7(2n1)4 4 )


6 (2n1)6

The errors in approximating the original functions using 10 terms of the Fourier quarter-wave cosine series are
graphed in Figure 5.2.

5.3
1.

Solving the BVP using Fourier series


(a)

n=1

2(1(1)n )
n3 3

sin (nx)
n

3.

)
(b) x + n=1 2(1(1)
sin (nx)
n3 3


P 32(1)n+1
(2n1)x
(a)
n=1 (2n1)4 4 sin
2

(b) 1 +
(c)

16((1)n +2(1)n+1 n2)

n=1

2(1(1)n )
n=1 n (2+n2 2 )

(2n1)4 4

sin (nx)

cos

(2n1)x
2

30

CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS


1

0.04
0.02

0.5
0
0
0.02
0.5
0

0.5
x

0.01

0.04
0

0.5
x

0.5
x

0.05

0.01

0.05

0.02

0.1

0.03
0

0.5
x

0.15
0

Figure 5.2: Errors in approximating four functions by 10 terms


of their Fourier quarter-wave cosine series (see

Exercise 5.2.11). Top left: g(x) = x; Top right: h(x) = 12 x 21 ; Bottom left: m(x) = x x3 ; Bottom right:
k(x) = 7x 10x3 + 3x5 .

(d) x +

2(1)n
n=1 n (1+n2 2 )

sin (nx)

5. We have
d2 u
(x) = x, 0 < x < 1,
dx2
so
du
(x)
dx

=
=
=

Z x 2
du
d u
(0) +
(s) dx
2
dx
0 dx
Z x
du
(0)
s dx
dx
0
x2
du
(0)
.
dx
2

Write C for du/dx(0); then another integration yields


x

u(x)

du
(s) ds
dx


Z x
s2
0+
C
ds
2
0
u(0) +

=
=

Cx

x3
.
6

Finally, we choose C so that u(1) = 0, which yields C = 1/6. This yields


u(x) =


1
x x3 .
6

7. The Fourier quarter-wave sine coefficients of T d2 u/dx2 are


bn =

2T
`

2
`

d2 u
(x) sin
dx2

(2n 1)x
2`


dx,

while those of u are


an =


u(x) sin

(2n 1)x
2`


dx.

5.3. SOLVING THE BVP USING FOURIER SERIES

31

Using integration by parts twice, almost exactly as in (5.19), we can express bn in terms of an :



(2n 1)x
d2 u
(x) sin
dx
2
2`
0 dx
(

`
(2n 1)x
du
2T
(x) sin

`
dx
2`
x=0

 
Z `
(2n 1)x
(2n 1)
du
(x) cos

dx
2`
2`
0 dx


Z `
2T (2n 1)
(2n 1)x
du
(x) cos
dx
2`2
dx
2`
0
(since sin (0) = du/dx(`) = 0)
(

`
(2n 1)x
2T (2n 1)
u(x)
cos
2`2
2`
x=0

 
Z `
(2n 1)
(2n 1)x
+
u(x) sin
dx
2`
2`
0


Z
T (2n 1)2 2 2 `
(2n 1)x
dx
u(x)
sin
4`2
` 0
2`
(since u(0) = cos ((2n 1)/2) = 0)

2T

T (2n 1)2 2
an .
4`2

This gives the desired result. (Actually, since it is known that the negative second derivative operator is symmetric
under the mixed boundary conditions, we can just appeal to (5.25), which is the above calculation written
abstractly.)
9. Let a1 , a2 , a3 , . . . be the Fourier quarter-wave sine coefficients of u; then




X
(2n 1)2 2
(2n 1)x
d2 u
(x)
=
a
sin
,
n
dx2
2002
200
n=1

where = 3/2. We also have


0.001 =

X
n=1

0.004
sin
(2n 1)


(2n 1)x
.
200

Setting the two series equal and solving for an , we find


u(x) =

X
n=1

3.2 102
sin
3(2n 1)3 3


(2n 1)x
.
200

The temperature distribution is graphed in Figure 5.3.


3.5
3

temperature

2.5
2
1.5
1
0.5
0
0

20

40

60

80

100

Figure 5.3: The temperature distribution (in degrees Celsius) in Exercise 5.3.9.

32

CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS

5.4

Finite element methods for BVPs

2
1. Suppose f, g CD
[0, `], so that

f (0) = f (`) = g(0) = g(`) = 0.


Then


=
=
=
=
=


k(x)

df
dx


,g



df
k(x) (x) g(x) dx
dx
0
` Z `

df
df
dg
k(x) (x)g(x) +
k(x) (x) (x) dx (integration by parts)
dx
dx
dx
0
0
Z `
df
dg
k(x) (x) (x) dx (using g(0) = g(`) = 0)
dx
dx
0
` Z `



d
dg
dg
f (x)
k(x) (x) dx (integration by parts)
k(x)f (x) (x)
dx
dx
dx
0
0


Z `
d
dg

f (x)
k(x) (x) dx (using f (0) = f (`) = 0)
dx
dx
0



d
dg
f,
k(x)
.
dx
dx
Z

d
dx

d
dx

3. Take p(x) = (x c)3 (d x)3 and v[c,d] as suggested in the hint.


2
[0, `] be a test function. We have
5. Let v CD


d
du

k(x) (x) + p(x)u(x) = f (x), 0 < x < `


dx
dx


d
du

k(x) (x) v(x) + p(x)u(x)v(x) = f (x)v(x), 0 < x < `
dx
dx


Z `
Z `
Z `
du
d

k(x) (x) v(x) dx +
p(x)u(x)v(x) dx =
f (x)v(x) dx
dx
0 dx
0
0
` Z `
Z `
Z `

du
dv
du
k(x) (x)v(x) +
k(x) (x) (x) dx +
p(x)u(x)v(x) dx =
f (x)v(x) dx
dx
dx
dx
0
0
0
0
Z `
Z `
Z `
dv
du
p(x)u(x)v(x) dx =
f (x)v(x) dx

k(x) (x) (x) dx +


dx
dx
0
0
0

Z `
Z `
du
dv

k(x) (x) (x) + p(x)u(x)v(x) dx =


f (x)v(x) dx.
dx
dx
0
0

The last step follows from the fact that v(0) = v(`) = 0. Thus the weak form of the given BVP is

Z `
Z `
du
dv
2
2
find u CD
[a, b] such that
k(x) (x) (x) + p(x)u(x)v(x) dx =
f (x)v(x) dx for all v CD
[a, b].
dx
dx
0
0
7. The calculation is the same as in Exercise 5; we integrate by parts only in the first integral, and obtain the
2
following weak form: Find u CD
[a, b] such that

Z `
Z `
du
dv
du
2
k(x) (x) (x) + c(x) (x)v(x) + p(x)u(x)v(x) dx =
f (x)v(x) dx for all v CD
[a, b].
dx
dx
dx
0
0
Notice that now the left-hand side is not symmetric in u and v.
9. Repeating the calculation beginning on page 167, we obtain
" Z
#
 2
 2
Z
1 `
u
1 `
u
A(x)
dx +
Ak(x)
dx
t 2 0
t
2 0
x
Z `  2
u
=
c
dx, t > 0.
t
0

5.5. THE GALERKIN METHOD

33

This shows that derivative with respect to time of the total energy is always negative, and hence that the total
energy is always decreasing.

5.5
1.

The Galerkin method


(a) Yes.
(b) No, a(f, f ) = 0 for f (x) = 1, but f 6= 0.
(c) No, a(f, f ) = 0 for f (x) = 1, but f 6= 0.

3. Let
FN = span {sin (x), sin (2x), . . . , sin (N x)} .
We will apply the Galerkin method to the BVP
d2 u
= f (x), 0 < x < `,
dx2
u(0) = 0,

u(`) = 0,
using FN as the approximating subspace. The weak form of the BVP is
Z `
Z `
dv
du
2
2
find u CD
[a, b] such that
f (x)v(x) dx for all v CD
[a, b],
k (x) (x) dx =
dx
dx
0
0
and the Galerkin method takes the form
find vN =

N
X

uj sin (jx) such that

k
0

j=1

dvn
dv
(x) (x) dx =
dx
dx

f (x)v(x) dx for all v FN .


0

We find the coefficients uj , j = 1, 2, . . . , N , by solving Ku = f , where


Z `
Z `
di
dj
(x)
(x) dx, Fi =
f (x)i (x) dx
Kij =
k
dx
dx
0
0
and j (x) = sin (jx). We have
`

Z
0

di
dj
k
(x)
(x) dx =
dx
dx

kij cos (jx) cos (ix) dx =


0

kj 2 2
,
2

0,

i = j,
i 6= j.

This last step follows from the fact that the functions cos (x), cos (2x), . . . , cos (N x) are mutually orthogonal
with respect to the L2 (0, 1) inner product. Also, notice that
Z `
Z `
cj
f (x)j (x) dx =
f (x) sin (jx) dx = ,
2
0
0
where cj is the Fourier sine coefficient of f . Since K is diagonal, it is easy to solve Ku = f :
uj =

cj /2
cj
= 2 2.
kj 2 2 /2
kj

Thus
vN (x) =

N
X
j=1

cj
sin (jx).
kj 2 2

This is exactly the solution obtained by the method of Fourier series in Section 5.3.2.
5.

(a) The set S is the span of {x, x2 } and therefore is a subspace.


(b) As discussed in the text, a(, ) automatically satisfies two of the properties of an inner product. Every
function p in S satisfies p(0) = 0, so a(, ) also satisfies the third property (a(u, u) = 0 implies that u = 0)
for exactly the same reason as given in the text for the subspace V (see page 174).
(c) The best approximation is p(x) = (9 3e)x2 + (4e 10)x.

34

CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS


(d) The bilinear form is not an inner product on P2 , since a(1, 1) = 0 but 1 6= 0 (a constant is invisible to the
energy inner product and norm). Therefore, every polynomial of the form (9 3e)x2 + (4e 10)x + C S
is equidistant from f (x) = ex in the energy norm.
7. Write p(x) = x(1 x) and q(x) = x(1/2 x)(1 x). The approximation will be v(x) = u1 p(x) + u2 q(x), where
Ku = f . The stiffness matrix K is
" R1
K

=
"
=

dp
dp
(1 + x) dx
(x) dx
(x) dx

0
R1
(1
0
1
2
1
30

dq
dp
(x) dx
(x) dx
+ x) dx
#
1
30
,
3

R1

dq
dp
(1 + x) dx
(x) dx
(x) dx

0
R1
(1
0

dq
dq
+ x) dx
(x) dx
(x) dx

40

and the load vector f is


 R1
 " 1 #
xp(x) dx
12
0
f = R1
=
.
1
xq(x) dx
120
0
Therefore,
.
u=

0.16412
0.038168

The exact solution is


1
1
1
u(x) = x2 + x
ln (1 + x).
4
2
4 ln 2
The exact and approximate solutions are graphed in Figure 5.4.
0.045
0.04
0.035
0.03
0.025
0.02
0.015
exact
approximate

0.01
0.005
0
0

0.2

0.4

0.6

0.8

Figure 5.4: The exact and approximate solutions from Exercise 5.5.7.

9.

(a) It will take about 103 times as long, or 1000 seconds (almost 17 minutes), to solve a 1000 1000 system,
and 1003 times as long, or 106 seconds (about 11.5 days) to solve a 10000 10000 system.
(b) Gaussian elimination consists of a forward phase, in which the diagonal entries are used to eliminate nonzero
entries below and in the same column, and a backward phase, in which the diagonal entries are used to
eliminate nonzero entries above and in the same column. During the forward phase, at a typical step, there
is only 1 nonzero entry below the diagonal, and only 5 arithmetic operations are required to eliminate it (1
division to compute the multiplier, and 2 multiplications and 2 additions to add a multiple of the current
row to the next). Thus the forward phase requires O(5n) operations. A typical step of the backward phase
requires 3 arithmetic operations (a multiplication and an addition to adjust the right-hand side and a division
to solve for the unknown). Thus the backward phase requires O(3n) operations. The grand total is O(8n)
operations.
(c) It will take about 10 times as long, or 0.1 seconds, to solve a 1000 1000 tridiagonal system, and 100 times
as long, or 1 second, to solve a 10000 10000 tridiagonal system.

5.6. PIECEWISE POLYNOMIALS AND THE FINITE ELEMENT METHOD

5.6

35

Piecewise polynomials and the finite element method

1. We wish to compute the piecewise linear finite element approximation to the solution of
d2 u
= x, 0 < x < 1,
dx2
u(0) = 0,

u(`) = 0
using a uniform mesh with four elements. Such a mesh corresponds to h = 1/4, and there are three basis functions.
The stiffness matrix is

8 4
0
8 4
K = 4
0 4
8
(as computed in Example 5.18 in the text). The load vector F R3 is defined by
1

Z
Fi =

f (x)i (x) dx.


0

A direct calculation shows that F1 = 1/16, F2 = 1/8, F3 = 3/16. Solving Ku = f yields


5

u=

128
1
16
7
128

The exact solution to the BVP is u(x) = (x x3 )/6. Figure 5.5 shows the exact solution and the piecewise linear
approximation.
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
0

0.2

0.4

0.6

0.8

Figure 5.5: The exact (dashed curve) and approximate (solid curve) solutions from Exercise 5.6.1.
3.

(b) Here are the errors for n = 10, 20, 40, 80:
n
10
20
40
80

maximum error
1.6586 103
4.3226 104
1.1036 104
2.7881 105

We see that, when n is doubled, the error decreases by a factor of approximately four. Thus
 
1
error = O
.
n2
5. The exact solution is u(x) = x(1 x3 )/12. Here are the errors for n = 10, 20, 40, 80:

36

CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS


n
10
20
40
80

maximum error
1.1286 103
2.9710 104
7.6186 105
1.9288 105

We see that, when n is doubled, the error descreases by a factor of approximately four. Thus
 
1
error = O
.
n2
7. The weak form is
`

Z
find u V such that
0



dv
du
k(x) (x) (x) + p(x)u(x)v(x) dx
dx
dx

f (x)v(x) dx for all v V.

=
0

The bilinear form is


Z

a(u, v) =
0



dv
du
k(x) (x) (x) + p(x)u(x)v(x) dx.
dx
dx

9. We wish to apply the piecewise linear finite element method to the BVP

d2 u
1
+ 2u = x, 0 < x < 1,
dx2
2
u(0) = 0,
u(1) = 0.

We use a sequence of increasingly fine uniform meshes. The weak form of the BVP is

Z 1
Z 1
Z 1
dv
du
1
2
2
u CD
[0, 1],
(x) (x) dx +
x v(x) dx for all v CD
[a, b],
2u(x)v(x) dx =
dx
2
0 dx
0
0
and the Galerkin method requires the solution of

Z 1
Z 1
Z 1
dvn
1
dv
vn Vn ,
(x) (x) dx + 2
x v(x) dx for all v Vn .
vn (x)v(x) dx =
dx
dx
2
0
0
0
The second integral on the left side of the variational equation leads to the matrix M R(n1)(n1) , where
Z 1
Mij =
j (x)i (x) dx
0

and j is the jth standard basis function for the space of continuous piecewise linear functions. The matrix M
can be computed explicitly (similarly to how K was computed in Example 5.18 in the text), and the result is

2h
,
j = i,

3
Mij =
f rach6, j = i 1 or j = i + 1,

0,
otherwise.
We then must solve (K + 2M)u = f , where K is the usual stiffness matrix (as in Example 5.18) and the load
vector f is defined by

Z 1
1
h
fi =
x i (x) dx = (1 2ih), i = 1, 2, . . . , n 1.
2
2
0
After solving (K + 2M)u = f to get the piecewise linear approximation for each n, we estimate the maximum
error by evaluating both the exact function and the approximation on a finer mesh. The results are shown in the
following table.
n
10
20
40
80
160
320

error
5.4953 104
1.4660 104
3.7842 105
9.6121 106
2.4222 106
6.0794 107

5.6. PIECEWISE POLYNOMIALS AND THE FINITE ELEMENT METHOD

37

These results show that when n is doubled, the error is reduced by a factor of approximately 4. Thus it appears
that the error is O(1/n2 ).

Chapter 6

Heat Flow and Diffusion


6.1

Fourier series methods for the heat equation

1. The steady-state solution of Example 6.2 satisfies the BVP


d2 u
dx2
u(0)

107 , 0 < x < 100,

0,

u(100)

0.

Either by solving this BVP or by taking the limit (as t ) of the solution of Example 6.2, we find that the
steady-state solution is

 nx 
X
2 103 (1 (1)n )
us (x) =
sin
.
Dn3 3
100
n=1
3. The solution is
u(x, t) =

X
2(1)n+1 n2 2 t
e
sin (nx).
n
n=1

A graph of u(, 0.1) is given in Figure 6.1.


1
u(,0)
u(,0.1)

0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0

0.2

0.4

0.6

0.8

Figure 6.1: The snapshot u(, 0.1), together with the initial temperature distribution, for Exercise 6.1.3.
5. With
p(x, t) = g(t) +

x
(h(t) g(t))
`

and v(x, t) = u(x, t) p(x, t), we have


c

2v
v
2
t
x

=
=



2u
2p
u
p
2 c
2
t
x
t
x



x dh
dg
dg
f (x, t) c
(t) +
(t)
(t)
.
dt
` dt
dt
c

39

40

CHAPTER 6. HEAT FLOW AND DIFFUSION


We also have
v(x, t0 ) = u(x, t0 ) p(x, t0 ) = (x) g(t0 )

x
(h(t0 ) g(t0 ))
`

and
v(0, t)

u(0, t) p(0, t) = g(t) g(t) = 0,

v(`, t)

u(`, t) p(`, t) = h(t) h(t) = 0.

We define


g(x, t) = f (x, t) c

dg
x
(t) +
dt
`

and
(x) = (x) g(t0 )


dh
dg
(t)
(t)
dt
dt

x
(h(t0 ) g(t0 )).
`

Then v satisfies
c

2v
v
2
t
x
v(x, t0 )

(x), 0 < x < `,

v(0, t)

0, t > t0 ,

v(`, t)

0, t > t0 .

g(x, t), 0 < x < `, t > 0,

7. Define v(x, t) = u(x, t) x cos (t). Then v satisfies the following IBVP (with homogeneous boundary conditions,
but with a nonzero source term):
v
2v

t
x2
v(x, 0)

x sin (t), 0 < x < 1, t > 0,

0, 0 < x < 1,

v(0, t)

0, t > 0,

v(1, t)

0, t > 0.

This IBVP has solution

v(x, t) =

an (t) sin (nx),

n=1

where



2 2
2(1)n
cos (t) en t n2 2 sin (t) .
4
4
n (n + 1)
The solution to the original IBVP is then u(x, t) = v(x, t) + x cos (t). A graph of u(, 1.0) is given in Figure 6.2.
an (t) =

1
u(,0)
u(,0.1)

0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0

0.2

0.4

0.6

0.8

Figure 6.2: The snapshot u(, 1.0), together with the initial temperature distribution, for Exercise 6.1.7.
9. The temperature u(x, t) satisfies the IBVP
c

u
2u
2
t
x
u(x, 0)

0, 0 < x < 100, t > 0,

5, 0 < x < 100,

u(0, t)

0, t > 0,

u(100, t)

0, t > 0.

6.2. PURE NEUMANN CONDITIONS AND THE FOURIER COSINE SERIES


The solution is
u(x, t) =

41

 nx 
X
n2 2 t
10(1 (1)n ) 100
2 c
sin
e
.
n
100
n=1

The temperature at the midpoint after 20 minutes is


.
u(50, 1200) = 1.58 degrees Celsius.
11.

(a) The steady-state temperature is us (x) = x/20.


(b) The temperature u(x, t) satisfies the IBVP
c

2u
u
2
t
x
u(x, 0)

0, 0 < x < 100, t > 0,

5, 0 < x < 100,

u(0, t)

0, t > 0,

u(100, t)

5, t > 0.

The solution is

u(x, t) =

 nx 
X 10 n2 2 t
x
+
e 1002 c sin
.
20 n=1 n
100

Considering the results of Exercise 6.1.9, it is obvious that at least several thousand seconds will elapse
before the temperature is within 1% of steady state, so we can accurately estimate u(x, t) using a single
term of the Fourier series:
 x 
2 t
10 100
. x
2 c
u(x, t) =
+
e
.
sin
20

100
We want to find t large enough that
|u(x, t) us (x)|
0.01
|us (x)|
for all x [0, 100]. Using our approximation for u, this is equivalent to


200 sin x 
2

100 1002 c t
0.01.

e


x
A graph shows that

200 sin



x

x
100



2

for all x, so we need


2
2

100 c

0.005.

This yields
1002 c ln 0.005 .
= 4520.
2
About 75 minutes and 20 seconds are required.
t

6.2

Pure Neumann conditions and the Fourier cosine series

1. The solution is
u(x, t) = d0 +

dn en

2 t

cos (nx),

n=1

where
Z
d0 =
0

1
x(1 x) dx = , dn = 2
6

The graphs are given in Figure 6.3.

Z
0


2 (1)n+1 1
x(1 x) cos (nx) dx =
.
n2 2

42

CHAPTER 6. HEAT FLOW AND DIFFUSION


0.25

0.2

0.15

0.1
u(x,0)
u(x,0.02)
u(x,0.04
u(x,0.06)
u(x,)

0.05

0
0

0.2

0.4

0.6

0.8

Figure 6.3: The solution u(x, t) from Exercise 6.2.4 at times 0, 0.02, 0.04, and 0.06, along with the steady-state
solution. These solutions were estimated using 10 terms in the Fourier series.
3.

2
[0, `], then
(a) If u, v CN

=
=
=
=
=
=

d2 u
(x)v(x) dx
2
0 dx
` Z `

dv
du
du
(x)v(x) +
(x) (x) dx

dx
dx
0 dx
0
Z `
du
dv
(x) (x) dx (since du
(0) = du
(`) = 0)
dx
dx
dx
dx
0
` Z `

d2 v
dv
u(x) 2 (x) dx
u(x) (x)
dx
dx
0
0
Z `
2
d v
dv
dv

(0) = dx
(`) = 0)
u(x) 2 (x) dx (since dx
dx
0
(u, LN v).
Z

(LN u, v)

This shows that LN is symmetric.


(b) Suppose is an eigenvalue of LN and u is a corresponding eigenvector, normalized so that (u, u) = 1. Then
= (u, u)

(u, u)

(LN u, u)
Z ` 2
d u

(x)u(x) dx
2
0 dx
` Z ` 
2

du
du

(x)u(x) +
(x)
dx
dx
dx
0
0
2
Z `
du
(x)
dx (since du
(0) = du
(`) = 0)
dx
dx
dx
0
0.

=
=
=

Thus LN cannot have any negative eigenvalues.


5.

(a) Suppose u is a solution to the BVP. Then




Z `
Z ` 2
d u
du
du
f (x) dx =
(x)
dx
=

(0)

(`)
= (a b).
2
dx
dx
0
0 dx
This is the compatibility condition:
Z

f (x) dx = (a b).
0
2
(b) The operator K : CN
[0, `] C[0, `] defined by

Ku =

d2 u
+u
dx2

6.2. PURE NEUMANN CONDITIONS AND THE FOURIER COSINE SERIES

43

has eigenpairs
 nx 
n2 2
, n = 1, 2, 3, . . . .
,

(x)
=
cos
n
`2
`

0 = 1, 0 (x) = 1, and n = 1 +

The method of Fourier series can be applied to show that a unique solution exists for each f C[0, `]. (The
key is that 0 is not an eigenvalue of K, as it is of LN .)
7. As shown in this section, the solution to the IBVP is
u(x, t) = d0 +

dn en

2 t/`2

cos

 nx 
`

n=1

where d0 , d1 , d2 , . . . are the Fourier cosine coefficients of . We have



X

 nx 
 nx 
X
2 2
2



n2 2 t/`2
cos
dn e
|dn | en t/` cos




`
`
n=1

n=1

|dn | en

2 t/`2

n=1

t/`2

|dn | e(n

1) 2 t/`2

n=1

This last series certainly converges (as can be proved, for example, using the comparison test), and
e
This shows that
d0 +

dn en

t/`2

0 as t .

2 t/`2

cos

n=1

The limit d0 is
1
`
the average of the initial temperature distribution.

 nx 
`

d0 as t .

(x) dx,
0

9. The steady-state temperature is about 0.992 degrees Celsius.


11.

(a) Suppose that the Fourier sine series of u(x, t) on (0, `) is


u(x, t) =

X
n=1

an (t) sin

Z
 nx 
 nx 
2 `
, an (t) =
u(x, t) sin
dx
`
` 0
`

and u satisfies

u
u
(0, t) =
(`, t) = 0 for all t > 0.
x
x
The nth Fourier sine coefficient of 2 u/x2 is computed as follows:
Z
 nx 
2 ` 2u

(x,
t)
sin
dx
` 0 x2
`
"
#

Z
 nx  `
 nx 
2 u
n ` u

=
(x, t) sin

(x, t) cos
dx
` x
` 0
` 0 x
`
Z
 nx 
2n ` u
=
(x,
t)
cos
dx
`2 0 x
`

Z
 nx  `
 nx  
2n
n `

=
u(x,
t)
cos
+
u(x,
t)
sin
dx

`2
`
` 0
`
0
=

2n
n2 2
((1)n u(`, t) u(0, t)) + 2 an (t).
2
`
`

Since the values u(0, t) and u(`, t) are unknown, we see that it is not possible to express the Fourier sine
coefficients of 2 u/x2 in terms of a1 (t), a2 (t), . . ..

44

CHAPTER 6. HEAT FLOW AND DIFFUSION


(b) The Fourier sine series of u(x, t) = t is

X
2 (1 (1)n ) t
sin (nx),
n
n=1

and the formal calculation of the sine series of 2 u/x2 yields

2 (1 (1)n ) nt sin (nx).

n=1

However,
2u
(x, t) = 0,
x2
and so all of the Fourier sine coefficients of 2 u/x2 should be zero. Thus the formal calculation is wrong.

6.3

Periodic boundary conditions and the full Fourier series

1. The formula for the solution u is exactly the same as in Example 6.6, with a different value for (4.29 instead of
3.17). This implies that the amplitude of the solution is reduced by about 26%. Therefore, there is less variation
in the temperature distribution in the silver ring as opposed to the gold ring.
3.

(a) The IBVP is


c

2u
u
2
t
x
u(x, 0)
u(5, t)
u
(5, t)
x

0, 5 < x < 5, t > 0,

(x), 5 < x < 5,

u(5, t), t > 0,


u
(5, t), t > 0.
x

(b) The solution is


u(x, t) = c0 +

cn e

n t
25c

cos

n=1

 nx 
5

where
c0

cn

4
,
9
n+1
10(1)
, n = 1, 2, 3, . . . .
n4

25 +

(c) The steady-state temperature is the constant us = 25 + 4 /9 degrees Celsius.


(d) We must choose t so that
|us u(x, t)|
0.01
|us |
holds for every x [5, 5]. By trial and error, we find that about 360 seconds (6 minutes) are required.
5.

(a) To show that Lp is symmetric, we perform the now familiar calculation: we form the integral (Lp u, v) and
integrate by parts twice to obtain (u, Lp v). The boundary term from the first integration by parts is


du
(x)v(x)
dx

`
=
`

du
du
(`)v(`)
(`)v(`).
dx
dx

Since both u and v satisfy periodic boundary conditions, we have


v(`) = v(`),

du
du
(`) =
(`),
dx
dx

so the boundary term vanishes. The boundary term from the second integration by parts vanishes for exactly
the same reason.

6.3. PERIODIC BOUNDARY CONDITIONS AND THE FULL FOURIER SERIES

45

(b) Suppose Lp u = u, where u has been normalized: (u, u) = 1. Then


Z ` 2
d u
(x)u(x) dx
= (u, u) = (u, u) = (Lp u, u) =
2
` dx

`
2
Z ` 
du
du
+
=
(x)u(x)
(x)
dx
dx
dx
`
`
2
Z ` 
du
dx
(x)
=
dx
`
0.
The boundary terms vanishes because of the periodic boundary conditions:
du
du
(`)u(`) =
(`)u(`).
dx
dx
7.

(a) Since the ring is completely insulated, a steady-state temperature distribution cannot exist unless the net
amount of heat being added to the ring is zero. This is exactly the same situation as a straight bar with the
ends, as well as the sides, insulated.
(b) Suppose u is a solution to (6.21). Then

`


Z `
Z ` 2
u
u
u
u
(x, t) dx =
(x, t)
=
(`, t)
(`, t) = 0.
f (x) dx =
2
x
x
x
`
` x
`
The last step follows from the periodic boundary conditions.
(c) The negative second derivative operator, subject to boundary conditions, has a nontrivial null space, namely,
the space of all constant functions on (`, `). In analogy to the Fredholm alternative for symmetric matrices,
we would expect a solution to the boundary value problem to exist if and only if the right-hand-side function
is orthogonal to this null space. This condition is
Z `
cf (x) dx = 0 for all c R,
`

or simply
Z

f (x) dx = 0.
`

9. Consider the IBVP


c

2u
u
2 + pu = f (x, t), ` < x < `, t > t0 ,
t
x
u(x, t0 ) = (x), ` < x < `,
u(`, t) = u(`, t), t > t0 ,
u
u
(`, t) =
(`, t), t > t0 .
x
x

Assume that p is a constant.


(a) We wish to derive the solution to the IBVP using the Fourier series method. The calculation is very similar
to that carried out in Section 6.3.3 in the text, and we will use the same notation as in that section. We
represent the solution u as the series
n
 nx 
 nx o
X
u(x) = a0 +
an cos
+ bn sin
.
`
`
n=1
Substituting this series into the left side of the PDE yields
u
2u
(x, t) 2 (x, t) + pu(x, t)
t
x
 2 2



 nx 
X
da0
dan
n
= c
+ pa0 (t) +
c
(t) +
+
p
a
(t)
cos
+
n
dt
dt
`2
`
n=1

 2 2


 nx 
dbn
n
c
(t) +
+
p
b
(t)
sin
n
dt
`2
`
c

46

CHAPTER 6. HEAT FLOW AND DIFFUSION


Following the derivation in Section 6.3.3, we find a0 , a1 , . . ., b1 , b2 , . . . by solving the IVPs
da0
+ pa0 = c0 (t), a0 (t0 ) = p0 ,
dt
 2 2

n
+
+
p
an = cn (t), an (t0 ) = pn , n = 1, 2, . . . ,
`2
 2 2

n
+
+
p
bn = dn (t), bn (t0 ) = qn , n = 1, 2, . . . .
`2
c

dan
dt

dbn
dt

(b) The eigenvalues of the spatial operator are 0 = p and


n2 2
+ p, n = 1, 2, . . . .
`2

n =

Therefore, n 0 for all n, and all the eigevalues are positive if and only if p > 0.
11. Let f : (`, `) R be an even function. We wish to prove that the full Fourier series of f reduces to the cosine
series of f , regarded as a function on (0, `). The full Fourier series of f is
f (x) = a0 +

n
X

an cos

 nx 

n=1

+ bn sin

 nx o
`

where
Z `
1
f (x) dx,
2` `
Z `
 nx 
1
dx, n = 1, 2, . . . ,
f (x) cos
an =
` `
`
Z
 nx 
1 `
bn =
dx, n = 1, 2, . . . .
f (x) sin
` `
`
a0 =

For any function g : (`, `) R, if g is even, then


Z `
Z
g(x) dx = 2
`

g(x) dx,
0

while if g is odd, then


Z

g(x) dx = 0.
`

Since f is even,
a0 =

1
2`

f (x) dx =
`

1
`

f (x) dx.
0

Also, f (x) cos (nx/`) is an even function of x (the product of even functions is even), and therefore
Z
Z
 nx 
 nx 
2 `
1 `
an =
f (x) cos
dx =
f (x) cos
dx, n = 1, 2, . . . .
` `
`
` 0
`
Finally, f (x) sin (nx/`) is an odd function of x (the product of an even and an odd function is odd), and thus
Z
 nx 
1 `
dx = 0, n = 1, 2, . . . .
bn =
f (x) sin
` `
`
Thus the full Fourier series reduces to
f (x) = a0 +

X
n=1

where

an cos

 nx 
`

Z
Z
 nx 
1 `
2 `
f (x) dx, an =
f (x) cos
dx, n = 1, 2, . . . .
` 0
` 0
`
This is precisely the Fourier cosine series of f on the interval (0, `) (cf. Section 6.2.2).
a0 =

6.4. FINITE ELEMENT METHODS FOR THE HEAT EQUATION

6.4

47

Finite element methods for the heat equation

1. We give the proof for the general case of a Gram matrix G. Suppose Gx = 0, where x Rn . Then (x, Gx) = 0
must hold, and
!
n
n X
n
n X
n
n
n
X
X
X
X
X
(x, Gx) =
(Gx)i xi =
Gij xj xi =
(uj , ui )xj xi =
xj u j , u i u i
i=1

i=1 j=1

i=1 j=1

i=1
n
X

j=1

xj uj ,

j=1

n
X

!
xi u i

i=1

n
2
X



xj uj .



j=1

Pn

Thus Gx = 0 implies that the vector


j=1 xj uj is the zero vector. But, since {u1 , u2 , . . . , un } is linearly
independent, this in turn implies that x1 = x2 = = xn = 0, that is, that x = 0. Since the only vector x Rn
satisfying Gx = 0 is the zero vector, G is nonsingular.
3.

(a)

M=

2/9
1/18

1/18
2/9

6
3

, K=

3
6


, f (t) =

1
162

11 cos (t)
11 cos (t)

(b) The system of ODEs is M d


= K + f (t), that is,
dt
2 d1
1 d2
+
9 dt
18 dt
2 d2
1 d1
+
18 dt
9 dt
5.

=
=

11 cos (t)
,
162
11 cos (t)
31 62 +
.
162
61 + 32 +

(a) Write 1 = 8.97, 2 = 7.88,



(x) =

1 ,
2 ,

0 < x < 50,


50 < x < 100,

and similarly for c(x) and (x). Then the IBVP is




u

u
(x)c(x)

(x)
t
x
x
u(x, 0)

0, 0 < x < 100, t > 0,

5, 0 < x < 100,

u(0, t)

0, t > 0,

u(100, t)

0, t > 0.

(b) The mass matrix M is tridiagonal and symmetric, and its nonzero entries are
( c h
1 1
,
i = 1, 2, . . . , n2 1,
6
Mi,i+1 =
2 c 2 h
,
i = n2 , n2 + 1, . . . , n 1,
6
and
Mii =

21 c1 h
,
3
(1 c1 +2 c2 )h
,
3
22 c2 h
,
3

i = 1, 2, . . . ,
i=
i=

n
,
2
n
+
2

1,

n
2

n
2

1,

+ 2, . . . , n 1.

The stiffness matrix K is tridiagonal and symmetric, and its nonzero entries are
(
h1 ,
i = 1, 2, . . . , n2 1,
Ki,i+1 =
h2 ,
i = n2 , n2 + 1, . . . , n 1,
and
Kii =

21
,
h
1 +2
,
h
22
,
h

i = 1, 2, . . . ,
i=
i=

n
,
2
n
+
2

1,

n
2

n
2

1,

+ 2, . . . , n 1.


.

48

CHAPTER 6. HEAT FLOW AND DIFFUSION


7. The solution is
u(x, t) =

an (t) sin

n=1

 nx 
,
100

where
an (t) =

400(2 + (1)n )
2 7 n7





2 2
n t
104 c e 104 c 1 + n2 2 t .

The errors in Examples 6.8 and 6.9 are graphed in Figure 6.4.
0.05

0.05

0.1

0.15

0.2
Euler
Backward Euler
0.25
0

20

40

60

80

100

Figure 6.4: The errors in Examples 6.8 and 6.9 (see Exercise 6.4.7).

(a) The IBVP is

(x)c(x)

t
x



u
(x)
x
u(x, 0)

0, 0 < x < `, t > 0,

5, 0 < x < `,

u(0, t)

0, t > 0,

u(`, t)

0, t > 0.

(b) The weak form is to find u satisfying


`

Z
0



u
u
dv
(x)c(x) (x, t)v(x) + (x) (x, t) (x) dx = 0, t > 0, v V.
t
x
dx

(c) The temperature distribution after 120 seconds is shown in Figure 6.5.
t = 120 (seconds)
5
4.5
4
3.5

temperature

9.

3
2.5
2
1.5
1
0.5
0
0

20

40

60

80

100

Figure 6.5: The temperature distribution after 120 seconds in Exercise 6.4.9.

6.5. FINITE ELEMENTS AND NEUMANN CONDITIONS

6.5

49

Finite elements and Neumann conditions

1. The BVP to be solved is


d2 u
dx2
du
(0)
dx
du
(100)
dx
k

f (x), 0 < x < 100,

0,

0,

with k = 1.5 and f (x) = 107 x(25 x)(100 x) + 1/240. The steady-state temperature is not unique; the solution
with u(100) = 0 is shown in Figure 6.6.
6
5

temperature

4
3
2
1
0
1
0

20

40

60

80

100

Figure 6.6: The computed steady-state temperature distribution from Exercise 6.5.1.
(a) The total amount of heat energy being added to the bar is 0.51A W, where A is the cross-sectional area
(0.01A W through the left end and 0.5A W in the interior). Therefore, 0.51A W must be removed through
the right end; that is, heat energy must be removed at a rate of 0.51 W/cm2 through the right end.
(b) The BVP is
d2 u
dx2
du
k (0)
dx
du
k (100)
dx

0.005, 0 < x < 100,

0.01,

0.51.

The steady-state temperature is not unique; the temperature with u(100) = 0 is graphed in Figure 6.7.
7
6
5

temperature

3.

4
3
2
1
0
0

20

40

60

80

100

Figure 6.7: The computed steady-state temperature distribution from Exercise 6.5.3.

50

CHAPTER 6. HEAT FLOW AND DIFFUSION


5.

(a) We have

=
u Ku

n X
n
X

n X
n
X

ij uj ui =
K

i=0 j=0

a (j , i ) uj ui

i=0 j=0

n
X

i=0

n
X

ui

n
X

j=0
n
X

uj j ,

j=0

!
uj j , i

ui i

i=0

a(v, v).

Therefore,
= 0 u Ku
= 0 a(v, v) = 0.
Ku
(b) Suppose v V and a(v, v) = 0. By definition of a(, ), this is equivalent to
`


(x)

2
dv
(x)
dx = 0.
dx

Since the integrand is nonnegative, this implies that the integrand is in fact zero, and, since (x) is positive,
we conclude that
dv
(x)
dx

7.

is the zero function. Therefore, v is a constant function.


= 0, it follows that v(x) = Pn ui i (x) is a constant function, where u0 , u2 , . . . , un are the
(c) Thus, if Ku
i=0
components of u. But then there is a constant C such that v(xi ) = C, i = 0, 1, 2, . . . , n. These nodal values
of v are precisely the numbers u0 , u1 , . . . , un , so we see that u = Cuc , which is what we wanted to prove.


(a) Define V = v C 2 [0, `] : v(0) = 0 . Then the weak form of the BVP is
find u V such that a(u, v) = (f, v) for all v V .

(6.1)

(b) The fact that a solution of the strong form is also a solution of the weak form is proved by the usual argument:
multiply the differential equation by an arbitrary test function v V , and then integrate by parts.
The proof that a solution of the weak form is also a solution of the strong form is similar to the argument
given in Section 6.5.2. Assuming that u satisfies the weak form (6.1), an integration by parts and some
simplification shows that

k(`)

du
(`)v(`)
dx

Z
0




du
d
k(x) (x) + f (x) v(x) dx = 0 for all v V .
dx
dx

Since V V , this implies that the differential equation




d
du
k(x) (x) + f (x) = 0, 0 < x < `
dx
dx
holds, and we then have
k(`)

du
(`)v(`) = 0 for all v V .
dx

Choosing any v V with v(`) 6= 0 shows that the Neumann condition holds at x = `.
9. The temperature distribution after 300 seconds is shown in Figure 6.8.

6.5. FINITE ELEMENTS AND NEUMANN CONDITIONS

51

t=300 (seconds)
8
7

temperature

6
5
4
3
2
1
0
0

20

40

60

80

100

Figure 6.8: The temperature distribution from Exercise 6.5.9 (after 300 seconds).
= 0, then
11. Here is a sketch of the proof: If Ku
= 0 a(v, v) = 0,
u Ku
P
where v = n1
i=0 ui i . But then, by the usual reasoning, v must be a constant function, and v(xn ) = 0 (since
i (xn ) = 0 for i = 0, 1, 2, . . . , n 1). Thus v is the zero function, which implies that the nodal values of v are all
is nonsingular.
zero. Therefore u = 0, and so K

Chapter 7

Waves
7.1

The homogeneous wave equation without boundaries

1. The solution, by dAlemberts formula, is u(x, t) = ((x ct) + (x + ct)). Figure 7.1 shows three snapshots of
u.
4

20

x 10

15

10

5
20

15

10

10

15

20

Figure 7.1: Three snapshots of the solution of Exercise 7.1.1: t = 0 (dashed curve), t = 0.01 (solid curve), and
t = 0.025 (dash-dotted curve).

3. The two waves join and add constructively, and then separate again. See Figure 7.2.
3

1.5

x 10

t=0
t=0.02
t=0.04

0.5

0
40

30

20

10

0
x

10

20

30

40

Figure 7.2: Constructive interference in Exercise 7.1.3. The blip in the center is the result of two waves
combining temporarily. (The velocity in this example is c = 1.)

53

54

CHAPTER 7. WAVES
5. Consider the IVP
2
2u
2 u

c
= 0, < x < , t > 0,
t2
x2
u(x, 0) = (x), < x < ,

u
= 0, < x < ,
t
where the support of is [a, b]. The solution is u(x, t) = ((x ct) + (x + ct))/2. Now, since (x ct) is a
right-moving wave, we see that (x1 ct) = 0 if any of the following conditions hold:
x1 a;
a < x1 < b and t

x1 a
c

(since (x1 ct) = 0 after the trailing edge of the wave passes x1 );

x1 b
c

x b and (t
or t x1ca ) (since (x1 ct) = 0 before the leading edge of the wave reaches x1 and
after the trailing edge of the wave passes x1 ).
Similarly, (x + ct) is a left-moving wave, and therefore (x1 + ct) = 0 if any of the following is true:
x1 b;
a < x1 < b and t
x1 a and (t

bx1
;
c

ax1
c

or t

bx1
).
c

Since u(x1 , t) is guaranteed to be zero if both (x1 ct) and (x1 + ct) are zero, we see that u(x1 , t) = 0 if any
of the following is true:
x1 a and (t

ax1
c

a < x1 < b and t


x1 b and (t

or t

x1 a
c

x1 b
c

bx1
);
c

and t

or t

bx1
;
c

x1 a
).
c

7. Consider the IBVP


2u
2u
c2 2 = 0, 0 < x < `, t > 0,
2
t
x
u(x, 0) = (x), 0 < x < `,
u
= 0, 0 < x < `,
t
u(0, t) = 0, t > 0,
u(`, t) = 0, t > 0,
where the support of is [a, b] and 0 < a < b < `. If we define
u(x, t) =

1
((x ct) + (x + ct)) ,
2

then we know that u satisfies the same PDE and initial condition as does the solution of the above IBVP. Also,
since the support of is [a, b], u(0, t) = 0 for all t a/c (since u(0, t) cannot be nonzero until the leading edge of
the left-moving wave reaches x = 0), and similarly u(`, t) = 0 for all t (` b)/c (since u(`, t) cannot be nonzero
until the leading edge of the right-moving wave reaches x = `). Therefore, if t < tf = min{a/b, (` b)/c}, then u
satisfies both boundary conditions, in addition to the initial conditions and the PDE, and hence is a solution of
the above IBVP.

7.2

Fourier series methods for the wave equation

1. The solution is found by setting cn = 0 in Example 7.4:


u(x, t) =

X
n=1


bn cos

cnt
25


sin

 nx 
.
25

A graph analogous to Figure 7.6 from the text is given in Figure 7.3.

displacement

7.2. FOURIER SERIES METHODS FOR THE WAVE EQUATION

55

10

15

20

25

Figure 7.3: Fifty snapshots of the vibrating string from Example 7.4, with no external force.

3. The solution is
u(x, t) =


an (t) sin

n=1


(2n 1)x
,
50

where
502 cn
2
c (2n 1)2 2


an (t) = bn
and
bn =


cos

c(2n 1)t
50


+

502 cn
1)2 2

c2 (2n


2 sin (n/2) 2 cos (n/2) + (1)n
4000
, cn =
.
5(2n 1)2 2
(2n 1)

The fundamental frequency is now c/100 instead of c/50. Fifty snapshots are shown in Figure 7.4.
2.5
2
1.5

displacement

1
0.5
0
0.5
1
1.5
2
2.5
0

10

15

20

25

Figure 7.4: Fifty snapshots of the vibrating string from Example 7.4, with the right end free.

5. The solution is

u(x, t) =

1
+ 50t2
20


+


bn cos

n=1

cnt
25


cos

 nx 
25

where
bn =

2 (2 cos (n/2) 1 (1)n )


, n = 1, 2, 3, . . . .
5n2 2

Fifty snapshots of the solution are shown in Figure 7.5. The solution gradually moves up; this is possible because
both ends are free to move vertically.
7. The solution is
u(x, t) =

X
n=1


an (t) sin


(2n 1)x
,
2

56

CHAPTER 7. WAVES
0.6

displacement

0.4

0.2

0
0

10

15

20

25

Figure 7.5: Fifty snapshots of the vibrating string from Example 7.4, with both ends free.

where

an (t)

bn

cn

bn

4cn
c2 (2n 1)2 2


cos

c(2n 1)t
2


+

4cn
,
c2 (2n 1)2 2

2(1)n+1
,
125(2n 1)2 2
4g
.
(2n 1)

Snapshots of the solution are graphed in Figure 7.6, which should be compared to Figure 7.9 from the text.
3

displacement

x 10

1
t=0
t=5e05
t=0.0001
t=0.00015

0
0

0.2

0.4

0.6

0.8

Figure 7.6: Snapshots of the displacement of the bar in Example 7.6, taking into account the effect of gravity.
9. Consider a string whose (linear) density (in the unstretched state) is 0.25 g/cm and whose longitudinal stiffness is
6500 N. Suppose the unstretched (zero tension) length of the string is 40 cm. We wish to determine the length to
which the string must be stretched in order that its fundamental frequency be f0 = 261 Hz (middle C). We will
write `0 = 40, k = 6.5 108 (the stiffness of the string in g cm/s2 ), and T for the unknown tension. Note that the
mass of the string is m = 10 (g). We know that f0 = c/(2`), where c is the wave speed and ` = `0 + `. Also,
c2 = T /, where = m/`. Finally, ` is related to T by Hookes law: k`/`0 = T . Putting all these equations
together, we obtain
q
c
1
q
f0 =
=
2(`0 + `)
2(`0 + `)

k`
`0

m
`0 +`

k`
k`
= p

= f02 .
4m`
(`
0 0 + `)
2 m`0 (`0 + `)

Some straightforward algebra yields


` =

4m`20 f02
.
= 8.0586.
k 4m`0 f02

Thus the string must be stretched to 48.0586 cm.

7.3. FINITE ELEMENT METHODS FOR THE WAVE EQUATION

7.3

57

Finite element methods for the wave equation

1. The fundamental period is 2`/c = 0.2. Using h = 100/20 = 5, Dt = T /60, and the RK4 method, we obtain the
solution shown in Figure 7.7.

displacement

0.2

0.2
0

0.2

0.4

0.6

0.8

Figure 7.7: The computed solution of the wave equation in Exercise 7.3.1. Shown are 30 snapshots, plus the
initial displacement. Twenty subintervals in space and 60 time steps were used.
3.

(a) Since the initial disturbance is 24 cm from the boundary and the wave speed is 400 cm/s, it will take
24/400 = 0.06 s for the wave to reach the boundary.
(b) The IBVP is
2u
2u
c2 2
2
t
x
u(x, 0)
u
(x, 0)
t
u(0, t)
u(50, t)

0, 0 < x < 50, t > 0,

0, 0 < x < 50,

(x), 0 < x < 50,

0, t > 0,

0, t > 0,

with c = 400 and given in the statement of the exercise.


(c) Using piecewise linear finite elements and the RK4 method (with h = 50/80 and t = 6104 ), we computed
the solution over the interval 0 t 0.06. Four snapshots are shown in Figure 7.8, which shows that it does
take 0.06 seconds for the wave to reach the boundary. (The reader should notice the spurious wiggles in
the computed solution; these are due to the fact that the true solution is not smooth.)

displacement

0.1

0.1
0

10

20

30

40

50

Figure 7.8: The computed solution of the wave equation in Exercise 7.3.3.
5. It is not possible to obtain a reasonable numerical solution using finite elements. In Figure 7.9, we display the
result obtained using h = 2.5 103 and t = 3.75 104 . Three snapshots are shown.
7.

(a) The weak form is


Z
0



Z `
u
dv
2u
(x) 2 (x, t)v(x) + k(x) (x, t) (x) dx =
f (x, t)v(x) dx
t
x
dx
0

58

CHAPTER 7. WAVES
1.2
1

displacement

0.8
0.6
0.4
0.2
0
0.2
0

0.2

0.4

0.6

0.8

Figure 7.9: The computed solution of the wave equation in Exercise 7.3.5.
for t t0 and v V , where


V = v C 2 [0, `] : v(0) = 0 .
(b) The system of ODEs has the same form as in the case of a homogeneous bar:
2

d u + Ku
=
M
f (t),
dt2
except that the entries in the mass matrix are now
Z `
ij =
M
(x)j (x)i (x) dx, i, j = 1, 2, . . . , n,
0

and the entries in the stiffness matrix are now


Z `
di
dj
ij =
(x)
(x) dx, i, j = 1, 2, . . . , n.
K
k(x)
dx
dx
0
The components of the vector
f are unchanged (see Section 7.3.2).

7.4

Resonance

1. We represent the solution as


u(x, t) =

X
n=1

an (t) sin

 nx 
.
`

Following the usual procedure, an must solve the IVP


d2 an  cn 2
dan
+
an = cn (t), an (0) = 0,
(0) = 0,
dt2
`
dt
where cn (t), n = 1, 2, . . ., are the Fourier sine coefficients of the right-hand-side function f (t) = sin (2t):
Z
 nx 
2 `
2
sin (2t) sin
dx =
cn (t) =
(1 (1)n ) sin (2t)
` 0
`
n

0,
if n is odd,
=
4
sin (2t), if n is even.
n
Therefore, an (t) = 0 if n is even, while, if n is odd,
Z t
 cn

`
an (t) =
sin
(t s) cn (s) ds.
cn 0
`
If n is odd and 6= cn/(2`), we obtain
an (t) =

4`2 (cn sin (2t) 2` sin


cn2 2 (c2 n2 4`2 2 )

cnt
`


)

7.4. RESONANCE

59

If n is odd and = cn/(2`), we obtain


an (t) =

cnt
`

2`(` sin

cnt cos
c2 n3 3

cnt
`


)

Therefore, if does not equal cn/(2`) for any odd n, then the Fourier coefficients of u are uniformly bounded
with respect to t and go to zero like 1/n3 . Notice, though, that if is very close to cn/(2`) for some odd n, then
the corresponding an (t) is larger (due to the factor of c2 n2 4`2 2 in the denominator), and thus that frequency
has greater weight in the Fourier series.
On the other hand, if = cn/(2`) for some odd n, then the corresponding Fourier coefficient an (t) grows without
bound as t , and resonance is observed.
3. The experiment described in this problem is modeled by the IBVP
2u
2u
c2 2 = 0, 0 < x < 1, t > 0,
t2
x
u(x, 0) = 0, 0 < x < 1,
u
(x, 0) = 0, 0 < x < 1,
t
u
k (0, t) = B sin (2t), t > 0,
x
u(1, t) = 0, t > 0.
.
Here c2 = k/ = 3535.53 m/s.
We transform this problem into one that we can analyze by the Fourier series method by shifting the data. The
function v(x, t) = (B/k) sin (2t)(x 1) satisfies the given boundary conditions; if we define w = u v, then w
satisfies the IBVP
2w
2w
4 2 2 B
sin (2t)(x 1), 0 < x < 1, t > 0,
c2 2 =
2
t
x
k
w(x, 0) = 0, 0 < x < 1,
w
2B
(x, 0) =
(x 1), 0 < x < 1,
t
k
w
k
(0, t) = 0, t > 0,
x
w(1, t) = 0, t > 0.
We solve this IBVP by the usual method. We write
u(x, t) =

an (t) sin (nx).

n=1

The Fourier coefficients an are found by solving the IVP


d2 an
dan
+ c2 n2 2 an = cn (t), an (0) = 0,
(0) = bn ,
dt2
dt
where
Z

cn (t) = 2
0

4 2 2 B
8 2 B
sin (2t)(x 1) sin (nx) dx =
sin (2t)
k
kn

and
bn =

4B
k

(x 1) sin (nx) dx =
0

4B
.
kn

It follows (see Section 4.2.3 from the text) that


Z t
Z t
bn
1
4B
1
an (t) =
sin (cnt) +
sin (cn(t s))cn (s) ds =
sin
(cnt)
+
sin (cn(t s))cn (s) ds.
cn
cn 0
kcn2
cn 0
If 6= cn/2, then
an (t) =

8 2 B(cn sin (2t) 2 sin (cnt))


4B
sin (cnt)
,
2
kcn
ckn2 (c2 n2 4 2 )

60

CHAPTER 7. WAVES
while if = cn/2,
an (t) =

4B
4 2 B
sin (cnt)
2
kcn
ckn2


sin (cnt)
t cos (cnt) .
cn

(a) From the above analysis, we see that the smallest resonant frequency is r = c/2, the fundamental frequency
of the wave equation modeling the problem.
(b) If = r , then a1 (t) is given by the second formula above, while an (t), n > 1, is given by the first. We
compute several snapshots of the displacement, using 20 terms in the Fourier series, on each of the time
intervals [0, 0.005], [0.005, 0.01], [0.01, 0.015], and [0.015, 0.02]. These are shown in Figure 7.10. The graphs
show that the amplitude grows as t increase, and also that the shape of the displacement is dominated by
the first fundamental mode.
0.5

0.5

0.5
0

0.5

0.5
0

0.5

0.5

0.5
0

0.5

0.5
0

0.5

0.5

Figure 7.10: Resonance in Exercise 7.3.3(a).


(c) With = r /4, we compute the displacements at the same times as in the previous part of the exercise.
The results are shown in Figure 7.11. Here the absence of resonance is clearly seen, in that the amplitudes
remain bounded as t increases.
3

x 10

5
0

0.5

5
0

x 10

x 10

5
0

0.5

0.5

x 10

0.5

5
0

Figure 7.11: Absence of resonance in Exercise 7.3.3(b).

7.5. FINITE DIFFERENCE METHODS FOR THE WAVE EQUATION

61

5. We solve the IBVP by the usual method, taking


u(x, t) =

an (t) sin (nx),

n=1

where the Fourier coefficient an solves the IVP


dan
d2 an
+ c2 n2 2 an = cn (t), an (0) = 0,
(0) = 0.
dt2
dt
Here cn is the Fourier coefficient of the right-hand-side function f (x, t):
Z 1
Z 13/5
cn (t) = 2
f (x, t) sin (nx) dx = 2 sin (2t)
sin (nx) dx
0

3/5

2 sin (2t)
=
n


cos

3n
5


cos

13n
20


.

It follows that
1
cn

sin (cn(t s))cn (s) ds




cos 13n
2 cos 3n
(cn sin (2t) 2 sin (cnt))
5
20
=
.
cn2 2
(c2 n2 4 2 )

an (t) =

Five snapshots of the solution, at t = 0.002, 0.004, 0.006, 0.008, 0.01, are shown in Figure 7.12.
6

x 10

1.5
1
0.5
0
0.5
1
1.5
2
0

0.2

0.4

0.6

0.8

Figure 7.12: Snapshots of the solution of Exercise 7.3.5.

7.5

Finite difference methods for the wave equation

1. Let : R R be at least twice continuously differentiable. Then, by Taylors theorem,


(x + x) = (x) +

d
1 d2
(x)x +
(c)x2 ,
dx
2 dx2

where c is some number between x and x + x. Solving for d/dx yields


(x + x) (x)
d
1 d2
(x) =

(c)x
dx
x
2 dx2
or

Since

(x + x) (x)
d
1 d2
(x)
=
(c)x.
dx
x
2 dx2

d2
d2
(c)
(x)
2
dx
dx2
as x 0, it follows that the error in the forward difference approximation to the first derivative is approximately
proportional to x.

62

CHAPTER 7. WAVES
3. Suppose : R R is at least four times continuously differentiable. By Taylors theorem,
d
(x)x +
dx
d
(x)x +
(x x) = (x)
dx

(x + x) = (x) +

1 d2
(x)x2 +
2 dx2
1 d2
(x)x2
2 dx2

1 d3
(x)x3 +
6 dx3
1 d3
(x)x3 +
6 dx3

1 d4
(c1 )x4 ,
24 dx4
1 d4
(c2 )x4 ,
24 dx4

where c1 is between x and x + x and c2 is between x and x x. Adding these two equations yields


d2
1 d4
d4
2
(x + x) + (x x) = 2(x) + 2 (x)x +
(c1 ) + 4 (c2 ) x4 .
dx
24 dx4
dx
Solving this equation for the second derivative yields
(x + x) 2(x) + (x x)
d2
1
(x) =

dx2
x2
24


d4
d4
(c
)
+
(c
)
x2 .
1
2
dx4
dx4

Since

d4
d4
d4
(c1 ) + 4 (c2 ) 2 4 (x)
4
dx
dx
dx
as x 0, it follows that the error in the central difference approximation to the second derivative is approximately proportional to x2 .
5. With a Dirichlet condition at the left endpoint and a Neumann condition at the right, we must compute
(j)

ui

.
= u(xi , tj ), i = 1, 2, . . . , k, j = 1, 2, . . . , n

(using the same notation as in the text). We apply the usual 2-2 scheme at each (xi , tj ), i = 1, 2, . . . , k 1,
(j+1)
(j+1)
, i = 1, 2, . . . , k 1. To compute uk
,
resulting in equation (7.41) (page 301 in the text) for computing ui
we approximate the Neumann condition
u
(xk , tj ) = 0
x
by
(j)
(j)
uk+1 uk1
(j)
(j)
= 0 uk+1 = uk1 .
x
(j+1)

(1)

We then obtain equation (7.48) for uk


. Finally, we use (7.44) to compute ui , i = 1, 2, . . . , k 1, and (7.41)
(1)
with i = k and (xi+1 ) replaced by (xi1 ) to compute uk .
To test the scheme, we try in on the given problem, using a time interval of [0, 1] with initial values of k = 10 and
n = 500 (this gives ct/Dt = 0.9). Doubling k and n at each iteration, we obtain the following maximum errors:
x
0.1
0.05
0.025
0.0125

t
0.002
0.001
0.0005
0.00025

These errors display the expected second-order behavior.

maximum error
1.9 102
4.8802 103
1.2250 103
3.0792 104

Chapter 8

First-order PDEs and the Method of


Characteristics
8.1

The simplest PDE and the method of characteristics

1. Consider the PDE


u
= 0.
y
(a) Intuitively, since the solution is constant in y, the characteristics must be the vertical lines x = const. We
can verify this formally as follows. Suppose we impose the initial condition u(f (s), g(s)) = h(s). Then the
characteristics are determined by the equations
x
= 0, x(s, 0) = f (s),
t
y
= 1, y(s, 0) = g(s)
t
which yield
x(s, t) = f (s), y(s, t) = g(s) + t.
For each fixed s, these equations parametrize the vertical line x = f (s).
(b) The IVP
u
= 0, u(0, y) = (y)
y
is not well-posed. The general solution of the PDE is u(x, y) = (x). The initial condition u(0, y) = (y)
then yields (0) = (y), which is only possible if is a constant: (y) = c. Moreover, in this case, there are
infinitely many solutions, one for each satisfying (0) = c. Therefore the given IVP either has no solution
(if is not a constant function) or infinitely many (if is a constant function).
3. Consider the PDE
u
u
+3
= 0, 0 < x < 1, t > 0.
x
t
Given the initial condition u(f (s), g(s)) = h(s), the characteristics are determined by
4

x
= 4, x(0, ) = f (s),

t
= 3, t(0, ) = g(s),

which yield
x(s, ) = 4 + f (s), t(s, ) = 3 + g(s).

63

64

CHAPTER 8. FIRST-ORDER PDES AND THE METHOD OF CHARACTERISTICS


(a) Now consider the initial/boundary conditions
u(x, 0) = u0 (x), 0 < x < 1,
u(0, t) = (t), t > 0.
Characteristics passing through (s, 0), 0 < s < 1, have the form
x = 4 + s, t = 3 =

4
t
, s = x t.
3
3

This characteristic can also be written as t = (3/4)(x s). On such characteristics,



u(x, t) = v(s, ) = u0 (s) = u0


4
x t .
3

Characteristics through (0, s), s > 0, have the form


x = 4, t = 3 + s =

x
3
, s = t x.
4
4

This characteristic can also be written as t = s + (3/4)x. On such characteristics,




3
u(x, t) = v(s, ) = (s) = t x .
4
The characteristic dividing the domain into two is t = (3/4)x. Thus

u(x, t) =


u0 x 43 t ,
t 34 x ,

t 34 x,
t > 34 x.

(b) Now consider the initial/boundary conditions


u(x, 0) = u0 (x), 0 < x < 1,
u(1, t) = (t), t > 0.
This set of conditions does not define a well-posed problem, since every characteristic through a point
(x0 , 0), 0 < x0 < 1, also passes through a point (1, t0 ), 0 < t0 < 3/4. These means that the solution is
over-determined on part of the domain, and u0 , cannot be specified independently of each other.
5. Consider the IBVP
u
u
+c
= 0, 0 < x < 1, t > 0,
t
x
u(x, 0) = u0 (x), 0 < x < 1,
u(0, t) = (t), t > 0.
The solution is

u(x, t) =

u0 (x ct),
(t c1 x),

t < c1 x,
t > c1 x.

We assume that u0 and are both continuously differentiable.


(a) We wish to determine the conditions on u0 , that guarantee that u is continuous. Consider any (x0 , t0 )
with t0 = c1 x0 . We have
u0 (x ct) u0 (x0 ct0 ) = u0 (0) as (x, t) (x0 , t0 ),
(t c1 x) (t0 c1 x0 ) = (0) as (x, t) (x0 , t0 ),
which shows that u is continuous if and only if u0 (0) = (0).

8.2. FIRST-ORDER QUASILINEAR PDES

65

(b) Next, we have


u
(x, t) =
x

du0
(x ct),
dx
1 d
c dt (t c1 x),

t < c1 x,
t > c1 x,

and
du0
du0
du0
(x ct)
(x0 ct0 ) =
(0) as (x, t) (x0 , t0 ),
dx
dx
dx
d
d
d
c1 (t c1 x) c1 (t0 c1 x0 ) = c1 (0) as (x, t) (x0 , t0 ),
dt
dt
dt
Therefore, u/x is continuous if and only if
du0
d
(0) = c1 (0).
dx
dt
Similar reasoning shows that this condition also ensures that u/t is continuous.
7. Consider the IVP
u
u
+
= x + y, (x, y) R2 ,
y
x
u(x, x) = x2 , x R.
We solve the problem in characteristics variables as follows:
x
= 1, x(s, 0) = s,
t
y
= 1, y(s, 0) = s,
t
v
= x + y, v(s, 0) = s2 .
t
The first two equations yield
x = s + t, y = s + t s =
and therefore

xy
x+y
, t=
,
2
2

v
= 2t, v(s, 0) = s2 v(s, t) = s2 + t2 .
t

Thus,
u(x, y) =

8.2

 x y 2
2

 x + y 2
2

1 2
(x + y 2 ).
2

First-order quasilinear PDEs

1. Consider the following IVP:


x

u
u
+y
(x + y)u = 0,
x
y
u(1, y) = (y).

(a) The characteristics are defined by the equations


x
= x, x(s, 0) = 1,
t
y
= y, y(s, 0) = s,
t
which yield

y
.
x
Notice that x must be positive. Also, since s represents y0 on the initial curve x = 1, we see that the
characteristics can be written as y = y0 x. Thus the characteristic through (1, y0 ) is the line with slope y0
passing through the origin. This also shows that there must be a discontinuity when x decreases to zero.
x = et , y = set t = ln x, s =

66

CHAPTER 8. FIRST-ORDER PDES AND THE METHOD OF CHARACTERISTICS


(b) In the characteristic variables, the solution v(s, t) is defined by
v
= (x + y)v = (1 + s)et v, v(s, 0) = (s).
t
The ODE is separable and therefore the IVP is easily solved:
v(s, t) = (s)e(1+s)(e
Changing variables, we obtain

1)

y

ex+y1y/x .
x
(c) The formula for u shows that it is defined for all x > 0 (or for all x < 0, but the initial curve lies in the right
half-plane). This is consistent with the analysis of the characteristics.
u(x, y) =

3. Consider the IVP


u

u
u
+u
= 0,
x
y
u(x, 0) = (x).

The PDE is quasi-linear and can be solved by solving the characteristic equations:
x
= v, x(s, 0) = s,
t
y
= v, y(s, 0) = 0,
t
v
= 0, v(s, 0) = (s).
t
The equations for v yield v(s, t) = (s); substituting this into the first two equations yields x(s, t) = s + (s)t,
y = (s)t. From this we obtain s = x y, t = y/(x y), and the solution is
u(x, y) = v(s, t) = (s) = (x y),
that is, u(x, y) = (x y).
If we test the initial curve using the Jacobian test, we obtain
x


(s, 0) x
(s, 0) 1
s
t
y
=

(s, 0) y
(s, 0) 0
s
t


(s)
= (s),
(s)

we see that the initial curve is noncharacteristic if and only if (s) 6= 0.


5. Consider the IVP
u
u
+u
= 0, x > 0,
x
y
u(x, 0) = x, x > 0.
(a) The IVP can be solved by solving the characteristic equations:
x
= 1, x(s, 0) = s,
t
y
= v, y(s, 0) = 0,
t
v
= 0, v(s, 0) = s.
t
It is straightforward to obtain the solution:
x(s, t) = s + t, y(s, t) = st, v(s, t) = s.
Solving x = s + t, y = st for s, t (and bearing in mind that s = x when t = 0), we obtain
p
p
x + x2 4y
x x2 4y
, t=
.
s=
2
2

8.3. BURGERSS EQUATION

67

Since v(s, t) = s, it follows that


u(x, y) =

x+

x2 4y
.
2

This solution is defined for x > 0, y x2 /4.


(b) The characteristic indexed by s passes through the point (s, 0), so we can regards s as x0 . Notice that
x = s + t, y = st implies that t = x s and hence y = s(x s). This shows that the characteristics are the
lines y = x0 (x x0 ).
(c) Since the slopes of the characteristics increase as x0 increases, it follows that, for x1 > x0 , the characteristics
through (x0 , 0) and (x1 , 0) will intersect at some point (x, y) with x > x1 . A simple calculation shows that
y = x0 (x x0 ) and y = x1 (x x1 ) intersect at the point (x0 + x1 , x0 x1 ). Taking the limit as x1 decreases
toward x0 reveals the first point where the characteristic through (x0 , 0) intersects another characteristic:
(2x0 , x20 ). Notice that this is a point on the curve y = x2 /4, which is consistent with the results obtained
above.

8.3

Burgerss equation

1. Consider the inviscid Burgerss equation


u
u
+u
=0
t
x
with initial condition
u(x, 0) = u0 (x) =

1
.
1 + x2

We have seen that the characteristics are the lines


x = x0 + u0 (x0 )t t = u0 (x0 )1 (x x0 ).
(a) We wish to show that the solution of the IVP is well-defined for at each point (x, t), x < 0, t > 0. To show
this, it suffices to prove that there is a unique characteristic passing through any such point. Since the slope
(in the x, t plane) of every characteristic is positive, the characteristic through (x0 , 0) passes through (x, t)
only if x0 < x < 0 and
t = (1 + x20 )(x x0 ) x30 xx20 + x0 + (t x) = 0.
If we define (x0 ) = x30 xx20 + x0 + (t x), then it is easy to verify that (0) > 0, (x0 ) < 0 for x0
sufficiently large and negative, and 0 (x0 ) > 0 for all x0 < 0. It follows that (x0 ) = 0 has a unique solution
x0 < 0, and hence there is a unique characteristic passing through (x, t).
(b) We now wish to describe the set of all (x, t), t > 0, for which the solution is uniquely defined. Referring to
the analysis in the text, culminating in Figure 8.9, we see that u(x, t) is uniquely defined for all (x, t) outside
the caustic, which is defined by the parametric equations
x=

(1 + x20 )2
1 + 3x20
, t=
, x0 > 0.
2x0
2x0

The corner of the caustic can be found by setting the derivatives of x and t (with respect to x0 ) to zero and
solving, which yields

1
8
x0 = , x = 3, t = .
3
3 3
Moreover, we can solve
1 + 3x20
x=
2x0
for x0 in terms of x to get

x x2 3
x0 =
.
3
Substituting into the equation for t yields the two branches of the caustic:

 !2

 !2
3 1+
t1 =

x2 3
3

2(x x2 3)

3 1+
, t2 =

x+

2(x +

x2 3
3

x2

3)

, x

68

CHAPTER 8. FIRST-ORDER PDES AND THE METHOD OF CHARACTERISTICS


(where t2 > t1 for all x). Comparing to Figure 8.9, we see that u(x, t) is uniquely defined if t > 0 and



x < 3 or x 3 and (t < t1 or t > t2 .


3. Consider the IVP
u
u
+ (1 u)
= 0, < x < 0, t > 0,
t
x
1
u(x, 0) = , < x < 0.
x
(a) The characteristic equations are
x
= 1 v, x(s, 0) = s,

t
= 1, t(s, 0) = 0,

v
1
= 0, v(s, 0) = .

s
Solving yields
x(s, t) = s +

s1
1
, t(s, t) = , v(s, t) = .
s
s

Setting s = x0 , we obtain

x0
x0 1
t t=
(x x0 ).
x0
x0 1
These are the equations of the characteristics.
x = x0 +

(b) We can solve


x=s+

s1
t
s

for s as follows:
x=s+

s1
t s2 + (t x)s t = 0
s
p
x t (t x)2 + 4t
s=
2
p
x t (t x)2 + 4t
s=
,
2

where the last step uses the fact that s must be negative. We then obtain u(x, t) = v(s, ) = 1/s, that is,
u(x, t) =

2
p
.
x t (t x)2 + 4t

(c) Notice that the slope of the characteristic decreases as x0 increases; therefore, the characteristics through
(x0 , 0) and (x1 , 0) will intersect at some point (x, t) with t < 0. Solving the equations
t=

x0
x1
(x x0 ), t =
(x x1 )
x0 1
x1 1

for (x, t) yields


(x, t) = (x0 x0 x1 + x1 , x0 x1 ).
Notice that t < 0, as expected.
5. Consider the IVP
u
u
+ a(u)
= 0, < x < , t > 0,
t
x
u(x, 0) = (x), x > 0.
The characteristics are defined by
x(s, ) = s + a((s)), t(s, ) = , v(s, ) = (s).

8.3. BURGERSS EQUATION

69

We can write the characteristic passing through (x0 , 0) as


x = x0 + a((x0 ))t t =

x x0
.
a((x0 ))

Assuming that a((x)) is an decreasing function of x, we know that characteristic passing through (x0 , 0) will
intersect with the characteristic passing through (x1 , 0) if x1 > x0 . We can compute the point of intersection as
follows:
x = x0 + a((x0 ))t, x = x1 + a((x1 ))t
x0 + a((x0 ))t = x1 + a((x1 ))t
x0 x1
1
t=
= a((x ))a((x )) .
1
0
a((x1 )) a((x0 ))
x1 x0

If we take the limit as x1 decreases to x0 , we find the smallest value of t for the characteristic through (x0 , 0)
intersects another characteristic:
t =

d
(a((x))) x=x
dx
0

1
((x
)) d
(x0 )
0
du
dx

= da

On the other hand, suppose we look for the smallest value of for which the change of variables from (s, ) to
(x, t) is no longer well-defined. This occurs when the following Jacobian determinant is first zero:


x
da

d
da
(s, ) x
(s, ) 1 + du
((s)) d
(s) a((s))

dx
s
=
t
t
= 1 + du ((s)) dx (s).

(s, )
(s, )
0
1
s

Setting this expression equal to zero, solving for , and replacing s by x0 and by t yields the same result as
before.

Chapter 9

Greens Functions
9.1

Greens functions for BVPs in ODEs: Special cases

1. u(x) = xex .
3.

(a) This BVP models a bar whose top end (originally at x = 0) is free and whose bottom end is fixed at x = `.
If we apply a unit force to the cross-section at x = s, then the part of the bar originally between x = s and
x = ` will compress, and the part of the bar originally above x = s will just move rigidly with u(x) = u(s)
for 0 x < s. The compression of the bottom part of the bar will satisfy Hookes law:
k

u(x)
`x
= 1 u(x) =
`x
k

(the uncompressed length of the part of the bar between x = s and x = ` is ` x). Therefore we obtain
( `s
, 0 < x < s,
k
u(x) =
`x
, s < x < `.
k
The Greens function is

`s
,
k
`x
,
k

G(x; s) =

0 < x < s,
s < x < `.

(b) The Greens function is


Z

G(x; s) =
max{x,s}

dz
.
k(z)

(c) If k is constant, then


` max{x, s}
G(x; s) =
=
k

`s
,
k
`x
,
k

0 < x < s,
s < x < `.

(d)
u(x) =

ln (1 + x)
ln 2
1
x2
x

+
.
2
4
4
2
2

5. By direct integration, we obtain the following solution to (9.11):


Z x
ds
u(x) = p
.
0 k(s)
Since x = min{x, `} for x [0, `], we can write
min{x,s}

Z
u(x) = p
0

ds
,
k(s)

that is,
u(x) = g(x; `)p.

71

72

CHAPTER 9. GREENS FUNCTIONS


2
2
7. Let the operators K : Cm
[0, `] C[0, `] and M : C[0, `] Cm
[0, `] be defined by

d
dx

Ku =



du
k(x)
dx

and
`

Z
(M f )(x) =

G(x; y)f (y) dy,


0

where
min{x,y}

Z
G(x; y) =
0

1
dz.
k(z)

2
We wish to prove directly that (M K)u = u for all u Cm
[0, `]. Given the definition of G, we will write
x

Z
(M f )(x) =

G(x; y)f (y) dy +


0

1
f (y) dz dy +
k(z)

1
f (y) dy dz +
k(z)

0
x

=
0

=
Z

G(x; y)f (y) dy


x

xZ

1
f (y) dz dy
k(z)

1
f (y) dy dz,
k(z)

0
x

Z
Z

where the last step follows from changing the order of integration. Therefore,




Z xZ `
du
du
1 d
1 d
k(y) (y) dy dz
k(y) (y) dy dz
dx
dx
0
0
z k(z) dx
x k(z) dx




Z x
Z x
1
du
du
1
du
du
=
k(x) (x) k(z) (z) dz
k(`) (`) k(x) (x) dz
dx
dx
dx
dx
0 k(z)
0 k(z)


Z x
du
1
k(z) (z) dz
=
dx
0 k(z)
Z x
du
=
(z) dz = u(x)
0 dx
Z

(M Ku)(x) =

(notice how we used both boundary conditions in the course of this calculation). This is the desired result.

9.2

Greens functions for BVPs in ODEs: the symmetric case

1. The Greens function is


(
G(x; y) =

sin (y)((tan ) cos (x)sin (x))


,
tan
sin (x)((tan ) cos (y)sin (y))
,
tan

0 y x,
x y 1.

3. The Greens function is



G(x; y) =

kv1 (y)v2 (x),


kv1 (x)v2 (y),

0 y x,
x y 1,

where v1 (x) = ex ex , u2 (x) = ex e(2x) , and


k=

1
.
2(e2 1)

5. Let G = G(x, y) be any continuous function of two variables, a x b, a y b, and define M : C[a, b] C[a, b]
by
Z b
(M f )(x) =
G(x, y)f (y) dy.
a

9.2. GREENS FUNCTIONS FOR BVPS IN ODES: THE SYMMETRIC CASE

73

Suppose G is symmetric in the sense that G(y, x) = G(x, y) for all x, y [a, b]. We then have
Z b
(M f, g)L2 =
(M f )(x)g(x) dx
a

Z

=
a


G(x, y)f (y) dy g(x) dx

a
b

G(x, y)f (y)g(x) dy dx


a

a
b

G(x, y)f (y)g(x) dx dy (changing the order of integration)


a

a
b

Z


G(x, y)g(x) dx dy


G(y, x)g(x) dx dy (since G is symmetric)

f (y)
a

Z
f (y)

Z
=

a
b

f (y)(M g)(y) dy = (f, M g)L2 .


a

Thus M is a symmetric operator with respect to the L2 (a, b) inner product.


7. Define H : R R by

H(x) =
We wish to prove that
Z

0,
1.

x < 0,
0<x

(x)(x) dx =

H(x)

d
(x) dx
dx

holds for all D(R). That is, we wish to prove that if D(R), then
Z
d
H(x) (x) dx = (0).
dx

This is a direct calculation. Choose b > 0 sufficiently large that (x) = 0 for all x b. Then
Z
Z
Z b
d
d
d
H(x) (x) dx =
(x) dx =
(x) dx = (b) (0) = (0),
dx
dx

0
0 dx
as desired.
9. Let G be the Greens function for the BVP


du
d

P (x)
+ R(x)u = f (x), a < x < b,
dx
dx
du
1 u(a) + 2 (a) = 0,
dx
du
1 u(b) + 2 (b) = 0.
dx
Then

(
G(x; y) =

(y)v2 (x)
vP1(x)W
, a y x,
(x)
(x)v2 (y)
vP1(x)W
, x y b,
(x)

where v1 and v2 are certain solutions of the homogeneous ODE




d
du

P (x)
+ R(x)u = 0, a < x < b.
dx
dx
We wish to show that, for fixed y (a, b), u(x) = G(x; y) is the solution of the above BVP with the right-hand-side
function f (x) replaced by (x y). To do this, we must interpret the BVP in its weak sense, which is
b Z b 

Z b

du
du
dv
P (x) (x)v(x) +
P (x) (x) (x) + R(x)u(x)v(x) dx =
(x y)v(x) dx = v(y).
dx
dx
dx
a
a
a

74

CHAPTER 9. GREENS FUNCTIONS


Here u must satisfy the given boundary conditions and the above variational equation must hold for all test
functions v satisfying the same boundary conditions. Now, the Greens function is continuous but its derivative
du/dx has a jump discontinuity at x = y. We will write
v 0 (y)v2 (y)
du
du
(y) = lim
(x) = 1
,
dx
P (y)W (y)
xy dx
v1 (y)v20 (y)
du
du
(y+) = lim
(x) =
.
dx
P (y)W (y)
xy + dx
We now substitute u into the left-hand side of the variational equation to obtain
b Z b 


du
dv
du
(x)v(x) +
P (x) (x) (x) + R(x)u(x)v(x) dx
dx
dx
dx
a
a

Z y
du
du
dv
du
= P (a) (a)v(a) P (b) (b)v(b) +
P (x) (x) (x) + R(x)u(x)v(x) dx
dx
dx
dx
dx
a

Z b
dv
du
+
P (x) (x) (x) + R(x)u(x)v(x) dx.
dx
dx
y
P (x)

The integrands of both integrals on smooth on the intervals of integration, and hence integration by parts is valid:
b Z b 


du
du
dv
(x)v(x) +
P (x) (x) (x) + R(x)u(x)v(x) dx
dx
dx
dx
a
a
du
du
du
du
du
du
= P (a) (a)v(a) P (b) (b)v(b) + P (y) (y )v(y) P (a) (a)v(a) + P (b) (b)v(b) P (y) (y + )v(y)
dx
dx
dx
dx
dx
dx






Z b
Z y
du
du
d
d
P (x) (x) v(x) + R(x)u(x)v(x) dx +
P (x) (x) v(x) + R(x)u(x)v(x) dx
+

dx
dx
dx
dx
y
a



Z b
du
du
du
d
= P (y) (y )v(y) P (y) (y + )v(y) +
P (x) (x) + R(x)u(x) v(x) dx

dx
dx
dx
dx
a
du
du +
= P (y) (y )v(y) P (y) (y )v(y),
dx
dx
P (x)

where the last step follows because, on both (a, y) and (y, b), u(x) = G(x; y) is a smooth solution of the homogeneous ODE


d
du

P (x)
+ R(x)u = 0.
dx
dx
We now have
b Z b 


du
du
dv
P (x) (x)v(x) +
P (x) (x) (x) + R(x)u(x)v(x) dx
dx
dx
dx
a
a


du
du +
= P (y)v(y)
(y )
(y )
dx
dx
!
2
1
(y) dv
(y)v2 (y)
v1 (y) dv
dx
dx
= P (y)v(y)
= v(y)
P (y)W (y)
2
since W (y) = v1 (y) dv
(y)
dx

dv1
(y)v2 (y).
dx

This completes the proof.

11. We wish to find a formula for the solution of




d
du

P (x)
+ R(x)u = 0, a < x < b,
dx
dx
du
1 u(a) + 2 (a) = va ,
dx
du
1 u(b) + 2 (b) = vb ,
dx

9.3. GREENS FUNCTIONS FOR BVPS IN ODES: THE GENERAL CASE

75

in terms of the Greens function G for the BVP




d
du

P (x)
+ R(x)u = f (x), a < x < b,
dx
dx
du
1 u(a) + 2 (a) = 0,
dx
du
1 u(b) + 2 (b) = 0.
dx
We proceed as in Section 9.2.2; in particular, we apply




dv
du
dv
du
(u, Lv) (Lu, v) = P (a) u(a) (a)
(a)v(a) P (b) u(b) (b)
(b)v(b)
dx
dx
dx
dx
as in the text (where L is defined by (9.16)), with v(x) = G(x; y) (for a fixed y) and u the solution of the above
BVP with inhomogeneous boundary conditions. We then have (Lv)(x) = (x y), and hence (u, Lv) = u(y).
Also, Lu = 0 since u satisfies the homogeneous ODE, and therefore (Lu, v) = 0. We thus obtain




dv
du
dv
du
u(y) = P (a) u(a) (a)
(a)v(a) P (b) u(b) (b)
(b)v(b) .
dx
dx
dx
dx
We now apply the boundary condition satisfied by u and v:
du
(a) = va
dx
du
1 u(b) + 2 (b) = vb
dx
dv
1 v(a) + 2 (a) = 0
dx
dv
1 v(b) + 2 (b) = 0
dx

1 u(a) + 2

du
1
1
(a) =
va
u(a),
dx
2
2
du
1
1
(b) =
vb
u(b),
dx
2
2
dv
1
(a) = v(a),
dx
2
dv
1
(b) = v(b).
dx
2

We thus obtain



du
dv
du
dv
(a)v(a) P (b) u(b) (b)
(b)v(b)
u(y) = P (a) u(a) (a)
dx
dx
dx
dx




1
1
1
1
1
1
= P (a) u(a)v(a)
va v(a) +
u(a)v(a) P (b) u(b)v(b)
vb v(b) +
u(b)v(b)
2
2
2
2
2
2


= 21 P (b)v(b)vb 21 P (a)v(a)va
= 21 P (b)G(b; y)vb 21 P (a)G(a; y)va
= 21 P (b)G(y; b)vb 21 P (a)G(y; a)va .
In the last step we used the symmetry of G. This is the desired formula:
u(y) = 21 P (b)G(y; b)vb 21 P (a)G(y; a)va .

9.3

Greens functions for BVPs in ODEs: the general case

1. The Greens function is

(
G(x; y) =

(y)v2 (x)
,
vP1(x)W
(x)
v1 (x)v2 (y)
P (x)W (x) ,

0 y x,
x y 1,

where v1 (x) = ex e2x , v2 (x) = ex e2x1 , and P (x)W (x) is the constant 1 e1 . The solution to the BVP is
1

Z
u(x) =

G(x; y)f (y)w(y) dy,


0

where w(x) = e3x .

76

CHAPTER 9. GREENS FUNCTIONS


3. The Greens function is

(
G(x; y) =

(y)v2 (x)
,
vP1(x)W
(x)
v1 (x)v2 (y)
P (x)W (x) ,

0 y x,
x y 1,

where v1 (x) = ex sin (2x), v2 (x) = ex (sin(2x) (tan (2)) cos (2x)), and P (x)W (x) is the constant 2 tan (2). The
solution to the BVP is
Z
1

G(x; y)f (y)w(y) dy,

u(x) =
0

where w(x) = e2x .


5. The Greens function is


G(x; y) =


ey 6 + 6x + 3x2 + x3 ,
x
2
3
e 6 + 6y + 3y + y ,

1
y x,
2
x y 1.

The solution to the BVP when f (x) = x is


u(x) =

23
23
+
x + 6x2 + 2x3 7ex1 .
2
2

Rb
7. Let G be the Greens function derived in this section, and let M be defined by (M f )(x) = a G(x; y)f (y) dy. (Here
2
M maps complex C[a, b] into complex C [a, b].) We wish to prove that (M f, g)w = (f, M g)w for all f, g C[a, b].
In the following calculation, we use the facts that G is symmetric (G(x; y) = G(y; x) for all x, y [a, b]) and G is
real-valued, so that G(x; y) = G(x; y). We have

Z b Z b
Z b
(M f, g)w =
(M f )(x)g(x)w(x) dx =
G(x; y)f (y)w(y) dy g(x)w(x) dx
a

a
b

G(x; y)f (y)w(y)g(x)w(x) dy dx


a

a
bZ

G(x; y)f (y)w(y)g(x)w(x) dx dy


a

a
b

Z
=


G(x; y)g(x)w(x) dx w(y) dy


G(x; y)g(x)w(x) dx w(y) dy


G(y; x)g(x)w(x) dx w(y) dy

Z
f (y)

a
b

Z
=

Z
f (y)

a
b

Z
=

Z
f (y)

a
b

f (y)(M g)(y)w(y) dy = (f, M g)w .

=
a

(Notice how the key step was the interchanging of the order of integration.) This proves the desired result.

9.4

Introduction to Greens functions for IVPs

1. We wish to show that the solution of


d2 u
du
+ 2 u = f (t), u(0) = u0 ,
(0) = v0
dt2
dt
is
u(t) =

G
(t; 0)u0 + G(t; 0)v0 +
t

where

G(t; s) =

sin ((ts))
,

0,

G(t; s)f (s) ds,


0

t > s,
t < s.

We can write the proposed solution explicitly as


u(t) = cos (t)u0 +

sin (t)
v0 +

Z
0

sin ((t s))


f (s) ds.

9.4. INTRODUCTION TO GREENS FUNCTIONS FOR IVPS

77

Then
Z t
sin ((t t))
du
(t) = sin (t)u0 + cos (t)v0 +
f (t) +
cos ((t s))f (s) ds
dt

0
Z t
cos ((t s))f (s) ds
= sin (t)u0 + cos (t)v0 +
0

Z t
d2 u
2
(t)
=

cos
(t)u

sin
(t)v
+
cos
((t

t))f
(t)

sin ((t s))f (s) ds


0
0
dt2
0
Z t
sin ((t s))f (s) ds.
= 2 cos (t)u0 sin (t)v0 + f (t)
0

From these formulas, we can easily verify that u satisfies the ODE and the initial conditions:
Z 0
sin (0)
sin ((t s))
u(0) = cos (0)u0 +
v0 +
f (s) ds = u0 ,

0
Z 0
du
(0) = sin (0)u0 + cos (0)v0 +
cos ((t s))f (s) ds = v0 ,
dt
0
and
Z t
d2 u
2
2
(t)
+

u(t)
=

cos
(t)u

sin
(t)v
+
f
(t)

sin ((t s))f (s) ds+


0
0
dt2
0
Z t
2 cos (t)u0 + sin (t)v0 +
sin ((t s))f (s) ds
0

= f (t).
3. The Greens function is

G(t; s) =
5. The Greens function is


G(t; s) =

sin (2(ts))
,
2

0,

t > s,
t < s.

e(ts) e2(ts) ,
0,

7. The Greens function is


G(t; s) =

e0.02(ts) ,
0,

t > s,
t < s.

t > s,
t < s,

and the solution to the IVP is


Z
P (t) = G(t; 0)P0 +
G(t; s)f (s) ds = 55.5e0.02t + 450 + 10t 450e0.02t = 450 + 10t 394.5e0.02t .
0

9. Let the solution of


du
d2 u
+ a1 (t)
+ a0 (t)u = 0,
dt2
dt
u(s) = 0,
du
(s) = f (s)
dt
be u(t) = S(t; s)f (s), and define the Greens function G(t; s) by

S(t; s), t > s,
G(t; s) =
0,
t < s,
We wish to show that G satisfies
2G
G
(t; s) + a1 (t)
(t; s) + a0 (t)G(t; s) = (t s),
t2
t
G(t0 ; s) = 0,
G
(t0 ; s) = 0,
t

78

CHAPTER 9. GREENS FUNCTIONS


provided t0 < s. We notice that G(t, s) = H(t s)S(t, s), where H is the Heaviside function. We will show that
S
2G
G
2S
(t, s) = H(t s)
(t, s) and
(t, s) = (t s) + H(t s) 2 (t, s)
2
t
t
t
t
(in the weak sense). Let be any smooth function having compact support in [t0 , ), that is, any function for
which (t) = 0 for all t 6 (a, b), where t0 < a < b < . We first show that
Z
Z
S
d
H(t s)
G(t; s) (t) dt =
(t, s)(t) dt,

dt
t
t0
t0
which implies that
G
S
(t, s) = H(t s)
(t, s)
t
t
in the weak sense. We have
Z
Z
d
d

G(t; s) (t) dt =
H(t s)S(t, s) (t) dt
dt
dt
t0
t0
Z b
d
=
S(t, s) (t) dt
dt
s
Z b
S
= S(t, s)(t)|bs +
(t, s)(t) dt (by integration by parts)
s t
Z b
S
(t, s)(t) dt (since S(s, s) = 0 and (b) = 0)
=
t
Zs
S
=
H(t s)
(t, s)(t) dt.
t
t0
This proves the desired formula for G/t.
Next, we will show that
Z
Z
G
d
2S

(t; s) (t) dt = (s) +


H(t s) 2 (t, s)(t) dt,
t
dt
t
t0
t0
which implies that
2G
2S
(t, s) = (t s) + H(t s) 2 (t, s)
2
t
t
in the weak sense. We have
Z
Z
G
d
S
d

(t; s) (t) dt =
H(t s)
(t, s) (t) dt
t
dt
t
dt
t0
t0
Z b
S
d
=
(t, s) (t) dt
t
dt
s
b Z b 2

S
S
=
(t, s)(t) +
(t, s)(t) dt (by integration by parts)
t
t2
s
s
Z b 2
S
= (s) +
(t, s)(t) dt (since S
(s, s) = 1 and (b) = 0)
t
2
s t
Z
2S
= (s) +
H(t s) 2 (t, s)(t) dt.
t
t0
This proves the desired formula for G2 /t2 .
Since S(t, s), as a function of t, satisfies the homogeneous version of the ODE, we see that
2G
G
(t; s) + a1 (t)
(t; s) + a0 (t)G(t; s) = (t s),
t2
t
as desired. Also,
G
S
(t0 , s) = H(t0 s)
(t0 , s) = 0
t
t
since H(t0 s) = 0 because t0 s < 0 by assumption. This completes the proof.
G(t0 , s) = H(t0 s)S(t0 , s) = 0,

9.5. GREENS FUNCTIONS FOR THE HEAT EQUATION

9.5

79

Greens functions for the heat equation

1. Given that

2
1
ex /(4kt) ,
S(x, t) =
2 kt

we have

Z
2
1
S(x, t) dx =
ex /(4kt) dx.
2
kt

Making the change of variables u = x/(2 kt), we obtain


Z
Z
2
1
1
S(x, t) dx =
eu du =
= 1.

Also, for any x, y R,

S(x y, t) dx =

S(v, t) dv = 1.

3. For t = 660, six terms of the Fourier series are sufficient to give an accurate graph. For t = 61, even 100 terms
are not sufficient to give a correct graph.
5. Following the example in Section 9.5.2, we obtain the following Greens function:




(
P k(2n1)2 2 (ts)/(4`2 )
2
sin (2n1)x
,
e
sin (2n1)y
n=1
`c
2`
2`
G(x, t; y, s) =
0,

0 s t,
s > t.

Here we used the correct eigenfunctions for the given mixed boundary conditions and also adjust for the the fact
that the constants appear differently in the PDE in this exercise than in the example in Section 9.5.2 (notice the
extra factor of 1/(c) in the formula for this Greens function). As before, k = /(c). Snapshots of G(x, t; 75, 60)
are shown in Figure 9.1.
Graph of G(x,t;75,60) for various values of t

temperature

0.02
t=120
t=240
t=360
t=480
t=600

0.015

0.01

0.005

0
0

20

40

60

80

100

Figure 9.1: Snapshots of the Greens function in Exercise 9.5.5 at times t = 120, 240, 360, 480, 600 seconds.
Twenty terms of the Fourier series were used to create these graphs.
7. We have
`

Z
u(x, t) =

G(x, t; y, 0)(y) dy
0

 ny 
 nx 
2 X kn2 2 t/`2
e
sin
sin
(y) dy
`
`
0 ` n=1

 Z `
 ny 
 nx 
X
2 2
2
2
=
sin
(y) dy ekn t/` sin
` 0
`
`
n=1

X
n=1

bn ekn

2 t/`2

sin

 nx 
`

80

CHAPTER 9. GREENS FUNCTIONS


where
2
`

bn =

sin
0

 ny 
(y) dy, n = 1, 2, 3, . . .
`

are the Fourier sine coefficients of the function . We recognize u as the solution of the IBVP
u
2u
k 2 = 0, 0 < x < `, t > 0,
t
x
u(x, 0) = (x), 0 < x < `,
u(0, t) = 0, t > 0,
u(`, t) = 0, t > 0
(see the derivation at the beginning of Section 6.1 in the text).

9.6

Greens functions for the wave equation

1. Let
1
2c

u(x, t) =

x+c(ts)

f (y, s) dy ds.
0

xc(ts)

We wish to show that u satisfies the inhomogeneous wave equation (with right-hand side f (x, t)) on the real line,
subject to zero boundary conditions. We have
1
u
(x, t) =
t
2c

1
2c

=
=

1
2c

x+c(tt)

f (y, t) dy +
xc(tt)
x

f (y, t) dy +
x
Z t

1
2c

1
2c

{cf (x + c(t s), s) + cf (x c(t s), s)} ds


0

{cf (x + c(t s), s) + cf (x c(t s), s)} ds


0

{cf (x + c(t s), s) + cf (x c(t s), s)} ds,


0


Z t
2u
1
1
2 df
2 df
(cf
(x
+
c(t

t),
t)
+
cf
(x

c(t

t),
t))
+
c
(x
+
c(t

s),
s)

c
(x

c(t

s),
s)
ds
(x,
t)
=
t2
2c
2c 0
dx
dx

Z t
1
df
1
df
=
(cf (x, t) + cf (x, t)) +
c2 (x + c(t s), s) c2 (x c(t s), s) ds
2c
2c 0
dx
dx

Z 
c t df
df
= f (x, t) +
(x + c(t s), s)
(x c(t s), s) ds,
2 0 dx
dx
Z t
u
1
(x, t) =
{f (x + c(t s), s) f (x c(t s), s)} ds,
x
2c 0

Z t
1
2u
df
df
(x,
t)
=
(x
+
c(t

s),
s)

(x

c(t

s),
s)
ds.
x2
2c 0 dx
dx
Thus
2u
2u
c
(x, t) c2 2 (x, t) = f (x, t) +
2
t
x
2


df
df
(x + c(t s), s)
(x c(t s), s) ds
dx
dx
0

Z t
c
df
df

(x + c(t s), s)
(x c(t s), s) ds
2 0 dx
dx
Z

= f (x, t),
as desired. It is obvious from the formulas for u and u/t that both are identically zero when t = 0.
3. We wish to show that
H(c(t s) |x y|) = (H((x y) + c(t s)) H((x y) c(t s))) H(t s)

9.6. GREENS FUNCTIONS FOR THE WAVE EQUATION

81

for all x, y, t, s R such that c(t s) 6= |x y|. (The two expressions differ when c(t s) = |x y| > 0, at least
when H is defined as in the text: H(t) = 1 if t > 0 and H(t) = 0 if t 0.) We have
H(c(t s) |x y|) = 1 c(t s) |x y| > 0
c(t s) > |x y|
c(t s) < |x y| < c(t s) and t s > 0
x y + c(t s) > 0 and x y c(t s) < 0 and t s > 0
H(x y + c(t s)) = 1 and H(x y c(t s)) = 0 and H(t s) = 1
(H((x y) + c(t s)) H((x y) c(t s))) H(t s) = 1.
The reasoning can be reversed if we add the condition c(t s) 6= |x y|. This completes the proof.
5. Let u be the solution to
2u
2u
c2 2 = f(x, t), < x < , t > 0,
2
t
x
u(x, 0) = 0, < x < ,
u
(x, 0) = 0, < x < ,
t
where f is odd (f(x, t) = f(x, t)). We wish to show that u is also odd. We will do this by defining v(x, t) =
u(x, t) and proving that v satisfies the same IVP; then, by uniqueness, it will follow that v = u, that is,
u(x, t) = u(x, t), as desired.
We have
v
u
(x, t) = (x, t),
t
t
2v
2u
(x, t) = 2 (x, t),
t2
t
v
u
(x, t) =
(x, t),
x
x
2
v
2u
(x, t) = 2 (x, t).
2
x
x
Therefore,
2v
2v
2u
2u
(x, t) c2 2 (x, t) = 2 (x, t) + c2 2 (x, t)
2
t
x
t
x
 2

2
u
2 u
=
(x,
t)

c
(x,
t)
t2
x2
= f(x, t) = f(x, t)
(since f is odd). Thus v satisfies the same wave equation as does u. Moreover, it is obvious that v also satisfies
the same initial conditions; hence v = u and the proof is complete.
7. We outline the derivation of the Greens function for
2u
2u
c2 2 = f (x, t), 0 < x < `, t > 0,
2
t
x
u(x, 0) = 0, 0 < x < `,
u
(x, 0) = 0, 0 < x < `,
t
u
(0, t) = 0, t > 0,
x
u
(`, t) = 0, t > 0.
x

82

CHAPTER 9. GREENS FUNCTIONS


We define f to be the even, periodic extension of f , and define u
to be the solution of
2u

2u

c2 2 = f(x, t), < x < , t > 0,


2
t
x
u
(x, 0) = 0, < x < ,
u

(x, 0) = 0, < x < .


t
From earlier results, we know that
Z t Z x+c(ts)
Z tZ
1
1
H(c(t s) |x y|)f(y, s) dy ds =
f(y, s) dy ds.
u
(x, t) =
2c 0 xc(ts)
0
2c
Then

(x, t) =
x

(x, 0) =
x

(x, `) =
x

n
o
f(x + c(t s), s) f(x c(t s), s) ds.

It follows that
t

n
o
f(c(t s), s) f(c(t s), s) ds,

0
t

n
o
f(` + c(t s), s) f(` c(t s), s) ds.

Since f is even, we have f(c(t s), s) = f(c(t s), s), and hence
u

(x, 0) = 0.
x
Also,
f(` c(t s), s) = f(` + c(t s), s) (since f is even)
= f(` + c(t s), s) (since f is 2`-periodic).
Therefore,
u

(x, `) = 0.
x
It follows that u
, restricted to the interval 0 < x < `, solves the original IBVP.
The derivation of the Greens function for the IBVP is almost exactly the same as that given in the text (for
Dirichlet conditions). The result is
G(x, t; y, s) =

X
n=

1
{H(c(t s) |x y 2n`|) + H(c(t s) |x + y 2n`|)} .
2c

Chapter 10

Sturm-Liouville Eigenvalue Problems


10.2

Properties of the Sturm-Liouville operator

1. The verification that L is symmetric is exactly the same as that given (for the general case) on pages 389390,
except for the treatment of the boundary term. We have
b

du
du
du
P (x) (x)v(x) = P (b) (b)v(b) + P (a) (a)v(a)
dx
du
dx
a
du
= P (b) (b)v(b) (since v(a) = 0)
du


1
1
du
=
(b) = u(b) .
P (b)u(b)v(b) since
2
dx
2
Therefore,
(Lu, v)w =

1
P (b)u(b)v(b) +
2

P (x)
a

du
dv
(x) (x) dx +
dx
dx

R(x)u(x)v(x) dx.
a

The expression on the right is symmetric in u and v, which shows that


(u, L(v))w = (L(v), u)w = (L(u), v)w ,
verifying that L is symmetric with respect to (, )w .
3. Consider a Robin condition of the form

du
(a) = 0
dx
(relative to the interval [a, b]). We wish to determine the physically meaningful sign for 1 in the case that this
boundary condition models heat flow through the left end of a bar. Recall that the heat flux at x = a (a vector
quantity) is given by
du
(a)
dx
(the direction of the vector is indicated by the sign). Since the normal direction to the left end of the bar is 1,
the rate at which heat flows out of the bar at x = a is
1 u(a) +

du
du
(a)(1) = (a).
dx
dx

Thus consider the equation


du
(a) = (u(a) T ),
dx
where T is the temperature of the surroundings. This equation states that the rate at which heat flows out of the
bar is proportional to the difference between the temperature at the left end of the bar and the temperature of
the bar. The above boundary condition is equivalent to

u(a) +

83

du
(a) = T,
dx

84

CHAPTER 10. STURM-LIOUVILLE EIGENVALUE PROBLEMS


which shows that we should take 1 = in the Robin boundary condition. Thus 1 < 0 is the physically
meaningful case for a Robin boundary condition at the left endpoint.
At the right endpoint x = b, the normal direction is 1, and therefore the rate at which heat flows out of the bar is

du
(b).
dx

The same reasoning as above then shows that the boundary condition is
u(b) +

du
(b) = T.
dx

Therefore, we should take 1 = , which shows that 1 > 0 is the physically meaningful case.
5. The eigenpairs are
n = 3 +
7.

 n 2
ln 2


, un (x) = sin


n ln x
, n = 1, 2, 3, . . . .
ln 2

(a) The eigenpairs are


n = 4 + +

 n 2
ln 2

, un (x) = x2 sin


n ln x
, n = 1, 2, 3, . . . .
ln 2

(b) 0 is an eigenvalue if and only if


= 4

 n 2
ln 2

for some positive integer n.


(c) There is exactly one negative eigenvalue if and only if
4

4 2
2
< 4
,
2
(ln 2)
(ln 2)2

while there are exactly k negative eigenvalues if and only if


4

(k + 1)2 2
k2 2
< 4
.
(ln 2)2
(ln 2)2

9. The eigenpairs are


n = 2 +

10.3

 n 2
ln 2

, un (x) = x1

n
cos
ln 2

n ln x
ln 2


+ sin

n ln x
ln 2


, n = 1, 2, 3, . . . .

Numerical Methods for Sturm-Liouville problems

1. We wish to apply the finite element method to




du
d
P (x)
+ R(x)u = w(x)u, a < x < b,

dx
dx
u(a) = 0,
du
(b) = 0.
dx
Using the usual uniform mesh on the interval [a, b], the finite element space of consists of all piecewise linear
functions v (relative to the given mesh) satisfying v(a) = 0 (note that the Neumann condition is a natural
boundary condition). The standard basis for this space is {1 , . . . , n } (where each j is the usual hat function).
Applying the Galerkin method to the weak form (Equation (10.12) in the text), we obtain Au = Wu, where A
and W are the n n matrices defined by

Z b
dj
di
Aij =
P (x)
(x)
(x) + R(x)j (x)i (x) dx,
dx
dx
a
Z b
Wij =
w(x)j (x)i (x) dx.
a

(These are the same formulas derived in the text, except now i and j vary from 1 to n.)

10.4. EXAMPLES OF STURM-LIOUVILLE PROBLEMS

85

3. The result is exactly the same as in Exercise 1, but now the basis for the finite element space is {0 , 1 , . . . , n },
the matrices A and W are (n + 1) (n + 1), and i, j vary from 0 to n in the formulas for Aij , Wij .
5. Let C and x Cn satisfy Ax = Wx, and let (x, y)W = (Wx) y. We can assume x satisfies (x, x)W = 1.
We then obtain

= (x, x)W = (Wx) x = (Ax) x = x (Ax) = x (Wx) = x (Wx) = ((Wx) x) = .
(Notice how the symmetry of both A and W is used to move these matrices from one side of the inner products
to the other.) Since = , it follows that R.

10.4

Examples of Sturm-Liouville problems

1. Let
u(x) =

n
X

i i (x)

i=0

be a continuous piecewise linear function defined on [0, `], relative to the usual uniform mesh. Here {0 , 1 , . . . , n }
is the standard basis. The average value of u on [0, `] is then
Z
Z
Z `
n
n
1 `
1X
1 `X
i i (x) dx =
u(x) dx =
i
i (x) dx.
` 0
` 0 i=0
` i=0
0
Since the graph of each i , i = 1, . . . , n 1, forms a triangle of height 1 and base 2h (h = `/n), it follows that
Z `
i (x) dx = h, i = 1, 2, . . . , n 1;
0

similarly,
Z

Z
0 (x) dx =

n (x) dx =

h
, i = 1, 2, . . . , n 1.
2

Thus the average value of u on [0, `] is


h
`


1
1
0 + 1 + + n1 + n .
2
2

3. The fundamental frequency is about 3254 Hz.

10.5

Robin boundary conditions

1. The solution to the IBVP is


u(x, t) =


an (t) cos

n=1


(2n 1)x
,
2`

where
2

an (t) = cn e(2n1)

2 t/(4`2 c)

, cn =

40(1)n+1
, n = 1, 2, . . . .
(2n 1)

Some snapshots of the solution are shown in Figure 10.1.


3. Consider the following Sturm-Liouville problem:
d2 u
= u, 0 < x < `,
dx2
u(0) = 0,

du
(`) + u(`) = 0
dx

where > 0, < 0. We can write the second boundary condition as


du
(`) u(`) = 0,
dx
where = / > 0. The analysis of the eigenvalues turns out to depend on the value of `. We do the analysis
by considering three cases:

86

CHAPTER 10. STURM-LIOUVILLE EIGENVALUE PROBLEMS


11
10
9
8
7
6
5
4
3
2
1
0
0

20

40

60

80

100

Figure 10.1: The temperature in the bar of Exercise 10.5.1 after 30, 60, 90, 120, 150, 180 minutes.
Case 1 ( > 0) The positive eigenvalues are the solutions of the equation

tan ( `) =

or
s
, s > 0,
tan (s) =
`

.
where s = `. There are solutions sk = (2k + 1)/2, k = 1, 2, 3, . . .. The corresponding eigenpairs are
s x
s2
k
, k = 1, 2, 3, . . . .
k = 2k , k (x) = sin
`
`
These eigenpairs exist regardless of the value of `. In addition, if ` < 1, then there is an additional solution
of tan (s) = s/(`), namely, s0 (0, /2), with corresponding eigenvalue 0 = s20 /`2 and eigenfunction
0 (x) = sin (s0 x/`).
Case 2 ( = 0) If ` = 1, then 0 = 0 is an eigenvalue with eigenfunction 0 (x) = x. If ` 6= 1, then 0 is not an
eigenvalue.
Case 3 ( < 0) Negative eigenvalues must satisfy the equation

tanh ( `) =

or
s
, s > 0,
tanh (s) =
`

where s = `. If ` 1, then this equation has no solution and hence there are no negative eigenvalues.
If ` > 1, then there is a single solution s0 , leading to a single negative eigenvalue 0 = s20 /`2 and
eigenfunction 0 (x) = sinh (s0 x/`).
Therefore, when < 0, there is a sequence of eigenpairs
s x
s2
k
k = 2k , k (x) = sin
, k = 1, 2, 3, . . . ,
`
`
where
2 2
. (2k + 1)
k =
.
2
4`

There is also an eigenvalue 0 , which is positive if ` < 1 (with eigenfunction 0 (x) = sin
( 0 x)), zero if ` = 1
(with eigenfunction 0 (x) = x), and negative if ` > 1 (with eigenfunction 0 (x) = sinh ( 0 x)).

10.6

Finite element methods for Robin boundary conditions

1. The finite element formulation of

d
dx



du
P (x)
+ R(x)u = F (x), a < x < b,
dx
u(a) = 0,
du
(b) + u(b) = 0,
dx

10.6. FINITE ELEMENT METHODS FOR ROBIN BOUNDARY CONDITIONS

87

where P (x) > 0 for all x [a, b], , > 0, is nearly the same as for the BVP (10.26) given in the text. The
Dirichlet condition at x = a is an essential boundary condition (whereas the Neumann condition in (10.26) is a
natural boundary condition). This implies that we only consider finite element functions satisfying the Dirichlet
condition, so we use the basis {1 , 2 , . . . , n } instead of {0 , 1 , . . . , n }. The weak form of the BVP is unchanged
from (10.27), although now
du
P (a) (a)v(a)
dx
vanishes because v(a) = 0 rather than because du/dx(a) = 0. The result is the linear system Au = f , where A
and f are given by the same formulas as in the text (page 420), except that the entries corresponding to 0 are
omitted. Thus A is now n n and f is now an n-vector.
3. The weak form of

d
dx


P (x)

du
dx


+ R(x)u = F (x), a < x < b,

du
(a) = 0,
dx
du
1 u(b) + 2 (b) = 0
dx

1 u(a) + 2

is
P (a)

du
du
(a)v(a) P (b) (b)v(b) +
dx
dx

P (x)
a

du
dv
(x) (x) dx +
dx
dx

Z
R(x)u(x)v(x) dx =

F (x)v(x) dx
a

for all test functions v. The boundary conditions imply


du
1
du
1
(a) =
u(a),
(b) = u(b),
dx
2
dx
2
and therefore the weak form can be written as
1
1
P (a)u(a)v(a) +
P (b)u(b)v(b) +
2
2

P (x)
a

dv
du
(x) (x) dx +
dx
dx

Z
R(x)u(x)v(x) dx =

F (x)v(x) dx.
a

Notice that the Robin conditions at the endpoints are natural boundary conditions, and hence no boundary
conditions are imposed on the test functions. We therefore take {0 , 1 , . . . , n } as the basis for the finite element
space (using the usual notation), and obtain the linear system Au = f , where A = K + M + G. The matrices K
and M are the same stiffness and mass matrices defined in the text (page 420), and G R(n+1)(n+1) is defined
by
1
2 P (a), i = j = 0,
1
Gij =
P (b), i = j = n,
2
0,
otherwise.
5. Suppose u satisfies

du
= F (x), 0 < x < `,
dx

du
(0) = 0,
dx

du
(`) + u(`) = 0.
dx

Then
Z

Z
F (x) dx =

d2 u
(x) dx =
dx2


du
du
(`)
(0)
dx
dx


du
du
= (`) since
(0) = 0
dx
dx
= u(`) (applying the Robin condition at x = `).

88

CHAPTER 10. STURM-LIOUVILLE EIGENVALUE PROBLEMS

10.7

The theory of Sturm-Liouville problems: an outline

1. Let L : U V be a compact linear operator, where U , V are normed linear spaces. We wish to show that L is
bounded. We will argue by contradiction and assume L is unbounded. Then there exists a sequence {un } U
with kun kU = 1 for all n and kLun kV as n . (Here we are using the alternate definition of the norm
of L: kLk = sup{kLukV : u U, kukU = 1}.) Since L is compact and {un } is bounded in U , there must exist a
subsequence {unk } of {un } such that {Lunk } is convergent in V . But kLun kV implies that kLunk kV ,
and hence that {Lunk } is not convergent. This is a contradiction, which shows that the assumption that L is
unbounded is not possible. Therefore, L must be bounded, which is what we wanted to prove.
3. Suppose that, for a given R, u = , u = both satisfy


du
d

P (x)
+ R(x)u = w(x)u, a < x < b,
dx
dx
du
1 u(a) + 2 (a) = 0,
dx
du
1 u(b) + 2 (b) = 0,
dx
where P and w are assumed to be positive on the interval [a, b]. Let


(x)
d
d
(x)

W (x) = d
d
= (x) dx (x) dx (x)(x)
(x)
(x)
dx
dx
be the Wronskian of , . Since , satisfy the linear homogeneous ODE


d
du

P (x)
+ (R(x) w(x)u = 0
dx
dx
on [a, b], we can show that {, } is linearly independent by proving that W (x) = 0 for any given x [a, b]. We
have
d
d
1
1 (a) + 2 (a) = 0
(a) = (a),
dx
dx
2
and similarly
d
1
(a) = (a).
dx
2
Therefore,
d
1
d
1
(a)
(a)(a) = (a)(a) +
W (a) = (a)
(a)(a) = 0.
dx
dx
2
2
This shows that {, } is linearly dependent, as desired.

Chapter 11

Problems in Multiple Spatial


Dimensions
11.1

Physical models in two or three spatial dimensions

1. Let R2 be the rectangular domain




= x R2 : a < x1 < b, c < x2 < d ,
and let F : R2 R2 be a smooth vector field. Then

Z
Z bZ d
F1
F2
F=
(x1 , x2 ) +
(x1 , x2 ) dx2 dx1
x1
x2

a
c
Z bZ d
Z bZ d
F1
F2
=
(x1 , x2 ) dx2 dx1 +
(x1 , x2 ) dx2 dx1
x
1
a
a
c
c x2
Z dZ b
Z bZ d
F1
F2
=
(x1 , x2 ) dx1 dx2 +
(x1 , x2 ) dx2 dx1
c
a x1
a
c x2
Z d
Z b
=
{F1 (b, x2 ) F1 (a, x2 )} dx2 +
{F2 (x1 , d) F2 (x2 , c)} dx1
c

a
d

Z
=
Zc
=

Z b
Z b
F1 (b, x2 ) dx2
F1 (a, x2 ) dx2 +
F2 (x1 , d) dx1
F2 (x2 , c) dx1
c
a
a
Z
Z
Z
Z
Fn+
Fn+
Fn+
Fn=
F n,
Z

as desired. Here 1 , 2 , 3 , 4 denote the four sides of , labeled as in Figure 11.3 on page 452 of the text.
3. We have F(x) = 1, and therefore
Z
F = area() = .

On the other hand, on , n = x and therefore F n = 2x1 x2 + x22 . In polar coordinates, F n = sin (2) + sin2 (),
and hence
Z
Z 2


sin (2) + sin2 () d = .
Fn=

This verifies the divergence theorem for this domain and vector field.
5. Let L : C 2 () C() be defined by Lu = (k(x)u). By the product rule,
(k(u)v) = ku v + (ku)v;
therefore,
Z

(ku)v =

ku v

89

(k(u)v).

90

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS


By the divergence theorem,
Z

(k(u)v) =

k(u)v) n =

u
v.
n

The boundary term disappears if u and v both satisfy Dirichlet condition (since then v = 0 on ) and also if u
and v both satisfy Neumann conditions (since then u/n = 0 on ). Thus, in either case,
Z
Z
(Lu, v) =
(ku)v =
ku v.

Since the right-hand side is symmetric in u and v, so is the left-hand side; that is, (Lu, v) = (Lv, u) = (u, Lv),
and we see that L is a symmetric operator.
7. We have

(F1 (u(x))) +
(F2 (u(x))) +
(F3 (u(x)))
x1
x2
x3
u
u
u
= F10 (u(x))
(x) + F20 (u(x))
(x) + F30 (u(x))
(x)
x1
x2
x3
= F0 (u(x)) u(x).

F(u(x)) =

9. Using the product rule for scalar functions, we obtain


(vu) =


 X

3 
3
X

v u
u
2u
v
=
+v 2
xi
xi
xi xi
xi
i=1
i=1

3
3
X
X
2u
v u
+v
xi xi
x2i
i=1
i=1

v u + vu.

2
11. Suppose u, v Cm
(). Then

(Lm u, v) =

vu

Z
u v

u
(Greens first identity)
n

Z
u v

=
Z
=

Z
uv (Greens first identity)

Z
=

uv = (u, Lm v).

The boundary terms vanish because the product that forms the integrand is zero over the entire boundary. For
example,
Z
u
v
=0
n
since v = 0 on 1 and u/n = 0 on 2 .

11.2
1.

Fourier series on a rectangular domain


(a)
cmn =

4 (5 + 7(1)m ) (1 + (1)n )
m3 n3 6

(b) The graphs of the error are given in Figure 11.1.


3. The solution is given by
u(x) =

X
cmn
sin (mx1 ) sin (nx2 ),

mn
m=1 n=1

where the cmn are the coefficients from Exercise 1 and


mn = (m2 + n2 ) 2 .

11.2. FOURIER SERIES ON A RECTANGULAR DOMAIN

91

x 10
2
0
2
1

0.5
0

0.2

x2

0.4

0.8

0.6

0.8

0.6

x1

x 10
2
0
2
1

0.5
0

0.2

x2

0.4
x1

Figure 11.1: The error in approximating f (x, y) by the first 4 terms (top) and the first 25 terms (bottom) of
the double Fourier sine series. (See Exercise 11.2.1.)

5.

(a) The IBVP is


c

u
u
t
u(x, 0)

The domain is the rectangle x R2

0.02, x , t > 0,

5, x ,

0, x , t > 0.

: 0 < x1 < 50, 0 < x2 < 50 .

u(x, t)


(b) The solution is


X

u(x, t) =

amn (t) sin

m=1 n=1

 mx 
1

50

sin

 nx 
2

50

where

amn (t)

bmn

cmn

mn


cmn
cmn
emn t/(c) +
,
mn
mn
20 (1 + (1)m ) (1 + (1)n )
,
mn 2
2 (1 + (1)m ) (1 + (1)n )
,
25mn 2
(m2 + n2 ) 2
.
2500
bmn

(c) The steady-state temperature us (x) satisfies the BVP

The solution is
us (x) =

0.02, x ,

u(x)

0, x .

 mx 
 nx 
X
cmn
1
2
sin
sin
.

50
50
mn
m=1 n=1

(d) The maximum difference between the temperature after 10 minutes and the steady-state temperature is
about 1 degree. The difference is graphed in Figure 11.2.
7. The minimum temperature in the plate reaches 4 degrees Celsius after 825 seconds.

9. The leading edge of the wave is initially 2/5 units from the boundary,
wave travels at a speed of 261 2
and the
.
units per second. Therefore, the wave reaches the boundary after 2/1305 = 0.00108 seconds. Figure 11.6 from
the text shows the wave about to reach the boundary after 103 seconds.

92

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

1
0.8
0.6
0.4
0.2
0
60
60

40
40
20

20
0

x2

x1

Figure 11.2: The difference between the temperature in the plate after 10 minutes and the steady-state temperature. (See Exercise 11.2.5.)
11. The difficult task is to compute the Fourier coefficients of the initial displacement . If we write
(x) =

bmn sin (mx1 ) sin (nx2 ),

m=1 n=1

then we find that

(
bmn =

We then have that


u(x, t) =

0,
sin2 (m/2)
,
1250m2 2

m 6= n,
m = n.

amn (t) sin (mx1 ) sin (nx2 ),

m=1 n=1

where amn (t) satisfies


d2 amn
+ mn c2 amn
dt2
amn (0)
damn
(0)
dt
The result is


amn (t) =

Thus the solution is


u(x, t) =

0,

bmn ,

0.

0,

bmm cos (c mm t),

m 6= n,
m = n.

bmm cos (c mm t) sin (mx1 ) sin (mx2 ).

m=1

Four snapshots of u are shown in Figure 11.3.


13. The solution is
u(x) =

X
4 sin (m/2) sin (n/2)
sin (mx1 ) sin (nx2 ).
(m2 + n2 ) 2
m=1 n=1

The graph of u is shown in Figure 11.4.


15.

(a) The IBVP is


c

u
u
t
u(x, 0)
u(x, t)
u
(x, t)
n

0.02, x , t > 0,

5, x ,

0, x 1 4 , t > 0,

0, x 2 3 , t > 0.

The domain is the rectangle





x R2 : 0 < x1 < 50, 0 < x2 < 50 .

11.2. FOURIER SERIES ON A RECTANGULAR DOMAIN


4

x 10

x 10

1
1
0.5
x

1
1

1
0 0

0.5
x

0.5
x1

0.5
x1

0 0

0.5
x1

x 10
1

1
1

1
0 0

x 10
1

0.5
x

93

1
1

0.5
x

0.5
0 0

x1

Figure 11.3: Four snapshots of the solution to Exercise 11.2.11: t = 0 (top left), t = T /8 (top right), t = T /2
(bottom left), t = 5T /8 (bottom right). The solution is periodic with period T .

0.5

0.5
1
1
0.5
0.5
0

x2

x1

Figure 11.4: The solution to Exercise 11.2.13.


(b) The solution is
u(x, t) =


amn (t) sin

m=1 n=1

(2m 1)x1
100


sin


(2n 1)x2
,
100

where

amn (t)

bmn

cmn

mn


cmn
cmn
,
bmn
emn t/(c) +
mn
mn
80
(2m 1)(2n 1) 2
8
25(2m 1)(2n 1) 2

((2m 1)2 + (2n 1)2 ) 2


.
10000

(c) The steady-state temperature us (x) satisfies the BVP

The solution is
us (x) =

0.02, x ,

u(x)
u
(x)
n

0, x 1 4 ,

0, x 2 3 .





X

X
(2m 1)x1
(2n 1)x2
cmn
sin
sin
.
mn
100
100
m=1 n=1

94

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS


(d) After 10 minutes, the temperature u is not very close to the steady-state temperature; the difference
u(x, y, 600) us (x, y) is graphed in Figure 11.5. (Note: The temperature variation in this problem may
be outside the range in which the linear model is valid, so these results may be regarded with some skepticism.)

0
2
4
6
8
10
60
60

40
40
20
x2

20
0 0

x1

Figure 11.5: The difference between the temperature in the plate after 10 minutes and the steady-state temperature. (See Exercise 11.2.15.)

11.3

Fourier series on a disk

1. The next three coefficients in the series for g are


.
.
.
c40 = 0.0209908, c50 = 0.0116362, c60 = 0.00722147.
3. The solution is
u(r, ) =

am0 J0 (s0m r),

m=1

where
am0 =

cm0
,
s20m

the cm0 are the coefficients of f (r, ) = 1 r, and the s0m are the positive roots of J0 . A direct calculation shows
that
a10
a20
a30
a40
a50
a60

.
=
.
=
.
=
.
=
.
=
.
=

0.226324,
0.0157747,
0.00386078,
0.00148156,
0.000716858,
0.000399554.

The solution (approximated by six terms of the series) is graphed in Figure 11.6.
5. The solution is
u(r, ) =

am0 J0 (s0m r),

m=1

where
am0 =

cm0
,
s20m

11.3. FOURIER SERIES ON A DISK

95

0.25
0.2
0.15
0.1
0.05
0
1
1

0.5
0.5

0
0

0.5

0.5
1 1

x2

x1

Figure 11.6: The approximation to solution u, computed with six terms of the (generalized) Fourier series (see
Exercise 11.3.3).

the cm0 are the coefficients of f (r, ) = r, and the s0m are the positive roots of J0 . A direct calculation shows
that
.
=
.
=
.
=
.
=
.
=
.
=

a10
a20
a30
a40
a50
a60

0.141350,
0.0371986,
0.0106599,
0.00537260,
0.00283289,
0.00182923.

The solution (approximated by six terms of the series) is graphed in Figure 11.7.

0.15

0.1

0.05

0
1
1

0.5
0.5

0
0

0.5
x2

0.5
1 1

x1

Figure 11.7: The approximation to solution u, computed with six terms of the (generalized) Fourier series (see
Exercise 11.3.5).
7. If we write
(r, ) =

cm0 J0 (m0 r) +

m=1

(cmn cos (n) + dmn sin (n)) Jn (mn r),

m=1 n=1

where the cmn and dmn are known, and


u(r, , t) =

am0 (t)J0 (m0 r) +

m=1

(amn (t) cos (n) + bmn (t) sin (n)) Jn (mn r),

m=1 n=1

then
amn (t)

cmn emn t/(c) , m = 1, 2, 3, . . . , n = 0, 1, 2, . . . ,

bmn (t)

dmn emn t/(c) , m, n = 1, 2, 3, . . . .

96

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS


However, since (r, ) = r(1 r) cos ()/5 (a function of r times cos ()), all of the coefficients of are zero except
for cm1 , m = 1, 2, 3, . . .. Therefore,
u(r, , t) =

am1 (t) cos ()J1 (m1 r),

m=1

with am1 (t) given above. After 30 seconds, the temperature distribution can be approximated accurately using a
single eigenfunction (corresponding to the largest eigenvalue, 11 ), so we need only
.
c11 = 9.04433.
The temperature distribution after 30 seconds is graphed in Figure 11.8.

0.04
0.02
0
0.02
0.04
10
10

5
5

0
0

5
x2

5
10 10

x1

Figure 11.8: The approximation to solution u at t = 30, computed with one term of the (generalized) Fourier
series (see Exercise 11.3.7).
9. A circular drum of radius A has area A2 , the same area as a square drum of side length
frequency of such a square drum is
q
2
2
c (A)2 + (A)2
c
c 1 .
= 0.398942 .
=
2
A 2
A

A. The fundamental

Comparing to Example 11.9, we see that the circular drum sounds a lower frequency than a square drum of equal
area.
.
.
.
.
11. s41 = 7.588342434503804, s42 = 11.06470948850118, s43 = 14.37253667161759, s44 = 17.61596604980483

11.4

Finite elements in two dimensions

1. The mesh for this problem is shown in Figure 11.9, in which the free nodes are labeled. The stiffness matrix is

4.4815 1.1759 1.1759


0.0000
4.9259
0.0000 1.3426
. 1.1759
,
K=
1.1759 0.00000
4.9259 1.3426
0.0000 1.3426 1.3426
5.8148
while the load vector is

0.11111
. 0.11111

F=
0.11111 .
0.11111

The resulting weights for the finite element approximation are given by

0.048398
. 0.044979

u = K1 F =
0.044979 .
0.039879

11.4. FINITE ELEMENTS IN TWO DIMENSIONS

97

0.8
3

x2

0.6

0.4

0.2

0
0

0.2

0.4

0.6

0.8

x1

Figure 11.9: The mesh for Exercise 11.4.1.

3. The mesh for this problem is shown in Figure 11.10, in which the free nodes are labeled. The stiffness matrix is
16 16 and neither it nor the load vector will be reproduced here. The matrix is singular, as is expected for a
Neumann problem. The unique solution to KU = F with its last component equal to zero is

.
u=

0.071138
0.047315
0.012656
0.001458
0.067934
0.047349
0.014145
0.001566
0.065432
0.046198
0.015160
0.000329
0.062914
0.046391
0.016065
0.000000

13

14

15

16

10

11

12

0.8

x2

0.6

0.4

0.2

0
0

0.2

0.4

0.6

0.8

x1

Figure 11.10: The mesh for Exercise 11.4.3.

5. Let Vn be the space of continuous piecewise linear functions relative to a given triangulation of the domain , and
2
let {1 , . . . , n } be the standard basis for Vn . Suppose that u :
PR belongs to L (). We wish to find v Vn
that minimizes kw ukL2 () over all w Vn . We can write v = n

and
use
the projection theorem: v
i=1 i i
must satisfy (u v, w)L2 () = 0 for all w Vn , which is equivalent to (u v, i )L2 () = 0 for all i = 1, 2, . . . , n.

98

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS


We obtain the following equations:
(v, i ) = (u, i ), i = 1, 2, . . . , n
!
n
X

j j , i = (u, i ), i = 1, 2, . . . , n
j=1

n
X

j (j , i ) = (u, i ), i = 1, 2, . . . , n.

j=1

This last system of equations is equivalent to M = f , where M is the usual mass matrix,
Z
Mij =
j i , i, j = 1, 2, . . . , n,

and f is the vector defined by


Z
fi =

vi , i = 1, 2, . . . , n.

7.

(a) A direct calculation shows that the inhomogeneous Dirichlet problem


(k(x)u)

f (x), x ,

u(x)

g(x), x ,

has weak form


2
u G + V, a(u, v) = (f, v) for all v V = CD
(),

where G is any function satisfying the condition G(x) = g(x) for x , and
G + V = {G + v : v V } .
Substituting u = G + w, where w V , into the weak form yields
w V, a(w, v) = (f, v) a(G, v) for all v V.
In the Galerkin method, we replace V by a finite-dimensional subspace Vn and solve
w Vn , a(w, v) = (f, v) a(G, v) for all v Vn .
When using piecewise linear finite elements, we can satisfy the boundary conditions approximately by taking
G to be a continuous piecewise linear function whose values at the boundary nodes agree with the given
boundary function g. For simplicity, we take G to be zero at the interior nodes. The resulting load vector
is then given by
fi = (f, i ) a(G, i ), i = 1, 2, 3, . . . , n.
Since G is zero on interior nodes, the quantity a(G, i ) is nonzero only if (free) node i belongs to a triangle
adjacent to the boundary.
(b) The regular triangulation of the unit square having 18 triangles has only four interior (free) nodes, and each
one belongs to triangles adjacent to the boundary. This means that every entry in the load vector is modified
(which is not the typical case). Since f = 0, the load vector f is defined by
fi = a(G, i ), i = 1, 2, 3, 4.
The load vector is

while the solution to Ku = f is

0.22222222222222
. 1.55555555555556

f =
0.22222222222222 ,
1.55555555555556

0.27777777777778
. 0.61111111111111

u=
0.27777777777778 .
0.61111111111111

11.4. FINITE ELEMENTS IN TWO DIMENSIONS


9.

99

(a) Consider the BVP


(k(x)u) = f (x), in ,
u
(x) = h(x), x .
n

(11.1)

Multiplying the PDE by a test function v V = C 2 () and applying Greens first identity yields
Z
Z
Z
ku v =
fv +
kvh for all v V .

We will apply Galerkins method with Vm equal to the space of all continuous piecewise linear function
relative to a given triangulation T . We label the standard basis of Vm as 1 , 2 , . . . , n , and the nodes as
z1 , z2 , . . . , zn . (Every node in the mesh is now free.) Thus Vn = span{1 , 2 , . . . , n }.
We then define the Galerkin approximation wn by
Z
wn Vn , a(wn , i ) = (f, i ) +
khi , i = 1, 2, . . . , m.

Writing wn =

Pm

j=1 j j and

1
2

w = . ,
..
n

we obtain the system Kw = F. The stiffness matrix K Rmm is given by


ij = a(j , i ), i, j = 1, 2, . . . , n,
K
Rm by
and the load vector F
Fi = (f, i ) +

Z
khi , i = 1, 2, . . . , n.

The boundary integral in the expression for Fi is zero unless zi is a boundary node.
(b) The compatibility condition for (11.1) is determined by the following calculation:
Z
Z
Z
Z
u
f =
(ku) =
k
=
kh.

(c) Now consider (11.1) with


3
3x2
, h(x) = 1 ,
4
5
where is the unit square. We will produce the finite element solution using the regular grid with 18
R1616 is singular, as should be expected, and there are
triangles (16 nodes). The stiffness matrix K
infinitely many solutions. The unique solution u with last component equal to zero is

0.3622
0.2984

0.1344

0.0843

0.3728

0.3302

0.2081

0.0255
.

u=

0.3803
0.3447

0.2334

0.0591

0.3665

0.3257

0.1878
k(x) = 1, f (x) = x1 x2 +

0.0000

100

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

11.5

The free-space Greens function for the Laplacian

1. Following the hint and using the trigonometric identities


cos (a b) = cos (a) cos (b) + sin (a) sin (b), sin (a b) = sin (a) cos (b) cos (a) sin (b),
we obtain
y1 = r cos ( ) = r cos () cos () + r sin () sin ()
= x1 cos () + x2 sin (),
y2 = r sin ( ) = r sin () cos () r cos () sin ()
= x1 sin () + x2 cos (),

as desired.
3. We have

1 d
d2
d
d2

=
(r)

= r(r)
dr2
r dr
dr2
dr 
d
d

r
(r) = r(r).
dr
dr

This last ODE can be solved by integrating twice to yield the general solution
Z r  
r
(r) = c1 + c2 ln (r)
ln
(s)s ds.
s
0
5. Let V be the space of all smooth functions defined on R2 and having compact support. We wish to show that
the variational problem
Z
u(x) v(x) dx = v(y) for all v V
R2

is equivalent to
Z
0

Z
0

1 u v
u v
+ 2
r r
r


v rdrd = v(y) for all v V

in polar coordinates.
(a) We first convert
Z
u(x) v(x) dx
R2

to polar coordinates, where y R2 is fixed and represents the origin for the polar coordinates. By the chain
rule, we have
sin () u u
cos () u
u
u
u
= cos ()

,
= sin ()
+
x1
r
r x2
r
r

(cf. the derivation in Section 11.3.1) and similarly for v. Therefore,





sin () u
sin () v
u
v
u v = cos ()

cos ()

+
r
r
r
r



cos () u
cos () v
u
v
sin ()
+
sin ()
+
r
r

r
r
sin () cos () u v
sin () cos () u v
sin2 () u v
u v

+
+
r r
r
r
r
r
r2
2
sin () cos () u v
sin () cos () u v
cos () u v
u v
sin2 ()
+
+
+
r r
r
r
r
r
r2

 2

2
sin ()
cos () u v
u v
2
2
= (sin () + cos ())
+
+
r r
r2
r2

u v
1 u v
=
+ 2
.
r r
r
= cos2 ()

11.5. THE FREE-SPACE GREENS FUNCTION FOR THE LAPLACIAN

101

It follows that
Z

u(x) v(x) dx =
R2

u v
1 u v
+ 2
r r
r


v rdrd,

as desired.
(b) We can derive the same result by starting with the PDE u = (x y) in polar coordinates, multiplying
by a test function, and integrating. The right-hand side becomes
Z
(x y)v(x) dx = v(y).
R2

On the left side, we have


2


2u
1 2u
1 u

vr dr d

r2
r r
r2 2
0
0

Z 2 Z 2
Z 2 Z
Z  Z 2 2
u
u
1
u

vr
dr
d

v
dr
d

v
d
r dr
r2
r
r2 0 2
0
0
0
0
0
Z

Z 2 
Z
Z 2 Z
u
u v
u
u
r v +
r dr +
v dr d
v dr d
r
r
r
r
r
0
0
0
0
0
0
(
)
2 Z 2
Z
u
1
u v
v

d r dr
r2 0

0
0
Z 2
Z 2 Z
u v
1 u v
r dr d +
r dr d
r r
r2
0
0
0

Z 2 
u v
1 u v
+ 2
r dr d.
r r
r
0
Z

=
=

=
=

Once again, we have derived the desired result.


7. The derivation is long and tedious. As of the time of this writing, it can be found at
planetmath.org/encyclopedia/DerivationOfTheLaplacianFromRectangularToSphericalCoordinates.html.
9. Let g() = c1 /. Then
c1
g
() = 2

and therefore
Z
0

Z
0

Z
0

g v 2
sin () d d d = c1

1 v 2
sin () d d d
2

v
sin () d d d


Z
Z 2 Z
v
d d d
= c1
sin ()

0
0
0
Z 2 Z
= c1
sin () (v(y)) d d
= c1

0
2 Z

= c1 v(y)

sin () d d
0

Z
= 2c1 v(y)

d
0

= 4c1 v(y).
From this we see that g is a solution of (11.83) if and only if c1 = 1/(4).

102

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

11.6

The Greens function for the Laplacian on a bounded domain

1. Suppose u satisfies
u = f (x) in ,
1 u + 2

u
= 0 on ,
n

and let v be any test function in C 2 (). Then


Z
Z
Z
fv
(u)v =

u
v+
n

Z
u v =

f v.

The boundary condition yields


u
1
=
u on ,
n
2
Z
Z
uv +
u v =
f v,

and hence we obtain

1
2

as desired.
3. Let G be the free-space Greens function for the Laplacian and define
w(x; y) = 1 G(x; y) +

G
(x; y)
nx

for all x and y . Assume that u(x) = v (x; y) satisfies


u = 0 in
1 u + 2

u
= w(x; y) on ,
n

where
w(x; y) = 1 G(x; y) + 2
Define

G
(x; y).
nx

Z
u2 (x) =

v (x; y)f (y) dy.

Then, for all v C 2 (),


Z
(x v v = 0
Z
Z
v

(x; y)v(x) dx +
x v (x; y) v(x) dx = 0
nx

Z
Z
Z
1
1

v (x; y)v(x) dx
w(x; y)v(x) dx +
x v (x; y) v(x) dx = 0
2
2

Z
Z
Z
1
1

v (x; y)v(x) dx +
x v (x; y) v(x) dx =
w(x; y)v(x) dx .
2
2

Notice how we used the boundary condition satisfied by v to substitute for v /nx . We now multiply both
sides of this last equation by f (y) and integrate over to obtain


Z Z
Z Z
1
v (x; y)v(x) dx f (y) dy+
x v (x; y) v(x) dx f (y) dy
2


Z Z
1
=
w(x; y)v(x) dx f (y) dy.
2

Changing the order of integration in the two integrals on the left yields


Z Z
Z Z
1
v (x; y)f (y) dy v(x) dx +
x v (x; y)f (y) dy v(x) dx
2


Z Z
1
=
w(x; y)v(x) dx f (y) dy.
2

11.6. THE GREENS FUNCTION FOR THE LAPLACIAN ON A BOUNDED DOMAIN


Since

Z

103

x v (x; y)f (y) dy =

v (x; y)f (y) dy

= u2 (x),

we obtain
1
2

Z
u2 (x)v(x) dx +

u2 (x) v(x) dx

Z Z
1
w(x; y)v(x) dx f (y) dy,
=
2

as desired.
5. Let G be the free-space Greens function for the Laplacian, and suppose v (x; y) satisfies the BVP
x v = 0 in ,
v (x; y) = G(x; y) on
for all y . (Notice that G(x; y) is a continuous function of x for all y , and therefore v is welldefined.) We define G (x; y) = G(x; y) v (x; y), and we will show that G is the Greens function for the
BVP
u = f (x) in ,
u = 0 on .
The weak form of the last BVP is
2
u CD
(),

2
f (x)v(x) dx for all v CD
().

u(x) v(x) dx =

We prove that G is the desired Greens function by proving that


Z
G (x; y)f (y) dy
u(x) =

satisfies the above variational problem. We have


Z
Z
G(x; y)f (y) dy
v (x; y)f (y) dy = u1 (x) u2 (x),
u(x) =

where

u1 (x) =

G(x; y)f (y) dy, u2 (x) =

v (x; y)f (y) dy.

Letting V be the space of all smooth functions with compact support, we have
Z
Z
u1 (x) v(x) dx =
f (x)v(x) dx for all v V,
R2

R2

where f has been extended to be zero outside of . This last variational equation holds because G is the free-space
2
Greens function. For any v CD
(), we can extend v to be identically zero outside of and thereby obtain an
element v of V . We then have
Z
Z
2
u1 (x) v(x) dx =
f (x)v(x) dx for all v CD
().

On the other hand, we have


u2 (x) = 0 for all x ;
multiplying by v

2
CD
()

and integrating yields


Z
2

u2 (x)v(x) dx = 0 for all v CD


().

Integrating by parts on the left, we obtain


Z
2
u2 (x) v(x) dx = 0 for all v CD
().

104

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS


(Notice that the boundary term vanishes because v = 0 on .) Putting together the variational equations
satisfies by u1 and u2 , we see that u = u1 u2 satisfies
Z
Z
2
u(x) v(x) dx =
f (x)v(x) dx for all v CD
().

Also, for x , we have


Z
Z
Z
Z
u(x) =
G(x; y)f (y) dy
v (x; y)f (y) dy =
G(x; y)f (y) dy
G(x; y)f (y) dy = 0.

2
This shows that u CD
(); hence u satisfies the given BVP, which shows that G is the desired Greens function.

7. Greens second identity is


Z

Z
(vu uv) =

v
u
u
n
n


.

Let G be the Greens function for the BVP


u = f (x) in
1 u + 2

u
= 0 on ,
n

and, for y, z , define u(x) = G (x; y), v(x) = G (x; z). Since G (x; y) satisfies
x G = (x y) in
1 G + 2

G
= 0, on ,
nx

we see that
Z
vu = v(y) = G(y; z),
Z
uv = u(z) = G(z; y).

Therefore,
Z
(vu uv) = G(z; y) G(y; z).

We also have

u
1
= u on ,
n
2

or

1
G
(x; y) = G (x; y).
nx
2

Similarly,
G
1
(x; z) = G (x; z).
nx
2
Therefore,


u
v
u
n
n


1
1
G (x; z)G (x; y) +
G (x; y)G (x; z) dx = 0.
2
2

Thus, by Greens second identity,


G(z; y) G(y; z) = 0,
that is, G(z; y) = G(y; z), as desired.
9. Let R2 be given, and let u be the solution of
u = 0 in ,
u = (x) on .

11.6. THE GREENS FUNCTION FOR THE LAPLACIAN ON A BOUNDED DOMAIN

105

Let v(x) = G (x; y), where G is the Greens function for the BVP
u = f (x) in ,
u = 0 on .
Finally, define  = {x : kx yk > }, where y is given and  > 0 is small enough that B (y) .
Notice that u = 0 in , v = 0 in  , and v(x) = 0 for all x . Applying Greens second identity to u and
v yields


Z
Z
u
v
(vu uv) =
v
u
dx
n
n






Z
Z
v
u
v
u
(x) u(x)
(x) dx +
v(x)
(x) u(x)
(x) dx
0=
v(x)
n
n
n
n
S (y)




Z 
Z
u
u
G
G
0=
0
G (x; y)
(x) (x)
(x; y) dx +
(x) u(x)
(x; y) dx
n
nx
n
nx

S (y)
Z
Z
Z
G
u
G

(x)
(x; y) dx =
G (x; y)
(x) dx
u(x)
(x; y) dx .
nx
n
nx

S (y)
S (y)
Now, recall that G = G v , where G is the free-space Greens function for the Laplacian and v (x; y) satisfies
x v = 0 in ,
v (x; y) = G(x; y) on .
We therefore have
Z
(x)

G
(x; y) dx =
nx

G(x; y)
S (y)

u
(x) dx
n

Z
v (x; y)
S (y)

u
(x) dx +
n

u(x)
S (y)

G
(x; y) dx
nx

Z
u(x)
S (y)

v
(x; y) dx .
nx

The integrands for the last two integrals are continuous, with no singularities as  0+ . Therefore, these two
integrals tend to zero as  0+ . We have
G(x; y) =

1
ln (kx yk) ,
2

and therefore G(x; y) is constant for x S (y). It follows that


Z
u
G(x; y)
(x) dx
n
S (y)
is just a multiple of
Z
S (y)

u
(x) dx =
n

Z
u(x) dx = 0
B (y)

(applying the divergence theorem and using the fact that u = 0 in ). It remains only to calculate
Z
G
u(x)
(x; y) dx .
n
x
S (y)
Now,
x G(x; y) =
and, on S (y),
nx =

xy
2kx yk2

xy
kx yk

(notice that this is the outward-pointing normal to  ). Therefore,


G
1
(x; y) = x G(x; y) nx =
.
nx
2

106

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS


Thus

Z
u(x)
S (y)

G
1
(x; y) dx =
nx
2

Z
u(x) dx ,
S (y)

which is the average value of u on S (y), and therefore


Z
G
u(x)
(x; y) dx u(y)
nx
S (y)
as  0+ . Therefore, it finally follows, by taking the limit as  0+ in Greens second identity, that
Z
G
(x)
(x; y) dx = u(y),
nx

which, given the symmetry of G , yields the desired result.


11. In the text it is shown that, if u solves
u = 0 in BR (0),
u = (x) on SR (0),
then
Z
u(x) =
SR (0)

R2 kxk2
(y) dy .
2Rkx yk2

Now suppose that u is to represented as a function of polar coordinates (r, ). Let the circle SR (0) be represented
by y = (R cos (), R sin ()), 0 2. Then
s
2 
2
q
y1
y2
dy =
+
d = R2 cos2 () + R2 sin2 () d = Rd.

With x represented by the polar coordinates (r, ), we have kxk2 = r2 and


kx yk2 = (r cos () R cos ())2 + (r sin () R sin ())2 = r2 + R2 2rR cos ( )
(where we used the trignometric identity cos () cos () + sin () sin () = cos ( )). Changing variables from
y to (r, ) thus yields
Z
Z 2
R2 kxk2
R2 r 2
1
() d,
(y) dy =
2
2
2
2 0 R + r 2Rr cos ( )
SR (0) 2Rkx yk
as desired.
13. In Chapter 9, it was shown that the solution to


du
d

P (x)
+ R(x)u = 0, a < x < b,
dx
dx
u(a) = ua ,
u(b) = ub
is

G
G
(y; a) P (b)ub
(y; b),
y
y
where G is the Greens function for the inhomogeneous differential equation with homogeneous boundary conditions. If we take P (x) = 1, we obtain


G
G
u(y) =
(y; a)ua +
(y; b)ub .
y
y
u(y) = P (a)ua

Thus u is obtained by integrating (that is, summing) the normal derivative of the Greens function, times the
boundary function over the boundary of = (a, b) (that is, the set {a, b}). Notice that the unit normal to
at x = b is n = 1, while at x = a it is n = 1, so that

G
(y; a)
y

11.7. GREENS FUNCTION FOR THE WAVE EQUATION

107

is the normal derivative of G at x = a, while


G
(y; b)
y
is the normal derivative of G at x = b. Thus formula (9.24) is exactly analogous to formula (11.103).
15. If = BR (z) for some z R2 , then formula (11.107) can be modified to show that the solution of
u = f (x), x BR (z),
u(x) = 0, x SR (z)
is
Z
u(x) =
SR (z)

R2 kx zk2
(y) dy .
2Rkx yk2

Substituting x = z, we see that kz yk2 = R2 (since y SR (z), and of course kz zk2 = 0; therefore,
Z
Z
R2
1
u(z) =
(y) dy =
(y) dy .
3
2R SR (z)
SR (z) 2R
Thus u(z) is the average value of u over the circle SR (z) (recall that u(y) = (y) on SR (z)).

11.7

Greens function for the wave equation

1. Let : R3 R, c R, and y R3 be given. Then, by the chain rule,


3

((x + cty)) =
(x + cty) (xi + ctyi )
t
x
t
i
i=1
=

3
X

(x + cty)(cyi )
x
i
i=1

=c

3
X

(x + cty)yi = (x + cty) y.
x
i
i=1

Similarly,
!
3
X

c
(x + cty)yi
xi
i=1


3
X

=c
(x + cty)yi
t xi
i=1

((x + cty)) =
t2
t

=c

3 X
3
X
2

(x + cty)yi (xj + ctyj )


x
t
j xi
i=1 j=1

=c

3 X
3
X
2
(x + cty)yi cyj
xj xi
i=1 j=1

=c

3
X
i=1

= c2

3
X

yi

3
X
2
(x + cty)yj
xj xi
j=1

yi 2 (x + cty)y


i

i=1

= c2 y 2 (x + cty)y.
3. We wish to derive the solution of
2u
c2 u = 0, x R2 , t > 0,
t2
u(x, 0) = 0, x R2 ,
u
(x, 0) = (x), x R2 .
t

108

CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS


We can follow the same reasoning as in 11.7.2. The solution of the same IVP in three dimensions is
Z
t
u(x, t) =
(x + cty) dy .
4 B1 (0)
If, in this formula, does not depend on x3 , then neither does u, and it is easy to see that u, regarded as a
function on R2 , is the solution of the IVP given above. Therefore, it remains only to write u as an integral over
a two-dimensional region, namely, B1 (0). If S represents the upper hemisphere of B1 (0), then
Z
Z
(x + cty) dy
(x + cty) dy = 2
S

B1 (0)

Z 1x2

=2

(x1 + cty1 , x2 + cty2 )


p
dy2 dy1
1 y12 y22
(x + cty)
p
dy.
1 kyk2

Z
=2
B1 (0)

It follows that

1x2

(x + cty)
p
dy.
1 kyk2
B1 (0)
Performing the change of variables z = x + cty yields the alternate formula
Z
(z)
1
p
dy.
u(x, t) =
2c Bct (x) c2 t2 kz xk2
u(x, t) =

t
2

5. The solution of
2u
c2 u = 0, x R3 , t > 0,
t2
u(x, 0) = 0, x R3 ,
u
(x, 0) = (x), x R3 .
t
is
u(x, t) =

t
4(ct)2

Let


(x) =

1,
0,

Z
(z) dz .
Bct (x)

kxk < 1,
otherwise,

and let u be the corresponding solution of the above IVP. Suppose first that x R3 , kxk > R, and t < (kvkR)/c.
This last condition implies that ct < kxk R, and therefore, if z Sct (x), then
kz xk = ct < kxk R.
It is easy to see that this condition implies that kzk > R (since z is closer to x than x is to SR (0)). Therefore,
z Sct (x) (z) = 0,
and it follows from the formula for u(x, t) that u(x, t) = 0.
Now suppose t > (kxk + R)/c, that is, ct > kxk + R. Then
z Sct (x) kz xk = ct > kxk + R,
which implies that kzk > R (since kz xk kzk + kxk). Therefore, in this case also,
z Sct (x) (z) = 0,
and we see that u(x, t) = 0.
7. The causal Greens function is
G(x, t; y, s) =

( P

n=1

sin (c

n (ts))

n (x)n (y),
c n

0,

t > s,
t < s.

11.8. GREENS FUNCTIONS FOR THE HEAT EQUATION

11.8

109

Greens functions for the heat equation

1. We wish to show that the Gaussian kernel,


2

S(x, t) = (4kt)n/2 ekxk

/(4kt)

satisfies the homogeneous heat equation in Rn . We have




2
kxk2
S
n
(x, t) = (4kt)n/2 ekxk /(4kt)

,
t
4kt2
2t


2
xi
S
(x, t) = (4kt)n/2 ekxk /(4kt)
,
xi
2kt


2S
x2i
1
n/2 kxk2 /(4kt)
(x,
t)
=
(4kt)
e

,
x2i
4k2 t2
2kt


2
kxk2
n
S(x, t) = (4kt)n/2 ekxk /(4kt)

.
4k2 t2
2kt
From these formulas, it follows immediately that
S
(x, t) kS(x, t) = 0.
t
3. We have seen that the IBVP
v
kv = f (x, T t), x , 0 < t < T,
t
v(x, 0) = (x), x ,
v(x, t) = 0, x , 0 < t < T
has a unique solution v. Let us define u(x, t) = v(x, T t). Then
u
v
(x, t) = (x, T t),
t
t
u(x, t) = v(x, T t),
and hence

u
v
(x, t) ku(x, t) =
(x, T t) kv(x, T t) = f (x, T (T t)) = f (x, t).
t
t

Also, u(x, T ) = v(x, 0) = (x) for all x , and u(x, t) = v(x, T t) = 0 for all x and 0 < t < T . Thus u
satisfies

u
ku = f (x, t), x , 0 < t < T,
t
u(x, T ) = (x), x ,
u(x, t) = 0, x , 0 < t < T,

which shows that this IBVP has a solution.


5. Let u, v be smooth functions defined for x and 0 t T . We have



Z TZ  
v
u
u
kv v
ku
dx dt
t
t
0

Z Z T
Z Z T
Z TZ
Z TZ
v
u
=
u
dt dx k
uv dx dt +
v
dt dx + k
vu dx dt
t
t
0
0

0
0



Z 
Z T
Z T Z
Z
Z Z T
u
v
u
dt dx k
u
dx
u v dx dt +
v
dx dt+
=
uv|T0
v
t
n
t

0
0

0

Z T Z
Z
u
k
v
dx
u v dx dt
0
n


Z
Z TZ 
u
v
=
(u(x, T )v(x, T ) u(x, 0)v(x, 0)) dx + k
v
u
dx .
n
n

Chapter 12

More about Fourier Series


12.1

The complex Fourier series

1. The complex Fourier series of f is

cn einx ,

n=

where c0 = 2/3 and


cn =

2(1)n
, n = 1, 2, . . . .
n2 2

The errors in approximating f by a partial Fourier series are shown in Figure 12.1.
0.04
0.02
0
0.02
0.04
1
0.04

0.5

0
x

0.5

0.5

0
x

0.5

0.5

0
x

0.5

0.02
0
0.02
0.04
1
0.04
0.02
0
0.02
0.04
1

Figure 12.1: The error in approximating f (x) = 1 x2 by its partial complex Fourier series with N = 10 (top),
N = 20 (middle), and N = 40 (bottom). (See Exercise 12.1.1.)

3. The complex Fourier coefficients of f are


cn =

(1)n+1 sin (1)


.
n 1

The magnitudes of the error in approximating f by a partial Fourier series are shown in Figure 12.2.
5. Let
g(x) = a0 +


 nx 
 nx 
X
an cos
+ bn sin
,
`
`
n=1

111

112

CHAPTER 12. MORE ABOUT FOURIER SERIES


1

0.5

0
1
1

0.5

0
x

0.5

0.5

0
x

0.5

0.5

0
x

0.5

0.5

0
1
1

0.5

0
1

Figure 12.2: The magnitude of the error in approximating f (x) = eix by its partial complex Fourier series with
N = 10 (top), N = 20 (middle), and N = 40 (bottom). (See Exercise 12.1.3.)
where
a0

an

bn

Z `
1
g(x) dx,
2` `
Z
 nx 
1 `
g(x) cos
dx, n = 1, 2, 3, . . . ,
` `
`
Z `
 nx 
1
g(x) sin
dx, n = 1, 2, 3, . . . ,
` `
`

(see (6.25) in the text), and similarly let


h(x) = p0 +


 nx 
 nx 
X
pn cos
+ qn sin
.
`
`
n=1

The complex Fourier coefficient of f is given by


cn =

1
2`

f (x)einx/` dx.

For n > 0, we have


cn

=
=

Z `

 nx 
 nx 
1
(g(x) + ih(x)) cos
i sin
dx
2` `
`
`
 Z
Z
 nx 
 nx 
1 1 `
1 `
g(x) cos
dx i
g(x) sin
dx
2 ` `
`
` `
`
Z `
Z
 nx 
 nx  
1
1 `
+i
h(x) cos
dx +
h(x) sin
dx
` `
`
` `
`
1
(an + qn + i(pn bn )) .
2

Similarly, if n > 0, then


cn =

1
(an qn + i(pn + bn )) .
2

Finally,
c0 = a0 + ip0 .
7. We have
N
1 
X

eijn/N

2

n=0

N
1 
X

e2ij/N

n=0
2ij

e
1
,
e2ij/N 1

n

12.2. FOURIER SERIES AND THE FFT

113

using the formula for the sum of a finite geometric series:


m
X

rn =

n=0

rm+1 1
.
r1

Moreover, since ei is a 2-periodic function of , we see that e2ij = 1 and hence that
N
1 
X

eijn/N

2

= 0.

n=0

On the other hand, by Eulers formula,


N
1 
X

eijn/N

2

N
1 
X



2
jn
jn
+ i sin
N
N
n=0









N
1
X
jn
jn
jn
jn
sin2
+ 2i cos
sin
cos2
N
N
N
N
n=0




N
1
N
1
X
X
jn
jn

cos2
sin2
N
N
n=0
n=0




N
1
X
jn
jn
+2i
sin
.
cos
N
N
n=0

n=0

cos

Since this expression equals zero, we must have


N
1
X

cos2

n=0

jn
N

N
1
X

N
1
X

sin2

n=0


cos

n=0

jn
N


sin

jn
N

jn
N

0,

0.

The second equation is one of the results we set out to prove. The first equation can be written, using the
trigonometric identity sin2 () = 1 cos2 (), as
N
1
X

cos2

n=0

jn
N

N
1 
X

1 cos2

n=0

jn
N

which simplifies to
2

N
1
X

cos2

n=0

jn
N


= N,

or
N
1
X

cos2

n=0

jn
N

jn
N

N
,
2

N
2

which is the desired result. The result


N
1
X

sin2

n=0

then follows.

12.2

Fourier series and the FFT

1. The graph of {|Fn |} is shown in Figure 12.3.


3. As shown in the text,

.
cn = Fn , n = 16, 15, . . . , 15,


= 0,

114

CHAPTER 12. MORE ABOUT FOURIER SERIES


0.5

0.4

|Fn|

0.3

0.2

0.1

0
0

10
n

15

20

Figure 12.3: The magnitude of the sequence {Fn } from Exercise 12.2.1.
0.5
0.4
0.3
0.2
0.1
0
0.1
0.2
0.3
0.4
0.5
1

0.5

0
x

0.5

Figure 12.4: The function f (x) = x(1 x2 ) (the curve) and the estimates of f (xj ) (the circles) computed from
the complex Fourier coefficients of f (see Exercise 12.2.3.

15
where {Fn }15
n=16 is the DFT of {fj }j=16 ,

fj = f (xj ), xj = 1 +

j
, j = 16, 15, . . . , 15
16

(note that f (1) = f (1)). Therefore, we can estimate {f (xj )} by taking the inverse DFT (using the inverse FFT)
of {cn }. The results are shown in Figure 12.4.
5. We have
N
1
X

An e2ijn/N

n=0

N 1 N 1
1 X X
am e2imn/N e2ijn/N
N n=0 m=0
N 1 N 1
1 X X
am e2i(jm)n/N
N n=0 m=0
(N 1
)
N 1
X 2i(jm)n/N
1 X
am
e
.
N m=0
n=0

If j = m, then
N
1
X
n=0

e2i(jm)n/N =

N
1
X
n=0

1 = N,

12.3. RELATIONSHIP OF SINE AND COSINE SERIES TO THE FULL FOURIER SERIES

115

while if j 6= m, then this sum is a finite geometric series:


N
1
X

e2i(jm)n/N

N
1 
X

n=0

e2i(jm)/N

n

n=0


=

e2i(jm)/N

N

1
e2i(jm) 1
e2i(jm)/N 1
0.
e2i(jm)/N

=
=
Therefore,
am

N
1
X

e2i(jm)n/N =

N aj ,
0,

n=0

m = j,
m 6= j,

and so we obtain
N
1
X

2ijn/N

An e

n=0

N 1
1 X
am
=
N m=0

(N 1
X

)
2i(jm)n/N

n=0

1
N aj = aj ,
N

as desired.
7. Below we show the exact Fourier sine coefficients of f , the coefficients estimated by the DST, and the relative
error. Since both an and the estimated an are zero for n even, we show only an for n odd.
n

an
1

estimated an

relative error

2.5801 10

2.5801 10

6.2121 106

9.5560 103

9.5511 103

5.1571 104

2.0641 10

2.0555 10

4.1824 103

7.5222 104

7.3918 104

1.7340 102

3.5393 10

3.3531 10

5.2608 102

11

1.9385 104

1.6778 104

1.3448 101

13

1.1744 104

8.0874 105

3.1135 101

15

6.8241 101

7.6448 10

2.4279 10

9. We have
2

N
1
X


Fn sin

n=1

jn
N

N
1 N
1
X
X

fm sin

 mn 
N

n=1 m=1

N
1
X

fm

m=1

N
1
X

sin

 mn 
N

n=1

jn
N


jn
.
N

sin

sin

By the hint,
N
1
X

sin

 mn 

n=1


sin

jn
N

is either N/2 or 0, depending on whether m = j or not. It then follows immediately that

N
1
X
n=1

which is what we wanted to prove.


Fn sin

jn
N


=4

N
fj = 2N fj ,
2

116

CHAPTER 12. MORE ABOUT FOURIER SERIES


1.5

0.5

0.5

1.5
3

0
x

Figure 12.5: The partial Fourier sine series (50 terms) of f (x) = x.

12.3

Relationship of sine and cosine series to the full Fourier series

1. The partial Fourier sine series, with 50 terms, is shown in Figure 12.5. It appears that the series converges to the
function F satisfying
F (x) = x 2k, 2k 1 < x < 2k + 1, k = 0, 1, 2, . . . .
The period of this function is 2.
3.

(a) The odd extension fodd is continuous on [`, `] only if f (0) = 0. Otherwise, fodd has a jump discontinuity
at x = 0.

(b) The even extension feven is continuous on [`, `] for every continuous f : [0, `] R.
5. The quarter-wave sine series of f : [0, `] R is the full Fourier series of the function f : [2`, 2`] R obtained
by first reflecting the graph of f across the line x = ` (to obtain a function defined on [0, 2`]) and then taking the
odd extension of the result. That is, f is defined by

f (x),
0 x `,

f
(2`

x),
`
< x 2`,
f(x) =
f
(x),
`
x < 0,

f (x + 2`), 2` x < `.
Since this function is odd, its full Fourier series has only sine terms (all of the cosine coefficients are zero), and
because of the other symmetry, the even sine terms also drop out.

12.4

Pointwise convergence of Fourier series

1. The Fourier series of f converges pointwise to the function F defined by



0,
x = (2k 1), k = 1, 2, 3, . . . ,
F (x) =
(x 2k)3 , (2k 1) < x < (2k + 1), k = 0, 1, 2, . . . .
3. There are many such functions f , but they all have one or more discontinuities. An example is

x,
0 x 12 ,
f (x) =
x + 1, 21 < x 1.
5. If {fN } converges uniformly to f on [a, b], then it obviously converges pointwise (after all, the maximum difference,
over x [a, b], between fN (x) and f (x) converges to zero, so each individual difference must converge to zero).
To prove that uniform convergence implies mean-square convergence, define
MN = max{|f (x) fN (x)| : a x b}.
Then
s

s
Z

|f (x) fN (x)|2 dx

b
2
MN
dx

MN b a.

By hypothesis, MN 0 as N , which gives the desired result.

12.5. UNIFORM CONVERGENCE OF FOURIER SERIES

117

7. Suppose f : [0, `] R is continuous. Then feven , the even, periodic extension of f to R, is defined by

f (x 2k`),
2k` x < (2k + 1)`, k = 0, 1, 2, . . . ,
feven (x) =
f (x + 2k`), (2k 1)` x < 2k`, k = 0, 1, 2, . . . .
Obviously, then, feven is continuous on every interval (2k`, (2k + 1)`) and ((2k 1)`, 2k`), that is, except possibly
at the points 2k` and (2k 1)`, k = 0, 1, 2, . . .. We have
lim

feven (x) =

lim

feven (x) =

x2k`

lim

f (x + 2k`) = lim f (x) = f (0)

lim

f (x 2k`) = lim f (x) = f (0).

x2k`

x0+

and
x2k`+

x2k`+

x0+

Since feven (2k`) = f (0) by definition, this shows that feven is continuous at x = 2`.
A similar calculation shows that
lim

x(2k1)`

feven (x) =

lim

x(2k1)`+

feven (x) = feven ((2k 1)`) = f (`),

and hence that feven is continuous at x = (2k 1)`.


9. Given f : [0, `] R, define f : [2`, 2`] R by

f (x),

f (2` x),

f (x) =
f (x),

f (x + 2`),

0 x `,
` < x 2`,
` x < 0,
2` x < `.

Then define F : R R to be the periodic extension of f to R. Assuming f is piecewise smooth, the quarter-wave
sine series of f converges to F (x) if F is continuous at x, and to
1
[F (x) + F (x+)]
2
if F has a jump discontinuity at x. If f is continuous, then its quarter-wave sine series converges to f except
possibly at x = 0. If f is continuous and f (0) = 0, then the quarter-wave sine series of f converges to f at every
x [0, `].

12.5

Uniform convergence of Fourier series

1. The function h(x) fails to satisfy h(1) = h(1), so its Fourier coefficients decay like 1/n and its Fourier series is
the slowest to converge. The function f satisfies f (1) = f (1), but df /dx has a discontinuity at x = 0 (and the
derivative of fper also has discontinuities at x = 1). Therefore, the Fourier coefficients of f decay like 1/n2 .
Finally, gper and its first derivative are continuous, but its second derivative has a jump discontinuity at x = 1,
so its Fourier coefficients decay like 1/n3 . The Fourier series of g is the fastest to converge.
3.
5. Figure 12.6 shows the f , its partial Fourier series with 21, 41, 81, and 161 terms, and the line y = 1.09. Zooming
in near x = 0 shows that the overshoot is indeed about 9%; see Figure 12.7.

12.6
1.

Mean-square convergence of Fourier series


(a) The infinite series

X
1
2
n
n=1

converges to a finite value.1 Therefore, {1/n} `2 and so, by Theorem 12.36, the sine series converges to a
function in L2 (0, 1).
1A

standard result in the theory of infinite series is that

X
1
k
n
n=1

118

CHAPTER 12. MORE ABOUT FOURIER SERIES


1.5

0.5

0
21 terms
41 terms
81 terms
161 terms
0.5
1

0.5

0
x

0.5

Figure 12.6: The function f from Exercise 12.5.5, its partial Fourier series with 21, 41, 81, and 161 terms, and
the line y = 1.09.
1.105
21 terms
41 terms
81 terms
161 terms

1.1

1.095

1.09

1.085

1.08

1.075
0.02

0.02

0.04
x

0.06

0.08

0.1

Figure 12.7: Zooming in on the overshoot in Figure 12.6.


(b) Figure 12.8 shows the sum of the first 100 terms of the sine series. The graph suggests that the limit f is of
the form f (x) = m(1 x). The Fourier sine series of such an f are
Z 1
2m
cn = 2
m(1 x) sin (nx) =
, n = 1, 2, 3, . . . .
n
0
Therefore, in order that cn = 1/n, we must have m = /2. Therefore,
f (x) =

(1 x).
2

1.5

0.5

0.5
0

0.2

0.4

0.6

0.8

Figure 12.8: The partial sine series, with 100 terms, from Exercise 12.6.1.
converges if k is greater than 1. This can be proved, for example, by comparison with the improper integral
Z
dx
.
xk
1

12.7. A NOTE ABOUT GENERAL EIGENVALUE PROBLEMS


3. The infinite series

119

2 X


X
1
1

=
n
n
n=1
n=1

is the harmonic series, a standard example of a divergent series. Therefore, {1/ n} 6 `2 , and so the series does
2
not converge to an L (0, 1) function.
R1
5. (a) The function f (x) = xk belongs to L2 (0, 1) if and only if the integral 0 x2k dx is finite. Provided k 6= 1/2,
we have
 1
Z 1
Z 1
, k > 21 ,
1 r2k+1
1+2k
x2k dx = lim
x2k dx = lim
=
,
k < 12 .
1 + 2k
r0+
r0+ r
0
For k = 1/2,
Z 1
Z 1
Z 1
dx
dx
x2k dx =
= lim
= lim ln (r) = .
+
x
x
r0
r0+
0
0
r
2
Thus we see that f L (0, 1) if and only if k > 1/2.
(b) The first few Fourier sine coefficients of f (x) = x1/4 , as computed by the DST, are approximately
1.5816, 0.25353, 0.63033, 0.17859, 0.41060, 0.14157, . . . .
(c) The graphs of f , the partial Fourier sine series, with 63 terms, and the difference between the two, are shown
in Figure 12.9.
6

y=x1/4
sine series (63 terms)

0
0

0.2

0.4

0.6

0.8

0.6

0.8

x
0.1

0.1
0

0.2

0.4
x

Figure 12.9: The function f (x) = x1/4 , together with its partial Fourier sine series (first 63 terms) (top), and
the difference between the two (bottom). See Exercise 12.6.5.
7. Since vn v, there exists a positive integer N such that
n N kv vn k <


.
2

Then, if n, m N , we have
kvn vm k kvn vk + kv vm k <



+ = .
2
2

Therefore, {vn } is Cauchy.

12.7

A note about general eigenvalue problems

2
1. The proof is a direct calculation, using integration by parts (Greens identity): Suppose u, v CD
(). Then
Z
Z
Z
u
(KD u, v) =
(k(x)u) v =
k(x)u v
k(x)v
n

Z
=
k(x)u v (since v = 0 on )

Z
Z
v
=
(k(x)v) u +
k(x)u
n

Z
=
(k(x)v) u (since u = 0 on )

(u, KD v).

120

CHAPTER 12. MORE ABOUT FOURIER SERIES

3. If t is very large, then we can approximate u(x, t) by the first term in its generalized Fourier series. Using the
same notation as before for the eigenvalues and eigenfunctions of the negative Laplacian on , we have
.
u(x, t) = c1 e1 t/(c) 1 (x), t large.
The constant c1 is the first generalized Fourier coefficient of the initial temperature 5:
R
51
c1 = R 2 .

1
The approximation is valid provided 1 is a simple eigenvalue; that is, there is only one linearly independent
eigenvector corresponding to 1 . Then all of the other terms in the generalized Fourier series decay to zero much
more rapidly than does the first term.

Chapter 13

More about Finite Element Methods


13.1

Implementation of finite element methods

1. We must check that the one-point rule gives the exact values for the integral
f (x) = x2 . With f (x) = 1, we have
Z
1
f = (area of T R ) 1 =
2
TR

TR

f when f (x) = 1, f (x) = x1 , or

and
1
f
2

1 1
,
3 3

1
.
2

With f (x) = x1 , we have


Z

Z
f

1x1

x1 dx2 dx1

TR

0
1

Z
=
0


1
1
1
x1 x21 dx1 = = .
2
3
6

On the other hand,




1
f
2

1 1
,
3 3


=

1 1
1
= ,
2 3
6

so the rule is exact in this case as well. By symmetry, the rule must hold for f (x) = x2 , which shows that the
rule has degree of precision at least 1. To show that the degree of precision is not greater than 1, we note that,
for f (x) = x21 ,
Z
Z 1 Z 1x1
Z 1

1
1
1
f=
x21 dx2 dx1 =
x21 x31 dx1 = =
,
3
4
12
R
0
0
0
T
while
1
f
2

1 1
,
3 3


=

1 1
1
=
.
2 9
18

3. We have
Z

3/2

2x1 2

f=
T

x1 x22

42x1

dx2 dx1 +

3/2

x1 x22 dx2 dx1 =

On the other hand, the mapping from T R to T is


x1

1 + z1 +

x2

z2 .

1
z2 ,
2

The Jacobian is

J=

121

1
0

1
2


,

7
1
1
+
= .
120
15
8

122

CHAPTER 13. MORE ABOUT FINITE ELEMENT METHODS


and its determinant is 1. Therefore, with
g(z1 , z2 ) = f


 

1
1
1 + z1 + z2 , z2 = 1 + z1 + z2 z22 ,
2
2

we have

1z1

g=

f=
T

TR


1
1 + z1 + z2 z22 dz2 dz1 .
2

This last integral also equals 1/8.


5. Recall that the nodes in the mesh are enumerated from 1 to M . Let the constrained boundary nodes be those
with numbers c1 , c2 , . . . , cK . We define a new K 1 array CNodePtrs whose ith entry is ci . (Thus CNodePtrs
contains pointers into the NodeList array, allowing one to find the coordinates of any given constrained node.)
We need the inverse of the mapping i 7 ci ; let us define j 7 dj by

i if j = ci ,
dj =
0 if j 6= ci for all i = 1, 2, . . . , K.
Now, under the original description of NodePtrs, the ith entry is zero if the ith node is constrained. We now
redefine the ith entry to be di if the ith node, while the ith entry is still gi if the ith node is free. (The use of
the negative sign is just a trick to allow us to distinguish a free node from a constrained node; it avoids the need
to store a separate flag.)
Suppose we wish to solve a BVP with inhomogenous Dirichlet conditions (on all or part of the boundary). Let
G be the piecewise linear function whose nodal value is zero everywhere except at the constrained boundary
nodes. At the nonfree boundary nodes, the value of G is the assigned Dirichlet data. To solve the inhomogeneous
Dirichlet problem, we merely need to modify the load vector by replacing
Z
Fi =
f i

by
Z
f i a(G, i ).

Fi =

The quantity a(G, i ) is nonzero only if the free node nfi belongs to a triangle that also contains a constrained
boundary node. The point here is simply that this can easily be determined from the information in the data
structure. As we loop over the triangles, we can determine, for each, whether it contains both a free node and a
constrained node. If it does, we modify the load vector accordingly.

13.2

Solving sparse linear systems

1. Computing A = LU requires n 1 steps, and step i uses


(n i)(1 + 2(n i)) = 2(n i)2 + (n i)
arithmetic operations (this is determined by simply counting the operations in the pseudo-code on page 604).
The total number of operations required is
n1
X
i=1

n1
X 2 n1
X

n2
n
2n3
2(n i)2 + (n i) = 2
j +

.
j=
3
2
6
j=1
j=1

This agrees with the O(2n3 /3) operation count given in the text.
The computation of L1 b requires n 1 steps, with 2(n i) arithmetic operations per step. The total is
2

n1
X
i=1

(n 1) = 2

n1
X

j = n2 n.

j=1

The final step of back substitution requires n steps, with 2(n i) + 1 operations per step, for a total of
n
X

{2(n i) + 1} = 2

i=1

n1
X

j + n = n2 .

j=1
2

The total for the two triangular solves is 2n n, which also agrees with the count given in the text.

13.2. SOLVING SPARSE LINEAR SYSTEMS

123

3. With
(x) =

1
x Ax b x,
2

we have
(x + y) =

1
(x + y) A(x + y) b (x + y)
2

1
1
x Ax + y Ax + y Ay b x b y
2
2
1
(x) + (Ax b) y + y Ay.
2

=
=

The fact that A is symmetric allows the simplification


1
1
x Ay + y Ax = y Ax,
2
2

which was used above. We thus see that (x + y) = (x) + (x) y + O kyk2 , with (x) = Ax b.
5. An inner product has three properties:
(a) (x, x) 0 for all x, and (x, x) = 0 if and only if x = 0.
(b) (x, y) = (y, x) for all x, y.
(c) (x + y, z) = (x, z) + (y, z) for all x, y, z and all , .
These properties hold for (x, y)A = x Ay. The third property would be true for any matrix A, the second
property obviously requires that A be symmetric, and the first property requires that A be positive definite.


7. (a) With x(0) = (4, 2), the negative gradient is x(0) = (2, 1), and so we must minimize



x(0) x(0)
= 72 5 18.
The minimizer is = 5/14, and so
x(1) =

23 23
,
7 14


.

(b) At x(1) = (23/7, 23/14), the negative gradient is (3/14, 3/7), so we must minimize



45
529
27 2
x(1) x(1)
=

.
196
196
28
The minimizer is = 5/6, and so
x(2) =


87
,2 .
28

The desired solution is (3, 2).


(c) With x(0) = 0, the CG algorithm produces
.
x(1) = (2.67456, 2.34024),
with x(2) = (3, 2), the exact solution.
9. If y = x x(0) , then x = y + x(0) and so
Ax = b Ay + Ax(0) = b Ay = b Ax(0) .
We can therefore replace b by b Ax(0) , apply the CG algorithm to estimate y, and add x(0) to get the estimate
of x.

124

CHAPTER 13. MORE ABOUT FINITE ELEMENT METHODS

13.3

An outline of the convergence theory for finite element methods

1. Let the vector-valued function F be defined by F(x) = (f (x), 0). Then


(F) = F + F =

+
f,
x1
x1

so, by the divergence theorem,


Z
Z
Z
Z
Z
f

+
f=
(F) =
F n =
f n1 .
x1
x1

If C0 (), then the boundary integral vanishes, and we obtain


Z
Z

=
f.
x1
x1
The derivation for /x2 is exactly analogous.
3. A direct computation shows that
kf gkL2 =

1
for all integers m, n,
2

while

1p
1 + m2 2 + n2 2 for all m, n.
2
Thus the L2 error is independent of m, n, while the H 1 error becomes arbitrarily large as m, n .
5. The following table shows the L2 and energy norm errors. The initial mesh has eight triangles, and the side
lengths of the triangles are divided by two each time the mesh is refined.
kf gkH 1 =

h
2/2
2/4
2/8
2/16
2/32
2/64

L2 error
1.7803 102
5.6705 103
1.5112 103
3.8399 104
9.6392 105
2.4123 105

energy error
1.0190 101
5.3955 102
2.7318 102
1.3700 102
6.8554 103
3.4283 103

We see that the L2 error goes down by a factor of approximately four each time the mesh is refined, which is
consistent with O(h2 ) convergence. Similarly, the energy norm of the error goes down by a factor of approximately
two each time the mesh is refined, which is consistent with O(h) convergence.

13.4
1.

Finite element methods for eigenvalue problems


(a) Let u, v Rn contain the nodal values of piecewise linear functions uh , vh , respectively, so that
uh =

n
X

ui i , vh =

i=1

n
X

v i i .

i=1

It follows that
Z
(uh , vh ) =

uh vh =

Z X
n
n
X
(ui i )
(vi i )
i=1

j=1

n X
n Z
X

i=1 j=1

n X
n
X


i i ui vi

Mij ui vi

i=1 j=1

u Mv.

(b) As shown in the text, if u and v are generalized eigenvectors for the problem Ku = Mu, then LT u and
LT v are orthogonal in the Euclidean norm. But then
0 = LT u LT v = u LLT v = u Mv = (uh , vh ).
Thus uh and vh are orthogonal in the L2 norm.
3. The smallest eigenvalue is approximately 9.80 (correct to three digits).

You might also like