0% found this document useful (0 votes)
136 views

Partial Differential Equations PDF

This document outlines the contents of a course on partial differential equations (PDEs). Section 1 discusses PDE generalities, the transport equation, and the method of characteristics for solving initial value problems for first-order PDEs. It provides examples of solving transport equations using the method of characteristics and plotting solutions. Section 2 covers models for vibration, diffusion, and heat conduction, as well as ill-posed problems.

Uploaded by

abdulqader
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Partial Differential Equations PDF

This document outlines the contents of a course on partial differential equations (PDEs). Section 1 discusses PDE generalities, the transport equation, and the method of characteristics for solving initial value problems for first-order PDEs. It provides examples of solving transport equations using the method of characteristics and plotting solutions. Section 2 covers models for vibration, diffusion, and heat conduction, as well as ill-posed problems.

Uploaded by

abdulqader
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

MAT-51316

Partial Differential Equations


Robert Piche
Tampere University of Technology
2010

Contents
1 PDE Generalities, Transport Equation, Method of Characteristics 1
1.1 PDE Generalities . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Transport Equation . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Method of Characteristics . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Example: ut + 2ux = 0 . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Example: ut + xux = 0 . . . . . . . . . . . . . . . . . . . . . . . 4
1.6 Example: ut + (xu)x = 0 . . . . . . . . . . . . . . . . . . . . . . 5

2 Models of Vibration, Diffusion and Heat Conduction; Ill-Posed Prob-


lems 6
2.1 Vibrating String . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 One-dimensional Diffusion . . . . . . . . . . . . . . . . . . . . . 7
2.3 One-dimensional Heat Conduction . . . . . . . . . . . . . . . . . 8
2.4 Ill-posed Problems . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 One Dimensional Wave Equation 10


3.1 General Solution . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Solution of initial value problem . . . . . . . . . . . . . . . . . . 11
3.2.1 Example: Three-finger pluck . . . . . . . . . . . . . . . . 11
3.2.2 Example: Hammer blow . . . . . . . . . . . . . . . . . . 12
3.3 Energy and Uniqueness . . . . . . . . . . . . . . . . . . . . . . . 13

4 One Dimensional Diffusion Equation 14


4.1 Solution of IVP . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2 General Properties of the IVP Solution . . . . . . . . . . . . . . . 15
4.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4 Derivation of solution formula using Fourier transforms . . . . . . 17

5 Duhamels Principle; Half-Line Models 19


5.1 Duhamels Principle for ODE . . . . . . . . . . . . . . . . . . . . 19
5.2 Duhamels Principle for Diffusion Equation . . . . . . . . . . . . 19
5.3 Diffusion/Heat on the Half Line: Reflection Method . . . . . . . . 20

i
5.4 Diffusion/Heat on the Half Line with Sources . . . . . . . . . . . 21
5.5 Waves on the Half Line . . . . . . . . . . . . . . . . . . . . . . . 22

6 Separation of Variables 24
6.1 Separation of Variables for the Heat Equation . . . . . . . . . . . 24
6.2 Sturm-Liouville Theory . . . . . . . . . . . . . . . . . . . . . . . 25
6.3 Heat IBVP with Constant Coefficients . . . . . . . . . . . . . . . 26
6.4 Wave IBVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

7 Numerical Solution of PDEs with Matlab 28


7.1 Specifying an IBVP . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.2 Solving an IBVP . . . . . . . . . . . . . . . . . . . . . . . . . . 29

8 Fourier Series 32
8.1 Least-Squares Approximation, Completeness . . . . . . . . . . . 32
8.2 Classical Fourier series . . . . . . . . . . . . . . . . . . . . . . . 34
8.3 Pointwise Convergence . . . . . . . . . . . . . . . . . . . . . . . 35
8.4 Solving PDE initial value problems . . . . . . . . . . . . . . . . . 36
8.5 Heat equation with source term . . . . . . . . . . . . . . . . . . . 38

9 Laplaces Equation 40
9.1 Some Facts from Vector Analysis . . . . . . . . . . . . . . . . . . 40
9.2 Heat Flow in Three Dimensions . . . . . . . . . . . . . . . . . . 40
9.3 Membrane Vibration . . . . . . . . . . . . . . . . . . . . . . . . 41
9.4 Laplaces Equation . . . . . . . . . . . . . . . . . . . . . . . . . 43

10 Solving Two-Dimensional Laplace Equations 48


10.1 Dirichlet Problem in a disk . . . . . . . . . . . . . . . . . . . . . 48
10.2 Dirichlet Problem in a rectangle . . . . . . . . . . . . . . . . . . 50
10.3 Dirichlet-Neumann Problem in a wedge . . . . . . . . . . . . . . 52
10.4 Dirichlet Problem in the region outside a circle . . . . . . . . . . 53

11 Greens Functions 55
11.1 Greens Function for One-Dimensional Equation . . . . . . . . . 55
11.2 Greens Function for Two-Dimensional Poisson Equation . . . . . 57
11.3 Greens functions from eigenfunctions . . . . . . . . . . . . . . . 60

ii
1 PDE Generalities, Transport Equation, Method of
Characteristics
how to classify PDEs

how to model one dimensional transport phenomena by a first-order PDE

how to solve initial value problems for this equation using the method of
characteristics

how to compute and plot solutions using Maple function PDEplot

1.1 PDE Generalities


Recall that an ordinary differential equation (ODE) relates a one-variable function
u(x) and its derivatives in an equation of the form

F (x, u, u0 , u00 , . . . , u(n) ) = 0.

The order of the ODE is the highest derivative order that appears in the equation.
For example, the Malthus population growth model

u0 (t) = ru(t)

is a first-order ODE with independent variable t (time), dependent variable u (pop-


ulation), and constant parameter r (net growth rate).
An ODE is said to be linear if it has the form

a (x)u(x) + a1 (x)u0 (x) + an (x)u(n) (x) = g(x)


|0 {z }
Lu

and a linear ODE is said to be homogeneous if g 0. Linear homogeneous ODEs


have the superposition property: if u1 and u2 are solutions then so is the function
1 u1 + 2 u2 for any constants 1 , 2 . For example, the Malthus model is a linear
homogeneous ODE.
A solution of an ODE is a function that satisfies the equation everywhere in
some domain of the dependent variable. General solutions of ODEs generally
contain arbitrary constants. For example, u(t) = Aert for any constant A is a
solution of the Malthus model ODE.
A partial differential equation (PDE) relates a multivariable function u(x, y, . . .)
2u
and its derivatives ux = ux
, uxy = xy , . . . in an equation of the form

F (x, y, . . . , u, ux , uy , . . . , uxx , uxy , uyy , . . .) = 0

The order of the ODE is the highest derivative order that appears. Linear and
homogenous PDEs are defined analogously to ODEs. Here are some examples of

1
two-variable PDEs that are used to model physical phenomena:

1. ux + uy = 0 (transport; order 1, linear homogeneous)


2. ux + yuy = 0 (transport; order 1, linear homogenous)
3. ux + uuy = 0 (shock wave; order 1, nonlinear)
4. uxx + uyy = 0 (Laplace eqn; order 2, linear homogeneous)
5. utt uxx + u3 = 0 (wave with interaction; order 2, nonlinear)
6. ut + uux + uxxx = 0 (dispersive wave; order 3, nonlinear)
7. utt + uxxxx = 0 (vibrating beam; order 4, linear homog.)
8. ut iuxx = 0 (quantum mechanics; order 2, linear homog.)
A solution of a PDE is a function that satisfies the equation everywhere in some
domain of the dependent variables. For example, both u1 (x, t) = x2 + 2t and
u2 (x, t) = et sin x are solutions of the PDE ut uxx = 0 for all (x, t). General
solutions of PDEs generally involve arbitrary functions. For example, the general
solution of ux = t sin x is u(x, t) = t cos(x) + (t), and the general solution of
uxy = 0 is u(x, y) = F (y) + G(x).
In this course we will see how PDEs arise as mathematical models of phe-
nomena, we will present general properties of solutions, and learn some solution
techniques.

1.2 Transport Equation


Consider a substance (e.g. mass or energy) flowing in a region of space. Let
u(x, t) denote its density (units: [quantity] [volume]1 ) as a function of position
x and time t, and let (x, t) denote the flux (units: [quantity] [time]1 [area]1 ).
(Density and flux variations in the y and z directions are assumed to be negligible.)
The amount of substance in R ban interval a x b of a tube-shaped region of
constant cross section A is a u(x, t)A dx.

a b x
The net flux into the interval is (a, t)A (b, t)A. Let f (x, t, u) denote the
source term, that is, the rate (units: [quantity] [time] 1 [volume] 1 ) at which
substance density increases by processes other than flux, for example chemical
reaction. The rate of increase of the total amount of substance in the interval is
then
d b
Z Z b
u(x, t)A dx = (a, t)A (b, t)A + f (x, t, u)A dx,
dt a a

which can be rearranged to give


Z b
(ut + x f ) dx = 0.
a

Because [a, b] is arbitrary, this implies that the conservation equation

ut + x = f

2
should hold at every point in the region.
If we know the velocity c(x, t) (units: [length] [time]1 ) then the flux is
= cu. Substituting this constitutive equation into the conservation equation
gives the transport equation

ut + (cu)x = f. (1)

In an initial value problem for the transport equation, one seeks the function
u(x, t) that satisfies (1) and that satisfies u(x, 0) = u0 (x) for some given initial
density profile u0 .

1.3 Method of Characteristics


The transport equation (1) can be written as cux +ut = f cx u,  that is, as
c ux
c u = g where g(x, t, u) = f cx u, c = , and u = . The
1 ut
transport equation thus has a geometric interpretation: we seek a surface z =
u(x, t) whose directional derivative in the direction of vector c is g(x, t, u). This
geometric interpretation is the basis for the following solution method.
Curves x = X(t)   (x, t) plane that are tangential
in the
c(x, t) t
to the vector field are called characteristic curves.
1
c
From this definition it follows that the characteristic curve that
goes through the point (x, t) = (k, 0) is the graph of the func-
tion X that satisfies the ODE
dX k x
= c(X, t) (2)
dt
with initial condition X(0) = k.
Denoting the value of u along a characteristic curve by U (t) = u(X(t), t), we
have
d u dX u
U= + = cux + ut = g,
dt x dt t
that is, the value of u along the characteristic curve is determined by the ODE

U 0 = g(X(t), t, U (t)). (3)

The solution of the ODE (2) with initial value U (0) = u0 (k) determines the value
of u along the characteristic curve that intersects the x-axis at (k, 0), because
U (0) = u(X(0), 0) = u(k, 0) = u0 (k). The solution surface is the collection (or
envelope) of space curves created as k takes on all real values.
The Maple code PDEplot produces the graph of the solution
 using
 numerical 
X(0) k
algorithms to solve the ODEs (23) with initial condition = .
U (0) u0 (k)
In simple enough cases, the ODEs can also be solved analytically by hand.

1.4 Example: ut + 2ux = 0


This equation models transport with constant velocity c(x, t) = 2 and no source
term.

3
The characteristic ODE is X 0 = 2. The solution of x 2t = k
t
this ODE satisfying the initial condition X(0) = k is the
straight line X = 2t + k. The characteristic curve (in
this case: the line) through a given point (x, t) crosses
k x
the x axis at (k, 0) with k = x 2t.
The ODE describing the value of u along a charac-
teristic line is U 0 (t) = 0, i.e. the value is constant along the line. The solution
of this ODE satisfying the initial condition U (0) = u0 (k) is U (t) = u0 (k). The
solution of the PDE initial value problem is therefore u(x, t) = u0 (x 2t). In
2 2
particular, if u0 (x) = ex then the solution is u(x, t) = e(x2t) .
The solution of the PDE ut +2ux = 0 with ini-
2
tial profile u0 (x) = ex can be plotted in Maple
by the commands

> PDE:=diff(u(x,t),t)+2*diff(u(x,t),x)=0;
> with(PDEtools):
> PDEplot(PDE,[x,0,exp(-x2)],
x=-3..3,t=0..2); 0.8
2
0.6
The plot shows how the initial profile translates u(x,t) 1.5
0.4
to the right at constant speed without changing 1 t
shape. 0.2

0.5
-2 0 2 4 0
1.5 Example: ut + xux = 0 x 6

This equation can also be written as ut + (xu)x = u, which is of the form of


the transport equation (1) with source term f (x, t, u) = u. This equation models
transport in a velocity field c(x, t) = x, that is, the velocity is equal to the distance
from the origin. The source term f (x, t, u) = u models generation of substance
at a rate equal to the amount of substance.
The characteristic ODE is X 0 = X. The solution
of this ODE satisfying the initial condition X(0) = k t
is X = ket . The characteristic curve through a given x = ket
point (x, t) crosses the x axis at (k, 0) with k = xet .
The ODE describing the value of u along a charac-
teristic curve is U 0 = 0, i.e. the value is constant along
the curve. The solution of this ODE satisfying the ini-
tial condition U (0) = u0 (k) is U (t) = u0 (k). The k x
solution of the PDE initial value problem is therefore
2
u(x, t) = u0 (xet ). In particular, if the initial profile is u0 (x) = e(x3) then the
t 2
solution is u(x, y) = e(xe 3) .
The solution of the PDE ut + xux = 0 with
2
initial profile u0 (x) = e(x3) can be plotted in
Maple by the commands

> PDE:=diff(u(x,t),t)
+x*diff(u(x,t),x)=0; 2
> PDEplot(PDE,[x,0,exp(-(x-3)2)], 0.8 1.5
t
x=0..6,t=0..2); 0.6 1
u(x,t) 0.5
0.4
0
4 0.2
40
30
20
10 x
0
The PDE solution spreads out as time advances,
and the surface height remains constant along the
characteristic curves, and so the total amount of
substance increases as time advances.

1.6 Example: ut + (xu)x = 0


This equation models transport in the same velocity field as the previous example,
but without the source term. The characteristic curves are the same as in the
previous example.
Rewriting the equation in the form ut + xux = u, we see that the ODE
describing the value of u along a characteristic curve is U 0 = U .The solution of
this ODE satisfying the initial condition U (0) = u0 (k) is U (t) = u0 (k)et . The
solution of the PDE initial value problem is therefore u(x, t) = u0 (xet )et . In
2
particular, if the initial profile is u0 (x) = e(x3) then the solution is u(x, y) =
t 2
e(xe 3) t .
The solution of the PDE ut + xux = 0 with
2
initial profile u0 (x) = e(x3) can be plotted in
Maple by the commands
0.8 2

> PDE:=diff(u(x,t),t) 1.5


0.6
+diff(x*u(x,t),x)=0; 1
t

u(x,t)
> PDEplot(PDE,[x,0,exp(-(x-3)2)], 0.4 0.5

x=0..6,t=0..2); 0
40
0.2
30
The PDE solution spreads out as time advances, 20 x
10
and because there is no source term, the solu- 0

tion also decreases in amplitude, so that the total


amount of substance remains constant (conserva-
tion law).

5
2 Models of Vibration, Diffusion and Heat Conduc-
tion; Ill-Posed Problems
how to derive the PDE for the vibrating string
how to derive the PDE for one-dimensional diffusion or heat conduction
how to model boundary conditions for these PDEs
some examples of ill-posed problems

2.1 Vibrating String


Consider a thin flexible string moving in the xz plane. Assume that points of the
string move in the z direction only, and let z = u(x, t) denote the shape of the
string.
Longitudinal force balance: Let T (x, t) be the ten-
sion, assumed to act tangentially along the string. Let
= tan1 ux denote the angle between the string tan-
gent and the x axis. The only longitudinal forces acting
on the part of the string between x = a and x = b are the
x components of the tension force, and because there is
no longitudinal motion these forces must be equal, that
is,
T (b, t) cos (b, t) = T (a, t) cos (a, t).
Because the segment is arbitrary, this implies T cos is constant with respect to
x, say
T (x, t) cos (x, t) = (t).
Mass conservation: Let (x, t) be the strings mass per unit length, which may
vary as the string deforms during the motion, and let 0 (x) be the mass per unit
p If dx represents an element of length when the
length when the string is straight.
0
string is straight and dx = 1 + u2x dx is the length element of the deformed
string, then mass conservation requires that dx0 = 0 dx.
Transverse force balance: By Newtons law, the net transversal force on a
string segment [a, b] is equal to the time derivative of the momentum:
d b
Z
ut dx0 = T (b, t) sin (b, t) T (a, t) sin (a, t)
dt a
= T (b, t) cos (b, t) tan (b, t)
T (a, t) cos (a, t) tan (a, t)
= (t) (ux (b, t) ux (a, t))
Z b
= uxx dx.
a
d
Rb
Because of mass conservation, the left hand side can be written as dt a
ut 0 dx =
Rb
u dx, and so the transverse force balance becomes
a 0 tt
Z b
(0 utt uxx ) dx = 0.
a

6
Because the interval is arbitrary, this implies

0 utt uxx = 0
p
for all (x, t) in the solution domain. Denoting c = /0 , this can be written

utt = c2 uxx ,

which is the one-dimensional wave equation.


If the string is modelled to have finite length, say x [0, l], then it is necessary
to specify the boundary conditions. If the motion at the ends is known, this can
be modelled by the Dirichlet condition

u(0, t) = h0 (t), u(l, t) = h1 (t)

In particular, fixed ends are modelled by h0 0 and h1 0.


An end support at x = l that is not perfectly rigid can be modelled as a lin-
ear spring where the spring force is ku(l, t), with k being the spring constant.
The force balance with the transverse component of the
tension T

T (l, t) sin (l, t) = T (l, t) cos (l, t) tan (l, t) . k


| {z } | {z }
(t) ux (l, t)

produces the Robin condition

(t)ux (l, t) + ku(l, t) = 0.

Similarly, a flexible support at the other end can be modelled by the Robin condi-
tion
(t)ux (0, t) + ku(0, t) = 0.

2.2 One-dimensional Diffusion


Recall from 1.2 that the one-dimensional conservation equation relating the den-
sity u(x, t) of material moving with flux (x, t) and source term f (x, t, u) is

ut + x = f.

Diffusion processes, whereby substance flows from areas of high concentration to


areas of low concentration, can be modelled by the constitutive relation (Ficks
law)
= kux ,
where k(x) is a material parameter (diffusivity, units: [length]2 [time]1 ). Com-
bining these equations gives the one-dimensional diffusion equation

ut (kux )x = f.

7
If the domain is of finite length, say x [0, l], then
it is necessary to specify boundary conditions. For ex-
g
ample, consider a tube whose end x = l is covered by
a thin permeable membrane, beyond which there is a
large well-stirred reservoir with given density g(t). Sup-
posing the flux through the membrane is proportional to the difference in densities
on its two faces, we have

(l, t) = (u(l, t) g(t)),

where is the membrane permeability. Substituting Ficks law gives the Robin
condition
kux (l, t) + u(l, t) = g(t).

In the limiting case /k 0 (impermeable membrane, i.e. the tube end is closed)
this becomes the Neumann condition

ux = 0,

while in the limiting case /k (no membrane) we get the Dirichlet condition

u(l, t) = g(t).

2.3 One-dimensional Heat Conduction


The one-dimensional conservation equation is equally valid when u = cT de-
notes density of heat energy. Here c(x) and (x) are material parameters (specific
heat and mass per unit length) and T is the temperature. The constitutive relation
(Fouriers law)
= KTx

models conduction, whereby heat flows from hot areas to colder areas. The ma-
terial parameter K(x) is called the heat conductivity. Combining the equations
gives the one-dimensional heat equation

c(T )t (KTx )x = f.

This is very similar to the diffusion equation, and is essentially identical to it when
c is constant.
Similarly to the diffusion equation, one can model a thin insulating layer be-
tween the end x = l and a region with given temperature T1 by a Robin condition

KTx (l, t) + T (l, t) = T1 (t)

with Neumann and Dirichlet conditions obtained as limiting cases corresponding


to perfect insulation and perfect conduction.

8
2.4 Ill-posed Problems
A mathematical model or problem often consists of a set of differential and alge-
braic equations. However, not all such sets of equations are useful models: the set
should have a unique solution, and the solution should be continuously dependent
on the available data. Such models are said to be well posed problems. Here are
some examples of PDE problems that, although they may appear to be all right
at first glance, are in fact ill-posed. Well-posed PDE problems will be presented
later in the course.

1. The boundary value problem (BVP)

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

has no solutions. The problem is overdetermined.

2. The BVP

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

has infinitely many solutions, namely, solutions of the form u = constant.


The problem is underdetermined.

3. The two-dimensional Laplace equation

uxx + uyy = 0

on the domain y > 0 with boundary conditions u(x, 0) = 0 and uy (x, 0) =


0 has the solution

u 0. If the second boundary condition
is changed to
uy (x) = e n sin(nx), the solution becomes u(x, y) = n1 e n sin(nx) sinh(ny).
We can choose n large enough to make maxx |uy (x)| as small as we like,
but no matter how small the perturbation, the solution always blows up as
y . Thus, the problem is unstable: the solution does not depend con-
tinuously on the boundary data.

9
3 One Dimensional Wave Equation
general solution of one dimensional wave equation

dAlemberts solution of initial value problem

uniqueness of IVP solution via energy

3.1 General Solution


The one dimensional wave equation

utt c2 uxx = 0 (x R, t > 0)

models the transverse vibration of a long string whose ends are so far away that
they can be neglected. The PDE can be written as the sytem of first-order PDEs
   

c v = 0, +c u = v.
t x t x

The PDE vt cvx = 0 has the characteristic equation X 0 = c, its characteristic


curves are X = ct + k, and the general solution is v(x, t) = h(x + ct) where h
is an arbitrary function.
The PDE ut + cux = v has the characteristic equation X 0 = c, and its charac-
teristic curves are X = ct + l. The value of u along the characteristic is U (t) =
u(ct + l, t); it satisfies the ODE U 0 (t) = v(ct + l, t) = h(ct + l + ct) = h(2ct + l).
Making the change of variables s = 2ct + l and U (2ct + l) = U (t), we obtain Rthe
ODE 2cU 0 (s) = h(s), which has the solution U (s) = f (s) + g where f = 2c 1
h
and g is constant along the characteristic. Then

u(x, t) = U (t) = U (2ct + l) = f (2ct + l) + g(l) = f (2ct + (x ct)) + g(x ct)


= f (x + ct) + g(x ct). (4)

The general solution (4) is the sum of a shape f that moves left at speed c and a
shape g that moves right with speed c, as shown here:
t x ct = l t
x + ct = k

l x k x

g f

x x

10
The general solution (4) indicates that information t
(about the local shape of the string) propagates at a finite range of influence
speed c along the characteristics. The displacement at a given
(x0,t0)
point in time and space (x0 , t0 ) can be deduced from values domain of dependence
lying in a cone-shaped domain of dependence of previous val-
ues; values outside this domain have no influence on the value x
of u(x0 , t0 ). Similarly, any point (x0 , t0 ) has a cone-shaped range of influence.

3.2 Solution of initial value problem


The initial value problem for the one dimensional wave equation is to find the
solution given the initial displacement and velocity, that is, we are given the initial
conditions
u(x, 0) = (x), ut (x, 0) = (x).
Substituting t = 0 into u(x, t) = f (x + ct) + g(x ct) and ut (x, t) = cf 0 (x +
ct) cg 0 (x ct) gives

(x) = f (x) + g(x), (x) = cf 0 (x) cg 0 (x).

Differentiating the first equation and solving gives

0 0
f0 = + , g0 = ,
2 2c 2 2c
which can be integrated to give
1 1
Rx )
f (x) = 2
(x) + 2c 0
() d + A
1 1
Rx (5)
g(x) = 2
(x) 2c 0
() d + B.

Adding these together gives f (x) + g(x) = (x) + A + B, so we have A + B = 0.


Then

u(x, t) = f (x + ct) + g(x ct)


1 x+ct 1 xct
Z Z
1 1
= (x + ct) + () d + A + (x ct) () d + B
2 2c 0 2 2c 0
1 x+ct
Z
1
= [(x + ct) + (x ct)] + () d (6)
2 2c xct

Formula (6) is known as dAlemberts formula.

3.2.1 Example: Three-finger pluck


Consider the infinite-length string with initial displacement given by the hat
function
(
1 |x| |x| 1
(x) =
0 otherwise

11
and initial velocity 0. dAlemberts formula (6) gives the solution as
1
u(x, t) = [(x + ct) + (x ct)].
2
This could be written more explicitly using a lot of if clauses, but such a formula
would be difficult for a human reader to interpret. A more geometric approach is
to decompose the initial shape according to (5) with A = B = 0, which gives the
left-moving shape f (x) = 21 (x) and the right-moving shape g(x) = 12 (x). The
solution is thus the sum of two hat functions, one moving to the left and the other
moving to the right, both at speed c (see Figure 1).

u
ct = 0
x
-1 1
u
ct = 0.5
x
-1.5 1.5
u
ct = 2
x
-3 -1 1 3

Figure 1: Three-finger pluck solution snapshots

3.2.2 x
Example: Hammer blow
Consider
-1 1
the infinite-length string with zero initial displacement and initial veloc-
ity given by the step function

1 |x| 1
(x) = x
0 otherwise.
-1 1

dAlemberts formula (6) gives the solution


1
u(x, t) = [(x + ct) (x ct)]
2c
where is the ramp function

Z x 1 x < 1 x
(x) = () d = x |x| 1 -1 1
0
1 x > 1.

The solution is the sum of two mirror-image ramp functions, one moving to the
left and the other moving to the right, both at speed c.

12
3.3 Energy and Uniqueness
Define the total energy E(t) of an infinitely long string as the sum of kinetic
energy and potential energy
1 1 2
Z Z
2
E= 0 ut dx + u dx.
2 2 x
Differentiating, we have
Z Z
0 1 1
E = 0 (2ut utt ) dx + (2ux uxt ) dx
2 2
Z
= (ut uxx + ux uxt ) dx = ut ux .

| {z }
(ut ux )x

If we assume that the support of and (i.e. the subset of the domain where they
are nonzero) is contained in a finite interval [a, b], it follows that u(x, t) is zero for
x outside the range of influence of [a, b]. Then E 0 is identically zero and the total
energy E remains constant in time.
Similarly, the total energy E(t) of a finite-length string is defined as
1 L 1 L 2
Z Z
2
E= 0 ut dx + ux dx.
2 0 2 0
If the string is assumed to be clamped at both ends, that is, u is assumed to be
subject to the homogeneous Dirichlet boundary conditions
u(0, t) = 0, u(L, t) = 0,
L
then ut (0, t) = 0 and ut (L, t) = 0, so that E 0 = ut ux = 0, and the total

0
energy remains constant.
The above principle of conservation of energy can be used to prove the unique-
ness of the solution of the initial value problem for the finite-length string with
Dirichlet boundary conditions. Let u and v be solutions of the initial-boundary
value problem, that is,


utt = c2 uxx
vtt = c2 vxx
u(x, 0) = (x) v(x, 0) = (x)




ut (x, 0) = (x) and vt (x, 0) = (x)
u(0, t) = h0 (t) v(0, t) = h0 (t)








u(L, t) = h1 (t) v(L, t) = h1 (t)

Then the difference w = u v satisfies the initial-boundary value problem




wtt = c2 wxx
w(x, 0) = 0



wt (x, 0) = 0
w(0, t) = 0





w(L, t) = 0

The energy of w at any time is equal to its energy at t = 0, which is zero, and
so wx 0, which implies that w is constant with respect to x. To satisfy the
boundary conditions, the constant must be zero. Thus w 0, that is, u v.

13
4 One Dimensional Diffusion Equation
Formula for the solution of the initial value problem

General properties of the solution

Example IVPs

Derivation of the formula using Fourier Transforms

4.1 Solution of IVP


The solution of the initial value problem for the diffusion equation ut kuxx = 0
with u(x, 0) = (x) is given by formula (8) below.
Theorem 1 Let be a bounded and piecewise continuous function on R, and let
1 x2
S(x, t) = e 4kt (x R, t > 0), (7)
4kt
where k is a positive constant. Then
Z
u(x, t) = S(x , t)() d (8)

is a smooth function that satisfies ut = kuxx for x R, t > 0, and


(x+ ) + (x )
lim u(x, t) = (x R). (9)
t0 2
P ROOF. First, note that S > 0 and that
Z Z
1 2
S(x, t) dx |{z}
= ep dp = 1. (10)
x

p = 4kt

Then  Z
|u(x, t)| max |(x)| S(x , t) d = M, (11)
xR
| {z }
M
and so the improper integral (8) converges. Also,
Z
ux (x, t) = Sx (x , t)() d

1
Z
x (x)2
= e 4kt () d [ p = (x )/ 4kt
4kt 2kt
1
Z
2

= pep (x p 4kt) dp,
kt
and this integral converges because
Z
M 2 M
|u(x, t)| |p|ep dp = .
kt kt

14
Similarly, it can be shown that ut , uxx , uxt , and derivatives of higher orders all
exist, so u is smooth. It satisfies the diffusion equation because
Z
(ut kuxx )(x, t)) = (St kSxx )(x , t)() d = 0.

| {z }
=0

The proof of (9) is omitted.

4.2 General Properties of the IVP Solution


1. The formula (8) is a convolution1 and can be written u = S (with t
treated as a parameter).

2. The function S is variously called the kernel, source function, or fundamen-


tal solution of the diffusion (or heat) equation. We have limt0 S(x, t) = 0
for x 6= 0 and limt0 S(0, t) = . Snapshots of S at various time instants
show an initial narrow peak that spreads out as time advances.

0.8
kt = 0.1

S
0.4

kt = 1
kt = 10
0
8 4 0 4 8
x

3. Any jump discontinuities in the initial shape or in its derivatives are in-
stantly smoothed out not like the wave equation.

4. If > 0 on a finite interval [a, b] and is zero elsewhere, we have u(x, t) > 0
for all x (no matter how large) and all t > 0 (no matter how small). Thus, in
this model, information has infinite speed of propagation not like the
wave equation.

5. A small change in the initial condition produces a small change in the solu-
tion. That is, if
ut = kuxx (x R, t > 0) vt = kvxx (x R, t > 0)
and
u(x, 0) = (x) v(x, 0) = (x),

then the difference w = u v satisfies wt = kwxx with initial condition


w(x, 0) = (x) (x), and by (11) we have |w(x, t)| maxxR |(x)
(x)|.

6. The initial value problem has at most one solution. This can be proved by
setting = in the previous argument.
1
R The convolution of two functions f and g is denoted f g and is given by (f g)(x) =

f (x )g() d. Convolution is semilinear (i.e. (f ) g = (f g)), commutative (f g =
gf ), associative (f (gh) = (f g)h), and distributes over addition (f (g+h) = f g+f h).

15
7. The identity (10) can be interpreted in terms of the IVP: u 1 is indeed a
solution of the diffusion equation for 1.

4.3 Examples
Initial profile = step Solve the one-dimensional diffusion equation ut = kuxx
with initial condition
 1
0 (x < 0)
u(x, 0) = Heaviside(x) = . x
1 (x > 0)

Write the solution using the standard function erf, which is defined as
1
Z u
2 p2
erf(u) = e dp.
0 3
x
3

1
Solution. The solution formula (8) gives

u(x, t) = ( S)(x, t)
Z
1 2
= ez /(4kt) (x z) dz
4kt
1
Z x
2

= ez /(4kt) dz [ p = z/ 4kt
4kt
Z x/4kt
1 2
= ep dp

Z 0 Z x/4kt
1 2 1 2
= ep dp + ep dp
0
1 1
= + erf(x/ 4kt).
2 2
1 kt = 0.1
kt = 1
kt = 10

u 0.5

0
8 4 0 4 8
x

Initial profile = exponential Solve the one-dimensional diffusion equation ut =


kuxx with initial condition

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

16
Solution. The solution formula (8) gives
Z
1 2
u(x, t) = e(x) /(4kt) e d
4kt
Z
1 (x2kt)2
= e 4kt +ktx d
4kt
Z
(xkt) 1 (x2kt)2
= e e 4kt d
4kt
| {z }
=1
= (x kt),

that is, the initial shape translates to the right with speed k.

4.4 Derivation of solution formula using Fourier transforms


The Fourier transform F = Ff and the inverse Fourier transform f = F 1 F are
given by the formulas
Z Z
ix 1
F () = f (x)e dx, f (x) = F ()eix d.
2

These transforms have many useful properties, including:


Linearity of FT and IFT: If g(x) = 1 f1 (x)+2 f2 (x) then G() = 1 F1 ()+
2 F2 (). If G() = 1 F1 () + 2 F2 () then g(x) = 1 f1 (x) + 2 f2 (x).

FT of derivative: (Ff 0 )() = iF ().

FT of convolution: (F[f1 f2 ])() = F1 ()F2 ().


The Fourier transform can be used to solve the diffusion equation IVP as
follows. Transforming ut kuxx gives the ordinary differential equation Ut +
2
k 2 U = 0, which has the solution U (, t) = Ce kt . The initial condition gives
2
C = U (, 0) = (), so we have U (, t) = ()e kt . Thus u = f , where
2
f is the inverse Fourier transform of F () = e kt .
The inverse Fourier transform can be found Rfrom standard tables, or it can be
2
derived as follows. Differentiating f (x) = 2 e kt eix d gives
1

Z
0 1 2
f (x) = e kt ieix d
2
Z
1 i 2 kt ix 1 x 2 kt ix
= e e e e d
2 2kt 2 2kt

x
= f (x).
2kt
2 /(4kt)
Multiplying by ex gives the differential equation
2 /(4kt) x x2 /(4kt)
ex f 0 (x) + e f (x) = 0,
| {z2kt }
 0
2
ex /(4kt) f (x)

17
2 /(4kt)
which has the solution ex f (x) = constant. The constant is determined by
the initial condition
Z
1 2 kt 1
f (0) = e d = .
2 4kt
x2
1
Thus f (x) = 4kt e 4kt , which coincides with the formula of the fundamental
solution given in (7).

18
5 Duhamels Principle; Half-Line Models
how to solve linear problems with source terms (Duhamels Principle)

how to solve diffusion models on the half-line x > 0

how to solve wave models on the half-line x > 0

5.1 Duhamels Principle for ODE


Consider the linear homogeneous ODE

u + Au = 0, (12)

where u(t) is a vector and A is a constant square matrix. The source operator
S(t) is a square matrix such that, for any vector , u(t) = S(t) is a solution
of (12) with initial condition u(0) = . It follows that

S(0) = I and S(t) + AS(t) = 0,

where I is the identity matrix. For example, the scalar IVP u + u = 0, u(0) =
has the solution u(t) = et , that is, the source operator is S(t) = et .
The following theorem shows how the general solution of the homogeneous
ODE can be used to solve the ODE with a source term.
Theorem 2 (Duhamels Principle) The function
Z t
u(t) = S(t )f ( ) d + S(t) (13)
0

satisfies the differential equation u + Au = f with initial condition u(0) = .


P ROOF. We have u(0) = 0 + S(0) = and
Z t
u(t) = S(t )f ( ) d + S(t t)f (t) + S(t)
0
Z t 
= A S(t )f ( ) d + S(t) + If (t)
0
= Au(t) + f (t),

which completes the proof. Rt


Note that the integral in (13) can also be written 0 S( )f (t ) d .

5.2 Duhamels Principle for Diffusion Equation


Consider now the diffusion equation, which can be written as (12) with the dot
2
representing t and A representing the operator k x 2 for functions with spatial

domain x R. The general solution of the one-dimensional diffusion equation


IVP on R was shown earlier to be
Z
1 x2
u(x, t) = S(x , t)() d, where S(x, t) = e 4kt .
4kt

19
R operator S(t) for this problem transforms
From this formula we see that the source
the function (x) into the function S(x , t)() d. Duhamels principle
thus gives the solution of the IVP with source term
ut kuxx = f (x, t), u(x, 0) = (x)
as
Z tZ Z
u(x, t) = S(x , t )f (, ) d d + S(x , t)() d. (14)
0

Example Solve the diffusion equation ut kuxx = ex on x R, t > 0 with


initial condition u(x, 0) = 0.
S OLUTION . Duhamels formula gives
Z tZ
1 (x)2
u(x, t) = p e 4k(t ) e d d
0 4k(t )
Z t
1
= ex+k(t ) d = (ekt 1)ex ,
0 k
which can be verified (by substitution) to satisfy the equation and initial condition.

5.3 Diffusion/Heat on the Half Line: Reflection Method


Consider the initial-boundary value problem

vt kvxx = 0, (x > 0, t > 0)
v(x, 0) = (x) (x > 0) (15)
v(0, t) = 0 (t > 0).

This models, for example, the ground temperature at depth x (on a flat planet!)
given an initial temperature profile and a surface temperature that is fixed at
zero.
To solve this initial-boundary value problem, we exploit the fact that the solu-
tion of the diffusion problem on the whole line is odd whenever the initial profile
is odd. We introduce the odd extension of , that is, the function on R given by

(x) (x > 0)
odd
(x) = (x) (x < 0) x
0 (x = 0)

The solution of ut kuxx = 0 on x R with initial condition u(x, 0) = odd (x)


is
Z
u(x, t) = S(x , t)odd () d

Z Z 0
odd
= S(x , t) () d + S(x , t)odd () d
0
Z Z 0
= S(x , t)() d S(x , t)() d
0
Z
00
= S(x + , t)() d
0

20
The solution of the original initial-boundary value problem (15) is then the restric-
tion of u(x, t) to the half-line x > 0, that is,
Z
v(x, t) = Shalfline (x, , t)() d, (16)
0

where
Shalfline (x, , t) = S(x , t) S(x + , t)

Example Solve the IBVP (15) with initial profile (x) = 1. This models a
sudden drop in the surface temperature.
S OLUTION . The odd extension of the initial profile can be written as 1

odd (x) = 2Heaviside(x)1 x


-1
and so, using the result from section 4.3, we have
 
v(x, t) = 2 21 + 12 erf(x/ 4kt) 1 = erf(x/ 4kt).

1
kt = 0.1 kt = 1
kt = 10

v 0.5

0
0 2 4 6 8
x

5.4 Diffusion/Heat on the Half Line with Sources


The solution formula (16) can be written as Shalfline (t), where
R the source operator
Shalfline (t) transforms the function (x) into the function 0 Shalfline (x, , t)() d.
Then, using Duhamels Principle, the solution of the IBVP with source function

wt kwxx = f, (x > 0, t > 0)
w(x, 0) = (x) (x > 0) (17)
w(0, t) = 0 (t > 0).

can be written directly as


Z tZ Z
w(x, t) = Shalfline (x, , t )f (, ) d d + Shalfline (x, , t)() d.
0 0 0

Now consider the IBVP with Dirichlet boundary condition

yt kyxx = 0, (x > 0, t > 0)


y(x, 0) = 0 (x > 0)
y(0, t) = h(t) (t > 0).

21
Setting w(x, t) = y(x, t) h(t) yields the IBVP

wt kwxx = h, (x > 0, t > 0)


w(x, 0) = h(0) (x > 0)
w(0, t) = 0 (t > 0),

which is of the same form as (17) so, using its solution and the results of the
example in section 5.3, we have

Z t Z Z
y(x, t) = h(t) h( ) Shalfline (x, , t ) d d h(0) Shalfline (x, , t) d
0 0 0
!
Z t  
x x
= h(t) erf p h( ) d h(0) erf .
0 4k(t ) 4kt

5.5 Waves on the Half Line


Consider the wave equation initial-boundary value problem

vtt c2 vxx = 0 (x > 0, t > 0)
v(x, 0) = (x), vt (x, 0) = (x) (x > 0) (18)
v(0, t) = 0 (t > 0).

This models a semi-infinite string with one end fixed.


We can use the reflection method here too, because the solution of the wave
equation on the whole line is odd whenever both and are odd. Applying
dAlemberts formula, the solution of the odd-extended problem is

Z x+ct
1 1
u(x, t) = [odd (x + ct) + odd (x ct)] + odd () d,
2 2c xct

and so the solution of (18) is


R x+ct
12 [(x + ct) + (x ct)] + 1
2c xct
() d (x ct > 0)
v(x, t) = R x+ct
1 [(x + ct) (ct x)] + 1
() d (x ct < 0).
2 2c ctx

2
Example The solution of the IBVP (18) with initial profile (x) = e(x3) and
zero initial velocity is
2 2
21 [e(x+ct3) + e(xct3) ] (x ct > 0)
v(x, t) =
1 [e(x+ct3)2 e(ctx3)2 ] (x ct < 0).
2

22
1

0
ct = 0 ct = 3
1
0 2 4 x 6 8

ct = 0.75 ct = 3.75

ct = 1.5 ct = 4.5

ct = 2.25 ct = 5.25

23
6 Separation of Variables
first steps in solving the heat and wave equation on an interval

eigenvalues and eigenfunctions (Sturm-Liouville theory)

6.1 Separation of Variables for the Heat Equation


Consider the IBVP

ut (ux )x = 0 (x (0, l), t > 0)
u(0, t) = 0, u(l, t) = 0 (t 0) (19)
u(x, 0) = (x) (x (0, l))

where (x) = c(x)(x) > 0 and (x) > 0. This models heat flow in a pipe of
length l with fixed temperatures at the ends (Dirichlet boundary conditions).
Substituting a trial solution of the form u(x, t) = X(x)T (t) into the PDE
in (19) and rearranging gives

T0 (X 0 )0
= .
T X

The function on the left side of this equation is constant with respect to x and the
function on the right side is constant with respect to t, so they are both equal to a
constant, call it . We then have two ODEs, namely

T 0 + T = 0,

which has general solution T (t) = T (0)et , and

(X 0 )0 + X = 0, (20)

which, because of the boundary conditions in (19), has the boundary conditions

X(0) = 0, X(l) = 0. (21)

The solution method is as follows:

1. find numbers n and nonzero functions Xn that satisfy the BVP (2021);

the initial condition as a linear combination of the Xn , that is,


2. express P
(x) = n Cn Xn (x);

Cn Xn (x)en t .
P
3. then u(x, t) = n

In the remainder of this lecture we focus on stage 1 of the method.

24
6.2 Sturm-Liouville Theory
Theorem 3 There are infinitely many pairs of numbers n (eigenvalues) and nonzero
functions Xn (eigenfunctions) that are solutions of problem (2021). The eigen-
values are real and positive, the eigenfunctions corresponding to distinct eigen-
values are -orthogonal, that is,
Z l
m 6= n (x)Xm (x)Xn (x) dx = 0,
0

and every eigenvalue has multiplicity 1, that is, the corresponding eigenfunction
is unique up to a multiplicative factor.
P ROOF. First, note that for any two eigenfunctions we have
0
(Xm Xn Xn0 Xm )0 = (n m )Xm Xn ;
this can be verified by expanding the left hand side then substituting the ODE.
Now, if (n , Xn ) satisfies (2021) then so does the complex conjugate pair (n , Xn ),
and so Z l l
(n n ) Xn Xn dx = (Xn0 Xn Xn0 Xn ) = 0,

0 0
Rl
and dividing this through by 0 |Xn |2 dx (which is > 0) leads us to the result
n n = 0, that is, the eigenvalues are real.
Next, if m 6= n ,
Z l
1 l
0
Xm Xn dx = (Xm Xn Xn0 Xm ) = 0,

0 n m 0
and so Xm and Xn are -orthogonal.
Next, multiplying the ODE (20) by X and integrating, we obtain
Z l Z l
0 0
X(X ) dx + X 2 dx = 0,
0 0

from which we can solve for and get


Rl l
0 2
(X ) dx XX 0
Rl 0 0

0 X(X ) dx 0
0
= Rl = Rl 0.
X 2 dx X 2 dx
0 0

The case = 0 can be ruled out, because


Z l
=0 (X 0 )2 dx = 0 X 0 0 X is constant
0

and the only constant that is consistent with the boundary conditions (21) is zero.
Finally, if (, X1 ) and (, X2 ) satisfy (2021), we have
(X10 X2 X20 X1 )0 = ( )X1 X2 = 0,
and so (X10 X2 X20 X1 ) = constant. The boundary condition (21) implies that
the constant is zero, so X10 X2 X20 X1 = 0. Then (X2 /X1 )0 = 0, so X2 /X1
is a constant, that is, the eigenfunctions corresponding to are identical up to a
multiplicative factor.
The proof of existence and infiniteness of number of eigenvalues is omitted.

25
6.3 Heat IBVP with Constant Coefficients
For the heat equation (19) with constant and , equation (20) has the general
solution p p
X(x) = A cos(x /k) + B sin(x /k),
where k = /. The boundary conditions (21) imply that A = 0 and that
p
sin(l /k) = 0.
p
This is satisfied when l /k = n for n Z, so we have the eigenvalues
n = k(n/l)2 for n {1, 2, . . .}. (The solution = 0 is rejected because the
general solution of X 00 = 0 is X(x) = E +F x, and the boundary conditions imply
E = 0 and F = 0.) The corresponding eigenfunctions are Xn (x) = sin( nx l
).
1 1
X1 X4

0 0

1 1
0 x/l 1 0 1
1 1
X2 X5

0 0

1 1
0 1 0 1
1 1
X3 X6

0 0

1 1
0 1 0 1

For initial conditions of the form

(x) = C1 sin( x
l
) + C2 sin( 2x
l
) + + Cn sin( nx
l
),

the solution of (19) is a linear combination of spatial sinusoids with amplitudes


that are exponentially decaying in time:
2 t/l2 2 t/l2 2 2 t/l2
u(x, t) = C1 sin( x
l
)ek +C2 sin( 2x
l
)e4k + +Cn sin( nx
l
)ekn .

The solution tends to zero as time advances: all the heat eventually leaks out of
the ends of the tube. Note that the terms corresponding to larger n have wavier
shape and decay in time faster.

6.4 Wave IBVP


Consider the IBVP

0 utt uxx = 0 (x (0, l), t > 0)
u(0, t) = 0, u(l, t) = 0 (t 0) (22)
u(x, 0) = (x), ut (x, 0) = (x) (x (0, l))

where 0 (x) > 0 and > 0. This models the small-amplitude transverse motion
of a taught flexible string with fixed ends.

26
Proceeding as for the heat equation, we assume a trial solution of the form
u(x, t) = X(x)T (t) and obtain two ODEs,

T 00 + T = 0,

which has the general solution T (t) = T (0) cos(t ) + 1 T 0 (0) sin(t ), and

the eigenvalue problem

X 00 + 0 X = 0, X(0) = 0, X(l) = 0.

This is a special case of (2021), so the results of Theorem 1 apply here also:
there are real positive eigenvalues 0 < 1 < 2 < with unique eigenfunctions
X1 (x), X2 (x), . . .. If the initial conditions are linear combinations of eigenfunc-
tions, that is, if
X X
(x) = An Xn (x) and (x) = Bn Xn (x),
n n

then the solution of (22) is a superposition of shapes whose amplitudes vary sinu-
soidally in time:
X p 1 p 
u(x, t) = An cos(t n ) + Bn sin(t n ) Xn (x).
n
n

The factors n are called natural frequencies and have units [radians per time
unit].
In the case where 0 is constant, the eigenvalues are n = (nc/l)2 p and the
eigenfunctions are Xn (x) = sin(nx/l) for n {1, 2, . . .}, where c = /0 .
In this case, all the natural frequencies are integer multiples of the fundamental

q

frequency 1 = c/l = l 0 . From this formula we can explain various
musical phenomena associated with guitar or violin strings:

the note rises by one octave (i.e. the frequency is doubled) when the string
is clamped at its midpoint, because the clamping produces two vibrating
strings, each half the length;

the note rises when the string is tightened, because the tightening increases
the value of .

27
7 Numerical Solution of PDEs with Matlab
How to solve IBVPs in one spatial dimension using pdepe

7.1 Specifying an IBVP


The Matlab solver pdepe solves PDEs of the form

(x, t, u, ux )ut = xm (xm f (x, t, u, ux ))x +s(x, t, u, ux ) (x (a, b), t (t0 , tfinal ])

The constant m may be 0, 1 or 2; if m > 0 then a must be non-negative. The flux


term f must depend on ux . The term must be non-negative, and may only be
zero at mesh points. Spatial discontinuities in or the source term s are allowed
but only at mesh points.
The problem has an initial condition of the form

u(x, t0 ) = (x) (a x b).

The boundary conditions are

pleft (a, t, u(a, t)) + qleft (a, t)f (a, t, u(a, t), ux (a, t)) = 0,
pright (b, t, u(b, t)) + qright (b, t)f (b, t, u(b, t), ux (b, t)) = 0

for t t0 , where qleft and qright are either identically zero or never zero.
Thus, the mathematical problem is completely defined by the specifying the
values m, a, b, t0 , tfinal and by the functions , f, s, pleft , qleft , pright , qright , .

Example 1 Consider the PDE 2 ut = uxx on 0 < x < 1 and 0 < t 2 with
boundary conditions

u(0, t) = 0, ux (1, t) = et

and initial condition u(x, 0) = sin(x). This models for example the tempera-
ture in a rod with c = 2 and K = 1 that is insulated along its length, its left
end maintained at constant zero temperature, and flux at the right end given by
Kux (1) = et (the negative sign implies that heat flows out of the rod at this
end).
The specification of the problem for solution by pdepe is

m = 0, a = 0, b = 1, t0 = 0, tfinal = 2,
(x, t, u, ux ) = 2 , f (x, t, u, ux ) = ux , s(x, t, u, ux ) = 0,
pleft (a, t, u(a, t)) = u(a, t), qleft (a, t) = 0,
pright (b, t, u(b, t)) = et , qright (b, t) = 1,
(x) = sin(x).

The exact solution for this problem can be obtained by the method of separation
of variables:
u(x, t) = et sin(x).

28
Example 2 Consider the PDE

ut = x2 (x2 f (x, t, u, ux ))x + s(x, t, u, ux ) (0 < x < 1, 0 < t 1),

where
 
5ux x (0, 0.5] 1000eu x (0, 0.5]
f (x, t, u, ux ) = , s(x, t, u, ux ) =
ux x (0.5, 1) eu x (0.5, 1)

The boundary conditions are ux (0, t) = 0 and u(1, t) = 1, and the initial condition
is 
0 x (0, 1)
(x) =
1 x = 1.
The specification of the problem for solution by pdepe is

m = 2, a = 0, b = 1, t0 = 0, tfinal = 1,
(x, t, u, ux ) = 1,
pleft (a, t, u(a, t)) = 0, qleft (a, t) = 1
pright (b, t, u(b, t)) = u(b, t) 1, qright (b, t) = 0.

and with f, s, specified as above.

7.2 Solving an IBVP


The syntax of the Matlab PDE solver for a single PDE is

sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan)

where

m is 0, 1 or 2,

pdefun is a handle to a function that computes , f and s, with calling syntax

[mu,f,s] = pdefun(x,t,u,ux)

icfun is a handle to a function that computes the initial condition , with calling
syntax

phi = icfun(x)

bcfun is a handle to a function that computes the boundary condition. Its calling
syntax is

[pleft,qleft,pright,qright] = bcfun(a,ua,b,ub,t)

where ua and ub are the values of u(a, t) and u(b, t). For m > 0 and
a = 0 the solver automatically uses the boundary condition ux (0, t) = 0
and ignores the values returned in pleft and qleft.

29
xmesh is a vector of points in [a, b] where the solution is approximated. The
solution interval end points a and b are xmesh(1) and xmesh(end),
the values of xmesh must be monotonically increasing, and the length of
xmesh must be at least 3.

tspan is a vector of time values where the solution is approximated. The start
and end times t0 and tfinal are tspan(1) and tspan(end), the values of
tspan must be monotonically increasing, and the length of tspan must
be at least 3.

sol is a three-dimensional array where sol(i,j,1) is the solution value at


time tspan(i) and mesh point xmesh(j). (The third dimension is for
systems of PDEs.)

Example 1 can be coded by the functions

function [mu,f,s] = pdex1pde(x,t,u,ux)


mu = pi2;
f = ux;
s = 0;

function phi = pdex1ic(x)


phi = sin(pi*x);

function [pleft,qleft,pright,qright] = pdex1bc(a,ua,b,ub,t)


pleft = ua;
qleft = 0;
pright = pi * exp(-t);
qright = 1;

and solved using

x = linspace(0,1,20);
t = linspace(0,2,5);
sol = pdepe(0,@pdex1pde,@pdex1ic,@pdex1bc,x,t);
u = sol(:,:,1);
surf(x,t,u)

30
1

0.8

0.6

0.4

0.2

0
2
1.5 1
0.8
1 0.6
0.5 0.4
Time t 0.2
0 0 Distance x

The code to solve this example is pdex1 which you can run from the Matlab
command line. You can look at it using the command

edit pdex1

See pdex2 for the code that solves Example 2.

31
8 Fourier Series
How to approximate a function by a linear combination of orthogonal func-
tions

Fourier series and its convergence in mean square and pointwise

Solving PDEs using Fourier series

8.1 Least-Squares Approximation, Completeness


PN
Consider the approximation of a function f (x) by a linear combination n=1 cn Xn (x)
of functions X1 , X2 , . . . that are -orthogonal on (a, b).

Theorem 4 The coefficients c1 , c2 , . . . , cN that minimize the mean-square error


of the approximation,

N
!2
Z b X
EN = (x) f (x) cn Xn (x) dx,
a n=1

are the Fourier coefficients


Rb
(x)f (x)Xn (x) dx
cn = Ra b .
(x)(X (x))2 dx
a n

Rb
P ROOF. We use the notation (f, g) = a
(x)f (x)Xn (x) dx (inner product)
p
and kf k = (f, f ) (2-norm). Then
X
EN = kf cn X n k 2
n
X X
= (f cm X m , f cn X n )
m n
X XX
2
= kf k 2 cn (f, Xn ) + cm cn (Xm , Xn )
n
|m n
{z }
X
c2n kXn k2
n
2 X
(f, Xn )2

2
X
2 (f, Xn )
= kf k + kXn k cn 2
2
,
n
kX n k n
kX n k

which is minimized when cn = (f, Xn )/kXn k2 . 2

Theorem 5 (Bessels inequality) The Fourier coefficients of f satisfy



X
c2n kXn k2 kf k2 . (23)
n=1

32
P ROOF. Substituting cn = (f, Xn )/kXn k2 into the last line of the previous proof
gives N 2 2 2
P
n=1 cn kXn k kf k . Because the sequence of partial sums is monotone
and bounded, the series converges and the limit satisfies (23). 2
We saw earlier that the eigenfunctions of a Sturm-Liouville problem corre-
sponding to distinct eigenvalues are -orthogonal. The eigenfunctions corre-
sponding to a single eigenvalue span a space of dimension at most 2, so one can
find an orthogonal basis of the space spanned by all the eigenfunctions. The fol-
lowing result, whose proof is omitted, tells about the convergence of the best least
squares approximation that uses this basis.

Theorem 6 The set of orthogonal eigenfunctions of a Sturm-Liouville problem is


complete in the sense that for everyPfunction with finite 2-norm kf k, the best least
N 2
squares approximation sN (x) = n=1 (f, Xn )Xn (x)/kX Pnk converges to f in
the mean square sense: limN kf sN k = 0. Also, n=1 c2n kXn k2 = kf k2
(Parsevals identity).

Example 1 The functions sin(nx/l) are the eigenfunctions of X 00 +X = 0 on


(0, l) with boundary conditions X(0) = 0, X(l) = 0. The corresponding Fourier
coefficients of the function f (x) = 1 (0 < x < l) are

Rl
sin(nx/l) dx 2(1 (1)n )
cn = R l0 = ,
sin2 (nx/l) dx n
0

and the eigenfunction expansion is

4
sin(x/l) + 13 sin(3x/l) + 51 sin(5x/l) + .

f (x) =

PN
Some partial sums sN (x) = n=1 cn sin(nx/l) are:

s1 s3 s5 s21

0
0 x/l 1

Parsevals identity for this example gives the interesting series

X 1 2
= .
n=1,3,...
n2 8

33
8.2 Classical Fourier series
The trigonometric basis functions 1, cos(x/l), sin(x/l), cos(2x/l), sin(2x/l),. . .
are 2l-periodic and orthogonal on(l, l), that is,
Z l
cos(mx/l) cos(nx/l) dx = 0 (m 6= n)
l
Z l
sin(mx/l) sin(nx/l) dx = 0 (m 6= n)
l
Z l
cos(mx/l) sin(nx/l) dx = 0
l

This can be verified using trigonometric identities; the first two orthogonality
results can also be derived using the orthogonality of eigenfunctions of distinct
eigenvalues for the Sturm-Liouville problem X 00 + X = 0 with periodic bound-
ary conditions, as in problem 5 of exercise set 6. Then, using the results
Z l Z l Z l
2
dx = 2l, cos (nx/l) dx = sin2 (nx/l) dx = l (n 1),
l l l

we find that the coefficients that minimize the mean square error of
N
X
1
sN (x) = a
2 0
+ an cos(nx/l) + bn sin(nx/l)
n=1

as an approximation of f are
1 l
Z
an = f (x) cos(nx/l) dx (n 0),
l l
1 l
Z
bn = f (x) sin(nx/l) dx (n 1).
l l
These are the coefficients of the classical Fourier series, which by Theorem 3
converges in the mean square sense to f provided that kf k is finite. Parsevals
identity can be written

 1 l
X Z
1 2 2 2
a +
2 0
an + b n = (f (x))2 dx.
n=1
l l

Example 2 The Fourier series coefficients of the function f (x) = x/l (l <
x < l) are
Z l
1 x
an = cos(nx/l) dx = 0 (n 0),
l l l
Z l
1 x 2
bn = sin(nx/l) dx = (1)n+1 (n 1).
l l l n
and so the Fourier series for f is
2
sin(x/l) 21 sin(2x/l) + 13 sin(3x/l) . . . .


34
Some partial sums sN (x) are:

1
s s s s
1 2 4 10
0

1
1 0 1
x/l
Parsevals identity for this example gives the interesting series

X 1 2
= .
n=1
n2 6

The above example illustrates the fact that the Fourier series of an odd-symmetric
function has only sine terms. Similarly, the Fourier series of an even function has
only cosine terms. These facts can be used to relate Fourier series with sine or co-
sine series. For example, the series in Example 1 extended to the interval (l, l)
is the Fourier series of the step function
1
1 l < x < 0 x
f (x) = 0 x=0 -l l
1 0 < x < l.

-1

8.3 Pointwise Convergence


A function f is said to be piecewise continuous on the finite interval [a, b] if f (a+ )
and f (b ) exist and f is continuous on (a, b) except for a finite number of simple
jumps (i.e. points of discontinuity where the left and right limits exist). A function
is piecewise continuous on R if it is piecewise continuous on every finite interval.
A function f is said to be piecewise C1 on [a, b] if it is piecewise continuous on
[a, b], f 0 (a+ ) and f 0 (b ) exist, and f 0 exists and is continuous in (a, b) except for a
finite number of simple jumps. A function is piecewise C1 on R if it is piecewise
C1 on every finite interval.

Theorem 7 (Dirichlets Theorem) The Fourier series of a 2l-periodic function


+ (x )
f that is piecewise C1 on R converges to f (x )+f2
for all x. In particular, it
converges to f (x) at every point x where f is continuous.

The function in Example 2 can be extended to a 2l-periodic function with


f (nl) = 0 for n Z:
1

1
5 3 1 1 3 5
x/l
This extended function is piecewise C1 , with a jump of 2 at every odd multiple of

35
l. According to Theorem 4, the Fourier series converges to the extended function
at every x. The oscillation near the jump that is seen in the partial sums (Gibbs
phenomenon) does not spoil the convergence because it becomes infinitesimally
narrow as the number of terms is increased.
Similarly, the function in Example 1 can be extended to a 2l-periodic odd
function:
1

1
5 4 3 2 1 0 1 2 3 4 5
x/l

This extended function is piecewise C1 , so the Fourier series converges to it at


every x.
Pointwise convergence does not imply mean square conver-
gence. For example, the function sequence s3
3

N
sN (x) = (x > 0)
1 + N 2 x2 s2
2
converges pointwise to the zero function, but does not converge
in the mean-square sense because
s1
l Nl 1
N2
Z Z
1
ksN k2 > dx = N dy,
0 (1 + N 2 x2 )2 0 (1 + y 2 )2
R
and 0
(1 + y 2 )2 dy = /4, so ksN k . 0
0 1 x 2

Also, mean square convergence does not imply pointwise convergence. For
example, the function sequence

N |x| < 1/N 3 N
fN (x) = (x R) x
0 otherwise
-N-3 N-3

converges in mean square to the zero function, because


Z Z 1/N 3
2 2
(fN (x)) dx = N 2 dx = 0,
1/N 3 N

but does not converge pointwise at x = 0.

8.4 Solving PDE initial value problems


Heat equation with Dirichlet boundary conditions As we saw in lecture 6,
the solution of the IBVP

ut kuxx = 0 (x (0, l), t > 0)


u(0, t) = 0, u(l, t) = 0 (t 0)
u(x, 0) = (x) (x (0, l))

36
is
 nx  2
X
u(x, t) = cn sin ek(n/l) t ,
n=1
l
where the cn are the Fourier coefficients of the initial profile,
Z l
2
cn = (x) sin(nx/l) dx.
l 0

In particular, if (x) = 1 for 0 < x < l,


we can use the coefficients from Example 1
and obtain the solution

1
2(1(1)n ) 2
X
nx
ek(n/l) t .

u(x, t) = n
sin l
n=1
0.5

A plot of the partial sum with 21 terms


shows the rapid decay of the higher fre- 0
0 1

quency terms and the disappearance of the kt/l


2 0.1 x/l
Gibbs oscillation. 0.2 0

Wave equation with Dirichlet boundary conditions As we also saw in lec-


ture 6, the solution of the IBVP

utt c2 uxx = 0 (x (0, l), t > 0)


u(0, t) = 0, u(l, t) = 0 (t 0)
u(x, 0) = (x), ut (x, 0) = (x) (x (0, l))

is
 
X l
u(x, t) = An cos(nct/l) + Bn sin(nct/l) sin(nx/l),
n=1
nc

where the An and Bn are the Fourier coefficients of the initial profiles,
Z l Z l
2 2
An = (x) sin(nx/l) dx, Bn = (x) sin(nx/l) dx.
l 0 l 0

In particular, if (x) = 0 and (x) = 1 for 0 < x < l, we can use the coefficients
from Example 1 and obtain the solution

X 2(1 (1)n )l nct nx
u(x, t) = sin( ) sin( )
n=1
n2 2 c l l

2(1 (1)n )l
 
X
1 n(ct x) 1 n(ct + x)
= 2
cos( ) 2 cos( ) .
n=1
n2 2 c l l

The second formula has the same form as the general solution of the wave equation
f (x + ct) + g(x ct). A plot of a partial sum with a large number of terms shows
the time-periodic response:

37
0.1

0.1
1

0
x/l
1
ct/l
2 0

8.5 Heat equation with source term


Consider the heat equation with Dirichlet boundary conditions

ut (ux )x = 0 (x (0, l), t > 0)


u(0, t) = 0, u(l, t) = 0 (t 0)
u(x, 0) = (x) (x (0, l))

By the method of separation of variables, we have found that the source operator
S(t) for this problem transforms the initial profile (x) into the function
X (, Xn )
Xn (x)en t ,
n
kXn k2

where Xn are -orthogonal eigenfunctions corresponding to the eigenvalues n .


Then, by Duhamels principle, the solution of the problem with source term, that
is, of
ut (ux )x = (x)f (x, t) (x (0, l), t > 0)
u(0, t) = 0, u(l, t) = 0 (t 0) (24)
u(x, 0) = 0 (x (0, l))

is Z tX
(f ( ), Xn )
u(x, t) = 2
Xn (x)en (t ) d.
0 n
kX n k

Assuming that integration and summation commute, the solution can be written
as X
u(x, t) = un (t)Xn (x),
n

where Z t
un (t) = fn ( )en (t ) d (25)
0

with Rl
(f ( ), Xn ) 0
()f (, )Xn () d
fn ( ) = = Rl .
kXn k2 ()(Xn ())2 d
0

38
Here is an alternative derivation of
Pthe solution of (24). Substituting an as-
sumed solution of the form u(x, t) = m um (t)Xm (x) into the PDE gives
X X
(x)f (x, t) = (u0m Xm um (Xm0 0
))= (u0m + m um )Xm .
m m

Multiplying through by Xn /kXn k2 and integrating gives the decoupled ODEs


1 X
2
(f (t), Xn ) = (u0m + m um )(Xm , Xn )/kXn k2 = u0n (t) + n un (t),
kX k
| n {z } m
fn (t)

each of which (with initial condition un (0) = 0) has the solution (25).
For example, for the constant-coefficient heat equation problem

ut kuxx = 1 (x (0, l), t > 0)


u(0, t) = 0, u(l, t) = 0 (t 0)
u(x, 0) = 0 (x (0, l))

we have
l
2(1 (1)n )
Z
2
fn (t) = sin(n/l) d =
l 0 n
0.1
P
and so u(x, t) = n=1 un (t) sin(nx/l)
with 0.05

2(1 (1)n ) t k(n/l)2 (t )


Z
0
un (t) = e d 0
n 0
0.4

2(1 (1)n ) 2 x/l 0.2


kt/l2
= 3 3 2
(1 ek(n/l) t ). 1 0
kn /l

39
9 Laplaces Equation
Vector Analysis facts

Diffusion and Heat flow in three dimensions

Membrane vibration

Laplaces equation

9.1 Some Facts from Vector Analysis


Let D be an open simply connected spatial domain with surface D, let n be the
outward unit normal, and let f be a vector field. Gausss divergence theorem is
Z Z
f dV = f n dA,
D D

where the divergence of the vector field having cartesian coordinates f = f1 i +


f2 j + f3 k is
f1 f2 f3
f = + + .
x y z
The gradient of a scalar field u(x) in cartesian coordinates is the vector
u u u
u = i+ j+ k.
x y z
Applying the divergence theorem to f = vu, where u and v are scalar fields,
yields Greens first identity
Z Z
(vu) n dA = (v u + vu) dV
D D

where u = u = uxx + uyy + uzz is the laplacian of u.


In two dimensional problems, D denotes a two-dimensional domain and D
denotes the closed curve that is its boundary. The divergence theorem is written
Z Z
f dA = f n dl,
D D

and Greens first identity is written


Z Z
(vu) n dl = (v u + vu) dA.
D D

9.2 Heat Flow in Three Dimensions


Consider a substance (e.g. mass or energy) flowing in a region of space. Let
u(x, t) denote its density (units: [quantity] [volume]1 ) as a function of position
~ t) denote the flux vector. (units: [quantity]
x = [x, y, z] and time t, and let (x,
1 1
[time] [area] R ). The amount of substance in a domain D is given by the
volume integral D u(x, t) dV .

40
Letting n denote the unit normal vector Ron the surface D of the domain D, the
net flux out of the domain is given by D ~ n dA. Let f (x, t, u) denote the
source term, that is, the rate (units: [quantity] [time] 1 [volume] 1 ) at which
substance density increases by processes other than flux, for example chemical
reaction. The rate of increase of the total amount of substance in the interval is
then Z Z Z
d ~ n dA +
u(x, t) dV = f (x, t, u)dV.
dt D D D

Using the divergence theorem, the surface integral can be replaced by a volume
integral, yielding Z  
ut + ~ f dV = 0.
D

Because D is arbitrary, this implies that the conservation equation

~=f
ut +

should hold at every point in the region .


Diffusion processes, whereby substance flows from areas of high concentra-
tion to areas of low concentration, can be modelled by the constitutive relation
(Ficks law)
~ = ku,

where k(x) is a material parameter (diffusivity, units: [length]2 [time]1 ). Sub-
stituting this into the conservation equation gives the three-dimensional diffusion
equation
ut (ku) = f.
When k is constant, the equation reduces to ut ku = f .
Alternatively, we can let u = cT denote density of heat energy, where c(x)
and (x) are material parameters (specific heat and mass per unit length) and T is
the temperature. The constitutive relation (Fouriers law)

~ = KT

models conduction, whereby heat flows from hot areas to colder areas. The ma-
terial parameter K(x) is called the heat conductivity. Substituting Fouriers law
into the conservation equation gives the three-dimensional heat equation

cTt (KT ) = f.

This equation is very similar to the diffusion equation, and is essentially identical
to it (except for notation) when c is constant.

9.3 Membrane Vibration


Let u(x, y, t) denote the displacement of a thin membrane that moves in the z di-
rection (vertical) only.

41
Horizontal force balance: Let T (x, y, t) be
the tension (units [force] [length]1 ), as-
sumed to act tangentially along the mem-
brane. Let D be a domain in the xy
(horizontal) plane, let D be its bound-
ary curve, and let n denote the unit out-
ward normal vector (in the xy plane) on
D. Let un = n u denote the direc-
tional derivative of u in the direction n; then
= tan1 (n u) is the angle between n
and the tension vector. Because there is no horizontal motion, the vector sum of
the horizontal forces acting on the boundary must be zero, that is,
Z
T cos n dl = 0.
D
Then, for any constant vector a, we have
Z Z
a0 = a T cos n dl = (aT cos ) n dl
Z D D Z
= (aT cos ) dA = a (T cos ) dA,
D D
R
and since a is arbitrary, this implies D (T cos ) dA = 0. Because the domain
is arbitrary, this in turn implies (T cos ) = 0, so that T cos is constant with
respect to x and y, say
T (x, y, t) cos (x, y, t) = (t).
Mass conservation: Let (x, y, t) be the membranes mass per unit area (
may vary as the membrane deforms during the motion), and let 0 (x, y) be the
mass per unit area when the membrane is plane. If dA0 represents an area element
of deformed membrane and dA represents the same element when the membrane
is plane, then mass conservation requires that dA0 = 0 dA.
Vertical force balance: Consider a membrane piece whose projection onto the
xy plane is D. By Newtons law, the net vertical force on this piece is equal to the
time derivative of the momentum:
Z Z Z
d 0
ut dA = T sin dl = T cos tan dl
dt D
ZD D
Z
= u n dl = (u) dA.
D D
Using mass conservation gives
Z
(0 utt u) dA = 0,
D
which implies
0 utt u = 0.
p
Denoting c = /0 , this can be written
utt = c2 u,
which is the two-dimensional wave equation.

42
9.4 Laplaces Equation
If the source term in the diffusion equation is constant, then the steady state equi-
librium concentration is described by the diffusion equation with the time deriva-
tive terms removed:
(ku) = f.
When k is constant this reduces to the Poisson equation
u = F
where F = f /k. The Poisson equation with no source term is Laplaces equation
u = 0.
Similar equations arise as models of steady state heat flow. A membrane sub-
jected to a transversal static load f (x) is modelled by a two-dimensional Poisson
equation
u = f.
Laplaces and Poissons equations also arise as models of gravitational fields, elec-
trostatic fields, stationary fluid flow, brownian motion, and many other phenom-
ena.
Any function that satisfies Laplaces equation is called a harmonic function.
In one dimension, Laplaces equation is uxx = 0, so one-dimensional harmonic
functions are all of the form u(x) = A+Bx. Things get more interesting in higher
dimensions, however! The following results holds in the one, two, and three (and
higher!) dimensional versions of Laplaces equation.
Theorem 8 (Maximum Principle) If u is harmonic in a connected bounded open
set , and continuous in = , then the maximum value of u is attained on
the boundary .
Proof. Let  > 0 and v(x) = u(x) +  N 2
P
i=1 xi . If v has a maximum at a point
2v
x , the hessian matrix vxx = [ xi xj ] is negative semidefinite, which implies
2v
x2i
0 for every i. But
X 2v
v = = |{z}
u +2N  > 0,
i
x2i
=0

so v cannot have a maximum inside . Because v is continuous, it has a maximum


somewhere in the compact set , say at x . Then, for all x ,
X
u(x) v(x) v(x ) = u(x ) +  (xi )2 u(x0 ) +  max |x|2
x
i

where x0 is a point where u(x0 ) = maxx u(x). Then taking  0, we


have
u(x) u(x0 ) for all x ,
which completes the proof.
Corollary 1 (Minimum Principle) For u as in Theorem 1, the minimum value is
attained on the boundary .
Proof. Apply the maximum principle to the harmonic function u. 2

43
Example 1 Find the maximum value of f (x, y) = x2 y 2 in the unit disk
x2 + y 2 1.
Solution. Because f = 0, the maximum occurs on the disk boundary. Using po-
lar coordinates, f = cos2 sin2 = cos(2) on the boundary, and the maximum
value is 1, attained at the points (x, y) = (1, 0) and at (x, y) = (1, 0). 2

Example 2 Prove that the Dirichlet problem

u = f in connected bounded , u = h on .

has at most one solution.


Solution. If u1 and u2 are two solutions, their difference w = u1 u2 is harmonic
in and w = 0 on . By the maximum/minimum principle,

0 = min w(x) w(x) max w(x) = 0,


x x

for all x , and so w 0, that is, u1 u2 .


An alternative solution is based on Greens first identity:
Z Z
w w n dA =
|{z} |w|2 + w |{z}
w dV
=0 =0

Thus w 0, so w is constant, and the constant is zero because w is continuous


and is zero on the boundary. 2

The following result indicates that the laplacian is suitable for modelling isotropic
physical phenomena, in which there is no preferred direction. A rotation of the
coordinate axes corresponds to a linear transformation x0 = Bx with orthogonal
B (that is, B T B = I) and det(B) = 1. (An orthogonal B with det(B) = 1
models a rotation with reflection.)
Theorem 9 (Rotational invariance of laplacian) If u0 (x0 ) = u(B T x0 ) with or-
thogonal B then 0 u0 = u.
Proof. By the chain rule we have
u0 X u xl
=
x0i l
xl x0i
|{z}
bil

and
2 u0 X X 2u
= bil bjp = (Buxx B T )ij .
x0i x0j l p
x l x p

Then

0 u0 = tr(u0x0 x0 ) = tr(Buxx B T ) = tr(B T Buxx ) = tr(uxx ) = u.

Theorem 10 (Mean value property) If u is harmonic in the ball D = {x : |x


x0 | = a} then the value at the centre u(x0 ) is equal to the mean value on the ball
boundary.

44
Proof. Moving the origin to x0 , the mean value of u on the boundary of the three
dimensional ball is given by
R 2
u dA
Z Z
1
m(a) = D
= u(a, , )a2 sin d d.
A 4a2 0 0

1
From Greens first identity with v 4a2
and u = 0 we have
Z Z 2 Z
1
0= vu n dA = ur (a, , ) sin d d = m0 (a),
|x|=a 4 0 0

so that the mean value on the ball surface is independent of the balls radius.
Taking a 0 gives m = u(0). The proof for one and two dimensions is similar. 2
According to the maximum principle (Theorem 1), harmonic functions attain
their maximum on the boundary. Using the mean value property we can show that
the maximum is not attained inside the region, unless the function is constant.

Corollary 2 If u is harmonic in an open connected region , is continuous in


= , and attains its maximum in , then u is constant in .

Proof. Suppose u attains its Section maximum 2.4, Laplaces Equation 47

M := max u at a point x0 . We wish


to show that at any other point xm
we must have u(xm ) = M . Let the curve
x3 "
connect x0 and xm , and choose x1
x2
the finite set of points x1 , x2 , . . . xm1 on x0
xm
to be centers of balls contained , and ar-
ranged so that the point xi+1 lies on the sur- !
face Bi of the ball Bi centred at the previ-
Figure 2.1: Diagram for Proof of Maximum Principle.
ous point xi . The values on B0 are all less than or equal to M . But, by the mean
value property u(x0 ) must be equal to the
Proof. average
Suppose of its
u attains themaximum
valuesMon := the
max!balls sur-x0 !.
u at a point

face, and so the surface values must We wish


all be to show
equal that to
at any
M other
. In point xm ! we
particular, must)have
u(x = Mm. ) = M.
u(x
1
Let the curve " ! connect x0 and xm , and choose the finite set of points
With similar arguments we obtainx1u(x , x2 , .i )
. . x= M for i = 2, 3, . . . m.
m1 on " to be centers of balls contained !, and arranged so that
the point
In spherical coordinates the laplacian i+1 x is lies on the surface Bi of the ball Bi centred at the previous
point xi . The values on B0 are all less than or equal to M.z But, by the
mean value property (Theorem 2.17) u(x0 ) must be equal to the average of
1 2  1 the values on the balls surface,1 and so the surface values must all be equal to
u = 2 r ur r + 2 M. In(uparticular, sin )u(x +1) =
u arguments we obtain u(xr i ) = M
r r sin r2M.sinWith
2 similar
y
for i = 2, 3, . . . m (Figure 2.1). The proof for the minimum is similar.

Harmonic functions in three dimensions that depend
From Theorem 2.18 we only
can obtain r satisfy
on the results of section
x 2.2.1 on con-
the ODE (r2 ur )r = 0, which has tinuous dependence
the general on boundary
solution u(r)data=and r1 + of solutions of the
c1monotonicity
Dirichlet problem.
c2 .
In cylindrical polar coordinates the laplacian
2.4.4 Existence is
of Solution
This chapter has given several uniqueness
  results but has not yet said anything
1 1
about the existence of the solution. We close the chapter with a few words
u =
(Ruabout
R )Rthis.
+ (u ) + (Ruz )z .
R R
The Dirichlet problem can in fact fail to have a solution if there are sharp
enough spikes that penetrate into the domain !. In the absence of such
Harmonic functions that depend spikes,
only however,
on distance R will
a solution from see z-axis
exist;the [9, p.198]satisfy
for details.
theDomains
encountered in applications are unlikely to cause trouble in this regard.
ODE (RuR )R = 0, which has the general solution
An alternative u(R) the
is to replace = PDE
c1 ln(R) + c2 . formulation of the
by an integral
boundary value problem that doesnt require so much smoothness in the
solution. Such variational or weak formulations are the starting point for the
45
theory of numerical methods such as the Finite Element Method.
Example 3 A circular membrane with a uniform transverse load and fixed bound-
ary is modelled by u = 1 in the domain x2 +y 2 < a2 with u = 0 on the boundary.
Find the shape of the membrane.
Solution. Assuming a solution of the form u(R), we have the ODE R1 (RuR )R =
1, which has the solution u(R) = c1 ln(R) + c2 + 14 R2 . Taking c1 = 0 (to ensure
the solution remains bounded on the z axis) and c2 = a2 /4 to ensure u(a) = 0,
we have u(R) = (R2 a2 )/4.

R w that satisfy w =
Theorem 11 (Dirichlets Principle) Among all the functions
h on , the one that minimizes the energy E(w) = 21 |w|2 dV is har-
monic.

Proof. Let u = w = h on and u = 0 in . Then, with v = u w, we have


Z
E(w) = 2 1
|(u v)|2 dV
Z
= 21 (u v) (u v) dV
Z
= E(u) + E(v) u v dV

Greens first identity gives


Z Z Z
u v dV = v u n dA
|{z} u dV = 0,
v |{z}
=0 =0

so E(w) E(u). 2
The Dirichlet principle motivates the Rayleigh-Ritz method for computing an
approximate solution of the Dirichlet problem of Example 2. Choose functions
w0 , w1 , . . . , wn such that w0 = h and w1 = = wn = 0 on , and consider
the linear combination w = w0 + c1 w1 + + cn wn . Then
Z n
! n
!
X X
E(w) = 21 w0 + ci wi w0 + cj wj dV
i=1 j=1
1 T 1 T
= 2
a b c+ 2
c Ac,
R R R
where a = |w0 |2 dV , bi = w0 wi dV , and Aij = wi wj dV .
This energy is minimized when c = A1 b, because

E(w) = 1
2
a bT (c A1 b + A1 b) + 21 (c A1 b + A1 b)T A(c A1 b + A1 b)
= 1
2
(a bT A1 b) + 21 (c A1 b)T A(c A1 b),

and A is symmetric positive definite.

Example 4 Find an approximate solution to u = 0 on the triangle {(x, y) :


x > 0, y > 0, 3x + y < 3} with the boundary conditions

u(x, 0) = 0, u(0, y) = 3y y 2 , u(x, 3 3x) = 0.

46
Solution. With w0 = (33xy)y and w1 = (33xy)xy
2
we have
u
Z 1 Z 33x
w0 w1 w0 w1 9 1
b1 = + dy dx =
0 0 x x y y 20
Z 1 Z 33x  2  2
w1 w1 3 0
A11 = + dy dx = 3
2
1

0 0 x y 2 y 1 x
0 0
3
c1 = b1 /A11 =
10
3
so the approximate solution is w0 w
10 1
= y(3 3x y)(1 0.3x).

47
10 Solving Two-Dimensional Laplace Equations
Laplace equation boundary value problems in a disk, a rectangle, a wedge,
and in a region outside a circle

10.1 Dirichlet Problem in a disk


Consider the two dimensional Laplace equation in the disk x2 + y 2 < a2 with
u = h on the boundary. The Laplace equation in polar coordinates (r, ) is

1
(rur )r + (u ) = 0
r
A separation of variables trial solution u(r, ) = R(r)() gives

1 1
R00 + R0 + 2 R00 = 0
r r
which can be rearranged to

r2 R00 rR0 00
+ = .
R R
Equating both sides to the separation constant , we are left with two ODEs,

00 + = 0 (26)

and
r2 R00 + rR0 R = 0. (27)

For 6= 0, the general solution of (26) is () = A cos + B sin .
Substituting this into the periodic boundary conditions (0) = (2) and 0 (0) =
0 (2) gives the homogeneous equations

A(1 + cos(2 )) + B sin(2 ) = 0

A sin(2 ) + B (1 + cos(2 )) = 0

This system of equations has a nontrivial solution (that is, a solution other than
A =B = 0) if thedeterminant of the coefficient matrix is zero. The determinant
is 2 (1cos(2 )), and the nonzero values of that give a nontrivial solution
are n = n2 with n = 1, 2, . . .
For = 0, the general solution of (26) is () = A + B, and the only
nontrivial periodic solution is () = A (nonzero constant).
Consider now the equation (27). For 6= 0, a trial solution of the form R(r) =
r gives
(2 )r = 0,

which implies the solutions = = n. For = 0, (27) reduces to
r(rR0 )0 = 0, which has the general solution R(r) = c1 ln r + c2 .

48
Writing the solution as a linear combination of the solutions found above, we
have
X
u(r, ) = c1 ln r + c2 + (An cos n + Bn sin n)rn
n1
X
+ (An cos n + Bn sin n)rn (28)
n1

To ensure continuity and boundedness at the origin, we set c1 = An = Bn = 0,


leaving us with
X
u(r, ) = 21 A0 + (An cos n + Bn sin n)rn
n1

where the constant term c2 has been renamed 21 A0 . At the boundary r = a we


have X
u(a, ) = 21 A0 + (An cos n + Bn sin n)an = h()
n1

and the coefficents are determined by equating An an and Bn an with the Fourier
series coefficients of h:
Z X  1 Z 
1 0 0 0 0 0
u(r, ) = h( ) d + h( ) cos n d cos n
2 n1

 Z   
1 0 0 0 r n
+ h( ) sin n d sin n (29)
a

Example 1 Find the steady-state temperature in a long cylinder of radius a if


the upper half is kept at u = 100 and the lower half is kept at u = 0.

Solution. The boundary function is h() = 50 + 50f () where


1
1 < < 0
f () = 0 =0
-
1 0 < < .

-1

In section 8 we derived the Fourier series


X 2(1 (1)n )
f () = sin(n),
n1
n

so the PDE solution can be written directly as

X 2(1 (1)n )  r n
u(r, ) = 50+50 sin(n)
n1
n a

Plotting the sum of a large number of terms gives the above figure. 2

49
The series solution (29) for the Dirichlet problem in the disk can be written as
Z " #
1 X  r n
u(r, ) = h(0 ) 1 + 2 cos n( 0 ) d0 (30)
2 n1
a

0
Letting z = ar ei( ) , the term in brackets can be written

X z z 1 z z 1 |z|2
1+ z n + z n = 1 + + = =
n1
1 z 1 z (1 z)(1 z) 1 + |z|2 (z + z)
1 (r/a)2
=
1 + (r/a)2 2(r/a) cos( 0 )

Substituting this into (30) gives the Poisson integral formula


Z
a2 r 2
 
1 0
u(r, ) = h( ) 2 d0 .
2 a + r2 2ar cos( 0 )

One application of this formula is to provide


R an0 alternative derivation of the mean
1 0
value property: the value at r = 0 is 2 h( ) d , which is the average of u on
the circumference r = a.

10.2 Dirichlet Problem in a rectangle


Consider the two dimensional Laplace equation u = 0 in
the rectangle (0, a) (0, b) with u(x, b) = g(x) and u = 0 on y
u=g
the rest of the boundary. Substituting a solution of the form b
u(x, y) = X(x)Y (y) into uxx + uyy = 0 gives u=0 u=0
uxx + uyy = 0

X 00 Y + XY 00 = 0, x
u=0 a

which can be rearranged to


X 00 Y 00
= .
X Y
Equating both sides to the separation constant , we are left with two ODEs,

X 00 + X = 0 (31)

and
Y 00 Y = 0. (32)

For 6= 0, the general solution of (31) is X = A cos x + B sin x. Substi-
into the boundary conditions X(0) = 0 and X(a) = 0 gives A = 0
tuting this
and B sin( a) = 0, and the nonzero values of that give a nontrivial solution
are n = (n/a)2 with n = 1, 2, . . .. For = 0, the general solution of (31)
is X(x) = A + Bx, and there is no nontrivial solution satisfying the boundary
conditions.
The general solution of (32) with = (n/a)2 is Y (y) = A cosh(ny/a) +
B sinh(ny/a). The boundary condition Y (0) = 0 is satisfied by setting A = 0.

50
Writing the solution as a linear combination of the solutions found above, we
have X
u(x, y) = Bn sin(nx/a) sinh(ny/a)
n1

At the boundary y = b, this is


X
u(x, b) = Bn sin(nx/a) sinh(nb/a) = g(x).
n1

The coefficients are obtained by equating Bn sinh(nb/a) with the Fourier sine
series coefficients of g(x):
X 2 Z a 
0 0 0 sin(nx/a) sinh(ny/a)
u(x, y) = g(x ) sin(nx /a) dx (33)
n1
a 0 sinh(nb/a)

Example 2 Find the steady-state temperature in a long prismatic tube with square
a a cross-section if the top face is kept at u = 1 and other three faces are kept
at u = 0.
Solution. The boundary function is g(x) = 1, whose Fourier sine series was found
in section 8 to be
X 2(1 (1)n )
g(x) = sin(nx/a).
n1
n

The Dirichlet problem solution is then


X 2(1 (1)n ) sin(nx/a) sinh(ny/a)
u(x, y) =
n1
n sinh(n)

Plotting the sum of a large number of terms gives the above figure. 2

The solution for the general Dirichlet problem in the rectangle is found by
superposition of (33) and solutions of similar problems:
0

For u(x, 0) = h(x), and u = 0 elsewhere 0 0, the solution is


h
X 2 Z a 
0 0 0 sin(nx/a) sinh(n(b y)/a)
u(x, y) = h(x ) sin(nx /a) dx
n1
a 0 sinh(nb/a)

This is found by replacing y by b y [the laplacian is invariant to reflection]


and g by h in (33).
0

For u(a, y) = k(y), and u = 0 elsewhere 0 k, the solution is


0
X 2 Z b 
0 0 0 sin(ny/b) sinh(nx/b)
u(x, y) = k(y ) sin(ny /b) dy
n1
b 0 sinh(na/b)

which is found by swapping x y and a b and replacing g by k in (33).

51
0

for u(0, y) = j(y), and u = 0 elsewhere j 0, the solution is


0
X 2 Z b 
0 0 0 sin(ny/b) sinh(n(a x)/b)
u(x, y) = j(y ) sin(ny /b) dy .
n1
b 0 sinh(na/b)

10.3 Dirichlet-Neumann Problem in a wedge


Consider the two dimensional Laplace equation in the sector
{(r, ) : 0 < < , r < a}, with boundary conditions
u = 0 on the rays = 0 and = and a Neumann condition
ur = h on the perimeter r = a. Assuming a solution of the u = 0 ur = h
form u(r, ) = R(r)() and proceeding as for the disk, we
obtain the ODEs (26) and (27). From the boundary conditions (0) = () = 0
n/
we obtain () = sin(n/) with n = 1, 2, . . . and R(r) = r . Writing
u = 0 the
solution as a linear combination, we have
X
u(r, ) = Bn sin(n/)rn/ + Bn sin(n/)rn/
n1

To ensure boundedness at the origin, we set Bn = 0, leaving


X
u(r, ) = Bn sin(n/)rn/
n1

Substituting this into the Neumann boundary condition gives


X n n
h() = ur (a, ) = Bn sin(n/)a 1
n1

n
and the coefficients are determined by equating n
Bn a 1 with the Fourier sine
coefficients of h(), leading finally to
X a  2 Z   r n/
0 0 0
u(r, ) = h( ) sin(n /) d sin(n/)
n1
n 0 a

In a nonconvex sector having > , the term r 1 in the first term of
the series for ur is unbounded as r 0, and so this solution does not, strictly
speaking, satisfy the PDE in fact, the problem does not have a solution (having
second derivatives continuous up to the boundary) in this case.

Example 3 Solve u = 0 in a = /2 sector with u = 0 on the rays and


ur = 1 on the perimeter r = a.
Solution. We have
2 2(1 (1)n )
Z
h(0 ) sin(n0 /) d0 =
0 n
and so
X (1 (1)n )a  r 2n
u(r, ) = 2
sin(2n) .
n1
n a
Notice that Gibbs oscillation is not visible in the
plot of the solution surface. 2

52
10.4 Dirichlet Problem in the region outside a circle
Consider the two dimensional Laplace equation in the region x2 + y 2 > a2 with
u = h on the boundary and u bounded at infinity.
We can proceed as in section 10.1 up to formula (28). To ensure the solution
is bounded at infinity, we set c1 , An and Bn to zero, leaving
X
u(r, ) = 21 A0 + (An cos n + Bn sin n)rn
n1

Imposing the boundary condition on the circle perimeter gives


X
h() = u(a, ) = 12 A0 + (An cos n + Bn sin n)an
n1

The coefficients are determined by equating an An and and an Bn to the Fourier


coefficients of h, leading to
Z X  1 Z 
1 0 0 0 0 0
u(r, ) = h( ) d + h( ) cos n d cos n
2 n1

 Z   
1 0 0 0 a n
+ h( ) sin n d sin n . (34)
r

An alternative derivation is to use the change of variables r0 = a2 /r and u0 (r0 , ) =


u(a2 /r0 , ). By the chain rule,

u0 u r a2
u0r0 = = = ur
r0 r r0 (r0 )2
and
1 0 0 1 a2 r r  r 4 1
(r u r 0 )r 0 = ( u r ) r 0 = (ru r )r = (rur )r
r0 r0 r0 a2 r0 a r
and so
1 0 0 1  r 4
0 u0 = (r u 0
r r) 0 + (u 0
) = u.
r0 (r0 )2 a
Thus, if 0 u0 = 0 inside the circle then u = 0 outside it. The solution inside the
circle is (29) written with u0 and r0 , and applying the change of variables to this
solution gives (34). Similarly, the Poisson integral formula for the disk interior is
transformed to
Z
r 2 a2
 
1 0
u(r, ) = h( ) 2 d0 .
2 a + r2 2ar cos( 0 )

for the exterior.

Example 4: Stationary flow past a circular cylinder The steady-state two-


dimensional velocity field for the irrotational flow of an incompressible inviscid
constant-density fluid is given by y ix j, where is a harmonic function called
the stream function. Because the velocity is orthogonal to , the lines of con-
stant (called streamlines) are tangential to the velocity field.

53
Find the streamlines for flow past a long circular cylinder of radius a whose
axis is the z axis, assuming the flow far from the cylinder to be constant in the x
direction, that is, = U y.
Solution. The stream function satisfies the two dimensional Laplace equation on
the exterior of the circle r = a. The radial component of the velocity is zero on
the cylinder boundary, that is, the cylinder boundary is a streamline, which gives
the boundary condition =constant (say, zero) for r = a. Substituting this into
the general solution (28) we find

c1 ln a + c2 = 0
An an + An an = 0
Bn an + Bn an = 0

so that
r X n a2n
 
(r, ) = c1 ln + r n (An cos n + Bn sin n)
a n1 r

In order to satisfy the condition = U y = U r sin at r we set B1 = U


and the remaining An and Bn coefficients to zero, leaving

a2
 
r
(r, ) = c1 ln + U 1 2 r sin .
a r

Here are streamlines for various c1 values, which correspond to different cylinder
clockwise rotation speeds:
c1 = 0 c1 = Ua

c1 = 2Ua c1 = 2.1Ua

The closely spaced streamlines correspond to regions of low pressure and indicate
the presence of a net lift force in the y direction (Magnus effect).

54
11 Greens Functions
11.1 Greens Function for One-Dimensional Equation
The Greens function provides a complete solution to a boundary value problem in
much the same way that an inverse matrix provides a general solution for systems
of linear equations. In this section the Greens function is introduced in the context
of a simple one-dimensional problem.
Some of the proofs use the identity
Z b
b
(uv vu ) dx = a uv 0 vu0 .
00 00
a

This can be obtained by integrating (uv 0 vu0 )0 = uv 00 vu00 .


A singularity function K(x, ) of the operator L defined by Lu(x) = u00 (x)
c(x)u(x) is characterised by three properties:

1. K is continuous;

2. Kx is continuous in x < and in x > , and Kx (x+ , x) Kx (x , x) = 1;

3. Kxx is continuous and LK = 0 for x 6= .

Note that the three properties do not define a singularity function uniquely: if
K is a singularity function then so is K + H, where H(x, ) is any function with
continuous H and Hx and with LH = 0.
The Greens function G(x, ) for the operator L and the domain (a, b) with
Dirichlet boundary conditions is the singularity function that satisfies the homo-
geneous Dirichlet conditions G(a, ) = 0 and G(b, ) = 0. The Greens function
provides the solution to the boundary value problem with Dirichlet boundary con-
ditions:

Theorem 12 If u satisfies the differential equation u00 + cu = f on (a, b) and


the boundary conditions u(a) = 0, u(b) = 0, then
Z b
u() = G(x, )f (x) dx (35)
a

for all (a, b).

Proof. Letting v(x) = G(x, ), we have


Z b Z Z b
00 00
vf dx = uv vu dx + uv 00 vu00 dx
a a +

b
= a uv vu + + uv vu0
0 0 0

+ +
b
= a uv 0 vu0 u() v 0 + vu0 ,
| {z } | {z } | {z }
0 1 0

which completes the proof. 2

55
00
The load (or source) function f in the differential equationP u cu = f
can be thought of as a superposition of point loads f (x) = (xR )f ()d,
where (x ) is concentrated at and has unit magnitude (i.e. dx = 1).
Then formula (35) represents the solution as a weighted sum of Greens functions,
where each G(, x) is the solution to u00 (x) = (x ). The Greens function
can thus be thought of as the response to a unit point load.
The Greens function also provides the solution of the boundary value problem
with nonhomogeneous boundary conditions:

Theorem 13 The solution of u00 + cu = 0 with boundary conditions u(a) = h0


and u(b) = h1 satisfies

u() = Gx (a, )h0 Gx (b, )h1 (36)

for all (a, b).

Proof. Denoting v(x) = G(x, ), we have


Z Z b
00 00
0 = (uv vu ) dx + (uv 00 vu00 ) dx
a +

b
= a (uv 0 vu0 ) + + (uv 0 vu0 )

+
b
= a (uv 0 vu0 ) (uv 0 vu0 )

b
= a uv 0 + u(),

which completes the proof. 2


The following result tells us that the response at x to a point load applied at
is equal to the response at to a point load applied at x.

Theorem 14 (Reciprocity Principle) G(x, ) = G(, x) for all x, (a, b).

Proof. Let y and be distinct points in (a, b) with y < , let u(x) = G(x, ) and
v(x) = G(x, y). Then
Z y Z Z b
00 00 00 00
0 = uv vu dx + uv vu dx + uv 00 vu00 dx
a y + +

y b
= a uv 0 vu0 + y+ uv 0 vu0 + + uv 0 vu0

+ +
b y
= a uv 0 vu0 y uv 0 vu0 uv 0 vu0 ,
| {z } | {z } | {z }
0 u(y) v()

leaving u(y) v() = 0, that is, G(y, ) G(, y) = 0. The proof for y > is
similar. 2
As a consequence of Theorem 2, we can rewrite formula (35) as
Z b
u(x) = G(x, )f () d.
a

56
and formula (36) as

u(x) = G (x, a)h0 G (x, b)h1 .


d 2
A singularity function of dx 2 is given by

K(x, ) = 21 |x |,

as can readily be verified. The Greens function for the interval (0, 1) can be
found by solving Hxx = 0 with boundary conditions
H(0, ) = K(0, ) and H(1, ) = K(1, ), then 0.25

setting G = K + H. This yields


G

G(x, ) = 21 |x | + 12 (x + ) x

(1 x) for < x 0

= 1

(1 )x for x < .

1
0 x
00 0
The solution of u = f satisfying u(0) = h0 and u(1) = h1 is given by
Z 1
u(x) = G(x, )f () d + G (x, 0)h0 G (x, 1)h1
0
Z x Z 1
= (1 x) f () d + x (1 )f () d + (1 x)h0 + xh1 .
0 x

11.2 Greens Function for Two-Dimensional Poisson Equation


Now we go through the same discussion in two dimensions. Some of the proofs
use Greens second identity
Z Z
uv vu dA = (uv vu) n dl,

This can be derived by writing Greens first identity twice, with u and v inter-
changed the second time, and subtracting.
A singularity function K(x, x0 ) of the operator is characterised by the
three properties
Z
0
1. For any fixed x , lim K(x, x0 ) dl = 0, where B0 denotes the radius-
0 B0
0
disk centred at x ;
Z
0
2. For any fixed x , lim K(x, x0 ) n dl = 1, where n denotes the
0 B0
outward unit normal to B0 ;

3. K is harmonic as a function of x for x 6= x0 .

Note that these three properties do not define a singularity function uniquely:
if K is a singularity function then so is K + H, where H(x, x0 ) is any function
that is harmonic as a function of x.

57
A singularity function of is given by
1
K(x, x0 ) = ln |x x0 |. (37)
2
This assertion can be verified as follows. Without loss of generality we can take
x0 = 0. In polar coordinates, we have K = 1 2
ln r with r = |x|, which is
harmonic in R2 \ {0} (see section 9.4). Also,

1 2
Z Z
K dl = ln   d =  ln  0
B0 2 0

and (because K n = K/r)

1 2 1
Z Z
K n dl =  d = 1.
B0 2 0 

The Greens function for and a domain with Dirichlet boundary con-
ditions is a singularity function that satisfies G(x, x0 ) = 0 for x . The
Greens function provides the solution to the Poisson equation with homogeneous
Dirichlet boundary conditions:
Theorem 15 If u = f in and u = 0 on then
Z
0
u(x ) = G(x, x0 )f (x) dA (x0 ). (38)

Proof. Letting v(x) = G(x, x0 ), we have


Z Z
vf dA = uv vu dA
\B0 \B0
Z Z
= (uv vu) n dl (uv vu) n dl
B0
| {z }
0
Z Z
0
u(x ) vn dl + vun dl,
B0 B0
| {z }
1

and the second term goes to zero because


Z Z Z
min0 un v dl vun dl max un v dl,
B B0 B0 B0 B0
| {z } | {z }
0 0

which completes the proof. 2


The formula (38) represents the solution as the superposition of Greens func-
tions, which can be thought of as point source responses. The following result
tells us that the response at x to a point source located at x0 is equal to the response
at x0 to a point source located at x.
Theorem 16 (Reciprocity Principle) G(x, x0 ) = G(x0 , x) for x 6= x0 .

58
Proof. Let y and y0 be distinct points in , let B and B0 denote -radius disks
centred at y and y0 , and let u(x) = G(x, y0 ) and v(x) = G(x, y). Then
Z
0 = uv vu dA
\B0 \B
Z Z Z
= (uv vu) n dl
B B0
| {z }
0
Z Z
u(y) v n dl + vun dl
B B
| {z } | {z }
1 0
Z Z
uvn dl + v(y0 ) un dl,
B0 B0
| {z } | {z }
0 1

leaving us with u(y) v(y0 ) = 0, that is, G(y, y0 ) G(y0 , y) = 0. 2


As a consequence of Theorem 4, formula (38) can be written as
Z
u(x) = G(x, x0 )f (x0 ) dA0 .

The singularity function (37) is called the free-space Greens function for Pois-
sons equation. It is a Greens function for Poissons equation with the boundary
1
condition u(x) |x| as |x| . The free-space Greens function doesnt satisfy
this boundary condition, but the boundary condition does ensure that the term
Z
(uv vu) n dl

in the proof of Theorem 3 goes to zero when is taken to be a disk of radius R


centred at x0 and R .
The method of images can be used to find Greens functions for other domains.
For example, using the idea that a unit point source located at x0 = (x0 , y 0 ) with
y 0 > 0 and a point source of strength 1 located at (x0 , y 0 ) will cancel each other
on the x-axis, we find the Greens function
1 1 1 1
G(x, x0 ) = ln (x x0 )2 + (y y 0 )2 2 + ln (x x0 )2 + (y + y 0 )2 2
2 2
for the Poisson equation in the half-plane y > 0.
Using similar ideas, one can derive the formula for Greens function for the
origin-centred disk of radius a as

0 2 2
1 1 x |x| xa
G(x, x0 ) = ln |x x0 | + ln .
2 2 a|x|
Representing x and x0 in polar coordinates as (r, ) and (, 0 ), and using the
cosine law |x x0 |2 = |x|2 + |x0 |2 2|x||x0 | cos with = 0 , the disk
Greens function can be written
s
1 a4 + r2 2 2a2 r cos
G(x, x0 ) = ln . (39)
2 a2 (r2 + 2 2r cos )

59
The Greens function G((x, y), (0, 0.5)) for the half-plane and the unit-radius
disk are shown below.

0.4
0.3

0.3
0.2
G G 0.2

0.1
0.1

0 0
2 1
1 1
1 0
y 0.5
0
x y 0
x
0 1 1 1

The Greens function also provides the solution of Laplaces equation with
nonhomogeneous Dirichlet boundary conditions:

Theorem 17 If u = 0 in and u = h on then


Z
0
u(x ) = h(x)G(x, x0 ) n dl.

Proof. Similar to the proof of Theorem 4. 2


For the half-plane y > 0 the unit normal points in the negative y direction and
we have
y 0 /

G G
= = .
n y y=0 (x x0 )2 + (y 0 )2
The solution of Laplaces equation u = 0 in the half-plane with u(x, 0) = h(x)
is therefore
1 y 0 h(x)
Z
0 0
u(x , y ) = dx.
(x x0 )2 + (y 0 )2
For the origin-centred disk, the unit outward normal points in the radial direc-
tion and we have
a2 2

G G 1
= = .
n r r=a 2a a2 + 2 2a cos

The solution of Laplaces equation on the disk with u = h on the boundary r = a


is therefore
Z 2
0 1 (a2 2 )h()
u(, ) = d,
2 0 a2 + 2 2a cos( 0 )

which is Poissons integral formula (section 10.1).

11.3 Greens functions from eigenfunctions


The Poisson problem can also be solved by the method of eigenfunctions. To
introduce the technique, we start with a one-dimensional problem.

60
Consider the differential equation u00 = f with boundary conditions u(0) =
0, u(a) = 0. The associated eigenvalue problem is 00 + = 0 with the same
boundary conditions. The eigenvalues and eigenfunctions are
m2 2 mx
m = , m (x) = sin .
a2 a
P
Substituting a trial solution of the form m0 1 Am0 m0 (x) into the differential
equation, multiplying through by m (x), and integrating gives
Z a Z a
2 mx mx
Am m sin dx = f (x) sin dx,
0 a 0 a
| {z }
a/2

1
Thus the Am are m
the Fourier sine coefficients of f , and the solution at a point
(0, 1) is
" #
Z a X 2a mx m
u() = f (x) 22
sin sin dx.
0 m1
m a a

Comparing this with formula (35), we deduce the Greens function to be the term
in brackets, that is,
X 2a mx m
G(x, ) = 22
sin sin .
m1
m a a

When a = 1, this is the Fourier sine expansion of the Greens function presented
in section 1.
Next, consider the two-dimensional Poisson equation u = f on the do-
main (0, a) (0, b), with u = 0 on the boundary. The associated eigenvalue
problem is u + u = 0, with the same boundary conditions. Assuming a solu-
tion of the form u(x, y) = X(x)Y (y) yields, with 2 as separation constant, the
two eigenvalue problems

X 00 + 2 X = 0, Y 00 + ( 2 )Y = 0

with homogeneous boundary conditions X(0) = X(a) = Y (0) = Y (b) = 0. The


eigenfunctions of the one-dimensional problems are
mx ny
Xm (x) = sin , Yn (y) = sin .
a b
and the eigenvalues are
m2 n2
 
2
mn = + 2 .
a2 b
P P
Substituting a trial solution of the form m0 1 n0 1 Am0 ,n0 Xm0 (x)Yn0 (y) into
the Poisson equation, multiplying through by Xm Yn , and integrating gives
Z a Z b Z bZ a
2 mx 2 ny mx ny
Amn mn sin dx sin dy = f (x, y) sin sin dx dy
0 a 0 b 0 0 a b
| {z }| {z }
a/2 b/2

61
1
Thus the Amn are mn the two-dimensional Fourier sine coefficients of f , and
the solution at a point x0 is
Z aZ b
0 0
u(x , y ) = f (x, y)G(x, y, x0 , y 0 ) dx dy
0 0

with
4ab X X 1 mx ny mx0 ny 0
G(x, y, x0 , y 0 ) = sin sin sin sin .
2 m1 n1 m2 b2 + n2 a2 a b b b

The Greens function G(x, y, a/2, a/4) for a square domain is plotted below.

0.3

G 0.2

0.1

0
1
1

y/a 0.25
0.5
x/a
0 0

62

You might also like