contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

126
Contents 1 Classification of Differential Equations 1 2 Models in one dimension 3 2.1 Heat Flow in a bar; Fourier’s law ................................... 3 2.2 The hanging bar ............................................ 4 2.3 The wave equation for a vibrating string ............................... 5 2.4 Advection; kinematic waves ...................................... 5 3 Essential Linear Algebra 7 3.1 Linear systems as linear operator equations ............................. 7 3.2 Existence and uniqueness of solutions to Ax = b .......................... 9 3.3 Basis and dimension .......................................... 10 3.4 Orthogonal bases and projections ................................... 11 3.5 Eigenvalues and eigenvectors of a symmetric matrix ........................ 12 4 Essential Ordinary Differential Equations 15 4.1 Background ............................................... 15 4.2 Solutions to some simple ODEs .................................... 17 4.3 Linear systems with constant coefficients ............................... 19 4.4 Numerical methods for initial value problems ............................ 21 4.5 Stiff systems of ODEs ......................................... 23 5 Boundary Value Problems in Statics 25 5.1 The analogy between BVPs and linear algebraic systems ...................... 25 5.2 Introduction to the spectral method; eigenfunctions ......................... 27 5.3 Solving the BVP using Fourier series ................................. 29 5.4 Finite element methods for BVPs ................................... 32 5.5 The Galerkin method ......................................... 33 5.6 Piecewise polynomials and the finite element method ........................ 35 6 Heat Flow and Diffusion 39 6.1 Fourier series methods for the heat equation ............................. 39 6.2 Pure Neumann conditions and the Fourier cosine series ....................... 41 6.3 Periodic boundary conditions and the full Fourier series ...................... 44 6.4 Finite element methods for the heat equation ............................ 47 6.5 Finite elements and Neumann conditions ............................... 49 7 Waves 53 7.1 The homogeneous wave equation without boundaries ........................ 53 7.2 Fourier series methods for the wave equation ............................ 54 7.3 Finite element methods for the wave equation ............................ 57 7.4 Resonance ................................................ 58 i

Upload: others

Post on 07-Jun-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Contents

1 Classification of Differential Equations 1

2 Models in one dimension 32.1 Heat Flow in a bar; Fourier’s law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 The hanging bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 The wave equation for a vibrating string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 Advection; kinematic waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Essential Linear Algebra 73.1 Linear systems as linear operator equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.2 Existence and uniqueness of solutions to Ax = b . . . . . . . . . . . . . . . . . . . . . . . . . . 93.3 Basis and dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.4 Orthogonal bases and projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.5 Eigenvalues and eigenvectors of a symmetric matrix . . . . . . . . . . . . . . . . . . . . . . . . 12

4 Essential Ordinary Differential Equations 154.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.2 Solutions to some simple ODEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.3 Linear systems with constant coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.4 Numerical methods for initial value problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.5 Stiff systems of ODEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5 Boundary Value Problems in Statics 255.1 The analogy between BVPs and linear algebraic systems . . . . . . . . . . . . . . . . . . . . . . 255.2 Introduction to the spectral method; eigenfunctions . . . . . . . . . . . . . . . . . . . . . . . . . 275.3 Solving the BVP using Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295.4 Finite element methods for BVPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325.5 The Galerkin method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.6 Piecewise polynomials and the finite element method . . . . . . . . . . . . . . . . . . . . . . . . 35

6 Heat Flow and Diffusion 396.1 Fourier series methods for the heat equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396.2 Pure Neumann conditions and the Fourier cosine series . . . . . . . . . . . . . . . . . . . . . . . 416.3 Periodic boundary conditions and the full Fourier series . . . . . . . . . . . . . . . . . . . . . . 446.4 Finite element methods for the heat equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476.5 Finite elements and Neumann conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

7 Waves 537.1 The homogeneous wave equation without boundaries . . . . . . . . . . . . . . . . . . . . . . . . 537.2 Fourier series methods for the wave equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547.3 Finite element methods for the wave equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577.4 Resonance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

i

Page 2: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

ii CONTENTS

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

8 First-order PDEs and the Method of Characteristics 638.1 The simplest PDE and the method of characteristics . . . . . . . . . . . . . . . . . . . . . . . . 638.2 First-order quasilinear PDEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658.3 Burgers’s equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

9 Green’s Functions 719.1 Green’s functions for BVPs in ODEs: Special cases . . . . . . . . . . . . . . . . . . . . . . . . . 719.2 Green’s functions for BVPs in ODEs: the symmetric case . . . . . . . . . . . . . . . . . . . . . 729.3 Green’s functions for BVPs in ODEs: the general case . . . . . . . . . . . . . . . . . . . . . . . 759.4 Introduction to Green’s functions for IVPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769.5 Green’s functions for the heat equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799.6 Green’s functions for the wave equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

10 Sturm-Liouville Eigenvalue Problems 8310.2 Properties of the Sturm-Liouville operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8310.3 Numerical Methods for Sturm-Liouville problems . . . . . . . . . . . . . . . . . . . . . . . . . . 8410.4 Examples of Sturm-Liouville problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8510.5 Robin boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8510.6 Finite element methods for Robin boundary conditions . . . . . . . . . . . . . . . . . . . . . . . 8610.7 The theory of Sturm-Liouville problems: an outline . . . . . . . . . . . . . . . . . . . . . . . . . 88

11 Problems in Multiple Spatial Dimensions 8911.1 Physical models in two or three spatial dimensions . . . . . . . . . . . . . . . . . . . . . . . . . 8911.2 Fourier series on a rectangular domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9011.3 Fourier series on a disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9411.4 Finite elements in two dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9611.5 The free-space Green’s function for the Laplacian . . . . . . . . . . . . . . . . . . . . . . . . . . 10011.6 The Green’s function for the Laplacian on a bounded domain . . . . . . . . . . . . . . . . . . . 10211.7 Green’s function for the wave equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10711.8 Green’s functions for the heat equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

12 More about Fourier Series 11112.1 The complex Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11112.2 Fourier series and the FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11312.3 Relationship of sine and cosine series to the full Fourier series . . . . . . . . . . . . . . . . . . . 11612.4 Pointwise convergence of Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11612.5 Uniform convergence of Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11712.6 Mean-square convergence of Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11712.7 A note about general eigenvalue problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

13 More about Finite Element Methods 12113.1 Implementation of finite element methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12113.2 Solving sparse linear systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12213.3 An outline of the convergence theory for finite element methods . . . . . . . . . . . . . . . . . . 12413.4 Finite element methods for eigenvalue problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

Page 3: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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.

1

Page 4: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 5: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 2

Models in one dimension

2.1 Heat Flow in a bar; Fourier’s 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 Aρcu∆x are

cm2 g

cm3

J

g KKcm = J.

5. ∂u∂x

(`, t) = rAκ

, t > t0.

7. Measuring x in centimeters, the steady-state temperature distribution is u(x) = 0.1x+ 20, the solution of

−d2u

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

The heat flux is

−κdudx

(x) = −0.802 · 0.1 = −0.0802 W/cm2.

Since the area of the bar’s 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 temperaturebetween the bath and the end of the bar is u(`, t)− u`. The heat flux at x = ` is, according to Fourier’s law,

−κ∂u∂x

(`, t),

so the statement that the heat flux is proportional to the temperature flow is written

−κ∂u∂x

(`, t) = α (u(`, t)− u`) ,

where α > 0 is a constant of proportionality. This can be simplified to

αu(`, t) + κ∂u

∂x(`, t) = αu`.

The condition at the right end is similar:

αu(0, t)− κ∂u∂x

(0, t) = αu0.

(The sign change appears because, at the left end, a positive heat flux means that heat flows into the bar, whileat the right end the opposite is true.)

11. The IBVP is

∂u

∂t−D∂2u

∂x2= f(x, t), 0 < x < `, t > t0,

u(x, t0) = ψ(x), 0 < x < `,

∂u

∂x(0, t) = 0, t > t0,

∂u

∂x(`, t) = 0, t > t0.

3

Page 6: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

4 CHAPTER 2. MODELS IN ONE DIMENSION

13. (a) The rate is

−πr2D(u` − u0

`

).

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

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

−Ak(`)du

dx(`),

while the external traction results in a total force of pA (force per unit area times area). Therefore, we obtain

−Ak(`)du

dx(`) + pA = 0,

or

k(`)du

dx(`) = p.

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

3. (a) The stiffness is the ratio of the internal restoring force to the relative change in length. Therefore, if a barof length ` and cross-sectional area A is stretched to a length of 1 + p (0 < p < 1) times `, then the bar willpull back with a force of 195pA gigaNewtons. Equivalently, this is the force that must be applied to the endof 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

−195 · 109 d2u

dx2= 0, 0 < x < 1,

u(0) = 0,

195 · 109 du

dx(1) = 109.

It is easy to show by direct integration that the solution is u(x) = x/195, and therefore u(1) = 1/195. Sinceu is the displacement (in meters), the final position of the end of the bar is 1+1/195 m, that is, the stretchedbar is 196/195 m.

5. The wave equation is (7.9 · 103) ∂2u

∂t2−(1.95 · 1011) ∂2u

∂x2= f(x, t), 0 < x < 1.

The units of f are N/m3 (force per unit volume). The units of the first term on the left are

kg

m3

m

s2=

kgm/s2

m3=

N

m3,

and the units of the second term on the left are

N

m2

1

m=

N

m3.

7. (a) We have∂2u

∂t2(x, t) = −c2θ2u(x, t),

while∂2u

∂x2(x, t) = −θ2u(x, t).

Therefore,∂2u

∂t2− c2 ∂

2u

∂x2= −c2θ2u+ c2θ2u = 0.

(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 = 0,±1,±2, . . . .

Page 7: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

2.3. THE WAVE EQUATION FOR A VIBRATING STRING 5

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

∂x(`, t). (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(x, t)=f ′(x− ct), ∂2v

∂x2(x, t)=f ′′(x− ct),

∂v

∂t(x, t)=− cf ′(x− ct), ∂

2v

∂t2(x, t)=c2f ′′(x− ct),

Therefore,∂2u

∂t2(x, t)− c2 ∂

2u

∂x2(x, t) = c2f ′′(x− ct)− c2f ′′(x− ct) = 0,

as desired. Similarly, if v(x, t) = f(x+ ct), then

∂v

∂x(x, t)=f ′(x+ ct),

∂2v

∂x2(x, t)=f ′′(x+ ct),

∂v

∂t(x, t)=cf ′(x+ ct),

∂2v

∂t2(x, t)=c2f ′′(x+ ct),

and hence∂2v

∂t2(x, t)− c2 ∂

2v

∂x2(x, t) = c2f ′′(x+ ct)− c2f ′′(x+ ct) = 0.

2.4 Advection; kinematic waves

1. The solution u of

∂u

∂t+ c

∂u

∂x= 0, 0 < x < `, t > 0,

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). Thecross-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 boundarycondition u(0, t) = φ(t), and we must ask: At what time was the cross-section, now at point x at time t, found atx = 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

u(x, t) =

u0(x− ct), x− ct > 0,φ(t− 1

cx), x− ct < 0

solves the given IBVP.

3. Suppose u solves

∂u

∂t+ c

∂u

∂x= 0, −∞ < x <∞, t > 0,

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 ifx− ct ≤ a, that is, if t > (x− a)/c.

Page 8: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 9: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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) =

[x2

1 + 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 notlinear.

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 ∈ C1[a, b] is any nonzero function. Then

L(2u) = 2du

dx+ (2u)3 = 2

du

dx+ 8u3,

while

2Lu = 2du

dx+ 2u3.

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

9. Define K : C2[a, b]→ C[a, b] by

Ku = x2 d2u

dx2− 2x

du

dx+ 3u.

Then K is linear:

K(αu) = x2 d2

dx2(αu)− 2x

d

dx(αu) + 3(αu)

= αx2 d2u

dx2− 2αx

du

dx+ 3αu

= α

(x2 d

2u

dx2− 2x

du

dx+ 3u

)= αKu,

K(u+ v) = x2 d2

dx2(u+ v)− 2x

d

dx(u+ v) + 3(u+ v)

= x2

(d2u

dx2+d2v

dx2

)− 2x

(du

dx+dv

dx

)+ 3(u+ v)

=

(x2 d

2u

dx2− 2x

du

dx+ 3u

)+

(x2 d

2v

dx2− 2x

dv

dx+ 3v

)= Ku+Kv.

7

Page 10: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

8 CHAPTER 3. ESSENTIAL LINEAR ALGEBRA

Notice how we used the linearity of the derivative operator.

11. Let ρ, c, and κ be constants, and define L : C2(R2)→ C(R2) by

Lu = ρc∂u

∂t− κ∂

2u

∂x2.

We prove that L is linear as follows:

L(αu) = ρc∂

∂t(αu)− κ ∂2

∂x2(αu) = αρc

∂u

∂t− ακ∂

2u

∂x2= α

(ρc∂u

∂t− κ∂

2u

∂x2

)= αLu,

L(u+ v) = ρc∂

∂t(u+ v)− κ ∂2

∂x2(u+ v) = ρc

(∂u

∂t+∂v

∂t

)− κ

(∂2u

∂x2+∂2v

∂x2

)=

(ρc∂u

∂t− κ∂

2u

∂x2

)+

(ρc∂v

∂t− κ∂

2v

∂x2

)= Lu+ Lv.

13. (a) The proof is a direct calculation:

A(αx + βz) =

[a11 a12

a21 a22

](α

[x1

x2

]+ β

[z1

z2

])=

[a11 a12

a21 a22

] [αx1 + βz1

αx2 + βz2

]=

[a11(αx1 + βz1) + a12(αx2 + βz2)a21(αx1 + βz1) + a22(αx2 + βz2)

]=

[α(a11x1 + a12x2) + β(a11z1 + a12z2)α(a21x1 + a22x2) + β(a21z1 + a22z2)

]= α

[a11x1 + a12x2

a21x1 + a22x2

]+ β

[a11z1 + a12z2

a21z1 + a22z2

]= αAx + βAz.

This shows that the operator defined by A is linear.

(b) We have

(A(αx + βy))i =

n∑j=1

aij(αxj + βyj)

and

(αAx + βAy)i = α∑j=1

aijxj + β

n∑j=1

aijyj .

Now,

(A(αx + βy))i =

n∑j=1

aij(αxj + βyj)

=

n∑j=1

(αaijxj + βaijyj)

=

n∑j=1

αaijxj +n∑j=1

βaijyj

= α

n∑j=1

aijxj + β

n∑j=1

aijyj

= (αAx + βAy)i ,

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

Page 11: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

3.2. EXISTENCE AND UNIQUENESS OF SOLUTIONS TO AX = B 9

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 −2 −1 0 1 2 3−3

−2

−1

0

1

2

3

x1

x2

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

Ax =

[1 11 1

] [x1

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

b =

[11

],

but not for

b =

[12

].

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 C2[a, b] that satisfy

−d2u

dx2= 0

are functions of the form u(x) = C1x+ C2. The Neumann boundary condition at the left endpoint impliesthat C1 = 0, and the Dirichlet boundary condition at the right endpoint implies that C2 = 0. Therefore,only the zero function is a solution to Lmu = 0, and so the null space of Lm is trivial.

(b) Suppose f ∈ C[a, b] is given and u ∈ C2m[a, b] satisfies

−d2u

dx2(x) = f(x), a < x < b.

Integrating once yields, by the fundamental theorem of calculus,

−∫ x

a

d2u

dx2(s) ds =

∫ x

a

f(s) ds

⇒ −dudx

(x) +du

dx(a) =

∫ x

a

f(s) ds

⇒ du

dx(x) = −

∫ x

a

f(s) ds.

Page 12: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

10 CHAPTER 3. ESSENTIAL LINEAR ALGEBRA

The last step follows from the Neumann condition at x = a. We now integrate again:

du

dx(x) = −

∫ x

a

f(s) ds

⇒∫ b

x

du

dx(z) dz = −

∫ b

x

∫ z

a

f(s) ds dz

⇒ u(b)− u(x) = −∫ b

x

∫ z

a

f(s) ds dz

⇒ u(x) =

∫ a

x

∫ z

a

f(s) ds dz.

This shows that Lmu = f has a unique solution for each f ∈ C[a, b].

11. By the fundamental theorem of calculus,

u(x) =

∫ x

a

f(s) ds

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

u(x) =

∫ x

a

f(s) ds+ C

is another solution.

3.3 Basis and dimension

1. (a) Both equal (14, 4,−5).

(b) Both equal∑nj=1(vj)ixj .

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 = 0,−c1 − 3c3 = 0,

2c1 − 2c2 + 7c3 = 0.

A direct calculation (using Gaussian elimination) shows that this last system of equations has only the trivialsolution, 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 spansP2 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) = c1L1(x) + c2L2(x) + c3L3(x).

Then

q(x1) = c1L1(x1) + c2L2(x1) + c3L3(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 threedistinct points, and three points determine a quadratic (just as two points determine a line). Therefore,

p(x) = c1L1(x) + c2L2(x) + c3L3(x),

and we have shown that every p ∈ P2 can be written as a linear combination of L1, L2, L3. This completes theproof.

Page 13: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

3.4. ORTHOGONAL BASES AND PROJECTIONS 11

9. Let L : C2N [a, b] → C[a, b] be the second derivative operator. We wish to find a basis for the null space of L. A

function u ∈ C2N [a, b] belongs to the null space of L if and only if it satisfies

d2u

dx2(x) = 0 for all x ∈ [a, b],

du

dx(0) =

du

dx(`) = 0.

The only functions satisfying the differential equation are first-degree polynomials, u(x) = mx+ c. Moreover, theboundary conditions are satisfied if and only if the slope m is zero. Thus u belongs to the null space of L if andonly 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 Orthogonal bases and projections

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

v1 · v1 =1√3

1√3

+1√3

1√3

+1√3

1√3

=1

3+

1

3+

1

3= 1,

v1 · v2 =1√3

1√2

+1√3

0 +1√3

(− 1√

2

)=

1√6− 1√

6= 0,

and so forth.

(b)

x = (v1 · x)v1 + (v2 · x)v2 + (v3 · x)v3

=4√3v1 + 0v2 +

(− 2√

6

)v3.

3. We have

‖x + y‖2 = (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)

= ‖x‖2 + 2(x,y) + ‖y‖2.

Therefore,

‖x + y‖2 = ‖x‖2 + ‖y‖2

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∑i=1

αiwi.

Page 14: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

12 CHAPTER 3. ESSENTIAL LINEAR ALGEBRA

We then have

(y, z) =

(y,

n∑i=1

αiwi

)

=

n∑i=1

αi (y,wi)

=

n∑i=1

αi · 0

= 0.

This completes the proof.

7. The best approximation to the given data is y = 2.0109x− 0.0015151. See Figure 3.2.

1 1.5 2 2.5 32

2.5

3

3.5

4

4.5

5

5.5

6

x

y

Figure 3.2: The data from Exercise 3.4.7 and the best linear approximation.

9. The projection of g onto P2 is2

πq1(x) + 0q2(x) +

2√

5(π2 − 12)

π3q3(x)

or2

π+

10(π2 − 12)

π3− 60

π2 − 12

π3x+ 60

π2 − 12

π3x2.

See Figure 3.3.

0 0.2 0.4 0.6 0.8 1−0.5

0

0.5

1

y=sin(π x)

quadratic approx.

Figure 3.3: The function g(x) = sin (πx) and its best quadratic approximation over the interval [0, 1] (seeExercise 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

u1 =

[−0.8

0.6

], u2 =

[0.60.8

],

Page 15: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

3.5. EIGENVALUES AND EIGENVECTORS OF A SYMMETRIC MATRIX 13

respectively. The solution is

x =b · u1

λ1u1 +

b · u2

λ2u2 =

[11

].

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

u1 =

1√3

1√3

1√3

, u2 =

1√2

0

− 1√2

, u3 =

1√6

− 2√6

1√6

.The solution of the Ax = b is

x =b · u1

λ1u1 +

b · u2

λ2u2 +

b · u3

λ3u3 =

−3/21/25/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(Ls(j)

)k

=1

h2(− sin ((k − 1)jπh) + 2 sin (kjπh)− sin ((k + 1)jπh))

=1

h2(− sin (kjπh) cos (jπh) + cos (kjπh) sin (jπh) + 2 sin (kjπh)

− sin (kjπh) cos (jπh)− cos (kjπh) sin (jπh))

=1

h2(2− 2 cos (jπh)) sin (kjπh)

=1

h2(2− 2 cos (jπh)) s

(j)k .

Thus (Ls(j)

)k

=1

h2(2− 2 cos (jπh)) s

(j)k , k = 2, 3, . . . , n− 1.

Similar calculations show that this formula holds for k = 1 and k = n also. Therefore, s(j) is an eigenvectorof L with eigenvalue

λj =2− 2 cos (jπh)

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(1) +s(2) · xλ2

s(2) + · · ·+ s(n) · xλn

s(n).

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

Page 16: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 17: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 4

Essential Ordinary DifferentialEquations

4.1 Background

1. Define

x1 = u, x2 =du

dt.

Then

dx1

dt= x2,

dx2

dt= −1

2x1.

3. Define

x1 = u, x2 =du

dt, x3 =

d2u

dt2, x4 =

d3u

dt3.

Then

dx1

dt= x2,

dx2

dt= x3,

dx3

dt= x4,

dx4

dt= 2x3 − x1 + sin t.

5. Define

x1 = p, x2 =dp

dt, x3 = q, x4 =

dq

dt.

Then the first-order system is

dx1

dt= x2,

m1dx2

dt= f1(x1, x3, x2, x4),

dx3

dt= x4,

m2dx4

dt= f2(x1, x3, x2, x4).

7. Let u1(t) = e−t, u2(t) = e−2t.

15

Page 18: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

16 CHAPTER 4. ESSENTIAL ORDINARY DIFFERENTIAL EQUATIONS

(a) We have

du1

dt(t) = −e−t, d

2u1

dt2(t) = e−t,

and therefore

d2u1

dt2(t) + 3

du1

dt(t) + 2u(t) = e−t − 3e−t + 2e−t = 0.

Similarly,

du2

dt(t) = −2e−2t,

d2u2

dt2(t) = 4e−2t,

and thus

d2u2

dt2(t) + 3

du2

dt(t) + 2u(t) = 4e−2t − 6e−2t + 2e−2t = 0.

(b) The Wronskian of u1, u2 is

W (t) =

∣∣∣∣ u1(t) u2(t)du1dt

(t) du2dt

(t)

∣∣∣∣ =

∣∣∣∣ e−t e−2t

−e−t −2e−2t

∣∣∣∣ = −e−3t.

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) u2(t0)du1dt

(t0) du2dt

(t0)

∣∣∣∣ 6= 0.

We wish to prove that u1, u2 is linearly independent. We argue by contradiction, and suppose u1, u2 islinearly dependent. Then there exist c1, c2 ∈ R such that c1u1+c2u2 = 0. This means that c1u1(t)+c2u2(t) =0 for all t in the given interval, which in turn implies that c1

du1dt

(t) + c2du2dt

(t) = 0 for all t. But then, takingt = t0, we obtain

c1u1(t0) + c2u2(t0) = 0,

c1du1

dt(t0) + c2

du2

dt(t0) = 0.

In matrix-vector form, this system is[u1(t0) u2(t0)du1dt

(t0) du2dt

(t0)

] [c1c2

]=

[00

].

Since (c1, c2) 6= (0, 0), this implies that the matrix[u1(t0) u2(t0)du1dt

(t0) du2dt

(t0)

]is singular, contradicting the assumption that its determinant is nonzero. This contradiction completes theproof.

(b) Let u1(t) = cos (t), u2(t) = cos (2t). Then∣∣∣∣ u1(t) u2(t)du1dt

(t) du2dt

(t)

∣∣∣∣ =

∣∣∣∣ cos (t) cos (2t)− sin (t) −2 sin (2t)

∣∣∣∣ = cos (2t) sin (t)− 2 cos (t) 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 forall t, unless u1 and u2 are both solutions to the same second-order linear differential equation.

Page 19: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

4.2. SOLUTIONS TO SOME SIMPLE ODES 17

4.2 Solutions to some simple ODEs

1. (a) We first note that the zero function is a solution of (4.9), so S is nonempty. If u, v ∈ S and α, β ∈ R, thenw = αu+ βv satisfies

ad2w

dt2+ b

dw

dt+ cw = a

d2

dt2[αu+ βv] + b

d

dt[αu+ βv] + c(αu+ βv)

= a

(αd2u

dt2+ β

d2v

dt2

)+ b

(αdu

dt+ β

dv

dt

)+ c(αu+ βv)

= α

(ad2u

dt2+ b

du

dt+ cu

)+ β

(ad2v

dt2+ b

dv

dt+ cv

)= α · 0 + β · 0 = 0.

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 twofunctions. Thus S is finite-dimensional and it has dimension at most 2. Moreover, it is easy to see that eachof the sets er1t, er2t (r1 6= r2),

eµt cos (λt), eµt 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) = c1ert + c2te

rt

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 ofc1, c2 such that u(0) = k1, du/dt(0) = k2. We have

du

dt(t) = rc1e

rt + c2ert + rc2te

rt.

Therefore, the equations u(0) = k1, du/dt(0) = k2 simplify to[1 0r 1

]c = k.

Since the coefficient matrix is obviously nonsingular (regardless of the value of r), there is a unique solution c1, c2for 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 anothersolution.

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

d

dt

[∫ t

t0

ea(t−s)f(s) ds

]=

d

dt

[eat∫ t

t0

e−asf(s) ds

]= aeat

∫ t

t0

e−asf(s) ds+ eate−atf(t)

= a

∫ t

t0

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

Therefore, with

u(t) = u0ea(t−t0) +

∫ t

t0

ea(t−s)f(s) ds,

we have

du

dt(t) = au0e

a(t−t0) + a

∫ t

t0

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

= au(t) + f(t).

Thus u satisfies the differential equation. We also have

u(t0) = u0ea(t0−t0) +

∫ t0

t0

ea(t−s)f(s) ds = u0 + 0 = u0,

so the initial condition holds as well.

Page 20: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

18 CHAPTER 4. ESSENTIAL ORDINARY DIFFERENTIAL EQUATIONS

9. u(t) = 12

sin2 (t)

11. u(t) = 12

(e−t + cos (t) + sin (t)

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

2/2.

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

(c) The solution is y(t) = 1/2 + (1/2)e−t2

.

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

ad2u

dt2+ b

du

dt+ cu = f(t),

where u1, u2 are solutions of the homogeneous version of this ODE, and assume that

dc1dtu1 +

dc2dtu2 = 0.

We then have

du

dt= c1

du1

dt+ c2

du2

dt,

d2u

dt2= c1

d2u1

dt2+ c2

d2u2

dt2+dc1dt

du1

dt+dc2dt

du2

dt.

Substituting into the ODE, we obtain

a

(c1d2u1

dt2+ c2

d2u2

dt2+dc1dt

du1

dt+dc2dt

du2

dt

)+ b

(c1du1

dt+ c2

du2

dt

)+ c(c1u1 + c2u2) = f(t)

⇒c1(ad2u1

dt2+ b

du1

dt+ cu1

)+ c2

(ad2u2

dt2+ b

du2

dt+ cu2

)+ a

(dc1dt

du1

dt+dc2dt

du2

dt

)= f(t)

⇒a(dc1dt

du1

dt+dc2dt

du2

dt

)= f(t)

⇒dc1dt

du1

dt+dc2dt

du2

dt= a−1f(t),

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

ad2u1

dt2+ b

du1

dt+ cu1 = 0, a

d2u2

dt2+ b

du2

dt+ cu2 = 0.

17. Let us define v(s) = u(es); then u(t) = v(ln (t)). It follows that

du

dt(t) =

1

t

dv

ds(ln (t)),

d2u

dt2(t) =

1

t2d2v

ds2(ln (t))− 1

t2dv

ds(ln (t)).

It follows that

t2d2u

dt2(t) + at

du

dt(t) + bu(t) = 0

⇔d2v

ds2(ln (t))− dv

ds(ln (t)) + a

dv

ds(ln (t)) + bv(ln (t)) = 0

⇔d2v

ds2(ln (t)) + (a− 1)

dv

ds(ln (t)) + bv(ln (t)) = 0

⇔d2v

ds2(s) + (a− 1)

dv

ds(s) + bv(s) = 0.

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

Page 21: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

4.3. LINEAR SYSTEMS WITH CONSTANT COEFFICIENTS 19

4.3 Linear systems with constant coefficients

1. The solution is

x(t) =1√3u1 −

1√2e−tu2 +

1√6e−2tu3

=

13− 1

2e−t + 1

6e−2t

13− 1

3e−2t

13

+ 12e−t + 1

6e−2t

.3. The general solution is

x(t) =

[c1e

t + c2e−t

c1et − c2e−t

].

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

7.

x(t) =1

60

55− 3e−2t − 45e−t + 20t− 7 cos (t)− 11 sin (t)10 + 6e−2t + 20t− 16 cos (t)− 8 sin (t)

−5− 3e−2t + 45e−t + 20t− 37 cos (t) + 19 sin (t)

9. (a) The solution is

x(t) =3

2e−t +

1

2e3t, y(t) =

3

2e−t − 1

2e3t.

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, whilethe first species increases without bound.

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

x(t) =1

2

((r + s)e−t + (r − s)e3t) , y(t) =

1

2

((r + s)e−t + (s− r)e3t) .

Therefore, if r = s, both populations decay to zero exponentially; that is, both species die out.

11. Assume v(t; s) satisfiesd2v

dt2+ θ2v = 0, v(0; s) = 0,

dv

dt(0; s) = 0

for all s, and define

u(t) =

∫ t

0

v(t− s; s) ds.

Then

du

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

∫ t

0

dv

dt(t− s; s) ds =

∫ t

0

dv

dt(t− s; s) ds,

d2u

dt2(t) =

dv

dt(0; t) +

∫ t

0

d2v

dt2(t− s; s) ds = f(t) +

∫ t

0

d2v

dt2(t− s; s) ds

(using the fact that v(0; t) = 0 and dvdt

(0; t) = 0 for all t). We then have

d2u

dt2(t) + θ2u(t) = f(t) +

∫ t

0

d2v

dt2(t− s; s) ds+ θ2

∫ t

0

v(t− s; s) ds

= f(t) +

∫ t

0

d2v

dt2(t− s; s) + θ2v(t− s; s)

ds

= f(t)

sinced2v

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

Also,

u(t) =

∫ 0

0

v(t− s; s) ds = 0,du

dt(t) =

∫ 0

0

dv

dt(t− s; s) ds = 0,

and thus u satisfies both the differential equations and the initial conditions.

Page 22: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

20 CHAPTER 4. ESSENTIAL ORDINARY DIFFERENTIAL EQUATIONS

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

dku

dtk+ ak−1(t)

dk−1u

dtk−1+ · · ·+ a1(t)

du

dt+ a0(t)u = 0

and also the initial conditions

u(s) = 0,du

dt(s) = 0, . . . ,

dk−2u

dtk−2(s) = 0,

dk−1u

dtk−1(s) = f(s).

Define

u(t) =

∫ t

0

v(t; s) ds.

Thendu

dt(t) = v(t; t) +

∫ t

0

dv

dt(t; s) ds =

∫ t

0

dv

dt(t; s) ds

(since v(t; t) = 0 for all t). Similarly,

d2u

dt2(t) =

dv

dt(t; t) +

∫ t

0

d2v

dt2(t; s) ds =

∫ t

0

d2v

dt2(t; s) ds,

...

dk−1u

dtk−1(t) =

dk−2v

dtk−2(t; t) +

∫ t

0

dk−1v

dtk−1(t; s) ds =

∫ t

0

dk−1v

dtk−1(t; s) ds

and finallydku

dtk(t) =

dk−1v

dtk−1(t; t) +

∫ t

0

dkv

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

∫ t

0

dkv

dtk(t; s) ds.

We then see that

dku

dtk+ ak−1(t)

dk−1u

dtk−1+ · · ·+ a1(t)

du

dt+ a0(t)u

=f(t) +

∫ t

0

dkv

dtk(t; s) + ak−1(t)

dk−1v

dtk−1(t; s) + · · ·+ a1(t)

dv

dt(t; s) + a0(t)v(t; s)

ds

=f(t),

sincedkv

dtk(t; s) + ak−1(t)

dk−1v

dtk−1(t; s) + · · ·+ a1(t)

dv

dt(t; s) + a0(t)v(t; s) = 0

by assumption. Also,dju

dtj(0) =

∫ 0

0

djv

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

15. The solution to

d2u

dt2+ 3

du

dt+ 2u = 0,

u(0) = 0,

du

dt(0) = f(s)

is given by v(t; s) = (e−t − e−2t)f(s). Therefore, by Duhamel’s principle, the solution of

d2u

dt2+ 3

du

dt+ 2u = f(t),

u(0) = 0,

du

dt(0) = 0

is

u(t) =

∫ t

0

v(t− s; s) ds =

∫ t

0

(e−(t−s) − e−2(t−s)

)f(s) ds.

Page 23: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

4.4. NUMERICAL METHODS FOR INITIAL VALUE PROBLEMS 21

4.4 Numerical methods for initial value problems

1. (a) Four steps of Euler’s 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.

Euler’s method gives no correct digits, the improved Euler method gives one correct digit, and RK4 gives threecorrect 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= u2,

du2

dt= u1 + 2u4 −

µ2(u1 + µ1)

r1(u1, u3)3− µ1(u1 − µ2)

r2(u1, u3)3,

du3

dt= u4,

du4

dt= −2u2 + u3 −

µ2u3

r1(u1, u3)3− µ1u3

r2(u1, u3)3.

(b) The routine ode45 from MATLAB (version 5.3) required 421 steps to produce a graph with the endingpoint apparently coinciding with the initial value. The graph of y(t) versus x(t) is given in Figure 4.1. Thegraphs 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.5 −1 −0.5 0 0.5 1 1.5−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

x

y

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

0 1 2 3 4 5 6 7−2

0

2

t

x(t)

0 1 2 3 4 5 6 7−1

0

1

t

y(t)

0 1 2 3 4 5 6 70

0.05

0.1

0.15

Step index

Tim

e s

tep

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 · 10−4, and using this step length over the entire intervalof [0, T ] would require almost 19000 steps. This is to be compared to the 421 steps taken by the adaptivealgorithm. (Note: The exact results for minimum step size, etc., will differ according to the algorithm andtolerances used.)

Page 24: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 iswell-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

dt(t) =

d

dt[u(t− (t1 − t0))]

=du

dt(t− (t1 − t0))

= 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= t,

u(0) = 1,

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

dv

dt= t,

v(1) = 1

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

u(t− (1− 0)) = u(t− 1) =1

2(t− 1)2 + 1.

7. The exact solution is

x(t) =

2− 2e−t, 0 < t < ln 2,

12et, t > ln 2.

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

∆t Error

1/4 2.4332e-051/8 1.3697e-061/16 8.1251e-081/32 4.9475e-091/64 3.0522e-101/128 1.8952e-11

By inspection, we see that as ∆t is cut in half, the error is reduced by a factor of approximately 16, asexpected for O(∆t4) convergence.

(b) The following errors were obtained at t = 2.0:

Page 25: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

4.5. STIFF SYSTEMS OF ODES 23

∆t Error

1/4 5.0774e-031/8 3.2345e-031/16 3.1896e-041/32 1.0063e-041/64 8.9026e-061/128 3.4808e-06

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

4.5 Stiff systems of ODEs

1. (a) The exact solution is

x(t) =1

2

[e−t + et

e−t − 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

x(t) =1

2

[3e−t − e−100t

3e−t + e−100t

].

(b) By trial and error, we find that ∆t ≤ 0.02 is necessary for stability. Specifically, integrating from t = 0 tot = 1, n = 49 (i.e. ∆t = 1/49) yields

‖x49‖ > ‖x0‖ ,while n ≥ 50 yields

‖xn‖ ≤ ‖x0‖ .

(c) With xi+1 = xi + ∆tAxi and y(i)1 = u1 · xi, we have

u1 · xi+1 = u1 · xi + ∆tu1 ·Axi

⇒ y(i+1)1 = y

(i)1 + ∆t(Au1) · xi

⇒ y(i+1)1 = y

(i)1 + ∆tλ1u1 · xi

⇒ y(i+1)1 = y

(i)1 + ∆tλ1y

(i)1

⇒ y(i+1)1 = (1 + ∆tλ1)y

(i)1 .

A similar calculation shows thaty

(i+1)2 = (1 + ∆tλ2)y

(i)2 .

For stability, we need

|1 + ∆tλ1| ≤ 1,

|1 + ∆tλ2| ≤ 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, justas was determined by experiment.

(d) For the backward Euler method, a similar calculation shows that

y(i+1)1 = (1−∆tλ1)−1y

(i)1 ,

y(i+1)2 = (1−∆tλ2)−1y

(i)2 .

Stability is guaranteed for any ∆t, since|1−∆tλi|−1 < 1

for every ∆t > 0.

Page 26: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 27: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 5

Boundary Value Problems in Statics

5.1 The analogy between BVPs and linear algebraic systems

1. (a) Since MD is linear, it suffices to show that the null space of MD is trivial. If MDu = 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 isthe zero function. Thus N (MD) = 0.

(b) If u ∈ C1D[0, `] and MDu = f , then we have

du

dx(x) = f(x), 0 < x < ` and u(0) = 0,

which imply that

u(x) =

∫ x

0

f(s) ds.

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

0

f(s) ds = 0.

If f ∈ C[0, `] does not satisfy this condition, then it is impossible for MDu = 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. Thereforev−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 thezero 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 precedingExample 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

(`

2

)= 0⇒ a = 0.

Then u(x) = b, and ∫ `

0

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

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

25

Page 28: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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, anddu

dx(`) = 0⇒ a = 0.

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

5. The condition ∫ `

0

(du

dx(x)

)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 thatu is the zero function. But, by assumption, u is nonzero (we assumed that (u, u) = 1). Therefore, (5.1) cannothold.

7. (a) If Lmu = 0, then u has the form u(x) = ax + b. The first boundary condition, du/dx(0) = 0, implies thata = 0, and then the second boundary condition, u(`) = 0, yields b = 0. Therefore, u is the zero functionand N (Lm) is trivial.

(b) For any f ∈ C[0, `], the function

u(x) =

∫ `

x

∫ z

0

f(s) ds dz

belongs to C2m[0, `] and satisfies

−d2u

dx2(x) = f(x), 0 < x < `.

This shows that Lmu = f has a solution for any f ∈ C[0, `], and therefore R(Lm) = C[0, `].

(c) Suppose u, v ∈ C2m[0, `]. Then

(Lmu, v) = −∫ `

0

d2u

dx2(x)v(x) dx

= −[du

dx(x)v(x)

]`0

+

∫ `

0

du

dx(x)

dv

dx(x) dx

=

∫ `

0

du

dx(x)

dv

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

=

[u(x)

dv

dx(x)

]`0

−∫ `

0

u(x)d2v

dx2(x) dx

= −∫ `

0

u(x)d2v

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

= (u, Lmv).

Thus Lm is symmetric.

(d) Suppose λ is an eigenvalue of Lm with corresponding eigenfunction u, and assume that u has been normalizedso that (u, u) = 1. Then

λ = λ(u, u) = (λu, u) = (Lmu, u)

= −∫ `

0

d2u

dx2(x)u(x) dx

= −[du

dx(x)u(x)

]`0

+

∫ `

0

(du

dx(x)

)2

dx

=

∫ `

0

(du

dx(x)

)2

dx (since u(`) = 0, du/dx(0) = 0)

> 0.

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

Page 29: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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

(Mu, v) =7

30,

but

(u,Mv) =4

15.

11. (a) Suppose u, v ∈ C2R[0, `]. Then

(LRu, v) = −κ∫ `

0

d2u

dx2(x)v(x) dx

= −[κdu

dx(x)v(x)

]`0

+ κ

∫ `

0

du

dx(x)

dv

dx(x) dx

= −[κdu

dx(x)v(x)

]`0

+

[κu(x)

dv

dx(x)

]`0

− κ∫ `

0

u(x)d2v

dx2(x) dx

= −κdudx

(`)v(`) + κdu

dx(0)v(0) + u(`)κ

dv

dx(`)

−u(0)κdv

dx(0) + (u, LRv).

Applying the boundary conditions on u, v, we obtain

−κdudx

(`)v(`) + κdu

dx(0)v(0) + u(`)κ

dv

dx(`)− u(0)κ

dv

dx(0)

= αu(`)v(`) + αu(0)v(0)− αu(`)v(`)− αu(0)v(0) = 0,

so (LRu, v) = (u, LRv), as desired.

(b) If LRu = 0, then u must be a first degree polynomial: u(x) = ax+ b. The boundary conditions imply thata 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

(un, um) =

∫ `

0

sin(nπx

`

)sin(mπx

`

)dx

=1

2

∫ `

0

cos

((n−m)πx

`

)− cos

((n+m)πx

`

)dx

=1

2

[`

(n−m)πsin

((n−m)πx

`

)− `

(n+m)πsin

((n+m)πx

`

)]`0

.

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

4`2, cos

((2n− 1)πx

2`

), n = 1, 2, 3, . . . .

Page 30: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

28 CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS

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

r1 =1−√

21− 4λ

2, r2 =

1 +√

21− 4λ

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) = c1ex/2 + c2xe

x/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 solutionof the ODE is

u(x) = c1er1x + c2e

r2x.

The boundary conditions lead to the system

c1 + c2 = 0,

c1r1er1 + c2r2e

r2 = 0.

This system has the unique solution c1 = c2 = 0, so there is no nonzero solution for λ < 21/4. Hence no λ < 21/4is an eigenvalue.

Case 3: λ > 21/4. In this case, the roots are complex conjugate:

r1 =1

2− θi, r2 =

1

2+ θi, θ =

√4λ− 21

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 solutions0 < θ1 < θ2 < · · · , with

θk ∈(

2k − 1

2π,

2k + 1

), k = 1, 2, . . . .

Define λk by

θk =

√4λk − 21

2,

that is,

λk = θ2k +

21

4, k = 1, 2, . . . .

Then λk, k = 1, 2, . . ., are eigenvalues, and the corresponding eigenfunctions are

vk(x) = sin (θkx)ex/2.

Using Newton’s method, we find thatθ1

.= 1.8366, θ2

.= 4.8158,

which yieldsλ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.

Page 31: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

5.3. SOLVING THE BVP USING FOURIER SERIES 29

7. (a)∑∞n=1

2(−1)n+1

nπsin (nπx)

(b)∑∞n=1

4 sin (nπ2 )n2π2 sin (nπx)

(c)∑∞n=1

12(−1)n+1

n3π3 sin (nπx)

(d)∑∞n=1

720(−1)n+1

n5π5 sin (nπx)

The errors in approximating the original functions using 10 terms of the Fourier sine series are graphed in Figure5.1.

0 0.5 1−0.5

0

0.5

1

x

0 0.5 1−0.01

0

0.01

0.02

0.03

x

0 0.5 1−1

−0.5

0

0.5

1

1.5x 10

−3

x

0 0.5 1−5

0

5x 10

−5

x

Figure 5.1: Errors in approximating four functions by 10 terms of their Fourier sine series (see Exercise5.2.7). Top left: g(x) = x; Top right: h(x) = 1

2 −∣∣x− 1

2

∣∣; Bottom left: m(x) = x − x3; Bottom right:k(x) = 7x− 10x3 + 3x5.

9. sin (3πx) (That is, all of the Fourier sine coefficients are zero, except the third, which is one.)

11. The series have the form∞∑n=1

an cos

((2n− 1)πx

2

),

where

(a) an = − 4(2+(−1)n(2n−1)π)

π2(2n−1)2;

(b) an = 32 cos ((2n−1)π/4) sin2 ((2n−1)π/8)

π2(2n−1)2;

(c) an = − 8(24+12(−1)n(2n−1)π+(2n−1)2π2)π4(2n−1)4

;

(d) an = − 8(5760+2880(−1)n(2n−1)π+240(2n−1)2π2+7(2n−1)4π4)π6(2n−1)6

.

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

5.3 Solving the BVP using Fourier series

1. (a)∑∞n=1

2(1−(−1)n)

n3π3 sin (nπx)

(b) x+∑∞n=1

2(1−(−1)n)

n3π3 sin (nπx)

3. (a)∑∞n=1

32(−1)n+1

(2n−1)4π4 sin(

(2n−1)πx2

)(b) 1 +

∑∞n=1

16((−1)nπ+2(−1)n+1nπ−2)(2n−1)4π4 cos

((2n−1)πx

2

)(c)

∑∞n=1

2(1−(−1)n)

nπ(2+n2π2)sin (nπx)

Page 32: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

30 CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS

0 0.5 1−0.5

0

0.5

1

x

0 0.5 1−0.04

−0.02

0

0.02

0.04

x

0 0.5 1−0.03

−0.02

−0.01

0

0.01

x

0 0.5 1−0.15

−0.1

−0.05

0

0.05

x

Figure 5.2: Errors in approximating four functions by 10 terms of their Fourier quarter-wave cosine series (seeExercise 5.2.11). Top left: g(x) = x; Top right: h(x) = 1

2 −∣∣x− 1

2

∣∣; Bottom left: m(x) = x−x3; Bottom right:k(x) = 7x− 10x3 + 3x5.

(d) x+∑∞n=1

2(−1)n

nπ(1+n2π2)sin (nπx)

5. We have

d2u

dx2(x) = −x, 0 < x < 1,

so

du

dx(x) =

du

dx(0) +

∫ x

0

d2u

dx2(s) dx

=du

dx(0)−

∫ x

0

s dx

=du

dx(0)− x2

2.

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

u(x) = u(0) +

∫ x

0

du

dx(s) ds

= 0 +

∫ x

0

C − s2

2

ds

= Cx− x3

6.

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

u(x) =1

6

(x− x3) .

7. The Fourier quarter-wave sine coefficients of −Td2u/dx2 are

bn = −2T

`

∫ `

0

d2u

dx2(x) sin

((2n− 1)πx

2`

)dx,

while those of u are

an =2

`

∫ `

0

u(x) sin

((2n− 1)πx

2`

)dx.

Page 33: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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:

−2T

`

∫ `

0

d2u

dx2(x) sin

((2n− 1)πx

2`

)dx

= −2T

`

[du

dx(x) sin

((2n− 1)πx

2`

)]`x=0

− (2n− 1)π

2`

∫ `

0

du

dx(x) cos

((2n− 1)πx

2`

)dx

=

2T (2n− 1)π

2`2

∫ `

0

du

dx(x) cos

((2n− 1)πx

2`

)dx

(since sin (0) = du/dx(`) = 0)

=2T (2n− 1)π

2`2

[u(x) cos

((2n− 1)πx

2`

)]`x=0

+(2n− 1)π

2`

∫ `

0

u(x) sin

((2n− 1)πx

2`

)dx

=

T (2n− 1)2π2

4`22

`

∫ `

0

u(x) sin

((2n− 1)πx

2`

)dx

(since u(0) = cos ((2n− 1)π/2) = 0)

=T (2n− 1)2π2

4`2an.

This gives the desired result. (Actually, since it is known that the negative second derivative operator is symmetricunder the mixed boundary conditions, we can just appeal to (5.25), which is the above calculation writtenabstractly.)

9. Let a1, a2, a3, . . . be the Fourier quarter-wave sine coefficients of u; then

−κd2u

dx2(x) =

∞∑n=1

κ(2n− 1)2π2

2002an sin

((2n− 1)πx

200

),

where κ = 3/2. We also have

0.001 =

∞∑n=1

0.004

(2n− 1)πsin

((2n− 1)πx

200

).

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

u(x) =∞∑n=1

3.2 · 102

3(2n− 1)3π3sin

((2n− 1)πx

200

).

The temperature distribution is graphed in Figure 5.3.

0 20 40 60 80 1000

0.5

1

1.5

2

2.5

3

3.5

x

tem

pe

ratu

re

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

Page 34: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

32 CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS

5.4 Finite element methods for BVPs

1. Suppose f, g ∈ C2D[0, `], so that

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

Then (− d

dx

(k(x)

df

dx

), g

)= −

∫ `

0

d

dx

(k(x)

df

dx(x)

)g(x) dx

= − k(x)df

dx(x)g(x)

∣∣∣∣`0

+

∫ `

0

k(x)df

dx(x)

dg

dx(x) dx (integration by parts)

=

∫ `

0

k(x)df

dx(x)

dg

dx(x) dx (using g(0) = g(`) = 0)

= k(x)f(x)dg

dx(x)

∣∣∣∣`0

−∫ `

0

f(x)d

dx

(k(x)

dg

dx(x)

)dx (integration by parts)

= −∫ `

0

f(x)d

dx

(k(x)

dg

dx(x)

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

=

(f,− d

dx

(k(x)

dg

dx

)).

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

5. Let v ∈ C2D[0, `] be a test function. We have

− d

dx

(k(x)

du

dx(x)

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

⇒ − d

dx

(k(x)

du

dx(x)

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

⇒ −∫ `

0

d

dx

(k(x)

du

dx(x)

)v(x) dx+

∫ `

0

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

∫ `

0

f(x)v(x) dx

⇒ −k(x)du

dx(x)v(x)

∣∣∣∣`0

+

∫ `

0

k(x)du

dx(x)

dv

dx(x) dx+

∫ `

0

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

∫ `

0

f(x)v(x) dx

⇒∫ `

0

k(x)du

dx(x)

dv

dx(x) dx+

∫ `

0

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

∫ `

0

f(x)v(x) dx

⇒∫ `

0

k(x)

du

dx(x)

dv

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

dx =

∫ `

0

f(x)v(x) dx.

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

find u ∈ C2D[a, b] such that

∫ `

0

k(x)

du

dx(x)

dv

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

dx =

∫ `

0

f(x)v(x) dx for all v ∈ C2D[a, b].

7. The calculation is the same as in Exercise 5; we integrate by parts only in the first integral, and obtain thefollowing weak form: Find u ∈ C2

D[a, b] such that∫ `

0

k(x)

du

dx(x)

dv

dx(x) + c(x)

du

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

dx =

∫ `

0

f(x)v(x) dx for all v ∈ C2D[a, b].

Notice that now the left-hand side is not symmetric in u and v.

9. Repeating the calculation beginning on page 167, we obtain

∂t

[1

2

∫ `

0

Aρ(x)

(∂u

∂t

)2

dx+1

2

∫ `

0

Ak(x)

(∂u

∂x

)2

dx

]

= −∫ `

0

c

(∂u

∂t

)2

dx, t > 0.

Page 35: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;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 totalenergy is always decreasing.

5.5 The Galerkin method

1. (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. LetFN = span sin (πx), sin (2πx), . . . , sin (Nπx) .

We will apply the Galerkin method to the BVP

−k d2u

dx2= f(x), 0 < x < `,

u(0) = 0,

u(`) = 0,

using FN as the approximating subspace. The weak form of the BVP is

find u ∈ C2D[a, b] such that

∫ `

0

kdu

dx(x)

dv

dx(x) dx =

∫ `

0

f(x)v(x) dx for all v ∈ C2D[a, b],

and the Galerkin method takes the form

find vN =

N∑j=1

uj sin (jπx) such that

∫ `

0

kdvndx

(x)dv

dx(x) dx =

∫ `

0

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

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

Kij =

∫ `

0

kdφjdx

(x)dφidx

(x) dx, Fi =

∫ `

0

f(x)φi(x) dx

and φj(x) = sin (jπx). We have∫ `

0

kdφjdx

(x)dφidx

(x) dx =

∫ `

0

kijπ2 cos (jπx) cos (iπx) dx =

kj2π2

2, i = j,

0, i 6= j.

This last step follows from the fact that the functions cos (πx), cos (2πx), . . . , cos (Nπx) are mutually orthogonalwith respect to the L2(0, 1) inner product. Also, notice that∫ `

0

f(x)φj(x) dx =

∫ `

0

f(x) sin (jπx) dx =cj2,

where cj is the Fourier sine coefficient of f . Since K is diagonal, it is easy to solve Ku = f :

uj =cj/2

kj2π2/2=

cjkj2π2

.

Thus

vN (x) =

N∑j=1

cjkj2π2

sin (jπx).

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. Everyfunction 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.

Page 36: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 theenergy inner product and norm). Therefore, every polynomial of the form (9− 3e)x2 + (4e− 10)x+ C ∈ Sis 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) = u1p(x) + u2q(x), whereKu = f . The stiffness matrix K is

K =

[ ∫ 1

0(1 + x) dp

dx(x) dp

dx(x) dx

∫ 1

0(1 + x) dq

dx(x) dp

dx(x) dx∫ 1

0(1 + x) dp

dx(x) dq

dx(x) dx

∫ 1

0(1 + x) dq

dx(x) dq

dx(x) dx

]

=

[12

− 130

− 130

340

],

and the load vector f is

f =

[ ∫ 1

0xp(x) dx∫ 1

0xq(x) dx

]=

[112

− 1120

].

Therefore,

u.=

[0.16412

−0.038168

].

The exact solution is

u(x) = −1

4x2 +

1

2x− 1

4 ln 2ln (1 + x).

The exact and approximate solutions are graphed in Figure 5.4.

0 0.2 0.4 0.6 0.8 10

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

exactapproximate

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 nonzeroentries below and in the same column, and a backward phase, in which the diagonal entries are used toeliminate nonzero entries above and in the same column. During the forward phase, at a typical step, thereis only 1 nonzero entry below the diagonal, and only 5 arithmetic operations are required to eliminate it (1division to compute the multiplier, and 2 multiplications and 2 additions to add a multiple of the currentrow to the next). Thus the forward phase requires O(5n) operations. A typical step of the backward phaserequires 3 arithmetic operations (a multiplication and an addition to adjust the right-hand side and a divisionto 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 timesas long, or 1 second, to solve a 10000× 10000 tridiagonal system.

Page 37: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

5.6. PIECEWISE POLYNOMIALS AND THE FINITE ELEMENT METHOD 35

5.6 Piecewise polynomials and the finite element method

1. We wish to compute the piecewise linear finite element approximation to the solution of

−d2u

dx2= x, 0 < x < 1,

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

K =

8 −4 0−4 8 −4

0 −4 8

(as computed in Example 5.18 in the text). The load vector F ∈ R3 is defined by

Fi =

∫ 1

0

f(x)φi(x) dx.

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

u =

5

1281167

128

.The exact solution to the BVP is u(x) = (x− x3)/6. Figure 5.5 shows the exact solution and the piecewise linearapproximation.

0 0.2 0.4 0.6 0.8 10

0.01

0.02

0.03

0.04

0.05

0.06

0.07

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 maximum error

10 1.6586 · 10−3

20 4.3226 · 10−4

40 1.1036 · 10−4

80 2.7881 · 10−5

We see that, when n is doubled, the error decreases by a factor of approximately four. Thus

error = O

(1

n2

).

5. The exact solution is u(x) = x(1− x3)/12. Here are the errors for n = 10, 20, 40, 80:

Page 38: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

36 CHAPTER 5. BOUNDARY VALUE PROBLEMS IN STATICS

n maximum error

10 1.1286 · 10−3

20 2.9710 · 10−4

40 7.6186 · 10−5

80 1.9288 · 10−5

We see that, when n is doubled, the error descreases by a factor of approximately four. Thus

error = O

(1

n2

).

7. The weak form is

find u ∈ V such that

∫ `

0

k(x)

du

dx(x)

dv

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

dx

=

∫ `

0

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

The bilinear form is

a(u, v) =

∫ `

0

k(x)

du

dx(x)

dv

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

dx.

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

−d2u

dx2+ 2u =

1

2− x, 0 < x < 1,

u(0) = 0,

u(1) = 0.

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

u ∈ C2D[0, 1],

∫ 1

0

du

dx(x)

dv

dx(x) dx+

∫ 1

0

2u(x)v(x) dx =

∫ 1

0

(1

2− x)v(x) dx for all v ∈ C2

D[a, b],

and the Galerkin method requires the solution of

vn ∈ Vn,∫ 1

0

dvndx

(x)dv

dx(x) dx+ 2

∫ 1

0

vn(x)v(x) dx =

∫ 1

0

(1

2− x)v(x) dx for all v ∈ Vn.

The second integral on the left side of the variational equation leads to the matrix M ∈ R(n−1)×(n−1), where

Mij =

∫ 1

0

φj(x)φi(x) dx

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

Mij =

2h3, j = i,

−frach6, 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 loadvector f is defined by

fi =

∫ 1

0

(1

2− x)φi(x) dx =

h

2(1− 2ih), i = 1, 2, . . . , n− 1.

After solving (K + 2M)u = f to get the piecewise linear approximation for each n, we estimate the maximumerror by evaluating both the exact function and the approximation on a finer mesh. The results are shown in thefollowing table.

n error

10 5.4953 · 10−4

20 1.4660 · 10−4

40 3.7842 · 10−5

80 9.6121 · 10−6

160 2.4222 · 10−6

320 6.0794 · 10−7

Page 39: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 appearsthat the error is O(1/n2).

Page 40: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 41: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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

−Dd2u

dx2= 10−7, 0 < x < 100,

u(0) = 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 thesteady-state solution is

us(x) =

∞∑n=1

2 · 10−3 (1− (−1)n)

Dn3π3sin(nπx

100

).

3. The solution is

u(x, t) =

∞∑n=1

2(−1)n+1

nπe−n

2π2t sin (nπx).

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

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

x

u(⋅,0)

u(⋅,0.1)

Figure 6.1: The snapshot u(·, 0.1), together with the initial temperature distribution, for Exercise 6.1.3.

5. Withp(x, t) = g(t) +

x

`(h(t)− g(t))

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

ρc∂v

∂t− κ∂

2v

∂x2= ρc

∂u

∂t− κ∂

2u

∂x2−(ρc∂p

∂t− κ∂

2p

∂x2

)= f(x, t)− ρc

(dg

dt(t) +

x

`

(dh

dt(t)− dg

dt(t)

)).

39

Page 42: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

40 CHAPTER 6. HEAT FLOW AND DIFFUSION

We also havev(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

dt(t) +

x

`

(dh

dt(t)− dg

dt(t)

))and

φ(x) = ψ(x)− g(t0)− x

`(h(t0)− g(t0)).

Then v satisfies

ρc∂v

∂t− κ∂

2v

∂x2= g(x, t), 0 < x < `, t > 0,

v(x, t0) = φ(x), 0 < x < `,

v(0, t) = 0, t > t0,

v(`, t) = 0, t > t0.

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

∂t− ∂2v

∂x2= x sin (t), 0 < x < 1, t > 0,

v(x, 0) = 0, 0 < x < 1,

v(0, t) = 0, t > 0,

v(1, t) = 0, t > 0.

This IBVP has solution

v(x, t) =

∞∑n=1

an(t) sin (nπx),

where

an(t) =2(−1)n

nπ (n4π4 + 1)

(cos (t)− e−n

2π2t − n2π2 sin (t)).

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.

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

x

u(⋅,0)

u(⋅,0.1)

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

∂t− κ∂

2u

∂x2= 0, 0 < x < 100, t > 0,

u(x, 0) = 5, 0 < x < 100,

u(0, t) = 0, t > 0,

u(100, t) = 0, t > 0.

Page 43: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

6.2. PURE NEUMANN CONDITIONS AND THE FOURIER COSINE SERIES 41

The solution is

u(x, t) =

∞∑n=1

10(1− (−1)n)

nπe− κn

2π2

1002ρctsin(nπx

100

).

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∂u

∂t− κ∂

2u

∂x2= 0, 0 < x < 100, t > 0,

u(x, 0) = 5, 0 < x < 100,

u(0, t) = 0, t > 0,

u(100, t) = 5, t > 0.

The solution is

u(x, t) =x

20+

∞∑n=1

10

nπe− κn

2π2

1002ρctsin(nπx

100

).

Considering the results of Exercise 6.1.9, it is obvious that at least several thousand seconds will elapsebefore the temperature is within 1% of steady state, so we can accurately estimate u(x, t) using a singleterm of the Fourier series:

u(x, t).=

x

20+

10

πe− κπ2

1002ρctsin( πx

100

).

We want to find t large enough that|u(x, t)− us(x)||us(x)| ≤ 0.01

for all x ∈ [0, 100]. Using our approximation for u, this is equivalent to∣∣∣∣∣200 sin(πx100

)πx

∣∣∣∣∣ e− κπ2

1002ρct ≤ 0.01.

A graph shows that ∣∣∣∣∣200 sin(πx100

)πx

∣∣∣∣∣ ≤ 2

for all x, so we need

e− κπ2

1002ρct ≤ 0.005.

This yields

t ≥ −1002ρc ln 0.005

κπ2

.= 4520.

About 75 minutes and 20 seconds are required.

6.2 Pure Neumann conditions and the Fourier cosine series

1. The solution is

u(x, t) = d0 +

∞∑n=1

dne−n2π2t cos (nπx),

where

d0 =

∫ 1

0

x(1− x) dx =1

6, dn = 2

∫ 1

0

x(1− x) cos (nπx) dx =2((−1)n+1 − 1

)n2π2

.

The graphs are given in Figure 6.3.

Page 44: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

42 CHAPTER 6. HEAT FLOW AND DIFFUSION

0 0.2 0.4 0.6 0.8 10

0.05

0.1

0.15

0.2

0.25

x

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

u(x,∞)

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-statesolution. These solutions were estimated using 10 terms in the Fourier series.

3. (a) If u, v ∈ C2N [0, `], then

(LNu, v) = −∫ `

0

d2u

dx2(x)v(x) dx

= − du

dx(x)v(x)

∣∣∣∣`0

+

∫ `

0

du

dx(x)

dv

dx(x) dx

=

∫ `

0

du

dx(x)

dv

dx(x) dx (since du

dx(0) = du

dx(`) = 0)

= u(x)dv

dx(x)

∣∣∣∣`0

−∫ `

0

u(x)d2v

dx2(x) dx

= −∫ `

0

u(x)d2v

dx2(x) dx (since dv

dx(0) = dv

dx(`) = 0)

= (u, LNv).

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)

= (LNu, u)

= −∫ `

0

d2u

dx2(x)u(x) dx

= − du

dx(x)u(x)

∣∣∣∣`0

+

∫ `

0

(du

dx(x)

)2

dx

=

∫ `

0

(du

dx(x)

)2

dx (since dudx

(0) = dudx

(`) = 0)

≥ 0.

Thus LN cannot have any negative eigenvalues.

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

0

f(x) dx = −κ∫ `

0

d2u

dx2(x) dx = κ

(du

dx(0)− du

dx(`)

)= κ(a− b).

This is the compatibility condition: ∫ `

0

f(x) dx = κ(a− b).

(b) The operator K : C2N [0, `]→ C[0, `] defined by

Ku = −κd2u

dx2+ u

Page 45: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

6.2. PURE NEUMANN CONDITIONS AND THE FOURIER COSINE SERIES 43

has eigenpairs

λ0 = 1, γ0(x) = 1, and λn = 1 +κn2π2

`2, γn(x) = cos

(nπx`

), n = 1, 2, 3, . . . .

The method of Fourier series can be applied to show that a unique solution exists for each f ∈ C[0, `]. (Thekey 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 +

∞∑n=1

dne−n2π2t/`2 cos

(nπx`

),

where d0, d1, d2, . . . are the Fourier cosine coefficients of ψ. We have∣∣∣∣∣∞∑n=1

dne−n2π2t/`2 cos

(nπx`

)∣∣∣∣∣ ≤∞∑n=1

|dn| e−n2π2t/`2

∣∣∣cos(nπx

`

)∣∣∣≤

∞∑n=1

|dn| e−n2π2t/`2

≤ e−π2t/`2

∞∑n=1

|dn| e−(n2−1)π2t/`2 .

This last series certainly converges (as can be proved, for example, using the comparison test), and

e−π2t/`2 → 0 as t→∞.

This shows that

d0 +

∞∑n=1

dne−n2π2t/`2 cos

(nπx`

)→ d0 as t→∞.

The limit d0 is1

`

∫ `

0

ψ(x) dx,

the average of the initial temperature distribution.

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) =

∞∑n=1

an(t) sin(nπx

`

), an(t) =

2

`

∫ `

0

u(x, t) sin(nπx

`

)dx

and u satisfies∂u

∂x(0, t) =

∂u

∂x(`, t) = 0 for all t > 0.

The nth Fourier sine coefficient of −∂2u/∂x2 is computed as follows:

−2

`

∫ `

0

∂2u

∂x2(x, t) sin

(nπx`

)dx

= −2

`

[∂u

∂x(x, t) sin

(nπx`

)∣∣∣∣`0

− nπ

`

∫ `

0

∂u

∂x(x, t) cos

(nπx`

)dx

]

=2nπ

`2

∫ `

0

∂u

∂x(x, t) cos

(nπx`

)dx

=2nπ

`2

[u(x, t) cos

(nπx`

)∣∣∣`0

+nπ

`

∫ `

0

u(x, t) sin(nπx

`

)dx

]=

2nπ

`2((−1)nu(`, t)− u(0, t)) +

n2π2

`2an(t).

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

Page 46: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

44 CHAPTER 6. HEAT FLOW AND DIFFUSION

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

∞∑n=1

2 (1− (−1)n) t

nπsin (nπx),

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

∞∑n=1

2 (1− (−1)n)nπt sin (nπx).

However,

−∂2u

∂x2(x, t) = 0,

and so all of the Fourier sine coefficients of −∂2u/∂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 of3.17). This implies that the amplitude of the solution is reduced by about 26%. Therefore, there is less variationin the temperature distribution in the silver ring as opposed to the gold ring.

3. (a) The IBVP is

ρc∂u

∂t− κ∂

2u

∂x2= 0, −5π < x < 5π, t > 0,

u(x, 0) = ψ(x), −5π < x < 5π,

u(−5π, t) = u(5π, t), t > 0,

∂u

∂x(−5π, t) =

∂u

∂x(5π, t), t > 0.

(b) The solution is

u(x, t) = c0 +

∞∑n=1

cne− κn

2

25ρctcos(nx

5

),

where

c0 = 25 +π4

9,

cn =10(−1)n+1

n4, n = 1, 2, 3, . . . .

(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)||us|

≤ 0.01

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 (Lpu, v) andintegrate by parts twice to obtain (u, Lpv). The boundary term from the first integration by parts is

−[du

dx(x)v(x)

]`−`

=du

dx(−`)v(−`)− du

dx(`)v(`).

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

v(−`) = v(`),du

dx(−`) =

du

dx(`),

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

Page 47: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

6.3. PERIODIC BOUNDARY CONDITIONS AND THE FULL FOURIER SERIES 45

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

λ = λ(u, u) = (λu, u) = (Lpu, u) = −∫ `

−`

d2u

dx2(x)u(x) dx

= −[du

dx(x)u(x)

]`−`

+

∫ `

−`

(du

dx(x)

)2

dx

=

∫ `

−`

(du

dx(x)

)2

dx

≥ 0.

The boundary terms vanishes because of the periodic boundary conditions:

du

dx(−`)u(−`) =

du

dx(`)u(`).

7. (a) Since the ring is completely insulated, a steady-state temperature distribution cannot exist unless the netamount of heat being added to the ring is zero. This is exactly the same situation as a straight bar with theends, as well as the sides, insulated.

(b) Suppose u is a solution to (6.21). Then∫ `

−`f(x) dx = −κ

∫ `

−`

∂2u

∂x2(x, t) dx = −κ

[∂u

∂x(x, t)

]`−`

= κ

(∂u

∂x(−`, t)− ∂u

∂x(`, t)

)= 0.

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 functionis orthogonal to this null space. This condition is∫ `

−`cf(x) dx = 0 for all c ∈ R,

or simply ∫ `

−`f(x) dx = 0.

9. Consider the IBVP

ρc∂u

∂t− κ∂

2u

∂x2+ pu = f(x, t), −` < x < `, t > t0,

u(x, t0) = ψ(x), −` < x < `,

u(−`, t) = u(`, t), t > t0,

∂u

∂x(−`, t) =

∂u

∂x(`, t), t > t0.

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 similarto that carried out in Section 6.3.3 in the text, and we will use the same notation as in that section. Werepresent the solution u as the series

u(x) = a0 +

∞∑n=1

an cos

(nπx`

)+ bn sin

(nπx`

).

Substituting this series into the left side of the PDE yields

ρc∂u

∂t(x, t)− κ∂

2u

∂x2(x, t) + pu(x, t)

= ρcda0

dt+ pa0(t) +

∞∑n=1

[ρcdandt

(t) +

(κn2π2

`2+ p

)an(t)

]cos(nπx

`

)+[

ρcdbndt

(t) +

(κn2π2

`2+ p

)bn(t)

]sin(nπx

`

)

Page 48: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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

ρcda0

dt+ pa0 = c0(t), a0(t0) = p0,

ρcdandt

+

(κn2π2

`2+ p

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

ρcdbndt

+

(κn2π2

`2+ p

)bn = dn(t), bn(t0) = qn, n = 1, 2, . . . .

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

λn =κn2π2

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

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 cosineseries of f , regarded as a function on (0, `). The full Fourier series of f is

f(x) = a0 +

∞∑n=1

an cos

(nπx`

)+ bn sin

(nπx`

),

where

a0 =1

2`

∫ `

−`f(x) dx,

an =1

`

∫ `

−`f(x) cos

(nπx`

)dx, n = 1, 2, . . . ,

bn =1

`

∫ `

−`f(x) sin

(nπx`

)dx, n = 1, 2, . . . .

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

−`g(x) dx = 2

∫ `

0

g(x) dx,

while if g is odd, then ∫ `

−`g(x) dx = 0.

Since f is even,

a0 =1

2`

∫ `

−`f(x) dx =

1

`

∫ `

0

f(x) dx.

Also, f(x) cos (nπx/`) is an even function of x (the product of even functions is even), and therefore

an =1

`

∫ `

−`f(x) cos

(nπx`

)dx =

2

`

∫ `

0

f(x) cos(nπx

`

)dx, n = 1, 2, . . . .

Finally, f(x) sin (nπx/`) is an odd function of x (the product of an even and an odd function is odd), and thus

bn =1

`

∫ `

−`f(x) sin

(nπx`

)dx = 0, n = 1, 2, . . . .

Thus the full Fourier series reduces to

f(x) = a0 +

∞∑n=1

an cos(nπx

`

),

where

a0 =1

`

∫ `

0

f(x) dx, an =2

`

∫ `

0

f(x) cos(nπx

`

)dx, n = 1, 2, . . . .

This is precisely the Fourier cosine series of f on the interval (0, `) (cf. Section 6.2.2).

Page 49: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

6.4. FINITE ELEMENT METHODS FOR THE HEAT EQUATION 47

6.4 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) = 0must hold, and

(x,Gx) =

n∑i=1

(Gx)ixi =

n∑i=1

n∑j=1

Gijxjxi =

n∑i=1

n∑j=1

(uj , ui)xjxi =

n∑i=1

(n∑j=1

xjuj , ui

)ui

=

(n∑j=1

xjuj ,

n∑i=1

xiui

)

=

∥∥∥∥∥n∑j=1

xjuj

∥∥∥∥∥2

.

Thus Gx = 0 implies that the vector∑nj=1 xjuj 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

], K =

[6 −3−3 6

], f(t) =

1

162

[11 cos (t)11 cos (t)

].

(b) The system of ODEs is M dαdt

= −Kα+ f(t), that is,

2

9

dα1

dt+

1

18

dα2

dt= −6α1 + 3α2 +

11 cos (t)

162,

1

18

dα1

dt+

2

9

dα2

dt= 3α1 − 6α2 +

11 cos (t)

162.

5. (a) Write ρ1 = 8.97, ρ2 = 7.88,

ρ(x) =

ρ1, 0 < x < 50,ρ2, 50 < x < 100,

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

ρ(x)c(x)∂u

∂t− ∂

∂x

(κ(x)

∂u

∂x

)= 0, 0 < x < 100, t > 0,

u(x, 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

Mi,i+1 =

ρ1c1h

6, i = 1, 2, . . . , n

2− 1,

ρ2c2h6

, i = n2, n

2+ 1, . . . , n− 1,

and

Mii =

2ρ1c1h

3, i = 1, 2, . . . , n

2− 1,

(ρ1c1+ρ2c2)h3

, i = n2,

2ρ2c2h3

, i = n2

+ 1, n2

+ 2, . . . , n− 1.

The stiffness matrix K is tridiagonal and symmetric, and its nonzero entries are

Ki,i+1 =

−κ1

h, i = 1, 2, . . . , n

2− 1,

−κ2h, i = n

2, n

2+ 1, . . . , n− 1,

and

Kii =

2κ1h, i = 1, 2, . . . , n

2− 1,

κ1+κ2h

, i = n2,

2κ2h, i = n

2+ 1, n

2+ 2, . . . , n− 1.

Page 50: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

48 CHAPTER 6. HEAT FLOW AND DIFFUSION

7. The solution is

u(x, t) =

∞∑n=1

an(t) sin(nπx

100

),

where

an(t) =400(2 + (−1)n)

κ2π7n7

(104ρc

(e−κn

2π2

104ρct − 1

)+ κn2π2t

).

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

0 20 40 60 80 100−0.25

−0.2

−0.15

−0.1

−0.05

0

0.05

x

Euler

Backward Euler

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

9. (a) The IBVP is

ρ(x)c(x)∂u

∂t− ∂

∂x

(κ(x)

∂u

∂x

)= 0, 0 < x < `, t > 0,

u(x, 0) = 5, 0 < x < `,

u(0, t) = 0, t > 0,

u(`, t) = 0, t > 0.

(b) The weak form is to find u satisfying

∫ `

0

ρ(x)c(x)

∂u

∂t(x, t)v(x) + κ(x)

∂u

∂x(x, t)

dv

dx(x)

dx = 0, t > 0, ∀v ∈ V.

(c) The temperature distribution after 120 seconds is shown in Figure 6.5.

0 20 40 60 80 1000

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

x

tem

pera

ture

t = 120 (seconds)

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

Page 51: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

6.5. FINITE ELEMENTS AND NEUMANN CONDITIONS 49

6.5 Finite elements and Neumann conditions

1. The BVP to be solved is

−k d2u

dx2= f(x), 0 < x < 100,

du

dx(0) = 0,

du

dx(100) = 0,

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

0 20 40 60 80 100−1

0

1

2

3

4

5

6

x

tem

pera

ture

Figure 6.6: The computed steady-state temperature distribution from Exercise 6.5.1.

3. (a) The total amount of heat energy being added to the bar is 0.51AW, where A is the cross-sectional area(0.01AW through the left end and 0.5AW in the interior). Therefore, 0.51AW must be removed throughthe 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

−κd2u

dx2= 0.005, 0 < x < 100,

kdu

dx(0) = −0.01,

kdu

dx(100) = −0.51.

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

0 20 40 60 80 1000

1

2

3

4

5

6

7

x

tem

pe

ratu

re

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

Page 52: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

50 CHAPTER 6. HEAT FLOW AND DIFFUSION

5. (a) We have

u · Ku =

n∑i=0

n∑j=0

Kijujui =

n∑i=0

n∑j=0

a (φj , φi)ujui =

n∑i=0

a

(n∑j=0

ujφj , φi

)ui

= a

(n∑j=0

ujφj ,

n∑i=0

uiφi

)= a(v, v).

Therefore,

Ku = 0 ⇒ u · Ku = 0 ⇒ a(v, v) = 0.

(b) Suppose v ∈ V and a(v, v) = 0. By definition of a(·, ·), this is equivalent to

∫ `

0

κ(x)

(dv

dx(x)

)2

dx = 0.

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

dv

dx(x)

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

(c) Thus, if Ku = 0, it follows that v(x) =∑ni=0 uiφi(x) is a constant function, where u0, u2, . . . , un are the

components of u. But then there is a constant C such that v(xi) = C, i = 0, 1, 2, . . . , n. These nodal valuesof v are precisely the numbers u0, u1, . . . , un, so we see that u = Cuc, which is what we wanted to prove.

7. (a) Define V =v ∈ C2[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 argumentgiven in Section 6.5.2. Assuming that u satisfies the weak form (6.1), an integration by parts and somesimplification shows that

k(`)du

dx(`)v(`)−

∫ `

0

d

dx

[k(x)

du

dx(x)

]+ f(x)

v(x) dx = 0 for all v ∈ V .

Since V ⊂ V , this implies that the differential equation

d

dx

[k(x)

du

dx(x)

]+ f(x) = 0, 0 < x < `

holds, and we then have

k(`)du

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

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.

Page 53: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

6.5. FINITE ELEMENTS AND NEUMANN CONDITIONS 51

0 20 40 60 80 1000

1

2

3

4

5

6

7

8

x

tem

pera

ture

t=300 (seconds)

Figure 6.8: The temperature distribution from Exercise 6.5.9 (after 300 seconds).

11. Here is a sketch of the proof: If Ku = 0, then

u · Ku = 0⇒ a(v, v) = 0,

where v =∑n−1i=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 allzero. Therefore u = 0, and so K is nonsingular.

Page 54: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 55: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 7

Waves

7.1 The homogeneous wave equation without boundaries

1. The solution, by d’Alembert’s formula, is u(x, t) = (ψ(x − ct) + ψ(x + ct)). Figure 7.1 shows three snapshots ofu.

−20 −15 −10 −5 0 5 10 15 20−5

0

5

10

15

20x 10

−4

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

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

−40 −30 −20 −10 0 10 20 30 400

0.5

1

1.5x 10

−3

x

t=0

t=0.02

t=0.04

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

53

Page 56: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

54 CHAPTER 7. WAVES

5. Consider the IVP

∂2u

∂t2− c2 ∂

2u

∂x2= 0, −∞ < x <∞, t > 0,

u(x, 0) = ψ(x), −∞ < x <∞,∂u

∂t= 0, −∞ < x <∞,

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

• x1 ≤ a;

• a < x1 < b and t ≥ x1−ac

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

• x ≥ b and (t ≤ x1−bc

or t ≥ x1−ac

) (since ψ(x1 − ct) = 0 before the leading edge of the wave reaches x1 andafter 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 ≥ b−x1

c;

• x1 ≤ a and (t ≤ a−x1c

or t ≥ b−x1c

).

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 anyof the following is true:

• x1 ≤ a and (t ≤ a−x1c

or t ≥ b−x1c

);

• a < x1 < b and t ≥ x1−ac

and t ≥ b−x1c

;

• x1 ≥ b and (t ≤ x1−bc

or t ≥ x1−ac

).

7. Consider the IBVP

∂2u

∂t2− c2 ∂

2u

∂x2= 0, 0 < x < `, t > 0,

u(x, 0) = ψ(x), 0 < x < `,

∂u

∂t= 0, 0 < x < `,

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

2(ψ(x− ct) + ψ(x+ ct)) ,

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 ofthe left-moving wave reaches x = 0), and similarly u(`, t) = 0 for all t ≤ (`− b)/c (since u(`, t) cannot be nonzerountil the leading edge of the right-moving wave reaches x = `). Therefore, if t < tf = mina/b, (`− b)/c, then usatisfies both boundary conditions, in addition to the initial conditions and the PDE, and hence is a solution ofthe 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) =

∞∑n=1

bn cos

(cnπt

25

)sin(nπx

25

).

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

Page 57: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

7.2. FOURIER SERIES METHODS FOR THE WAVE EQUATION 55

0 5 10 15 20 25

0

x

dis

pla

cem

ent

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

3. The solution is

u(x, t) =

∞∑n=1

an(t) sin

((2n− 1)πx

50

),

where

an(t) =

(bn −

502cnc2(2n− 1)2π2

)cos

(c(2n− 1)πt

50

)+

502cnc2(2n− 1)2π2

and

bn =8(√

2 sin (nπ/2)−√

2 cos (nπ/2) + (−1)n)

5(2n− 1)2π2, cn =

4000

(2n− 1)π.

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

0 5 10 15 20 25−2.5

−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

x

dis

pla

ce

me

nt

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

20+ 50t2

)+

∞∑n=1

bn cos

(cnπt

25

)cos(nπx

25

),

where

bn =2 (2 cos (nπ/2)− 1− (−1)n)

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

Fifty snapshots of the solution are shown in Figure 7.5. The solution gradually moves up; this is possible becauseboth ends are free to move vertically.

7. The solution is

u(x, t) =

∞∑n=1

an(t) sin

((2n− 1)πx

2

),

Page 58: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

56 CHAPTER 7. WAVES

0 5 10 15 20 250

0.2

0.4

0.6

x

dis

pla

cem

en

t

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

where

an(t) =

(bn −

4cnc2(2n− 1)2π2

)cos

(c(2n− 1)πt

2

)+

4cnc2(2n− 1)2π2

,

bn =2(−1)n+1

125(2n− 1)2π2,

cn =4g

(2n− 1)π.

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

0 0.2 0.4 0.6 0.8 10

1

2x 10

−3

x

dis

pla

cem

en

t

t=0t=5e−05t=0.0001t=0.00015

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 is6500 N. Suppose the unstretched (zero tension) length of the string is 40 cm. We wish to determine the length towhich the string must be stretched in order that its fundamental frequency be f0 = 261 Hz (middle C). We willwrite `0 = 40, k = 6.5 · 108 (the stiffness of the string in g cm/s2), and T for the unknown tension. Note that themass 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 Hooke’s law: k∆`/`0 = T . Putting all these equationstogether, we obtain

f0 =c

2(`0 + ∆`)=

1

2(`0 + ∆`)

√k∆``0√m

`0+∆`

=

√k∆`

2√m`0(`0 + ∆`)

⇒ k∆`

4m`0(`0 + ∆`)= f2

0 .

Some straightforward algebra yields

∆` =4m`20f

20

k − 4m`0f20

.= 8.0586.

Thus the string must be stretched to 48.0586 cm.

Page 59: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

7.3. FINITE ELEMENT METHODS FOR THE WAVE EQUATION 57

7.3 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 thesolution shown in Figure 7.7.

0 0.2 0.4 0.6 0.8 1−0.2

0

0.2

x

dis

pla

ce

me

nt

Figure 7.7: The computed solution of the wave equation in Exercise 7.3.1. Shown are 30 snapshots, plus theinitial 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 take24/400 = 0.06 s for the wave to reach the boundary.

(b) The IBVP is

∂2u

∂t2− c2 ∂

2u

∂x2= 0, 0 < x < 50, t > 0,

u(x, 0) = 0, 0 < x < 50,

∂u

∂t(x, 0) = γ(x), 0 < x < 50,

u(0, t) = 0, t > 0,

u(50, t) = 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 = 6·10−4), we computedthe solution over the interval 0 ≤ t ≤ 0.06. Four snapshots are shown in Figure 7.8, which shows that it doestake 0.06 seconds for the wave to reach the boundary. (The reader should notice the spurious “wiggles” inthe computed solution; these are due to the fact that the true solution is not smooth.)

0 10 20 30 40 50−0.1

0

0.1

x

dis

pla

ce

me

nt

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 theresult obtained using h = 2.5 · 10−3 and ∆t = 3.75 · 10−4. Three snapshots are shown.

7. (a) The weak form is ∫ `

0

ρ(x)

∂2u

∂t2(x, t)v(x) + k(x)

∂u

∂x(x, t)

dv

dx(x)

dx =

∫ `

0

f(x, t)v(x) dx

Page 60: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

58 CHAPTER 7. WAVES

0 0.2 0.4 0.6 0.8 1−0.2

0

0.2

0.4

0.6

0.8

1

1.2

x

dis

pla

ce

me

nt

Figure 7.9: The computed solution of the wave equation in Exercise 7.3.5.

for t ≥ t0 and v ∈ V , whereV =

v ∈ C2[0, `] : v(0) = 0

.

(b) The system of ODEs has the same form as in the case of a homogeneous bar:

Md2u

dt2+ Ku = f(t),

except that the entries in the mass matrix are now

Mij =

∫ `

0

ρ(x)φj(x)φi(x) dx, i, j = 1, 2, . . . , n,

and the entries in the stiffness matrix are now

Kij =

∫ `

0

k(x)dφjdx

(x)dφidx

(x) dx, i, j = 1, 2, . . . , n.

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) =

∞∑n=1

an(t) sin(nπx

`

).

Following the usual procedure, an must solve the IVP

d2andt2

+(cnπ

`

)2

an = cn(t), an(0) = 0,dandt

(0) = 0,

where cn(t), n = 1, 2, . . ., are the Fourier sine coefficients of the right-hand-side function f(t) = sin (2πωt):

cn(t) =2

`

∫ `

0

sin (2πωt) sin(nπx

`

)dx =

2

nπ(1− (−1)n) sin (2πωt)

=

0, if n is odd,

4nπ

sin (2πωt), if n is even.

Therefore, an(t) = 0 if n is even, while, if n is odd,

an(t) =`

cnπ

∫ t

0

sin(cnπ

`(t− s)

)cn(s) ds.

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

an(t) =4`2(cn sin (2πωt)− 2`ω sin

(cnπt`

))

cn2π2(c2n2 − 4`2ω2).

Page 61: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

7.4. RESONANCE 59

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

an(t) =2`(` sin

(cnπt`

)− cnπt cos

(cnπt`

))

c2n3π3.

Therefore, if ω does not equal cn/(2`) for any odd n, then the Fourier coefficients of u are uniformly boundedwith respect to t and go to zero like 1/n3. Notice, though, that if ω is very close to cn/(2`) for some odd n, thenthe corresponding an(t) is larger (due to the factor of c2n2 − 4`2ω2 in the denominator), and thus that frequencyhas 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 withoutbound as t→∞, and resonance is observed.

3. The experiment described in this problem is modeled by the IBVP

∂2u

∂t2− c2 ∂

2u

∂x2= 0, 0 < x < 1, t > 0,

u(x, 0) = 0, 0 < x < 1,

∂u

∂t(x, 0) = 0, 0 < x < 1,

k∂u

∂x(0, t) = B sin (2πωt), t > 0,

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. Thefunction v(x, t) = (B/k) sin (2πωt)(x− 1) satisfies the given boundary conditions; if we define w = u− v, then wsatisfies the IBVP

∂2w

∂t2− c2 ∂

2w

∂x2=

4π2ω2B

ksin (2πωt)(x− 1), 0 < x < 1, t > 0,

w(x, 0) = 0, 0 < x < 1,

∂w

∂t(x, 0) = −2πωB

k(x− 1), 0 < x < 1,

k∂w

∂x(0, t) = 0, t > 0,

w(1, t) = 0, t > 0.

We solve this IBVP by the usual method. We write

u(x, t) =∞∑n=1

an(t) sin (nπx).

The Fourier coefficients an are found by solving the IVP

d2andt2

+ c2n2π2an = cn(t), an(0) = 0,dandt

(0) = bn,

where

cn(t) = 2

∫ 1

0

4π2ω2B

ksin (2πωt)(x− 1) sin (nπx) dx = −8πω2B

knsin (2πωt)

and

bn = −4πωB

k

∫ 1

0

(x− 1) sin (nπx) dx =4ωB

kn.

It follows (see Section 4.2.3 from the text) that

an(t) =bncnπ

sin (cnπt) +1

cnπ

∫ t

0

sin (cnπ(t− s))cn(s) ds =4ωB

kcn2πsin (cnπt) +

1

cnπ

∫ t

0

sin (cnπ(t− s))cn(s) ds.

If ω 6= cn/2, then

an(t) =4ωB

kcn2πsin (cnπt)− 8ω2B(cn sin (2πωt)− 2ω sin (cnπt))

ckn2π(c2n2 − 4ω2),

Page 62: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

60 CHAPTER 7. WAVES

while if ω = cn/2,

an(t) =4ωB

kcn2πsin (cnπt)− 4ω2B

ckn2π

(sin (cnπt)

cnπ− t cos (cnπt)

).

(a) From the above analysis, we see that the smallest resonant frequency is ωr = c/2, the fundamental frequencyof 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. Wecompute several snapshots of the displacement, using 20 terms in the Fourier series, on each of the timeintervals [0, 0.005], [0.005, 0.01], [0.01, 0.015], and [0.015, 0.02]. These are shown in Figure 7.10. The graphsshow that the amplitude grows as t increase, and also that the shape of the displacement is dominated bythe first fundamental mode.

0 0.5 1−0.5

0

0.5

0 0.5 1−0.5

0

0.5

0 0.5 1−0.5

0

0.5

0 0.5 1−0.5

0

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 amplitudesremain bounded as t increases.

0 0.5 1−5

0

5x 10

−3

0 0.5 1−5

0

5x 10

−3

0 0.5 1−5

0

5x 10

−3

0 0.5 1−5

0

5x 10

−3

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

Page 63: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

7.5. FINITE DIFFERENCE METHODS FOR THE WAVE EQUATION 61

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

u(x, t) =

∞∑n=1

an(t) sin (nπx),

where the Fourier coefficient an solves the IVP

d2andt2

+ c2n2π2an = cn(t), an(0) = 0,dandt

(0) = 0.

Here cn is the Fourier coefficient of the right-hand-side function f(x, t):

cn(t) = 2

∫ 1

0

f(x, t) sin (nπx) dx = 2 sin (2πωt)

∫ 13/5

3/5

sin (nπx) dx

=2 sin (2πωt)

(cos

(3nπ

5

)− cos

(13nπ

20

)).

It follows that

an(t) =1

cnπ

∫ t

0

sin (cnπ(t− s))cn(s) ds

=2(cos(

3nπ5

)− cos

(13nπ

20

))cn2π2

(cn sin (2πωt)− 2ω sin (cnπt))

π(c2n2 − 4ω2).

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

0 0.2 0.4 0.6 0.8 1−2

−1.5

−1

−0.5

0

0.5

1

1.5

2x 10

−6

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 Taylor’s theorem,

φ(x+ ∆x) = φ(x) +dφ

dx(x)∆x+

1

2

d2φ

dx2(c)∆x2,

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

dx(x) =

φ(x+ ∆x)− φ(x)

∆x− 1

2

d2φ

dx2(c)∆x

ordφ

dx(x)− φ(x+ ∆x)− φ(x)

∆x=

1

2

d2φ

dx2(c)∆x.

Sinced2φ

dx2(c)→ d2φ

dx2(x)

as ∆x→ 0, it follows that the error in the forward difference approximation to the first derivative is approximatelyproportional to ∆x.

Page 64: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

62 CHAPTER 7. WAVES

3. Suppose φ : R→ R is at least four times continuously differentiable. By Taylor’s theorem,

φ(x+ ∆x) = φ(x) +dφ

dx(x)∆x+

1

2

d2φ

dx2(x)∆x2 +

1

6

d3φ

dx3(x)∆x3 +

1

24

d4φ

dx4(c1)∆x4,

φ(x−∆x) = φ(x)− dφ

dx(x)∆x+

1

2

d2φ

dx2(x)∆x2 − 1

6

d3φ

dx3(x)∆x3 +

1

24

d4φ

dx4(c2)∆x4,

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

φ(x+ ∆x) + φ(x−∆x) = 2φ(x) +d2φ

dx2(x)∆x2 +

1

24

(d4φ

dx4(c1) +

d4φ

dx4(c2)

)∆x4.

Solving this equation for the second derivative yields

d2φ

dx2(x) =

φ(x+ ∆x)− 2φ(x) + φ(x−∆x)

∆x2− 1

24

(d4φ

dx4(c1) +

d4φ

dx4(c2)

)∆x2.

Sinced4φ

dx4(c1) +

d4φ

dx4(c2)→ 2

d4φ

dx4(x)

as ∆x → 0, it follows that the error in the central difference approximation to the second derivative is approxi-mately proportional to ∆x2.

5. With a Dirichlet condition at the left endpoint and a Neumann condition at the right, we must compute

u(j)i

.= 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,

resulting in equation (7.41) (page 301 in the text) for computing u(j+1)i , i = 1, 2, . . . , k − 1. To compute u

(j+1)k ,

we approximate the Neumann condition∂u

∂x(xk, tj) = 0

by

u(j)k+1 − u

(j)k−1

∆x= 0 ⇒ u

(j)k+1 = u

(j)k−1.

We then obtain equation (7.48) for u(j+1)k . Finally, we use (7.44) to compute u

(1)i , i = 1, 2, . . . , k − 1, and (7.41)

with i = k and ψ(xi+1) replaced by ψ(xi−1) to compute u(1)k .

To test the scheme, we try in on the given problem, using a time interval of [0, 1] with initial values of k = 10 andn = 500 (this gives c∆t/Dt = 0.9). Doubling k and n at each iteration, we obtain the following maximum errors:

∆x ∆t maximum error

0.1 0.002 1.9 · 10−2

0.05 0.001 4.8802 · 10−3

0.025 0.0005 1.2250 · 10−3

0.0125 0.00025 3.0792 · 10−4

These errors display the expected second-order behavior.

Page 65: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 8

First-order PDEs and the Method ofCharacteristics

8.1 The simplest PDE and the method of characteristics

1. Consider the PDE∂u

∂y= 0.

(a) Intuitively, since the solution is constant in y, the characteristics must be the vertical lines x = const. Wecan verify this formally as follows. Suppose we impose the initial condition u(f(s), g(s)) = h(s). Then thecharacteristics are determined by the equations

∂x

∂t= 0, x(s, 0) = f(s),

∂y

∂t= 1, y(s, 0) = g(s)

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

∂y= 0, u(0, 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 areinfinitely 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

4∂u

∂x+ 3

∂u

∂t= 0, 0 < x < 1, t > 0.

Given the initial condition u(f(s), g(s)) = h(s), the characteristics are determined by

∂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

Page 66: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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τ ⇔ τ =t

3, s = x− 4

3t.

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

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

(x− 4

3t

).

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

x = 4τ, t = 3τ + s ⇔ τ =x

4, s = t− 3

4x.

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

u(x, t) = v(s, τ) = φ(s) = φ

(t− 3

4x

).

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

u(x, t) =

u0

(x− 4

3t), t ≤ 3

4x,

φ(t− 3

4x), t > 3

4x.

(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 isover-determined on part of the domain, and u0, ψ cannot be specified independently of each other.

5. Consider the IBVP

∂u

∂t+ c

∂u

∂x= 0, 0 < x < 1, t > 0,

u(x, 0) = u0(x), 0 < x < 1,

u(0, t) = φ(t), t > 0.

The solution is

u(x, t) =

u0(x− ct), t < c−1x,φ(t− c−1x), t > c−1x.

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 = c−1x0. We have

u0(x− ct)→ u0(x0 − ct0) = u0(0) as (x, t)→ (x0, t0),

φ(t− c−1x)→ φ(t0 − c−1x0) = φ(0) as (x, t)→ (x0, t0),

which shows that u is continuous if and only if u0(0) = φ(0).

Page 67: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

8.2. FIRST-ORDER QUASILINEAR PDES 65

(b) Next, we have∂u

∂x(x, t) =

du0dx

(x− ct), t < c−1x,

−c−1 dφdt

(t− c−1x), t > c−1x,

and

du0

dx(x− ct)→ du0

dx(x0 − ct0) =

du0

dx(0) as (x, t)→ (x0, t0),

−c−1 dφ

dt(t− c−1x)→ −c−1 dφ

dt(t0 − c−1x0) = −c−1 dφ

dt(0) as (x, t)→ (x0, t0),

Therefore, ∂u/∂x is continuous if and only if

du0

dx(0) = −c−1 dφ

dt(0).

Similar reasoning shows that this condition also ensures that ∂u/∂t is continuous.

7. Consider the IVP

∂u

∂y+∂u

∂x= x+ y, (x, y) ∈ R2,

u(x,−x) = x2, x ∈ R.

We solve the problem in characteristics variables as follows:

∂x

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

∂y

∂t= 1, y(s, 0) = −s,

∂v

∂t= x+ y, v(s, 0) = s2.

The first two equations yield

x = s+ t, y = −s+ t ⇔ s =x− y

2, t =

x+ y

2,

and therefore∂v

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

Thus,

u(x, y) =(x− y

2

)2

+(x+ y

2

)2

=1

2(x2 + y2).

8.2 First-order quasilinear PDEs

1. Consider the following IVP:

x∂u

∂x+ y

∂u

∂y− (x+ y)u = 0,

u(1, y) = φ(y).

(a) The characteristics are defined by the equations

∂x

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

∂y

∂t= y, y(s, 0) = s,

which yield

x = et, y = set ⇔ t = lnx, s =y

x.

Notice that x must be positive. Also, since s represents y0 on the initial curve x = 1, we see that thecharacteristics can be written as y = y0x. 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.

Page 68: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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

∂t= (x+ y)v = (1 + s)etv, v(s, 0) = φ(s).

The ODE is separable and therefore the IVP is easily solved:

v(s, t) = φ(s)e(1+s)(et−1).

Changing variables, we obtain

u(x, y) = φ( yx

)ex+y−1−y/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 righthalf-plane). This is consistent with the analysis of the characteristics.

3. Consider the IVP

u∂u

∂x+ u

∂u

∂y= 0,

u(x, 0) = φ(x).

The PDE is quasi-linear and can be solved by solving the characteristic equations:

∂x

∂t= v, x(s, 0) = s,

∂y

∂t= v, y(s, 0) = 0,

∂v

∂t= 0, v(s, 0) = φ(s).

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

(s, 0) ∂x∂t

(s, 0)∂y∂s

(s, 0) ∂y∂t

(s, 0)

∣∣∣∣ =

∣∣∣∣ 1 φ(s)0 φ(s)

∣∣∣∣ = φ(s),

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

5. Consider the IVP

∂u

∂x+ u

∂u

∂y= 0, x > 0,

u(x, 0) = x, x > 0.

(a) The IVP can be solved by solving the characteristic equations:

∂x

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

∂y

∂t= v, y(s, 0) = 0,

∂v

∂t= 0, v(s, 0) = s.

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

s =x+

√x2 − 4y

2, t =

x−√x2 − 4y

2.

Page 69: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

8.3. BURGERS’S 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 thatx = s+ t, y = st implies that t = x− s and hence y = s(x− s). This shows that the characteristics are thelines y = x0(x− x0).

(c) Since the slopes of the characteristics increase as x0 increases, it follows that, for x1 > x0, the characteristicsthrough (x0, 0) and (x1, 0) will intersect at some point (x, y) with x > x1. A simple calculation shows thaty = x0(x − x0) and y = x1(x − x1) intersect at the point (x0 + x1, x0x1). Taking the limit as x1 decreasestoward x0 reveals the first point where the characteristic through (x0, 0) intersects another characteristic:(2x0, x

20). Notice that this is a point on the curve y = x2/4, which is consistent with the results obtained

above.

8.3 Burgers’s equation

1. Consider the inviscid Burgers’s equation∂u

∂t+ u

∂u

∂x= 0

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 showthis, 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) ⇔ x3

0 − xx20 + x0 + (t− x) = 0.

If we define ψ(x0) = x30 − xx2

0 + x0 + (t − x), then it is easy to verify that ψ(0) > 0, ψ(x0) < 0 for x0

sufficiently large and negative, and ψ′(x0) > 0 for all x0 < 0. It follows that ψ(x0) = 0 has a unique solutionx0 < 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 tothe analysis in the text, culminating in Figure 8.9, we see that u(x, t) is uniquely defined for all (x, t) outsidethe caustic, which is defined by the parametric equations

x =1 + 3x2

0

2x0, t =

(1 + x20)2

2x0, x0 > 0.

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

x0 =1√3, x =

√3, t =

8

3√

3.

Moreover, we can solve

x =1 + 3x2

0

2x0

for x0 in terms of x to get

x0 =x±√x2 − 3

3.

Substituting into the equation for t yields the two branches of the caustic:

t1 =

3

(1 +

(x−√x2−3

3

)2)2

2(x−√x2 − 3)

, t2 =

3

(1 +

(x+√x2−3

3

)2)2

2(x+√x2 − 3)

, x ≥√

3

Page 70: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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

∂t+ (1− u)

∂u

∂x= 0, −∞ < x < 0, t > 0,

u(x, 0) =1

x, −∞ < x < 0.

(a) The characteristic equations are

∂x

∂τ= 1− v, x(s, 0) = s,

∂t

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

∂v

∂τ= 0, v(s, 0) =

1

s.

Solving yields

x(s, t) = s+s− 1

sτ, t(s, t) = τ, v(s, t) =

1

s.

Setting s = x0, we obtain

x = x0 +x0 − 1

x0t ⇔ t =

x0

x0 − 1(x− x0).

These are the equations of the characteristics.

(b) We can solve

x = s+s− 1

st

for s as follows:

x = s+s− 1

st⇒ s2 + (t− x)s− t = 0

⇒ s =x− t±

√(t− x)2 + 4t

2

⇒ s =x− t−

√(t− x)2 + 4t

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

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

x0 − 1(x− x0), t =

x1

x1 − 1(x− x1)

for (x, t) yields(x, t) = (x0 − x0x1 + x1,−x0x1).

Notice that t < 0, as expected.

5. Consider the IVP

∂u

∂t+ a(u)

∂u

∂x= 0, −∞ < x <∞, t > 0,

u(x, 0) = φ(x), x > 0.

The characteristics are defined by

x(s, τ) = s+ a(φ(s))τ, t(s, τ) = τ, v(s, τ) = φ(s).

Page 71: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

8.3. BURGERS’S 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) willintersect with the characteristic passing through (x1, 0) if x1 > x0. We can compute the point of intersection asfollows:

x = x0 + a(φ(x0))t, x = x1 + a(φ(x1))t

⇒ x0 + a(φ(x0))t = x1 + a(φ(x1))t

⇒ t =x0 − x1

a(φ(x1))− a(φ(x0))= − 1

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∗ = − 1ddx

(a(φ(x)))∣∣x=x0

= − 1dadu

(φ(x0)) dφdx

(x0)

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

∂s(s, τ) ∂x

∂τ(s, τ)

∂t∂s

(s, τ) ∂t∂τ

(s, τ)

∣∣∣∣ =

∣∣∣∣ 1 + dadu

(φ(s)) dφdx

(s)τ a(φ(s))0 1

∣∣∣∣ = 1 +da

du(φ(s))

dx(s)τ.

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

Page 72: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 73: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 9

Green’s Functions

9.1 Green’s functions for BVPs in ODEs: Special cases

1. u(x) = xe−x.

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 andx = ` 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 Hooke’s law:

ku(x)

`− x = 1⇒ u(x) =`− xk

(the uncompressed length of the part of the bar between x = s and x = ` is `− x). Therefore we obtain

u(x) =

`−sk, 0 < x < s,

`−xk, s < x < `.

The Green’s function is

G(x; s) =

`−sk, 0 < x < s,

`−xk, s < x < `.

(b) The Green’s function is

G(x; s) =

∫ `

maxx,s

dz

k(z).

(c) If k is constant, then

G(x; s) =`−maxx, s

k=

`−sk, 0 < x < s,

`−xk, s < x < `.

(d)

u(x) =ln 2

2− 1

4− x2

4+x

2− ln (1 + x)

2.

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

u(x) = p

∫ x

0

ds

k(s).

Since x = minx, ` for x ∈ [0, `], we can write

u(x) = p

∫ minx,s

0

ds

k(s),

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

71

Page 74: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

72 CHAPTER 9. GREEN’S FUNCTIONS

7. Let the operators K : C2m[0, `]→ C[0, `] and M : C[0, `]→ C2

m[0, `] be defined by

Ku = − d

dx

(k(x)

du

dx

)and

(Mf)(x) =

∫ `

0

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

where

G(x; y) =

∫ minx,y

0

1

k(z)dz.

We wish to prove directly that (MK)u = u for all u ∈ C2m[0, `]. Given the definition of G, we will write

(Mf)(x) =

∫ x

0

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

∫ `

x

G(x; y)f(y) dy

=

∫ x

0

∫ y

0

1

k(z)f(y) dz dy +

∫ `

x

∫ y

0

1

k(z)f(y) dz dy

=

∫ x

0

∫ x

z

1

k(z)f(y) dy dz +

∫ x

0

∫ `

x

1

k(z)f(y) dy dz,

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

(MKu)(x) = −∫ x

0

∫ x

z

1

k(z)

d

dx

(k(y)

du

dx(y)

)dy dz −

∫ x

0

∫ `

x

1

k(z)

d

dx

(k(y)

du

dx(y)

)dy dz

= −∫ x

0

1

k(z)

[k(x)

du

dx(x)− k(z)

du

dx(z)

]dz −

∫ x

0

1

k(z)

[k(`)

du

dx(`)− k(x)

du

dx(x)

]dz

= −∫ x

0

1

k(z)

(−k(z)

du

dx(z)

)dz

=

∫ x

0

du

dx(z) dz = u(x)

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

9.2 Green’s functions for BVPs in ODEs: the symmetric case

1. The Green’s function is

G(x; y) =

sin (θy)((tan θ) cos (θx)−sin (θx))

θ tan θ, 0 ≤ y ≤ x,

sin (θx)((tan θ) cos (θy)−sin (θy))θ tan θ

, x ≤ y ≤ 1.

3. The Green’s function is

G(x; y) =

−kv1(y)v2(x), 0 ≤ y ≤ x,−kv1(x)v2(y), x ≤ y ≤ 1,

where v1(x) = eθx − e−θx, u2(x) = eθx − eθ(2−x), 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

(Mf)(x) =

∫ b

a

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

Page 75: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

9.2. GREEN’S 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

(Mf, g)L2 =

∫ b

a

(Mf)(x)g(x) dx

=

∫ b

a

(∫ b

a

G(x, y)f(y) dy

)g(x) dx

=

∫ b

a

∫ b

a

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

=

∫ b

a

∫ b

a

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

=

∫ b

a

f(y)

(∫ b

a

G(x, y)g(x) dx

)dy

=

∫ b

a

f(y)

(∫ b

a

G(y, x)g(x) dx

)dy (since G is symmetric)

=

∫ b

a

f(y)(Mg)(y) dy = (f,Mg)L2 .

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

7. Define H : R→ R by

H(x) =

0, x < 0,1. 0 < x

We wish to prove that ∫ ∞−∞

δ(x)φ(x) dx = −∫ ∞−∞

H(x)dφ

dx(x) dx

holds for all φ ∈ D(R). That is, we wish to prove that if φ ∈ D(R), then∫ ∞−∞

H(x)dφ

dx(x) dx = −φ(0).

This is a direct calculation. Choose b > 0 sufficiently large that φ(x) = 0 for all x ≥ b. Then∫ ∞−∞

H(x)dφ

dx(x) dx =

∫ ∞0

dx(x) dx =

∫ b

0

dx(x) dx = φ(b)− φ(0) = −φ(0),

as desired.

9. Let G be the Green’s function for the BVP

− d

dx

(P (x)

du

dx

)+R(x)u = f(x), a < x < b,

α1u(a) + α2du

dx(a) = 0,

β1u(b) + β2du

dx(b) = 0.

Then

G(x; y) =

− v1(y)v2(x)P (x)W (x)

, a ≤ y ≤ x,− v1(x)v2(y)P (x)W (x)

, x ≤ y ≤ b,

where v1 and v2 are certain solutions of the homogeneous ODE

− d

dx

(P (x)

du

dx

)+R(x)u = 0, a < x < b.

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-sidefunction f(x) replaced by δ(x− y). To do this, we must interpret the BVP in its weak sense, which is

−P (x)du

dx(x)v(x)

∣∣∣∣ba

+

∫ b

a

P (x)

du

dx(x)

dv

dx(x) +R(x)u(x)v(x)

dx =

∫ b

a

δ(x− y)v(x) dx = v(y).

Page 76: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

74 CHAPTER 9. GREEN’S FUNCTIONS

Here u must satisfy the given boundary conditions and the above variational equation must hold for all testfunctions v satisfying the same boundary conditions. Now, the Green’s function is continuous but its derivativedu/dx has a jump discontinuity at x = y. We will write

du

dx(y−) = lim

x→y−

du

dx(x) = −v

′1(y)v2(y)

P (y)W (y),

du

dx(y+) = lim

x→y+

du

dx(x) = −v1(y)v′2(y)

P (y)W (y).

We now substitute u into the left-hand side of the variational equation to obtain

−P (x)du

dx(x)v(x)

∣∣∣∣ba

+

∫ b

a

(P (x)

du

dx(x)

dv

dx(x) +R(x)u(x)v(x)

dx

= P (a)du

dx(a)v(a)− P (b)

du

dx(b)v(b) +

∫ y

a

(P (x)

du

dx(x)

dv

dx(x) +R(x)u(x)v(x)

dx

+

∫ b

y

(P (x)

du

dx(x)

dv

dx(x) +R(x)u(x)v(x)

dx.

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

−P (x)du

dx(x)v(x)

∣∣∣∣ba

+

∫ b

a

(P (x)

du

dx(x)

dv

dx(x) +R(x)u(x)v(x)

dx

= P (a)du

dx(a)v(a)− P (b)

du

dx(b)v(b) + P (y)

du

dx(y−)v(y)− P (a)

du

dx(a)v(a) + P (b)

du

dx(b)v(b)− P (y)

du

dx(y+)v(y)

+

∫ y

a

− d

dx

(P (x)

du

dx(x)

)v(x) +R(x)u(x)v(x)

dx+

∫ b

y

− d

dx

(P (x)

du

dx(x)

)v(x) +R(x)u(x)v(x)

dx

= P (y)du

dx(y−)v(y)− P (y)

du

dx(y+)v(y) +

∫ b

a

− d

dx

(P (x)

du

dx(x)

)+R(x)u(x)

v(x) dx

= P (y)du

dx(y−)v(y)− P (y)

du

dx(y+)v(y),

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

− d

dx

(P (x)

du

dx

)+R(x)u = 0.

We now have

−P (x)du

dx(x)v(x)

∣∣∣∣ba

+

∫ b

a

(P (x)

du

dx(x)

dv

dx(x) +R(x)u(x)v(x)

dx

= P (y)v(y)

(du

dx(y−)− du

dx(y+)

)= P (y)v(y)

(v1(y) dv2

dx(y)− dv1

dx(y)v2(y)

P (y)W (y)

)= v(y)

since W (y) = v1(y) dv2dx

(y)− dv1dx

(y)v2(y). This completes the proof.

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

− d

dx

(P (x)

du

dx

)+R(x)u = 0, a < x < b,

α1u(a) + α2du

dx(a) = va,

β1u(b) + β2du

dx(b) = vb,

Page 77: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

9.3. GREEN’S FUNCTIONS FOR BVPS IN ODES: THE GENERAL CASE 75

in terms of the Green’s function G for the BVP

− d

dx

(P (x)

du

dx

)+R(x)u = f(x), a < x < b,

α1u(a) + α2du

dx(a) = 0,

β1u(b) + β2du

dx(b) = 0.

We proceed as in Section 9.2.2; in particular, we apply

(u, Lv)− (Lu, v) = P (a)

(u(a)

dv

dx(a)− du

dx(a)v(a)

)− P (b)

(u(b)

dv

dx(b)− du

dx(b)v(b)

)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 aboveBVP 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

u(y) = P (a)

(u(a)

dv

dx(a)− du

dx(a)v(a)

)− P (b)

(u(b)

dv

dx(b)− du

dx(b)v(b)

).

We now apply the boundary condition satisfied by u and v:

α1u(a) + α2du

dx(a) = va ⇒

du

dx(a) =

1

α2va −

α1

α2u(a),

β1u(b) + β2du

dx(b) = vb ⇒

du

dx(b) =

1

β2vb −

β1

β2u(b),

α1v(a) + α2dv

dx(a) = 0⇒ dv

dx(a) = −α1

α2v(a),

β1v(b) + β2dv

dx(b) = 0⇒ dv

dx(b) = −β1

β2v(b).

We thus obtain

u(y) = P (a)

(u(a)

dv

dx(a)− du

dx(a)v(a)

)− P (b)

(u(b)

dv

dx(b)− du

dx(b)v(b)

)= P (a)

(−α1

α2u(a)v(a)− 1

α2vav(a) +

α1

α2u(a)v(a)

)− P (b)

(−β1

β2u(b)v(b)− 1

β2vbv(b) +

β1

β2u(b)v(b)

)= β−1

2 P (b)v(b)vb − α−12 P (a)v(a)va

= β−12 P (b)G(b; y)vb − α−1

2 P (a)G(a; y)va

= β−12 P (b)G(y; b)vb − α−1

2 P (a)G(y; a)va.

In the last step we used the symmetry of G. This is the desired formula:

u(y) = β−12 P (b)G(y; b)vb − α−1

2 P (a)G(y; a)va.

9.3 Green’s functions for BVPs in ODEs: the general case

1. The Green’s function is

G(x; y) =

− v1(y)v2(x)P (x)W (x)

, 0 ≤ y ≤ x,− v1(x)v2(y)P (x)W (x)

, x ≤ y ≤ 1,

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

u(x) =

∫ 1

0

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

where w(x) = e−3x.

Page 78: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

76 CHAPTER 9. GREEN’S FUNCTIONS

3. The Green’s function is

G(x; y) =

− v1(y)v2(x)P (x)W (x)

, 0 ≤ y ≤ x,− v1(x)v2(y)P (x)W (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). Thesolution to the BVP is

u(x) =

∫ 1

0

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

where w(x) = e−2x.

5. The Green’s function is

G(x; y) =

ey(6 + 6x+ 3x2 + x3

), 1

2≤ y ≤ x,

ex(6 + 6y + 3y2 + y3

), x ≤ y ≤ 1.

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

u(x) =23

2+

23

2x+ 6x2 + 2x3 − 7ex−1.

7. Let G be the Green’s function derived in this section, and let M be defined by (Mf)(x) =∫ baG(x; y)f(y) dy. (Here

M maps complex C[a, b] into complex C2[a, b].) We wish to prove that (Mf, g)w = (f,Mg)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 isreal-valued, so that G(x; y) = G(x; y). We have

(Mf, g)w =

∫ b

a

(Mf)(x)g(x)w(x) dx =

∫ b

a

(∫ b

a

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

)g(x)w(x) dx

=

∫ b

a

∫ b

a

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

=

∫ b

a

∫ b

a

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

=

∫ b

a

f(y)

(∫ b

a

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

)w(y) dy

=

∫ b

a

f(y)

(∫ b

a

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

)w(y) dy

=

∫ b

a

f(y)

(∫ b

a

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

)w(y) dy

=

∫ b

a

f(y)(Mg)(y)w(y) dy = (f,Mg)w.

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

9.4 Introduction to Green’s functions for IVPs

1. We wish to show that the solution of

d2u

dt2+ θ2u = f(t), u(0) = u0,

du

dt(0) = v0

is

u(t) =∂G

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

∫ ∞0

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

where

G(t; s) =

sin (θ(t−s))

θ, t > s,

0, t < s.

We can write the proposed solution explicitly as

u(t) = cos (θt)u0 +sin (θt)

θv0 +

∫ t

0

sin (θ(t− s))θ

f(s) ds.

Page 79: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

9.4. INTRODUCTION TO GREEN’S FUNCTIONS FOR IVPS 77

Then

du

dt(t) = −θ sin (θt)u0 + cos (θt)v0 +

sin (θ(t− t))θ

f(t) +

∫ t

0

cos (θ(t− s))f(s) ds

= −θ sin (θt)u0 + cos (θt)v0 +

∫ t

0

cos (θ(t− s))f(s) ds

d2u

dt2(t) = −θ2 cos (θt)u0 − θ sin (θt)v0 + cos (θ(t− t))f(t)−

∫ t

0

θ sin (θ(t− s))f(s) ds

= −θ2 cos (θt)u0 − θ sin (θt)v0 + f(t)−∫ t

0

θ sin (θ(t− s))f(s) ds.

From these formulas, we can easily verify that u satisfies the ODE and the initial conditions:

u(0) = cos (0)u0 +sin (0)

θv0 +

∫ 0

0

sin (θ(t− s))θ

f(s) ds = u0,

du

dt(0) = −θ sin (0)u0 + cos (0)v0 +

∫ 0

0

cos (θ(t− s))f(s) ds = v0,

and

d2u

dt2(t) + θ2u(t) = −θ2 cos (θt)u0 − θ sin (θt)v0 + f(t)−

∫ t

0

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

θ2 cos (θt)u0 + θ sin (θt)v0 +

∫ t

0

θ sin (θ(t− s))f(s) ds

= f(t).

3. The Green’s function is

G(t; s) =

sin (2(t−s))

2, t > s,

0, t < s.

5. The Green’s function is

G(t; s) =

e−(t−s) − e−2(t−s), t > s,

0, t < s.

7. The Green’s function is

G(t; s) =

e0.02(t−s), t > s,

0, t < s,

and the solution to the IVP is

P (t) = G(t; 0)P0 +

∫ ∞0

G(t; s)f(s) ds = 55.5e0.02t + 450 + 10t− 450e0.02t = 450 + 10t− 394.5e0.02t.

9. Let the solution of

d2u

dt2+ a1(t)

du

dt+ a0(t)u = 0,

u(s) = 0,

du

dt(s) = f(s)

be u(t) = S(t; s)f(s), and define the Green’s function G(t; s) by

G(t; s) =

S(t; s), t > s,

0, t < s,

We wish to show that G satisfies

∂2G

∂t2(t; s) + a1(t)

∂G

∂t(t; s) + a0(t)G(t; s) = δ(t− s),

G(t0; s) = 0,

∂G

∂t(t0; s) = 0,

Page 80: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

78 CHAPTER 9. GREEN’S 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

∂G

∂t(t, s) = H(t− s)∂S

∂t(t, s) and

∂2G

∂t2(t, s) = δ(t− s) +H(t− s)∂

2S

∂t2(t, s)

(in the weak sense). Let φ be any smooth function having compact support in [t0,∞), that is, any function forwhich φ(t) = 0 for all t 6∈ (a, b), where t0 < a < b <∞. We first show that

−∫ ∞t0

G(t; s)dφ

dt(t) dt =

∫ ∞t0

H(t− s)∂S∂t

(t, s)φ(t) dt,

which implies that∂G

∂t(t, s) = H(t− s)∂S

∂t(t, s)

in the weak sense. We have

−∫ ∞t0

G(t; s)dφ

dt(t) dt = −

∫ ∞t0

H(t− s)S(t, s)dφ

dt(t) dt

= −∫ b

s

S(t, s)dφ

dt(t) dt

= − S(t, s)φ(t)|bs +

∫ b

s

∂S

∂t(t, s)φ(t) dt (by integration by parts)

=

∫ b

s

∂S

∂t(t, s)φ(t) dt (since S(s, s) = 0 and φ(b) = 0)

=

∫ ∞t0

H(t− s)∂S∂t

(t, s)φ(t) dt.

This proves the desired formula for ∂G/∂t.

Next, we will show that

−∫ ∞t0

∂G

∂t(t; s)

dt(t) dt = φ(s) +

∫ ∞t0

H(t− s)∂2S

∂t2(t, s)φ(t) dt,

which implies that∂2G

∂t2(t, s) = δ(t− s) +H(t− s)∂

2S

∂t2(t, s)

in the weak sense. We have

−∫ ∞t0

∂G

∂t(t; s)

dt(t) dt = −

∫ ∞t0

H(t− s)∂S∂t

(t, s)dφ

dt(t) dt

= −∫ b

s

∂S

∂t(t, s)

dt(t) dt

= − ∂S

∂t(t, s)φ(t)

∣∣∣∣bs

+

∫ b

s

∂2S

∂t2(t, s)φ(t) dt (by integration by parts)

= φ(s) +

∫ b

s

∂2S

∂t2(t, s)φ(t) dt (since ∂S

∂t(s, s) = 1 and φ(b) = 0)

= φ(s) +

∫ ∞t0

H(t− s)∂2S

∂t2(t, s)φ(t) dt.

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

∂t2(t; s) + a1(t)

∂G

∂t(t; s) + a0(t)G(t; s) = δ(t− s),

as desired. Also,

G(t0, s) = H(t0 − s)S(t0, s) = 0,∂G

∂t(t0, s) = H(t0 − s)

∂S

∂t(t0, s) = 0

since H(t0 − s) = 0 because t0 − s < 0 by assumption. This completes the proof.

Page 81: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

9.5. GREEN’S FUNCTIONS FOR THE HEAT EQUATION 79

9.5 Green’s functions for the heat equation

1. Given that

S(x, t) =1

2√πkt

e−x2/(4kt),

we have ∫ ∞−∞

S(x, t) dx =1

2√πkt

∫ ∞−∞

e−x2/(4kt) dx.

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

−∞S(x, t) dx =

1√π

∫ ∞−∞

e−u2

du =1√π

√π = 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 termsare not sufficient to give a correct graph.

5. Following the example in Section 9.5.2, we obtain the following Green’s function:

G(x, t; y, s) =

2`ρc

∑∞n=1 e

−k(2n−1)2π2(t−s)/(4`2) sin(

(2n−1)πy2`

)sin(

(2n−1)πx2`

), 0 ≤ s ≤ t,

0, s > t.

Here we used the correct eigenfunctions for the given mixed boundary conditions and also adjust for the the factthat the constants appear differently in the PDE in this exercise than in the example in Section 9.5.2 (notice theextra factor of 1/(ρc) in the formula for this Green’s function). As before, k = κ/(ρc). Snapshots of G(x, t; 75, 60)are shown in Figure 9.1.

0 20 40 60 80 1000

0.005

0.01

0.015

0.02

x

tem

pe

ratu

re

Graph of G(x,t;75,60) for various values of t

t=120

t=240

t=360

t=480

t=600

Figure 9.1: Snapshots of the Green’s 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

u(x, t) =

∫ `

0

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

=

∫ `

0

2

`

∞∑n=1

e−kn2π2t/`2 sin

(nπy`

)sin(nπx

`

)φ(y) dy

=

∞∑n=1

(2

`

∫ `

0

sin(nπy

`

)φ(y) dy

)e−kn

2π2t/`2 sin(nπx

`

)=

∞∑n=1

bne−kn2π2t/`2 sin

(nπx`

),

Page 82: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

80 CHAPTER 9. GREEN’S FUNCTIONS

where

bn =2

`

∫ `

0

sin(nπy

`

)φ(y) dy, n = 1, 2, 3, . . .

are the Fourier sine coefficients of the function φ. We recognize u as the solution of the IBVP

∂u

∂t− k ∂

2u

∂x2= 0, 0 < x < `, t > 0,

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 Green’s functions for the wave equation

1. Let

u(x, t) =1

2c

∫ t

0

∫ x+c(t−s)

x−c(t−s)f(y, s) dy ds.

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

∂u

∂t(x, t) =

1

2c

∫ x+c(t−t)

x−c(t−t)f(y, t) dy +

1

2c

∫ t

0

cf(x+ c(t− s), s) + cf(x− c(t− s), s) ds

=1

2c

∫ x

x

f(y, t) dy +1

2c

∫ t

0

cf(x+ c(t− s), s) + cf(x− c(t− s), s) ds

=1

2c

∫ t

0

cf(x+ c(t− s), s) + cf(x− c(t− s), s) ds,

∂2u

∂t2(x, t) =

1

2c(cf(x+ c(t− t), t) + cf(x− c(t− t), t)) +

1

2c

∫ t

0

c2df

dx(x+ c(t− s), s)− c2 df

dx(x− c(t− s), s)

ds

=1

2c(cf(x, t) + cf(x, t)) +

1

2c

∫ t

0

c2df

dx(x+ c(t− s), s)− c2 df

dx(x− c(t− s), s)

ds

= f(x, t) +c

2

∫ t

0

df

dx(x+ c(t− s), s)− df

dx(x− c(t− s), s)

ds,

∂u

∂x(x, t) =

1

2c

∫ t

0

f(x+ c(t− s), s)− f(x− c(t− s), s) ds,

∂2u

∂x2(x, t) =

1

2c

∫ t

0

df

dx(x+ c(t− s), s)− df

dx(x− c(t− s), s)

ds.

Thus

∂2u

∂t2(x, t)− c2 ∂

2u

∂x2(x, t) = f(x, t) +

c

2

∫ t

0

df

dx(x+ c(t− s), s)− df

dx(x− c(t− s), s)

ds

− c

2

∫ t

0

df

dx(x+ c(t− s), s)− df

dx(x− c(t− s), s)

ds

= 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)

Page 83: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

9.6. GREEN’S 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 leastwhen 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

∂t2− c2 ∂

2u

∂x2= f(x, t), −∞ < x <∞, t > 0,

u(x, 0) = 0, −∞ < x <∞,∂u

∂t(x, 0) = 0, −∞ < x <∞,

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

∂t(x, t) = −∂u

∂t(−x, t),

∂2v

∂t2(x, t) = −∂

2u

∂t2(−x, t),

∂v

∂x(x, t) =

∂u

∂x(−x, t),

∂2v

∂x2(x, t) = −∂

2u

∂x2(−x, t).

Therefore,

∂2v

∂t2(x, t)− c2 ∂

2v

∂x2(x, t) = −∂

2u

∂t2(−x, t) + c2

∂2u

∂x2(−x, t)

= −(∂2u

∂t2(−x, t)− c2 ∂

2u

∂x2(−x, t)

)= −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 satisfiesthe same initial conditions; hence v = u and the proof is complete.

7. We outline the derivation of the Green’s function for

∂2u

∂t2− c2 ∂

2u

∂x2= f(x, t), 0 < x < `, t > 0,

u(x, 0) = 0, 0 < x < `,

∂u

∂t(x, 0) = 0, 0 < x < `,

∂u

∂x(0, t) = 0, t > 0,

∂u

∂x(`, t) = 0, t > 0.

Page 84: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

82 CHAPTER 9. GREEN’S FUNCTIONS

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

∂2u

∂t2− c2 ∂

2u

∂x2= f(x, t), −∞ < x <∞, t > 0,

u(x, 0) = 0, −∞ < x <∞,∂u

∂t(x, 0) = 0, −∞ < x <∞.

From earlier results, we know that

u(x, t) =

∫ t

0

∫ ∞−∞

1

2cH(c(t− s)− |x− y|)f(y, s) dy ds =

1

2c

∫ t

0

∫ x+c(t−s)

x−c(t−s)f(y, s) dy ds.

Then∂u

∂x(x, t) =

∫ t

0

f(x+ c(t− s), s)− f(x− c(t− s), s)

ds.

It follows that

∂u

∂x(x, 0) =

∫ t

0

f(c(t− s), s)− f(−c(t− s), s)

ds,

∂u

∂x(x, `) =

∫ t

0

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(x, 0) = 0.

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(x, `) = 0.

It follows that u, restricted to the interval 0 < x < `, solves the original IBVP.

The derivation of the Green’s function for the IBVP is almost exactly the same as that given in the text (forDirichlet conditions). The result is

G(x, t; y, s) =

∞∑n=−∞

1

2cH(c(t− s)− |x− y − 2n`|) +H(c(t− s)− |x+ y − 2n`|) .

Page 85: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 389–390,except for the treatment of the boundary term. We have

−P (x)du

dx(x)v(x)

∣∣∣∣ba

= −P (b)du

du(b)v(b) + P (a)

du

dx(a)v(a)

= −P (b)du

du(b)v(b) (since v(a) = 0)

=β1

β2P (b)u(b)v(b)

(since

du

dx(b) = −β1

β2u(b)

).

Therefore,

(Lu, v)w =β1

β2P (b)u(b)v(b) +

∫ b

a

P (x)du

dx(x)

dv

dx(x) dx+

∫ b

a

R(x)u(x)v(x) dx.

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

α1u(a) + κdu

dx(a) = 0

(relative to the interval [a, b]). We wish to determine the physically meaningful sign for α1 in the case that thisboundary condition models heat flow through the left end of a bar. Recall that the heat flux at x = a (a vectorquantity) is given by

−κdudx

(a)

(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

−κdudx

(a)(−1) = κdu

dx(a).

Thus consider the equation

κdu

dx(a) = γ(u(a)− T ),

where T is the temperature of the surroundings. This equation states that the rate at which heat flows out of thebar is proportional to the difference between the temperature at the left end of the bar and the temperature ofthe bar. The above boundary condition is equivalent to

−γu(a) + κdu

dx(a) = −γT,

83

Page 86: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

84 CHAPTER 10. STURM-LIOUVILLE EIGENVALUE PROBLEMS

which shows that we should take α1 = −γ in the Robin boundary condition. Thus α1 < 0 is the physicallymeaningful 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

dx(b).

The same reasoning as above then shows that the boundary condition is

γu(b) + κdu

dx(b) = γT.

Therefore, we should take β1 = γ, which shows that β1 > 0 is the physically meaningful case.

5. The eigenpairs are

λn = 3 +( nπ

ln 2

)2

, un(x) = sin

(nπ lnx

ln 2

), n = 1, 2, 3, . . . .

7. (a) The eigenpairs are

λn = 4 + β +( nπ

ln 2

)2

, un(x) = x2 sin

(nπ lnx

ln 2

), n = 1, 2, 3, . . . .

(b) 0 is an eigenvalue if and only if

β = −4−( nπ

ln 2

)2

for some positive integer n.

(c) There is exactly one negative eigenvalue if and only if

−4− 4π2

(ln 2)2≤ β < −4− π2

(ln 2)2,

while there are exactly k negative eigenvalues if and only if

−4− (k + 1)2π2

(ln 2)2≤ β < −4− k2π2

(ln 2)2.

9. The eigenpairs are

λn = 2 +( nπ

ln 2

)2

, un(x) = x−1

(nπ

ln 2cos

(nπ lnx

ln 2

)+ sin

(nπ lnx

ln 2

)), n = 1, 2, 3, . . . .

10.3 Numerical Methods for Sturm-Liouville problems

1. We wish to apply the finite element method to

− d

dx

(P (x)

du

dx

)+R(x)u = λw(x)u, a < x < b,

u(a) = 0,

du

dx(b) = 0.

Using the usual uniform mesh on the interval [a, b], the finite element space of consists of all piecewise linearfunctions v (relative to the given mesh) satisfying v(a) = 0 (note that the Neumann condition is a naturalboundary 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 Aand W are the n× n matrices defined by

Aij =

∫ b

a

P (x)

dφjdx

(x)dφidx

(x) +R(x)φj(x)φi(x)

dx,

Wij =

∫ b

a

w(x)φj(x)φi(x) dx.

(These are the same formulas derived in the text, except now i and j vary from 1 to n.)

Page 87: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 productsto the other.) Since λ = λ, it follows that λ ∈ R.

10.4 Examples of Sturm-Liouville problems

1. Let

u(x) =n∑i=0

αiφi(x)

be a continuous piecewise linear function defined on [0, `], relative to the usual uniform mesh. Here φ0, φ1, . . . , φnis the standard basis. The average value of u on [0, `] is then

1

`

∫ `

0

u(x) dx =1

`

∫ `

0

n∑i=0

αiφi(x) dx =1

`

n∑i=0

αi

∫ `

0

φi(x) dx.

Since the graph of each φi, i = 1, . . . , n− 1, forms a triangle of height 1 and base 2h (h = `/n), it follows that∫ `

0

φi(x) dx = h, i = 1, 2, . . . , n− 1;

similarly, ∫ `

0

φ0(x) dx =

∫ `

0

φn(x) dx =h

2, i = 1, 2, . . . , n− 1.

Thus the average value of u on [0, `] is

h

`

(1

2α0 + α1 + · · ·+ αn−1 +

1

2αn

).

3. The fundamental frequency is about 3254 Hz.

10.5 Robin boundary conditions

1. The solution to the IBVP is

u(x, t) =

∞∑n=1

an(t) cos

((2n− 1)πx

2`

),

where

an(t) = cne−κ(2n−1)2π2t/(4`2ρc), cn =

40(−1)n+1

(2n− 1)π, n = 1, 2, . . . .

Some snapshots of the solution are shown in Figure 10.1.

3. Consider the following Sturm-Liouville problem:

−d2u

dx2= λu, 0 < x < `,

u(0) = 0,

κdu

dx(`) + αu(`) = 0

where κ > 0, α < 0. We can write the second boundary condition as

du

dx(`)− αu(`) = 0,

where α = −α/κ > 0. The analysis of the eigenvalues turns out to depend on the value of α`. We do the analysisby considering three cases:

Page 88: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

86 CHAPTER 10. STURM-LIOUVILLE EIGENVALUE PROBLEMS

0 20 40 60 80 1000

1

2

3

4

5

6

7

8

9

10

11

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

tan (s) =s

α`, s > 0,

where s =√λ`. There are solutions sk

.= (2k + 1)π/2, k = 1, 2, 3, . . .. The corresponding eigenpairs are

λk =s2k

`2, ψk(x) = sin

(skx`

), k = 1, 2, 3, . . . .

These eigenpairs exist regardless of the value of α`. In addition, if α` < 1, then there is an additional solutionof tan (s) = s/(α`), namely, s0 ∈ (0, π/2), with corresponding eigenvalue λ0 = s2

0/`2 and eigenfunction

ψ0(x) = sin (s0x/`).

Case 2 (λ = 0) If α` = 1, then λ0 = 0 is an eigenvalue with eigenfunction ψ0(x) = x. If α` 6= 1, then 0 is not aneigenvalue.

Case 3 (λ < 0) Negative eigenvalues must satisfy the equation

tanh (√−λ`) =

√−λα

ortanh (s) =

s

α`, s > 0,

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 andeigenfunction ψ0(x) = sinh (s0x/`).

Therefore, when α < 0, there is a sequence of eigenpairs

λk =s2k

`2, ψk(x) = sin

(skx`

), k = 1, 2, 3, . . . ,

where

λk.=

(2k + 1)2π2

4`2.

There is also an eigenvalue λ0, which is positive if α` < 1 (with eigenfunction ψ0(x) = sin (√λ0x)), zero if α` = 1

(with eigenfunction ψ0(x) = x), and negative if α` > 1 (with eigenfunction ψ0(x) = sinh (√−λ0x)).

10.6 Finite element methods for Robin boundary conditions

1. The finite element formulation of

− d

dx

(P (x)

du

dx

)+R(x)u = F (x), a < x < b,

u(a) = 0,

βdu

dx(b) + αu(b) = 0,

Page 89: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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. TheDirichlet condition at x = a is an essential boundary condition (whereas the Neumann condition in (10.26) is anatural boundary condition). This implies that we only consider finite element functions satisfying the Dirichletcondition, so we use the basis φ1, φ2, . . . , φn instead of φ0, φ1, . . . , φn. The weak form of the BVP is unchangedfrom (10.27), although now

P (a)du

dx(a)v(a)

vanishes because v(a) = 0 rather than because du/dx(a) = 0. The result is the linear system Au = f , where Aand f are given by the same formulas as in the text (page 420), except that the entries corresponding to φ0 areomitted. 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,

−α1u(a) + α2du

dx(a) = 0,

β1u(b) + β2du

dx(b) = 0

is

P (a)du

dx(a)v(a)− P (b)

du

dx(b)v(b) +

∫ b

a

P (x)du

dx(x)

dv

dx(x) dx+

∫ b

a

R(x)u(x)v(x) dx =

∫ b

a

F (x)v(x) dx

for all test functions v. The boundary conditions imply

du

dx(a) =

α1

α2u(a),

du

dx(b) = −β1

β2u(b),

and therefore the weak form can be written as

α1

α2P (a)u(a)v(a) +

β1

β2P (b)u(b)v(b) +

∫ b

a

P (x)du

dx(x)

dv

dx(x) dx+

∫ b

a

R(x)u(x)v(x) dx =

∫ b

a

F (x)v(x) dx.

Notice that the Robin conditions at the endpoints are natural boundary conditions, and hence no boundaryconditions are imposed on the test functions. We therefore take φ0, φ1, . . . , φn as the basis for the finite elementspace (using the usual notation), and obtain the linear system Au = f , where A = K+M+G. The matrices Kand M are the same stiffness and mass matrices defined in the text (page 420), and G ∈ R(n+1)×(n+1) is definedby

Gij =

α1α2P (a), i = j = 0,

β1β2P (b)β, i = j = n,

0, otherwise.

5. Suppose u satisfies

−κdudx

= F (x), 0 < x < `,

du

dx(0) = 0,

κdu

dx(`) + αu(`) = 0.

Then ∫ `

0

F (x) dx = −κ∫ `

0

d2u

dx2(x) dx = −κ

(du

dx(`)− du

dx(0)

)= −κdu

dx(`)

(since

du

dx(0) = 0

)= αu(`) (applying the Robin condition at x = `).

Page 90: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 isbounded. We will argue by contradiction and assume L is unbounded. Then there exists a sequence un ⊂ Uwith ‖un‖U = 1 for all n and ‖Lun‖V → ∞ as n → ∞. (Here we are using the alternate definition of the normof L: ‖L‖ = sup‖Lu‖V : u ∈ U, ‖u‖U = 1.) Since L is compact and un is bounded in U , there must exist asubsequence unk of un such that Lunk is convergent in V . But ‖Lun‖V →∞ implies that ‖Lunk‖V →∞,and hence that Lunk is not convergent. This is a contradiction, which shows that the assumption that L isunbounded 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

− d

dx

(P (x)

du

dx

)+R(x)u = λw(x)u, a < x < b,

α1u(a) + α2du

dx(a) = 0,

β1u(b) + β2du

dx(b) = 0,

where P and w are assumed to be positive on the interval [a, b]. Let

W (x) =

∣∣∣∣ φ(x) ψ(x)dφdx

(x) dψdx

(x)

∣∣∣∣ = φ(x)dψ

dx(x)− dφ

dx(x)ψ(x)

be the Wronskian of φ, ψ. Since φ, ψ satisfy the linear homogeneous ODE

− d

dx

(P (x)

du

dx

)+ (R(x)− λw(x)u = 0

on [a, b], we can show that φ, ψ is linearly independent by proving that W (x) = 0 for any given x ∈ [a, b]. Wehave

α1φ(a) + α2dφ

dx(a) = 0 ⇒ dφ

dx(a) = −α1

α2φ(a),

and similarlydψ

dx(a) = −α1

α2ψ(a).

Therefore,

W (a) = φ(a)dψ

dx(a)− dφ

dx(a)ψ(a) = −α1

α2φ(a)ψ(a) +

α1

α2φ(a)ψ(a) = 0.

This shows that φ, ψ is linearly dependent, as desired.

Page 91: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 11

Problems in Multiple SpatialDimensions

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∫Ω

∇ · F =

∫ b

a

∫ d

c

∂F1

∂x1(x1, x2) +

∂F2

∂x2(x1, x2)

dx2 dx1

=

∫ b

a

∫ d

c

∂F1

∂x1(x1, x2) dx2 dx1 +

∫ b

a

∫ d

c

∂F2

∂x2(x1, x2) dx2 dx1

=

∫ d

c

∫ b

a

∂F1

∂x1(x1, x2) dx1 dx2 +

∫ b

a

∫ d

c

∂F2

∂x2(x1, x2) dx2 dx1

=

∫ d

c

F1(b, x2)− F1(a, x2) dx2 +

∫ b

a

F2(x1, d)− F2(x2, c) dx1

=

∫ d

c

F1(b, x2) dx2 −∫ d

c

F1(a, x2) dx2 +

∫ b

a

F2(x1, d) dx1 −∫ b

a

F2(x2, c) dx1

=

∫Γ2

F · n +

∫Γ4

F · n +

∫Γ3

F · n +

∫Γ1

F · n =

∫∂Ω

F · n,

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 ∫Ω

∇ · F = area(Ω) = π.

On the other hand, on ∂Ω, n = x and therefore F ·n = 2x1x2 +x22. In polar coordinates, F ·n = sin (2θ)+sin2 (θ),

and hence ∫∂Ω

F · n =

∫ 2π

0

sin (2θ) + sin2 (θ)

dθ = π.

This verifies the divergence theorem for this domain and vector field.

5. Let L : C2(Ω)→ C(Ω) be defined by Lu = −∇ · (k(x)∇u). By the product rule,

∇ · (k(∇u)v) = k∇u · ∇v +∇ · (k∇u)v;

therefore,

−∫

Ω

∇ · (k∇u)v =

∫Ω

k∇u · ∇v −∫

Ω

∇ · (k(∇u)v).

89

Page 92: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

90 CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

By the divergence theorem, ∫Ω

∇ · (k(∇u)v) =

∫∂Ω

k(∇u)v) · n =

∫∂Ω

k∂u

∂nv.

The boundary term disappears if u and v both satisfy Dirichlet condition (since then v = 0 on ∂Ω) and also if uand v both satisfy Neumann conditions (since then ∂u/∂n = 0 on ∂Ω). Thus, in either case,

(Lu, v) = −∫

Ω

∇ · (k∇u)v =

∫Ω

k∇u · ∇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

∇ · F(u(x)) =∂

∂x1(F1(u(x))) +

∂x2(F2(u(x))) +

∂x3(F3(u(x)))

= F ′1(u(x))∂u

∂x1(x) + F ′2(u(x))

∂u

∂x2(x) + F ′3(u(x))

∂u

∂x3(x)

= F′(u(x)) · ∇u(x).

9. Using the product rule for scalar functions, we obtain

∇ · (v∇u) =

3∑i=1

∂xi

[v∂u

∂xi

]=

3∑i=1

∂v

∂xi

∂u

∂xi+ v

∂2u

∂x2i

=

3∑i=1

∂v

∂xi

∂u

∂xi+ v

3∑i=1

∂2u

∂x2i

= ∇v · ∇u+ v∆u.

11. Suppose u, v ∈ C2m(Ω). Then

(Lmu, v) = −∫

Ω

v∆u =

∫Ω

∇u · ∇v −∫∂Ω

v∂u

∂n(Green’s first identity)

=

∫Ω

∇u · ∇v

=

∫∂Ω

u∂v

∂n−∫

Ω

u∆v (Green’s first identity)

= −∫

Ω

u∆v = (u, Lmv).

The boundary terms vanish because the product that forms the integrand is zero over the entire boundary. Forexample, ∫

∂Ω

v∂u

∂n= 0

since v = 0 on Γ1 and ∂u/∂n = 0 on Γ2.

11.2 Fourier series on a rectangular domain

1. (a)

cmn = −4 (5 + 7(−1)m) (−1 + (−1)n)

m3n3π6

(b) The graphs of the error are given in Figure 11.1.

3. The solution is given by

u(x) =

∞∑m=1

∞∑n=1

cmnλmn

sin (mπx1) sin (nπx2),

where the cmn are the coefficients from Exercise 1 and

λmn = (m2 + n2)π2.

Page 93: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.2. FOURIER SERIES ON A RECTANGULAR DOMAIN 91

00.2

0.40.6

0.81

0

0.5

1

−2

0

2

x 10−3

x1

x2

00.2

0.40.6

0.81

0

0.5

1

−2

0

2

x 10−3

x1

x2

Figure 11.1: The error in approximating f(x, y) by the first 4 terms (top) and the first 25 terms (bottom) ofthe double Fourier sine series. (See Exercise 11.2.1.)

5. (a) The IBVP is

ρc∂u

∂t− κ∆u = 0.02, x ∈ Ω, t > 0,

u(x, 0) = 5, x ∈ Ω,

u(x, t) = 0, x ∈ ∂Ω, t > 0.

The domain Ω is the rectanglex ∈ R2 : 0 < x1 < 50, 0 < x2 < 50

.

(b) The solution is

u(x, t) =

∞∑m=1

∞∑n=1

amn(t) sin(mπx1

50

)sin(nπx2

50

),

where

amn(t) =

(bmn −

cmnκλmn

)e−κλmnt/(ρc) +

cmnκλmn

,

bmn =20 (−1 + (−1)m) (−1 + (−1)n)

mnπ2,

cmn =2 (−1 + (−1)m) (−1 + (−1)n)

25mnπ2,

λmn =(m2 + n2)π2

2500.

(c) The steady-state temperature us(x) satisfies the BVP

−κ∆u = 0.02, x ∈ Ω,

u(x) = 0, x ∈ ∂Ω.

The solution is

us(x) =∞∑m=1

∞∑n=1

cmnκλmn

sin(mπx1

50

)sin(nπx2

50

).

(d) The maximum difference between the temperature after 10 minutes and the steady-state temperature isabout 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, and the wave travels at a speed of 261√

2units 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 10−3 seconds.

Page 94: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

92 CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

0

20

40

60

0

20

40

60

0

0.2

0.4

0.6

0.8

1

x1

x2

Figure 11.2: The difference between the temperature in the plate after 10 minutes and the steady-state tem-perature. (See Exercise 11.2.5.)

11. The difficult task is to compute the Fourier coefficients of the initial displacement ψ. If we write

ψ(x) =

∞∑m=1

∞∑n=1

bmn sin (mπx1) sin (nπx2),

then we find that

bmn =

0, m 6= n,sin2 (mπ/2)

1250m2π2 , m = n.

We then have that

u(x, t) =

∞∑m=1

∞∑n=1

amn(t) sin (mπx1) sin (nπx2),

where amn(t) satisfies

d2amndt2

+ λmnc2amn = 0,

amn(0) = bmn,

damndt

(0) = 0.

The result is

amn(t) =

0, m 6= n,bmm cos (c

√λmmt), m = n.

Thus the solution is

u(x, t) =

∞∑m=1

bmm cos (c√λmmt) sin (mπx1) sin (mπx2).

Four snapshots of u are shown in Figure 11.3.

13. The solution is

u(x) =

∞∑m=1

∞∑n=1

4 sin (mπ/2) sin (nπ/2)

(m2 + n2)π2sin (mπx1) sin (nπx2).

The graph of u is shown in Figure 11.4.

15. (a) The IBVP is

ρc∂u

∂t− κ∆u = 0.02, x ∈ Ω, t > 0,

u(x, 0) = 5, x ∈ Ω,

u(x, t) = 0, x ∈ Γ1 ∪ Γ4, t > 0,

∂u

∂n(x, t) = 0, x ∈ Γ2 ∪ Γ3, t > 0.

The domain Ω is the rectangle x ∈ R2 : 0 < x1 < 50, 0 < x2 < 50

.

Page 95: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.2. FOURIER SERIES ON A RECTANGULAR DOMAIN 93

0

0.5

1

0

0.5

1−1

0

1

x 10−4

x1

x2

0

0.5

1

0

0.5

1−1

0

1

x 10−4

x1

x2

0

0.5

1

0

0.5

1−1

0

1

x 10−4

x1

x2

0

0.5

1

0

0.5

1−1

0

1

x 10−4

x1

x2

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

0.5

1

0

0.5

1

−0.5

0

0.5

1

x1

x2

Figure 11.4: The solution to Exercise 11.2.13.

(b) The solution is

u(x, t) =

∞∑m=1

∞∑n=1

amn(t) sin

((2m− 1)πx1

100

)sin

((2n− 1)πx2

100

),

where

amn(t) =

(bmn −

cmnκλmn

)e−κλmnt/(ρc) +

cmnκλmn

,

bmn =80

(2m− 1)(2n− 1)π2

cmn =8

25(2m− 1)(2n− 1)π2

λmn =((2m− 1)2 + (2n− 1)2)π2

10000.

(c) The steady-state temperature us(x) satisfies the BVP

−κ∆u = 0.02, x ∈ Ω,

u(x) = 0, x ∈ Γ1 ∪ Γ4,

∂u

∂n(x) = 0, x ∈ Γ2 ∪ Γ3.

The solution is

us(x) =∞∑m=1

∞∑n=1

cmnκλmn

sin

((2m− 1)πx1

100

)sin

((2n− 1)πx2

100

).

Page 96: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 differenceu(x, y, 600) − us(x, y) is graphed in Figure 11.5. (Note: The temperature variation in this problem maybe outside the range in which the linear model is valid, so these results may be regarded with some skepti-cism.)

0

20

40

60

0

20

40

60

−10

−8

−6

−4

−2

0

x1

x2

Figure 11.5: The difference between the temperature in the plate after 10 minutes and the steady-state tem-perature. (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, θ) =

∞∑m=1

am0J0(s0mr),

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 showsthat

a10.= 0.226324,

a20.= −0.0157747,

a30.= 0.00386078,

a40.= −0.00148156,

a50.= 0.000716858,

a60.= −0.000399554.

The solution (approximated by six terms of the series) is graphed in Figure 11.6.

5. The solution is

u(r, θ) =

∞∑m=1

am0J0(s0mr),

where

am0 =cm0

s20m

,

Page 97: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.3. FOURIER SERIES ON A DISK 95

−1

−0.5

0

0.5

1

−1

−0.5

0

0.5

1

0

0.05

0.1

0.15

0.2

0.25

x1

x2

Figure 11.6: The approximation to solution u, computed with six terms of the (generalized) Fourier series (seeExercise 11.3.3).

the cm0 are the coefficients of f(r, θ) = r, and the s0m are the positive roots of J0. A direct calculation showsthat

a10.= 0.141350,

a20.= −0.0371986,

a30.= 0.0106599,

a40.= −0.00537260,

a50.= 0.00283289,

a60.= −0.00182923.

The solution (approximated by six terms of the series) is graphed in Figure 11.7.

−1

−0.5

0

0.5

1

−1

−0.5

0

0.5

1

0

0.05

0.1

0.15

x1

x2

Figure 11.7: The approximation to solution u, computed with six terms of the (generalized) Fourier series (seeExercise 11.3.5).

7. If we write

φ(r, θ) =

∞∑m=1

cm0J0(αm0r) +

∞∑m=1

∞∑n=1

(cmn cos (nθ) + dmn sin (nθ)) Jn(αmnr),

where the cmn and dmn are known, and

u(r, θ, t) =

∞∑m=1

am0(t)J0(αm0r) +

∞∑m=1

∞∑n=1

(amn(t) cos (nθ) + bmn(t) sin (nθ)) Jn(αmnr),

then

amn(t) = cmne−κλmnt/(ρc), m = 1, 2, 3, . . . , n = 0, 1, 2, . . . ,

bmn(t) = dmne−κλmnt/(ρc), m, n = 1, 2, 3, . . . .

Page 98: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 exceptfor cm1, m = 1, 2, 3, . . .. Therefore,

u(r, θ, t) =

∞∑m=1

am1(t) cos (θ)J1(αm1r),

with am1(t) given above. After 30 seconds, the temperature distribution can be approximated accurately using asingle 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.

−10

−5

0

5

10

−10

−5

0

5

10

−0.04

−0.02

0

0.02

0.04

x1

x2

Figure 11.8: The approximation to solution u at t = 30, computed with one term of the (generalized) Fourierseries (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√πA. The fundamental

frequency of such a square drum is

c√

π2

(√πA)2

+ π2

(√πA)2

2π=

c

A

1√2π

.= 0.398942

c

A.

Comparing to Example 11.9, we see that the circular drum sounds a lower frequency than a square drum of equalarea.

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

K.=

4.4815 −1.1759 −1.1759 0.0000−1.1759 4.9259 0.0000 −1.3426−1.1759 0.00000 4.9259 −1.3426

0.0000 −1.3426 −1.3426 5.8148

,while the load vector is

F.=

0.111110.111110.111110.11111

.The resulting weights for the finite element approximation are given by

u = K−1F.=

0.0483980.0449790.0449790.039879

.

Page 99: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.4. FINITE ELEMENTS IN TWO DIMENSIONS 97

0 0.2 0.4 0.6 0.8 10

0.2

0.4

0.6

0.8

1

1 2

3 4

x1

x2

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 is16 × 16 and neither it nor the load vector will be reproduced here. The matrix is singular, as is expected for aNeumann 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

.

0 0.2 0.4 0.6 0.8 10

0.2

0.4

0.6

0.8

1

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

x1

x2

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 Ω, andlet φ1, . . . , φn be the standard basis for Vn. Suppose that u : Ω→ R belongs to L2(Ω). We wish to find v ∈ Vnthat minimizes ‖w − u‖L2(Ω) over all w ∈ Vn. We can write v =

∑ni=1 αiφi and use the projection theorem: v

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.

Page 100: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

98 CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

We obtain the following equations:

(v, φi) = (u, φi), i = 1, 2, . . . , n

(n∑j=1

αjφj , φi

)= (u, φi), i = 1, 2, . . . , n

⇒n∑j=1

αj (φj , φi) = (u, φi), i = 1, 2, . . . , n.

This last system of equations is equivalent to Mα = f , where M is the usual mass matrix,

Mij =

∫Ω

φjφi, i, j = 1, 2, . . . , n,

and f is the vector defined by

fi =

∫Ω

vφi, 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 formu ∈ G+ V, a(u, v) = (f, v) for all v ∈ V = C2

D(Ω),

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 takingG to be a continuous piecewise linear function whose values at the boundary nodes agree with the givenboundary function g. For simplicity, we take G to be zero at the interior nodes. The resulting load vectoris 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 triangleadjacent to the boundary.

(b) The regular triangulation of the unit square having 18 triangles has only four interior (free) nodes, and eachone 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

f.=

0.222222222222221.555555555555560.222222222222221.55555555555556

,while the solution to Ku = f is

u.=

0.277777777777780.611111111111110.277777777777780.61111111111111

.

Page 101: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.4. FINITE ELEMENTS IN TWO DIMENSIONS 99

9. (a) Consider the BVP

−∇ · (k(x)∇u) = f(x), in Ω,

∂u

∂n(x) = h(x), x ∈ ∂Ω.

(11.1)

Multiplying the PDE by a test function v ∈ V = C2(Ω) and applying Green’s first identity yields∫Ω

k∇u · ∇v =

∫Ω

fv +

∫∂Ω

kvh for all v ∈ V .

We will apply Galerkin’s method with Vm equal to the space of all continuous piecewise linear functionrelative to a given triangulation T . We label the standard basis of Vm as φ1, φ2, . . . , φn, and the nodes asz1, z2, . . . , zn. (Every node in the mesh is now free.) Thus Vn = spanφ1, φ2, . . . , φn.We then define the Galerkin approximation wn by

wn ∈ Vn, a(wn, φi) = (f, φi) +

∫∂Ω

khφi, i = 1, 2, . . . ,m.

Writing wn =∑mj=1 βjφj and

w =

β1

β2

...βn

,we obtain the system Kw = F. The stiffness matrix K ∈ Rm×m is given by

Kij = a(φj , φi), i, j = 1, 2, . . . , n,

and the load vector F ∈ Rm by

Fi = (f, φi) +

∫∂Ω

khφi, 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:∫Ω

f = −∫

Ω

∇ · (k∇u) = −∫∂Ω

k∂u

∂n= −

∫∂Ω

kh.

(c) Now consider (11.1) with

k(x) = 1, f(x) = x1x2 +3

4, h(x) = −3x2

1

5,

where Ω is the unit square. We will produce the finite element solution using the regular grid with 18triangles (16 nodes). The stiffness matrix K ∈ R16×16 is singular, as should be expected, and there areinfinitely many solutions. The unique solution u with last component equal to zero is

u =

0.36220.29840.1344−0.0843

0.37280.33020.20810.02550.38030.34470.23340.05910.36650.32570.18780.0000

.

Page 102: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

100 CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

11.5 The free-space Green’s 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

−d2ψ

dr2− 1

r

dr= φ(r)⇒ −r d

dr2− dψ

dr= rφ(r)

⇒ − d

dr

(rdψ

dr(r)

)= rφ(r).

This last ODE can be solved by integrating twice to yield the general solution

ψ(r) = c1 + c2 ln (r)−∫ r

0

ln(rs

)φ(s)s ds.

5. Let V be the space of all smooth functions defined on R2 and having compact support. We wish to show thatthe variational problem ∫

R2

∇u(x) · ∇v(x) dx = v(y) for all v ∈ V

is equivalent to ∫ 2π

0

∫ ∞0

(∂u

∂r

∂v

∂r+

1

r2

∂u

∂θ

∂v

∂θ

)v rdrdθ = v(y) for all v ∈ V

in polar coordinates.

(a) We first convert ∫R2

∇u(x) · ∇v(x) dx

to polar coordinates, where y ∈ R2 is fixed and represents the origin for the polar coordinates. By the chainrule, we have

∂u

∂x1= cos (θ)

∂u

∂r− sin (θ)

r

∂u

∂θ,∂u

∂x2= sin (θ)

∂u

∂r+

cos (θ)

r

∂u

∂θ

(cf. the derivation in Section 11.3.1) and similarly for v. Therefore,

∇u · ∇v =

(cos (θ)

∂u

∂r− sin (θ)

r

∂u

∂θ

)(cos (θ)

∂v

∂r− sin (θ)

r

∂v

∂θ

)+(

sin (θ)∂u

∂r+

cos (θ)

r

∂u

∂θ

)(sin (θ)

∂v

∂r+

cos (θ)

r

∂v

∂θ

)= cos2 (θ)

∂u

∂r

∂v

∂r− sin (θ) cos (θ)

r

∂u

∂θ

∂v

∂r− sin (θ) cos (θ)

r

∂u

∂r

∂v

∂θ+

sin2 (θ)

r2

∂u

∂θ

∂v

∂θ+

sin2 (θ)∂u

∂r

∂v

∂r+

sin (θ) cos (θ)

r

∂u

∂θ

∂v

∂r+

sin (θ) cos (θ)

r

∂u

∂r

∂v

∂θ+

cos2 (θ)

r2

∂u

∂θ

∂v

∂θ

= (sin2 (θ) + cos2 (θ))∂u

∂r

∂v

∂r+

(sin2 (θ)

r2+

cos2 (θ)

r2

)∂u

∂θ

∂v

∂θ

=∂u

∂r

∂v

∂r+

1

r2

∂u

∂θ

∂v

∂θ.

Page 103: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.5. THE FREE-SPACE GREEN’S FUNCTION FOR THE LAPLACIAN 101

It follows that ∫R2

∇u(x) · ∇v(x) dx =

∫ 2π

0

∫ ∞0

(∂u

∂r

∂v

∂r+

1

r2

∂u

∂θ

∂v

∂θ

)v rdrdθ,

as desired.

(b) We can derive the same result by starting with the PDE −∆u = δ(x− y) in polar coordinates, multiplyingby a test function, and integrating. The right-hand side becomes∫

R2

δ(x− y)v(x) dx = v(y).

On the left side, we have∫ 2π

0

∫ ∞0

(−∂

2u

∂r2− 1

r

∂u

∂r− 1

r2

∂2u

∂θ2

)vr dr dθ

= −∫ 2π

0

∫ ∞0

∂2u

∂r2vr dr dθ −

∫ 2π

0

∫ ∞0

∂u

∂rv dr dθ −

∫ ∞0

(1

r2

∫ 2π

0

∂2u

∂θ2v dθ

)r dr

=

∫ 2π

0

−r ∂u

∂rv

∣∣∣∣∞0

+

∫ ∞0

∂u

∂r

∂v

∂rr dr +

∫ ∞0

∂u

∂rv dr

dθ −

∫ 2π

0

∫ ∞0

∂u

∂rv dr dθ−∫ ∞

0

1

r2

∂u

∂θv

∣∣∣∣2π0

−∫ 2π

0

∂u

∂θ

∂v

∂θdθ

r dr

=

∫ 2π

0

∂u

∂r

∂v

∂rr dr dθ +

∫ 2π

0

∫ ∞0

1

r2

∂u

∂θ

∂v

∂θr dr dθ

=

∫ 2π

0

∂u

∂r

∂v

∂r+

1

r2

∂u

∂θ

∂v

∂θ

r dr dθ.

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

∂g

∂ρ(ρ) = − c1

ρ2

and therefore ∫ 2π

0

∫ π

0

∫ ∞0

∂g

∂ρ

∂v

∂ρρ2 sin (φ) dρ dφ dθ = −c1

∫ 2π

0

∫ π

0

∫ ∞0

1

ρ2

∂v

∂ρρ2 sin (φ) dρ dφ dθ

= −c1∫ 2π

0

∫ π

0

∫ ∞0

∂v

∂ρsin (φ) dρ dφ dθ

= −c1∫ 2π

0

∫ π

0

sin (φ)

(∫ ∞0

∂v

∂ρdρ

)dφ dθ

= −c1∫ 2π

0

∫ π

0

sin (φ) (−v(y)) dφ dθ

= c1v(y)

∫ 2π

0

∫ π

0

sin (φ) dφ dθ

= 2c1v(y)

∫ 2π

0

= 4πc1v(y).

From this we see that g is a solution of (11.83) if and only if c1 = 1/(4π).

Page 104: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

102 CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

11.6 The Green’s function for the Laplacian on a bounded domain

1. Suppose u satisfies

−∆u = f(x) in Ω,

α1u+ α2∂u

∂n= 0 on ∂Ω,

and let v be any test function in C2(Ω). Then

−∫

Ω

(∆u)v =

∫Ω

fv ⇒ −∫∂Ω

∂u

∂nv +

∫Ω

∇u · ∇v =

∫Ω

fv.

The boundary condition yields

−∂u∂n

=α1

α2u on ∂Ω,

and hence we obtainα1

α2

∫∂Ω

uv +

∫Ω

∇u · ∇v =

∫Ω

fv,

as desired.

3. Let G be the free-space Green’s function for the Laplacian and define

w(x;y) = α1G(x;y) + α∂G

∂nx(x;y)

for all x ∈ ∂Ω and y ∈ Ω. Assume that u(x) = vΩ(x;y) satisfies

−∆u = 0 in Ω

α1u+ α2∂u

∂n= w(x;y) on ∂Ω,

where

w(x;y) = α1G(x;y) + α2∂G

∂nx(x;y).

Define

u2(x) =

∫Ω

vΩ(x;y)f(y) dy.

Then, for all v ∈ C2(Ω),

−∫

Ω

(∆xvΩv = 0

⇒ −∫∂Ω

∂vΩ

∂nx(x;y)v(x) dσx +

∫Ω

∇xvΩ(x;y) · ∇v(x) dx = 0

⇒ α1

α2

∫∂Ω

vΩ(x;y)v(x) dσx −1

α2

∫∂Ω

w(x;y)v(x) dσx +

∫Ω

∇xvΩ(x;y) · ∇v(x) dx = 0

⇒ α1

α2

∫∂Ω

vΩ(x;y)v(x) dσx +

∫Ω

∇xvΩ(x;y) · ∇v(x) dx =1

α2

∫∂Ω

w(x;y)v(x) dσx.

Notice how we used the boundary condition satisfied by vΩ to substitute for ∂vΩ/∂nx. We now multiply bothsides of this last equation by f(y) and integrate over Ω to obtain

α1

α2

∫Ω

(∫∂Ω

vΩ(x;y)v(x) dσx

)f(y) dy+

∫Ω

(∫Ω

∇xvΩ(x;y) · ∇v(x) dx

)f(y) dy

=1

α2

∫Ω

(∫∂Ω

w(x;y)v(x) dσx

)f(y) dy.

Changing the order of integration in the two integrals on the left yields

α1

α2

∫∂Ω

(∫Ω

vΩ(x;y)f(y) dy

)v(x) dσx+

∫Ω

(∫Ω

∇xvΩ(x;y)f(y) dy

)· ∇v(x) dx

=1

α2

∫Ω

(∫∂Ω

w(x;y)v(x) dσx

)f(y) dy.

Page 105: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.6. THE GREEN’S FUNCTION FOR THE LAPLACIAN ON A BOUNDED DOMAIN 103

Since ∫Ω

∇xvΩ(x;y)f(y) dy = ∇(∫

Ω

vΩ(x;y)f(y) dy

)= ∇u2(x),

we obtain

α1

α2

∫∂Ω

u2(x)v(x) dσx+

∫Ω

∇u2(x) · ∇v(x) dx

=1

α2

∫Ω

(∫∂Ω

w(x;y)v(x) dσx

)f(y) dy,

as desired.

5. Let G be the free-space Green’s function for the Laplacian, and suppose vΩ(x;y) satisfies the BVP

−∆xvΩ = 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 well-defined.) We define GΩ(x;y) = G(x;y) − vΩ(x;y), and we will show that GΩ is the Green’s function for theBVP

−∆u = f(x) in Ω,

u = 0 on ∂Ω.

The weak form of the last BVP is

u ∈ C2D(Ω),

∫Ω

∇u(x) · ∇v(x) dx =

∫Ω

f(x)v(x) dx for all v ∈ C2D(Ω).

We prove that GΩ is the desired Green’s function by proving that

u(x) =

∫Ω

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

satisfies the above variational problem. We have

u(x) =

∫Ω

G(x;y)f(y) dy −∫

Ω

vΩ(x;y)f(y) dy = u1(x)− u2(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∫R2

∇u1(x) · ∇v(x) dx =

∫R2

f(x)v(x) dx for all v ∈ V,

where f has been extended to be zero outside of Ω. This last variational equation holds because G is the free-spaceGreen’s function. For any v ∈ C2

D(Ω), we can extend v to be identically zero outside of Ω and thereby obtain anelement v of V . We then have∫

Ω

∇u1(x) · ∇v(x) dx =

∫Ω

f(x)v(x) dx for all v ∈ C2D(Ω).

On the other hand, we have−∆u2(x) = 0 for all x ∈ Ω;

multiplying by v ∈ C2D(Ω) and integrating yields

−∫

Ω

∆u2(x)v(x) dx = 0 for all v ∈ C2D(Ω).

Integrating by parts on the left, we obtain∫Ω

∇u2(x) · ∇v(x) dx = 0 for all v ∈ C2D(Ω).

Page 106: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

104 CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

(Notice that the boundary term vanishes because v = 0 on ∂Ω.) Putting together the variational equationssatisfies by u1 and u2, we see that u = u1 − u2 satisfies∫

Ω

∇u(x) · ∇v(x) dx =

∫Ω

f(x)v(x) dx for all v ∈ C2D(Ω).

Also, for x ∈ ∂Ω, we have

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.

This shows that u ∈ C2D(Ω); hence u satisfies the given BVP, which shows that GΩ is the desired Green’s function.

7. Green’s second identity is ∫Ω

(v∆u− u∆v) =

∫∂Ω

(v∂u

∂n− u ∂v

∂n

).

Let GΩ be the Green’s function for the BVP

−∆u = f(x) in Ω

α1u+ α2∂u

∂n= 0 on ∂Ω,

and, for y, z ∈ Ω, define u(x) = GΩ(x;y), v(x) = GΩ(x; z). Since GΩ(x;y) satisfies

−∆xGΩ = δ(x− y) in Ω

α1GΩ + α2∂GΩ

∂nx= 0, on ∂Ω,

we see that ∫Ω

v∆u = −v(y) = −G(y; z),∫Ω

u∆v = −u(z) = −G(z;y).

Therefore, ∫Ω

(v∆u− u∆v) = G(z;y)−G(y; z).

We also have∂u

∂n= −α1

α2u on ∂Ω,

or∂GΩ

∂nx(x;y) = −α1

α2GΩ(x;y).

Similarly,∂GΩ

∂nx(x; z) = −α1

α2GΩ(x; z).

Therefore, ∫∂Ω

(v∂u

∂n− u ∂v

∂n

)=

∫∂Ω

(−α1

α2GΩ(x; z)GΩ(x;y) +

α1

α2GΩ(x;y)GΩ(x; z)

)dσx = 0.

Thus, by Green’s 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 ∂Ω.

Page 107: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.6. THE GREEN’S FUNCTION FOR THE LAPLACIAN ON A BOUNDED DOMAIN 105

Let v(x) = GΩ(x;y), where GΩ is the Green’s function for the BVP

−∆u = f(x) in Ω,

u = 0 on ∂Ω.

Finally, define Ωε = x ∈ Ω : ‖x − y‖ > ε, 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 Green’s second identity to u andv yields ∫

Ωε

(v∆u− u∆v) =

∫∂Ωε

(v∂u

∂n− u ∂v

∂n

)dσx

⇒ 0 =

∫∂Ω

(v(x)

∂u

∂n(x)− u(x)

∂v

∂n(x)

)dσx +

∫Sε(y)

(v(x)

∂u

∂n(x)− u(x)

∂v

∂n(x)

)dσx

⇒ 0 =

∫∂Ω

(0∂u

∂n(x)− φ(x)

∂GΩ

∂nx(x;y)

)dσx +

∫Sε(y)

(GΩ(x;y)

∂u

∂n(x)− u(x)

∂GΩ

∂nx(x;y)

)dσx

⇒∫∂Ω

φ(x)∂GΩ

∂nx(x;y) dσx =

∫Sε(y)

GΩ(x;y)∂u

∂n(x) dσx −

∫Sε(y)

u(x)∂GΩ

∂nx(x;y) dσx.

Now, recall that GΩ = G− vΩ, where G is the free-space Green’s function for the Laplacian and vΩ(x;y) satisfies

−∆xvΩ = 0 in Ω,

vΩ(x;y) = G(x;y) on ∂Ω.

We therefore have∫∂Ω

φ(x)∂GΩ

∂nx(x;y) dσx =

∫Sε(y)

G(x;y)∂u

∂n(x) dσx −

∫Sε(y)

u(x)∂G

∂nx(x;y) dσx−∫

Sε(y)

vΩ(x;y)∂u

∂n(x) dσx +

∫Sε(y)

u(x)∂vΩ

∂nx(x;y) dσx.

The integrands for the last two integrals are continuous, with no singularities as ε → 0+. Therefore, these twointegrals tend to zero as ε→ 0+. We have

G(x;y) = − 1

2πln (‖x− y‖) ,

and therefore G(x;y) is constant for x ∈ Sε(y). It follows that∫Sε(y)

G(x;y)∂u

∂n(x) dσx

is just a multiple of ∫Sε(y)

∂u

∂n(x) dσx =

∫Bε(y)

∆u(x) dx = 0

(applying the divergence theorem and using the fact that ∆u = 0 in Ω). It remains only to calculate∫Sε(y)

u(x)∂G

∂nx(x;y) dσx.

Now,

∇xG(x;y) = − x− y

2π‖x− y‖2

and, on Sε(y),

nx = − x− y

‖x− y‖(notice that this is the outward-pointing normal to Ωε). Therefore,

∂GΩ

∂nx(x;y) = ∇xG(x;y) · nx =

1

2πε.

Page 108: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

106 CHAPTER 11. PROBLEMS IN MULTIPLE SPATIAL DIMENSIONS

Thus ∫Sε(y)

u(x)∂G

∂nx(x;y) dσx =

1

2πε

∫Sε(y)

u(x) dσx,

which is the average value of u on Sε(y), and therefore∫Sε(y)

u(x)∂G

∂nx(x;y) dσx → u(y)

as ε→ 0+. Therefore, it finally follows, by taking the limit as ε→ 0+ in Green’s second identity, that∫∂Ω

φ(x)∂GΩ

∂nx(x;y) dσx = −u(y),

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

u(x) =

∫SR(0)

R2 − ‖x‖2

2πR‖x− y‖2 φ(y) dσy.

Now suppose that u is to represented as a function of polar coordinates (r, θ). Let the circle SR(0) be representedby y = (R cos (ψ), R sin (ψ)), 0 ≤ ψ ≤ 2π. Then

dσy =

√(∂y1

∂ψ

)2

+

(∂y2

∂ψ

)2

dψ =√R2 cos2 (ψ) +R2 sin2 (ψ) dψ = Rdψ.

With x represented by the polar coordinates (r, θ), we have ‖x‖2 = r2 and

‖x− y‖2 = (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 fromy to (r, θ) thus yields∫

SR(0)

R2 − ‖x‖2

2πR‖x− y‖2 φ(y) dσy =1

∫ 2π

0

R2 − r2

R2 + r2 − 2Rr cos (ψ − θ)φ(ψ) dψ,

as desired.

13. In Chapter 9, it was shown that the solution to

− d

dx

(P (x)

du

dx

)+R(x)u = 0, a < x < b,

u(a) = ua,

u(b) = ub

is

u(y) = P (a)ua∂G

∂y(y; a)− P (b)ub

∂G

∂y(y; b),

where G is the Green’s function for the inhomogeneous differential equation with homogeneous boundary condi-tions. If we take P (x) = 1, we obtain

u(y) = −(−∂G∂y

(y; a)ua +∂G

∂y(y; b)ub

).

Thus u is obtained by “integrating” (that is, summing) the normal derivative of the Green’s function, times theboundary “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

(y; a)

Page 109: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.7. GREEN’S FUNCTION FOR THE WAVE EQUATION 107

is the normal derivative of G at x = a, while∂G

∂y(y; b)

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

u(x) =

∫SR(z)

R2 − ‖x− z‖2

2πR‖x− y‖2 φ(y) dσy.

Substituting x = z, we see that ‖z− y‖2 = R2 (since y ∈ SR(z), and of course ‖z− z‖2 = 0; therefore,

u(z) =

∫SR(z)

R2

2πR3φ(y) dσy =

1

2πR

∫SR(z)

φ(y) dσy.

Thus u(z) is the average value of u over the circle SR(z) (recall that u(y) = φ(y) on SR(z)).

11.7 Green’s function for the wave equation

1. Let ψ : R3 → R, c ∈ R, and y ∈ R3 be given. Then, by the chain rule,

∂t(ψ(x + cty)) =

3∑i=1

∂ψ

∂xi(x + cty)

∂t(xi + ctyi)

=

3∑i=1

∂ψ

∂xi(x + cty)(cyi)

= c

3∑i=1

∂ψ

∂xi(x + cty)yi = ∇ψ(x + cty) · y.

Similarly,

∂2

∂t2(ψ(x + cty)) =

∂t

(c

3∑i=1

∂ψ

∂xi(x + cty)yi

)

= c

3∑i=1

∂t

(∂ψ

∂xi(x + cty)yi

)

= c

3∑i=1

3∑j=1

∂2ψ

∂xj∂xi(x + cty)yi

∂t(xj + ctyj)

= c

3∑i=1

3∑j=1

∂2ψ

∂xj∂xi(x + cty)yicyj

= c23∑i=1

yi

(3∑j=1

∂2ψ

∂xj∂xi(x + cty)yj

)

= c23∑i=1

yi(∇2ψ(x + cty)y

)i

= c2y · ∇2ψ(x + cty)y.

3. We wish to derive the solution of

∂2u

∂t2− c2∆u = 0, x ∈ R2, t > 0,

u(x, 0) = 0, x ∈ R2,

∂u

∂t(x, 0) = ψ(x), x ∈ R2.

Page 110: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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

u(x, t) =t

∫∂B1(0)

ψ(x + cty) dσy.

If, in this formula, ψ does not depend on x3, then neither does u, and it is easy to see that u, regarded as afunction on R2, is the solution of the IVP given above. Therefore, it remains only to write u as an integral overa two-dimensional region, namely, B1(0). If S represents the upper hemisphere of ∂B1(0), then∫

∂B1(0)

ψ(x + cty) dσy = 2

∫S

ψ(x + cty) dσy

= 2

∫ 1

−1

∫ √1−x2

−√

1−x2

ψ(x1 + cty1, x2 + cty2)√1− y2

1 − y22

dy2 dy1

= 2

∫B1(0)

ψ(x + cty)√1− ‖y‖2

dy.

It follows that

u(x, t) =t

∫B1(0)

ψ(x + cty)√1− ‖y‖2

dy.

Performing the change of variables z = x + cty yields the alternate formula

u(x, t) =1

2πc

∫Bct(x)

ψ(z)√c2t2 − ‖z− x‖2

dy.

5. The solution of

∂2u

∂t2− c2∆u = 0, x ∈ R3, t > 0,

u(x, 0) = 0, x ∈ R3,

∂u

∂t(x, 0) = ψ(x), x ∈ R3.

is

u(x, t) =t

4π(ct)2

∫∂Bct(x)

ψ(z) dσz.

Let

ψ(x) =

1, ‖x‖ < 1,0, otherwise,

and let u be the corresponding solution of the above IVP. Suppose first that x ∈ R3, ‖x‖ > R, and t < (‖v‖−R)/c.This last condition implies that ct < ‖x‖ −R, and therefore, if z ∈ Sct(x), then

‖z− x‖ = ct < ‖x‖ −R.

It is easy to see that this condition implies that ‖z‖ > 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 > (‖x‖+R)/c, that is, ct > ‖x‖+R. Then

z ∈ Sct(x) ⇒ ‖z− x‖ = ct > ‖x‖+R,

which implies that ‖z‖ > R (since ‖z− x‖ ≤ ‖z‖+ ‖x‖). Therefore, in this case also,

z ∈ Sct(x) ⇒ ψ(z) = 0,

and we see that u(x, t) = 0.

7. The causal Green’s function is

G(x, t;y, s) =

∑∞n=1

sin (c√λn(t−s))

c√λn

ψn(x)ψn(y), t > s,

0, t < s.

Page 111: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

11.8. GREEN’S FUNCTIONS FOR THE HEAT EQUATION 109

11.8 Green’s functions for the heat equation

1. We wish to show that the Gaussian kernel,

S(x, t) = (4kπt)−n/2e−‖x‖2/(4kt)

satisfies the homogeneous heat equation in Rn. We have

∂S

∂t(x, t) = (4kπt)−n/2e−‖x‖

2/(4kt)

(‖x‖2

4kt2− n

2t

),

∂S

∂xi(x, t) = (4kπt)−n/2e−‖x‖

2/(4kt)(− xi

2kt

),

∂2S

∂x2i

(x, t) = (4kπt)−n/2e−‖x‖2/(4kt)

(x2i

4k2t2− 1

2kt

),

∆S(x, t) = (4kπt)−n/2e−‖x‖2/(4kt)

(‖x‖2

4k2t2− n

2kt

).

From these formulas, it follows immediately that

∂S

∂t(x, t)− k∆S(x, t) = 0.

3. We have seen that the IBVP

∂v

∂t− k∆v = f(x, T − t), x ∈ Ω, 0 < 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

∂t(x, t) = −∂v

∂t(x, T − t),

∆u(x, t) = ∆v(x, T − t),

and hence

−∂u∂t

(x, t)− k∆u(x, t) =∂v

∂t(x, T − t)− k∆v(x, T − t) = f(x, T − (T − t)) = f(x, 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 usatisfies

−∂u∂t− k∆u = f(x, t), x ∈ Ω, 0 < 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∫ T

0

∫Ω

u

(∂v

∂t− k∆v

)− v

(∂u

∂t− k∆u

)dx dt

=

∫Ω

∫ T

0

u∂v

∂tdt dx− k

∫ T

0

∫Ω

u∆v dx dt+

∫Ω

∫ T

0

v∂u

∂tdt dx + k

∫ T

0

∫Ω

v∆u dx dt

=

∫Ω

(uv|T0 −

∫ T

0

v∂u

∂tdt

)dx− k

∫ T

0

(∫∂Ω

u∂v

∂ndσx −

∫Ω

∇u · ∇v dx)dt+

∫Ω

∫ T

0

v∂u

∂tdx dt+

k

∫ T

0

(∫∂Ω

v∂u

∂ndσx −

∫Ω

∇u · ∇v dx)dt

=

∫Ω

(u(x, T )v(x, T )− u(x, 0)v(x, 0)) dx + k

∫ T

0

∫∂Ω

(v∂u

∂n− u ∂v

∂n

)dσx.

Page 112: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0
Page 113: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

Chapter 12

More about Fourier Series

12.1 The complex Fourier series

1. The complex Fourier series of f is∞∑

n=−∞

cneiπnx,

where c0 = 2/3 and

cn = −2(−1)n

n2π2, n = ±1,±2, . . . .

The errors in approximating f by a partial Fourier series are shown in Figure 12.1.

−1 −0.5 0 0.5 1−0.04

−0.02

0

0.02

0.04

x

−1 −0.5 0 0.5 1−0.04

−0.02

0

0.02

0.04

x

−1 −0.5 0 0.5 1−0.04

−0.02

0

0.02

0.04

x

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 +

∞∑n=1

(an cos

(nπx`

)+ bn sin

(nπx`

)),

111

Page 114: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

112 CHAPTER 12. MORE ABOUT FOURIER SERIES

−1 −0.5 0 0.5 10

0.5

1

x

−1 −0.5 0 0.5 10

0.5

1

x

−1 −0.5 0 0.5 10

0.5

1

x

Figure 12.2: The magnitude of the error in approximating f(x) = eix by its partial complex Fourier series withN = 10 (top), N = 20 (middle), and N = 40 (bottom). (See Exercise 12.1.3.)

where

a0 =1

2`

∫ `

−`g(x) dx,

an =1

`

∫ `

−`g(x) cos

(nπx`

)dx, n = 1, 2, 3, . . . ,

bn =1

`

∫ `

−`g(x) sin

(nπx`

)dx, n = 1, 2, 3, . . . ,

(see (6.25) in the text), and similarly let

h(x) = p0 +

∞∑n=1

(pn cos

(nπx`

)+ qn sin

(nπx`

)).

The complex Fourier coefficient of f is given by

cn =1

2`

∫ `

−`f(x)e−iπnx/` dx.

For n > 0, we have

cn =1

2`

∫ `

−`(g(x) + ih(x))

(cos(nπx

`

)− i sin

(nπx`

))dx

=1

2

(1

`

∫ `

−`g(x) cos

(nπx`

)dx− i1

`

∫ `

−`g(x) sin

(nπx`

)dx

+i1

`

∫ `

−`h(x) cos

(nπx`

)dx+

1

`

∫ `

−`h(x) sin

(nπx`

)dx

)=

1

2(an + qn + i(pn − bn)) .

Similarly, if n > 0, then

c−n =1

2(an − qn + i(pn + bn)) .

Finally,c0 = a0 + ip0.

7. We have

N−1∑n=0

(eπijn/N

)2

=

N−1∑n=0

(e2πij/N

)n=

e2πij − 1

e2πij/N − 1,

Page 115: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

12.2. FOURIER SERIES AND THE FFT 113

using the formula for the sum of a finite geometric series:

m∑n=0

rn =rm+1 − 1

r − 1.

Moreover, since eiθ is a 2π-periodic function of θ, we see that e2πij = 1 and hence that

N−1∑n=0

(eπijn/N

)2

= 0.

On the other hand, by Euler’s formula,

N−1∑n=0

(eiπjn/N

)2

=

N−1∑n=0

(cos

(jnπ

N

)+ i sin

(jnπ

N

))2

=

N−1∑n=0

(cos2

(jnπ

N

)− sin2

(jnπ

N

)+ 2i cos

(jnπ

N

)sin

(jnπ

N

))

=

N−1∑n=0

cos2

(jnπ

N

)−N−1∑n=0

sin2

(jnπ

N

)

+2i

N−1∑n=0

cos

(jnπ

N

)sin

(jnπ

N

).

Since this expression equals zero, we must have

N−1∑n=0

cos2

(jnπ

N

)−N−1∑n=0

sin2

(jnπ

N

)= 0,

N−1∑n=0

cos

(jnπ

N

)sin

(jnπ

N

)= 0.

The second equation is one of the results we set out to prove. The first equation can be written, using thetrigonometric identity sin2 (θ) = 1− cos2 (θ), as

N−1∑n=0

cos2

(jnπ

N

)−N−1∑n=0

(1− cos2

(jnπ

N

))= 0,

which simplifies to

2

N−1∑n=0

cos2

(jnπ

N

)= N,

orN−1∑n=0

cos2

(jnπ

N

)=N

2,

which is the desired result. The resultN−1∑n=0

sin2

(jnπ

N

)=N

2

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,

Page 116: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

114 CHAPTER 12. MORE ABOUT FOURIER SERIES

0 5 10 15 200

0.1

0.2

0.3

0.4

0.5

n

|Fn|

Figure 12.3: The magnitude of the sequence Fn from Exercise 12.2.1.

−1 −0.5 0 0.5 1−0.5

−0.4

−0.3

−0.2

−0.1

0

0.1

0.2

0.3

0.4

0.5

x

Figure 12.4: The function f(x) = x(1−x2) (the curve) and the estimates of f(xj) (the circles) computed fromthe complex Fourier coefficients of f (see Exercise 12.2.3.

where Fn15n=−16 is the DFT of fj15

j=−16,

fj = f(xj), xj = −1 +j

16, j = −16,−15, . . . , 15

(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∑n=0

Ane2πijn/N =

1

N

N−1∑n=0

N−1∑m=0

ame−2πimn/Ne2πijn/N

=1

N

N−1∑n=0

N−1∑m=0

ame2πi(j−m)n/N

=1

N

N−1∑m=0

am

N−1∑n=0

e2πi(j−m)n/N

.

If j = m, then

N−1∑n=0

e2πi(j−m)n/N =

N−1∑n=0

1 = N,

Page 117: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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∑n=0

e2πi(j−m)n/N =

N−1∑n=0

(e2πi(j−m)/N

)n

=

(e2πi(j−m)/N

)N− 1

e2πi(j−m)/N − 1

=e2πi(j−m) − 1

e2πi(j−m)/N − 1= 0.

Therefore,

am

N−1∑n=0

e2πi(j−m)n/N =

Naj , m = j,

0, m 6= j,

and so we obtainN−1∑n=0

Ane2πijn/N =

1

N

N−1∑m=0

am

N−1∑n=0

e2πi(j−m)n/N

=

1

NNaj = aj ,

as desired.

7. Below we show the exact Fourier sine coefficients of f , the coefficients estimated by the DST, and the relativeerror. Since both an and the estimated an are zero for n even, we show only an for n odd.

n an estimated an relative error

1 2.5801 · 10−1 2.5801 · 10−1 6.2121 · 10−6

3 9.5560 · 10−3 9.5511 · 10−3 5.1571 · 10−4

5 2.0641 · 10−3 2.0555 · 10−3 4.1824 · 10−3

7 7.5222 · 10−4 7.3918 · 10−4 1.7340 · 10−2

9 3.5393 · 10−4 3.3531 · 10−4 5.2608 · 10−2

11 1.9385 · 10−4 1.6778 · 10−4 1.3448 · 10−1

13 1.1744 · 10−4 8.0874 · 10−5 3.1135 · 10−1

15 7.6448 · 10−5 2.4279 · 10−5 6.8241 · 10−1

9. We have

2

N−1∑n=1

Fn sin

(jnπ

N

)= 4

N−1∑n=1

N−1∑m=1

fm sin(mnπ

N

)sin

(jnπ

N

)

= 4

N−1∑m=1

fm

N−1∑n=1

sin(mnπ

N

)sin

(jnπ

N

).

By the hint,N−1∑n=1

sin(mnπ

N

)sin

(jnπ

N

)is either N/2 or 0, depending on whether m = j or not. It then follows immediately that

2

N−1∑n=1

Fn sin

(jnπ

N

)= 4

N

2fj = 2Nfj ,

which is what we wanted to prove.

Page 118: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

116 CHAPTER 12. MORE ABOUT FOURIER SERIES

−3 −2 −1 0 1 2 3−1.5

−1

−0.5

0

0.5

1

1.5

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 thefunction 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 discontinuityat 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 obtainedby first reflecting the graph of f across the line x = ` (to obtain a function defined on [0, 2`]) and then taking theodd extension of the result. That is, f is defined by

f(x) =

f(x), 0 ≤ x ≤ `,f(2`− x), ` < x ≤ 2`,−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), andbecause 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

F (x) =

0, x = ±(2k − 1)π, k = 1, 2, 3, . . . ,(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

f(x) =

x, 0 ≤ x ≤ 1

2,

x+ 1, 12< 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 √∫ b

a

|f(x)− fN (x)|2 dx ≤

√∫ b

a

M2N dx

= MN

√b− a.

By hypothesis, MN → 0 as N →∞, which gives the desired result.

Page 119: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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

feven(x) =

f(x− 2k`), 2k` ≤ x < (2k + 1)`, k = 0,±1,±2, . . . ,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 possiblyat the points 2k` and (2k − 1)`, k = 0,±1,±2, . . .. We have

limx→2k`−

feven(x) = limx→2k`−

f(−x+ 2k`) = limx→0+

f(x) = f(0)

andlim

x→2k`+feven(x) = lim

x→2k`+f(x− 2k`) = lim

x→0+f(x) = f(0).

Since feven(2k`) = f(0) by definition, this shows that feven is continuous at x = 2κ`.

A similar calculation shows that

limx→(2k−1)`−

feven(x) = limx→(2k−1)`+

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(x), 0 ≤ x ≤ `,f(2`− x), ` < x ≤ 2`,−f(−x), −` ≤ x < 0,−f(x+ 2`), −2` ≤ x < −`.

Then define F : R→ R to be the periodic extension of f to R. Assuming f is piecewise smooth, the quarter-wavesine series of f converges to F (x) if F is continuous at x, and to

1

2[F (x−) + F (x+)]

if F has a jump discontinuity at x. If f is continuous, then its quarter-wave sine series converges to f exceptpossibly at x = 0. If f is continuous and f(0) = 0, then the quarter-wave sine series of f converges to f at everyx ∈ [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 isthe slowest to converge. The function f satisfies f(−1) = f(1), but df/dx has a discontinuity at x = 0 (and thederivative 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. Zoomingin near x = 0 shows that the overshoot is indeed about 9%; see Figure 12.7.

12.6 Mean-square convergence of Fourier series

1. (a) The infinite series∞∑n=1

1

n2

converges to a finite value.1 Therefore, 1/n ∈ `2 and so, by Theorem 12.36, the sine series converges to afunction in L2(0, 1).

1A standard result in the theory of infinite series is that

∞∑n=1

1

nk

Page 120: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

118 CHAPTER 12. MORE ABOUT FOURIER SERIES

−1 −0.5 0 0.5 1−0.5

0

0.5

1

1.5

x

y

21 terms41 terms81 terms161 terms

Figure 12.6: The function f from Exercise 12.5.5, its partial Fourier series with 21, 41, 81, and 161 terms, andthe line y = 1.09.

−0.02 0 0.02 0.04 0.06 0.08 0.11.075

1.08

1.085

1.09

1.095

1.1

1.105

x

y

21 terms41 terms81 terms161 terms

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 ofthe form f(x) = m(1− x). The Fourier sine series of such an f are

cn = 2

∫ 1

0

m(1− x) sin (nπx) =2m

nπ, n = 1, 2, 3, . . . .

Therefore, in order that cn = 1/n, we must have m = π/2. Therefore,

f(x) =π

2(1− x).

0 0.2 0.4 0.6 0.8 1−0.5

0

0.5

1

1.5

2

x

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∫ ∞1

dx

xk.

Page 121: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

12.7. A NOTE ABOUT GENERAL EIGENVALUE PROBLEMS 119

3. The infinite series∞∑n=1

(1√n

)2

=

∞∑n=1

1

n

is the harmonic series, a standard example of a divergent series. Therefore, 1/√n 6∈ `2, and so the series does

not converge to an L2(0, 1) function.

5. (a) The function f(x) = xk belongs to L2(0, 1) if and only if the integral∫ 1

0x2k dx is finite. Provided k 6= −1/2,

we have ∫ 1

0

x2k dx = limr→0+

∫ 1

r

x2k dx = limr→0+

1− r2k+1

1 + 2k=

1

1+2k, k > − 1

2,

∞, k < − 12.

For k = −1/2, ∫ 1

0

x2k dx =

∫ 1

0

dx

x= limr→0+

∫ 1

r

dx

x= limr→0+

− ln (r) =∞.

Thus we see that f ∈ L2(0, 1) if and only if k > −1/2.

(b) The first few Fourier sine coefficients of f(x) = x−1/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 shownin Figure 12.9.

0 0.2 0.4 0.6 0.8 10

2

4

6

x

y

y=x−1/4

sine series (63 terms)

0 0.2 0.4 0.6 0.8 1−0.1

0

0.1

x

Figure 12.9: The function f(x) = x−1/4, together with its partial Fourier sine series (first 63 terms) (top), andthe difference between the two (bottom). See Exercise 12.6.5.

7. Since vn → v, there exists a positive integer N such that

n ≥ N ⇒ ‖v − vn‖ <ε

2.

Then, if n,m ≥ N , we have

‖vn − vm‖ ≤ ‖vn − v‖+ ‖v − vm‖ <ε

2+ε

2= ε.

Therefore, vn is Cauchy.

12.7 A note about general eigenvalue problems

1. The proof is a direct calculation, using integration by parts (Green’s identity): Suppose u, v ∈ C2D(Ω). Then

(KDu, v) = −∫

Ω

∇ · (k(x)∇u) v =

∫Ω

k(x)∇u · ∇v −∫∂Ω

k(x)v∂u

∂n

=

∫Ω

k(x)∇u · ∇v (since v = 0 on ∂Ω)

= −∫

Ω

∇ · (k(x)∇v)u+

∫∂Ω

k(x)u∂v

∂n

= −∫

Ω

∇ · (k(x)∇v)u (since u = 0 on ∂Ω)

= (u,KDv).

Page 122: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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 thesame notation as before for the eigenvalues and eigenfunctions of the negative Laplacian on Ω, we have

u(x, t).= c1e

−κλ1t/(ρc)ψ1(x), t large.

The constant c1 is the first generalized Fourier coefficient of the initial temperature 5:

c1 =

∫Ω

5ψ1∫Ωψ2

1

.

The approximation is valid provided λ1 is a simple eigenvalue; that is, there is only one linearly independenteigenvector corresponding to λ1. Then all of the other terms in the generalized Fourier series decay to zero muchmore rapidly than does the first term.

Page 123: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

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∫TR

f when f(x) = 1, f(x) = x1, orf(x) = x2. With f(x) = 1, we have ∫

TR

f = (area of TR) · 1 =1

2

and1

2f

(1

3,

1

3

)=

1

2.

With f(x) = x1, we have ∫TR

f =

∫ 1

0

∫ 1−x1

0

x1 dx2 dx1

=

∫ 1

0

(x1 − x2

1

)dx1 =

1

2− 1

3=

1

6.

On the other hand,1

2f

(1

3,

1

3

)=

1

2· 1

3=

1

6,

so the rule is exact in this case as well. By symmetry, the rule must hold for f(x) = x2, which shows that therule 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) = x2

1, ∫TR

f =

∫ 1

0

∫ 1−x1

0

x21 dx2 dx1 =

∫ 1

0

(x2

1 − x31

)dx1 =

1

3− 1

4=

1

12,

while1

2f

(1

3,

1

3

)=

1

2· 1

9=

1

18.

3. We have ∫T

f =

∫ 3/2

1

∫ 2x1−2

0

x1x22 dx2 dx1 +

∫ 2

3/2

∫ 4−2x1

0

x1x22 dx2 dx1 =

7

120+

1

15=

1

8.

On the other hand, the mapping from TR to T is

x1 = 1 + z1 +1

2z2,

x2 = z2.

The Jacobian is

J =

[1 1

2

0 1

],

121

Page 124: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

122 CHAPTER 13. MORE ABOUT FINITE ELEMENT METHODS

and its determinant is 1. Therefore, with

g(z1, z2) = f

(1 + z1 +

1

2z2, z2

)=

(1 + z1 +

1

2z2

)z2

2 ,

we have ∫T

f =

∫TR

g =

∫ 1

0

∫ 1−z1

0

(1 + z1 +

1

2z2

)z2

2 dz2 dz1.

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 thosewith 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

dj =

i if j = ci,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 nowredefine 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 ofthe negative sign is just a trick to allow us to distinguish a free node from a constrained node; it avoids the needto store a separate flag.)

Suppose we wish to solve a BVP with inhomogenous Dirichlet conditions (on all or part of the boundary). LetG be the piecewise linear function whose nodal value is zero everywhere except at the constrained boundarynodes. At the nonfree boundary nodes, the value of G is the assigned Dirichlet data. To solve the inhomogeneousDirichlet problem, we merely need to modify the load vector by replacing

Fi =

∫Ω

fφi

by

Fi =

∫Ω

fφi − a(G,φi).

The quantity a(G,φi) is nonzero only if the free node nfi belongs to a triangle that also contains a constrainedboundary node. The point here is simply that this can easily be determined from the information in the datastructure. As we loop over the triangles, we can determine, for each, whether it contains both a free node and aconstrained 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

n−1∑i=1

2(n− i)2 + (n− i)

= 2

n−1∑j=1

j2 +

n−1∑j=1

j =2n3

3− n2

2− n

6.

This agrees with the O(2n3/3) operation count given in the text.

The computation of L−1b requires n− 1 steps, with 2(n− i) arithmetic operations per step. The total is

2

n−1∑i=1

(n− 1) = 2

n−1∑j=1

j = n2 − n.

The final step of back substitution requires n steps, with 2(n− i) + 1 operations per step, for a total of

n∑i=1

2(n− i) + 1 = 2

n−1∑j=1

j + n = n2.

The total for the two triangular solves is 2n2 − n, which also agrees with the count given in the text.

Page 125: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

13.2. SOLVING SPARSE LINEAR SYSTEMS 123

3. With

φ(x) =1

2x ·Ax− b · x,

we have

φ(x + y) =1

2(x + y) ·A(x + y)− b · (x + y) =

1

2x ·Ax + y ·Ax +

1

2y ·Ay − b · x− b · y

= φ(x) + (Ax− b) · y +1

2y ·Ay.

The fact that A is symmetric allows the simplification

1

2x ·Ay +

1

2y ·Ax = y ·Ax,

which was used above. We thus see that φ(x + y) = φ(x) +∇φ(x) · y +O(‖y‖2

), 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 secondproperty 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)

))= 7α2 − 5α− 18.

The minimizer is α = 5/14, and so

x(1) =

(23

7,

23

14

).

(b) At x(1) = (23/7, 23/14), the negative gradient is (−3/14, 3/7), so we must minimize

φ(x(1) − α∇φ

(x(1)

))=

27

196α2 − 45

196α− 529

28.

The minimizer is α = 5/6, and so

x(2) =

(87

28, 2

).

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 estimateof x.

Page 126: Contentsmsgocken/pdebook2/solutions.pdf2@ u @t 2 1:95 1011 @2u @x = f(x;t); 0

124 CHAPTER 13. MORE ABOUT FINITE ELEMENT METHODS

13.3 An outline of the convergence theory for finite element meth-ods

1. Let the vector-valued function F be defined by F(x) = (f(x), 0). Then

∇ · (φF) = φ∇ · F +∇φ · F = φ∂f

∂x1+

∂φ

∂x1f,

so, by the divergence theorem,∫Ω

φ∂f

∂x1+

∫Ω

∂φ

∂x1f =

∫Ω

∇ · (φF) =

∫∂Ω

φF · n =

∫∂Ω

φfn1.

If φ ∈ C∞0 (Ω), then the boundary integral vanishes, and we obtain∫Ω

φ∂f

∂x1= −

∫Ω

∂φ

∂x1f.

The derivation for ∂/∂x2 is exactly analogous.

3. A direct computation shows that

‖f − g‖L2 =1

2for all integers m,n,

while

‖f − g‖H1 =1

2

√1 +m2π2 + n2π2 for all m,n.

Thus the L2 error is independent of m,n, while the H1 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 sidelengths of the triangles are divided by two each time the mesh is refined.

h L2 error energy error√2/2 1.7803 · 10−2 1.0190 · 10−1

√2/4 5.6705 · 10−3 5.3955 · 10−2

√2/8 1.5112 · 10−3 2.7318 · 10−2

√2/16 3.8399 · 10−4 1.3700 · 10−2

√2/32 9.6392 · 10−5 6.8554 · 10−3

√2/64 2.4123 · 10−5 3.4283 · 10−3

We see that the L2 error goes down by a factor of approximately four each time the mesh is refined, which isconsistent with O(h2) convergence. Similarly, the energy norm of the error goes down by a factor of approximatelytwo each time the mesh is refined, which is consistent with O(h) convergence.

13.4 Finite element methods for eigenvalue problems

1. (a) Let u,v ∈ Rn contain the nodal values of piecewise linear functions uh, vh, respectively, so that

uh =

n∑i=1

uiφi, vh =

n∑i=1

viφi.

It follows that

(uh, vh) =

∫Ω

uhvh =

∫Ω

n∑i=1

(uiφi)

n∑j=1

(viφi) =

n∑i=1

n∑j=1

(∫Ω

φiφi

)uivi

=

n∑i=1

n∑j=1

Mijuivi

= u ·Mv.

(b) As shown in the text, if u and v are generalized eigenvectors for the problem Ku = λMu, then LTu andLTv are orthogonal in the Euclidean norm. But then

0 = LTu · LTv = u · LLTv = 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).