Notes PDEs2
Notes PDEs2
Notes PDEs2
Contents
1 The wave equation (introduction) 2
1.1 Solution (separation of variables) . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Standing waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Solution (eigenfunction expansion) . . . . . . . . . . . . . . . . . . . . . . . 6
2 Laplace’s equation 8
2.1 Solution in a rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Rectangle, with more boundary conditions . . . . . . . . . . . . . . . . . . . 11
2.2.1 Remarks on separation of variables for Laplace’s equation . . . . . . . 13
7 Appendix 31
7.1 PDEs with source terms; example . . . . . . . . . . . . . . . . . . . . . . . . 31
7.2 Good basis functions for Laplace’s equation . . . . . . . . . . . . . . . . . . 33
7.3 Compatibility conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1
1 The wave equation (introduction)
The wave equation is the third of the essential linear PDEs in applied mathematics. In one
dimension, it has the form
utt = c2 uxx
for u(x, t). As the name suggests, the wave equation describes the propagation of waves, so
it is of fundamental importance to many fields. It describes electromagnetic waves, some
surface waves in water, vibrating strings, sound waves and much more.
Note that we have two initial conditions because there are two time derivatives (unlike the
heat equation). A sketch and the domain (in the (x, t) plane) is shown below. Note that we
do not restrict t > 0 as in the heat equation.
How many boundary conditions are needed? Typically, for a PDE, to get a unique
solution we need one condition (boundary or initial) for each derivative in each variable. For
instance:
ut = uxx =⇒ one t-deriv, two x derivs =⇒ one IC, two BCs
2
and
utt = uxx =⇒ two t-derivs, two x derivs =⇒ two ICs, two BCs
In the next section, we consider Laplace’s equation uxx + uyy = 0:
This, along with the boundary conditions at the ends, yields the BVP for φ:
φ00n + c2 λn φn = 0.
There are no initial conditions here because neither initial condition is separable; the initial
conditions will be applied after constructing the full series (note that if, say, g = 0 or f = 0
then we would have a condition to apply to each φn ).
The full solution to the PDE with the boundary conditions u = 0 at x = 0, L is a superpo-
sition of these waves:
∞
X nπct nπct nπx
u(x, t) = (an cos + bn sin ) sin . (2)
n=1
L L L
3
To find the coefficients, the first initial condition u(x, 0) = f (x) gives
∞
X nπx
f (x) = an sin .
n=1
L
Both are Fourier sine series, so we easily solve for the coefficients and find
2 L
Z Z L
nπx 2 nπx
an = f (x) sin dx, bn = g(x) sin . dx. (3)
L 0 L ncπ 0 L
4
interfering with each other. At the nodes, they cancel out exactly (destructive interference)
and at the anti-nodes, they add together exactly (constructive interference).
For the separated solutions, this is easy to show:
1 1 1
cos nct sin nx = (sin n(x + ct) + sin n(x − ct)) = hn (x + ct) + hn (x − ct).
2 2 2
It is straightforward to check that both parts of the sum are solutions to the wave equation
(’travelling waves’) although they do not individually satisfy the boundary conditions.
We can be much more general about this (it is not just true for standing waves); see
later.
ω0 = πc/L,
we can also write hn in terms of this frequency and its multiples (the harmonics):
Physically, these correspond to standing waves, which oscillate at the frequency ωn and have
fixed nodes (with u = 0) at equally spaced points x = Lm/nπ for m = 0, · · · n. Note that
the ’fundamental frequency’ is typically written in cycles per time, so
c
f0 = , fn = nf0 .
2L
where A is the initial displacement at x = L/2. The initial speed is g = 0. In that case, it is
straightforward to show that bn = 0 and
8A nπ
an = 2 2
sin .
π n 2
In terms of the frequencies ωn , the response of the string is
∞
X nπx
u(x, t) = an cos(2πωn t) sin .
n=1
L
5
Since sin nπ/2 = 0 for n even, the string, when plucked exactly at the center, vibrates with
only the odd harmonics, and the amplitude of the harmonics decay quadratically with n.
Note that because the initial displacement is not an eigenfunction, there are an infinite num-
ber of harmonics present. For a musical instrument, this is ideal, since the sound is much
better when it is a mix of frequencies (a pure tone of one frequency is not pleasant).
To see this, note that from (3), if g(x) = 0 then the bn ’s are zero; if f (x) = 0 then the an ’s
are zero. It follows that the two terms above are really v and w.
6
which is just the familiar eigenvalue problem from the heat equation,
Rearrange to get
∞
X
(h00n (t) + λn hn (t))φn (x) = 0
n=1
so
h00n (t) + λn hn (t) = 0 for n ≥ 1.
From here, the solution is the same as for separation of variables - solve for φn , then apply
the initial conditions.
7
2 Laplace’s equation
In two dimensions the heat equation1 is
where ∆u = uxx + uyy is the Laplacian of u (the operator ∆ is the ’Laplacian’). If the
solution reaches an equilibrium, the resulting steady state will satisfy
This equation is Laplace’s equation in two dimensions, one of the essential equations in
applied mathematics (and the most important for time-independent problems). Note that
in general, the Laplacian for a function u(x1 , · · · , xn ) in Rn → R is defined to be the sum of
the second partial derivatives:
n
X ∂ 2u
∆u = .
j=1
∂x2j
∆u = 0.
utt = c2 uxx
are:
The first point changes the way the problem is solved slightly; the second point changes the
answer. Note that there is also no coefficient, but this is not really important (we can just
as easily solve uxx + k 2 uyy = 0).
1
The derivation follows the same argument as what we did in one dimension.
8
2.1 Solution in a rectangle
We can solve Laplace’s equation in a bounded domain by the same techniques used for the
heat and wave equation.
The boundary conditions are all homogeneous (shown in blue above) except on the right
edge (y = 0)). Motivated by this, we will try to get eigenfunctions φ(y), since the eigenvalue
problem requires us to impose homogeneous boundary conditions.
9
Now we solve for g for each λn . Note that there is only one boundary condition (at x = 1);
we leave the f (x) condition for later (it will require using the full series). We solve
g 00 − n2 π 2 g = 0, g(0) = 0
to get
gn (x) = an sinh nπx.
The solution
un = gn (x)φn (y)
satisfies the PDE and all the boundary conditions except u(x, 0) = f (x). To satisfy this, we
need to write u as a sum all of the separated solutions gn φn :
∞
X
u(x, y) = an sinh nπx sin nπy.
n=1
Note that the functions φn = sin πy are orthogonal in L2 [0, 1] (we have shown this several
times at this point!). As always, take inner products of both sides with hm = sin mπy to get
the coefficients:
hf, hm i = (am sinh mπ) hhm , hm i
so
1 hf, φn i
an = , n ≥ 1.
sinh nπ hφn , φn i
Remark (convergence): In terms of the eigenfunction basis (set φn = sin nπy; the basis
is {φn (y)}), we have
∞
X
u(x, y) = an sinh nπxφn (y).
n=1
Unlike the heat equation, the coefficients have an sinh πx, which contains a positive expo-
nential (sinh nπx ∼ enπ|x| /2 as n → ∞). However, the an ’s have a sinh nπ in the denominator,
which makes sure the coefficients are small enough that the series convergences. it can be
shown that
sinh nπx
an = decays exponentially as n → ∞
sinh nπ
for x in the domain. This is true since as n → ∞, the numerator grows like enπ|x| /2 while
the denominator grows like enπ /2, so if |x| < 1 the rate is faster for the denominator.
10
2.2 Rectangle, with more boundary conditions
Let’s return to the rectangle example and consider how to solve the problem when there
are inhomogeneous boundary conditions applied at all the sides for Laplace’s equation in a
rectangle of width A and height B:
0 = uxx + uyy , x ∈ (0, a), y ∈ (0, b)
u(x, 0) = f1 (x), u(x, 1) = f2 (x), x ∈ (0, A) (8)
u(0, y) = g1 (y), u(1, y) = g2 (y), y ∈ (0, B).
Both pairs of opposite sides (in blue and red above) could have non-homogeneous BCs. Our
method only works if one of those pairs is homogeneous.
To solve (8), we use superposition and break the problem up into parts. Each part will
take care of one (or two) of the boundaries and leave all the others zero. When added to-
gether, the sum of the parts will satisfy all the boundary conditions.
We find v, w solving
0 = vxx + vyy , x ∈ (0, A), y ∈ (0, B)
v(x, 0) = 0, v(x, B) = 0, x ∈ (0, A) (9)
v(0, y) = g1 (y), v(A, y) = g2 (y), y ∈ (0, B).
v = h(x)φ(y).
11
The solutions are
nπy
φn (y) = sin , λn = n2 π 2 /B 2 .
B
There are no boundary conditions we can apply for h (both boundaries have inhomogeneous
terms), which satisfies
h00n − λn hn = 0,
so we take the general solution. Set µn = nπ/a. The right choice of basis for solutions to the
ODE has one basis function vanish at x = 0 and the other at x = A:
See subsection 7.2 for details. Adding up all the separated solutions, the solution for v is
∞ h
X i
v(x, y) = an sinh(µn (A − x)) + bn sinh(µn x) φn (y).
n=1
Now the choice of basis becomes useful because it makes only one set of coeffiients appear
at each boundary. At x = 0:
∞
X
g1 (y) = v(0, y) = an sinh(µn )φn (y)
n=1
and so
B
hg1 , φn i
Z
2 nπy
an sinh µn = = g1 (y) sin dy.
hφn , φn i B 0 B
2
where hf, gi is the inner product on L [0, B]. At the x = A boundary:
∞
X
g2 (y) = v(A, y) = bn sinh(µn A)φn (y)
n=1
and so
B
hg2 , φn i
Z
2 nπy
bn sinh(µn A) = = g2 (y) sin dy.
hφn , φn i B 0 B
Finding w that solves (10) is the same process, and one gets a similar expression (left as an
exercise). Finally, the solution to the original problem (8) is
u = v + w.
12
Figure 1: Solution u to (8) and the solutions v and w to (9) and (10) for f1 = f2 = x(1 − x)
and g1 = g2 = y(1 − y).
then the eigenfunction method is required unless you are lucky and there is a ‘particular’
solution you can subtract out to remove the inhomogeneous terms.
When applying the eigenfunction method, one must pick a direction for the eigenfunctions,
either X X
u= cn (x)φn (y) or u = cn (y)φn (x).
The correct choice is one where the boundary conditions are homogeneous (if both work, then
it does not matter which you choose). The details are somewhat involved but straightforward
in concept.
13
Non-separable boundary conditions: There is a more fundamental concern: the
geometry of the problem. Notice that in order to ‘separate’ the problem, we needed each
boundary condition to involve only one coordinate. This was true, for instance, for the
rectangle (one edge is x = const, the other is y = const) and for a circle, annulus or wedge
(which have edges r = const or θ = const).
Dealing with boundary conditions that are not separable - for instance, flow of water
past a fish (at least a non-spherical fish) - is challenging and requires more sophisticated
techniques.
Both (a) and (b) can be solved using eigenfunction expansions; (a) is even simpler and can
be solved using separation of variables.2 Note that ’homogeneous BCs’ here means that there
are enough homogeneous BCs to get eigenfunctions; the other boundaries may be allowed to
stay inhomogeneous.
which represents heat flow with a time-independent source and/or ends fixed at some temper-
ature. The expectation is that over time, the heat will approach a steady state (equilibrium):
2
There is a method for reducing (b) to (a) that we will not cover here since we can solve (a); this method
is called Duhamel’s principle.
14
Formally, we can obtain this equilibrium shape as follows: if u(x) is a steady-state, then
it solves the PDE but does not depend on time. Thus it must satisfy
This we can then solve. The important point is that the difference betwee the PDE solution
and steady state,
v =u−u
solves the homogeneous IBVP
So to solve (11) we can find the steady state (formally), subtract it out and then solve (12)
for the ‘homogeneous’ part.
Note that the inhomogeneous term could appear in the source or in the boundaries.
There is a constant input source of heat, the heat is kept fixed at both ends and there some
initial distribution f (x) of heat. We want to show that the heat distribution converges to
some equilibrium shape as t → ∞. This is done in two steps:
1. Compute the steady state, assuming it exists: From knowledge of the heat equa-
tion, we expect a steady state to exist (diffusion wants to spread things out). Let us assume
that it exists, i.e. there is a function u(x) such that
15
Key point: At this point, we have shown that if a steady state exists, it must be (14). It
does not yet follow that the limit (13) exists!
The function v is the difference between the solution and the steady state, so we want to
show that v → 0 as t → ∞. Note that u is the solution to the IBVP
By linearity/superposition v satisfies
which is the difference of the IBVP satisfied by u and the one satisfied by u.
But this equation is just the heat equation (homogeneous) with Dirichlet boundary con-
ditions; the solution is
∞
X
v(x, t) = bn e−λn t sin λn x (15)
n=1
2 2
where λn = n π . and
Z 1 Z 1
bn = 2 v(x, 0) sin nπx dx = 2 (f (x) − u(x)) sin πx dx.
0 0
To verify that u is actually the steady state, note that all the eigenvalues are positive, so
16
When does the method fail? This trick works when there is a steady state but only
when the source term and boundary conditions do not depend on time. For instance,
ut = tuxx + sin x
cannot be solved using this method. Assuming ut = 0 is not enough since we also need to
take t → ∞ and we cannot find a u = u(x) that solves
tuxx + sin x = 0.
We can, however, solve the full problem using the eigenfunction method and find the steady
state directly.
v =u−w
will satisfy the homogeneous boundary conditions but will have both a different IC and
an extra source term. For example, consider the heat equation with time-dependent
boundary conditions:
There are many choices for a function w that satisfies the boundary conditions. For Dirichlet
BCs, the easiest is just to construct a line that goes from (0, g(t)) to (1, h(t)):
17
where
g = wt − wxx = (1 − x)g 0 (t) + xh0 (t).
It follows that
vt = ut − wt = uxx + f − (wxx + g) = vxx + f˜
where the new sourcce term for v is
f˜(x, t) = f − g = f − (1 − x)g 0 (t) − xh0 (t).
Finally, for the initial condition,
v(x, 0) = u(x, 0) − w(x, 0) = u0 (x) − (1 − x)g(0) − xh(0).
The problem to solve for v is then
vt = vxx + f˜(x, t), x ∈ [0, 1], t > 0,
v(0, t) = 0, v(1, t) = 0, t > 0,
v(x, 0) = u0 (x) − (1 − x)g(0) − xh(0).
We obtain v using the eigenfunction expansion method and then add w back in to get
u = v + w.
Illustrative example
We solve
ut = uxx , x ∈ (0, π), t > 0,
u(0, t) = 0, u(π, t) = At, t > 0,
u(x, 0) = 0.
Set
Axt
w= (16)
π
and
v = u − w.
Then wt = wxx + Ax/π, so the PDE for v is
vt = ut − wt
= uxx − (wxx + Ax/π)
Ax
= vxx − .
π
Since w(x, 0) = 0, the initial condition for v is the same for u (i.e. v(x, 0) = 0). Thus the
IBVP for v we need to solve is
Ax
vt = vxx − , x ∈ (0, π), t > 0,
π
v(0, t) = 0, v(π, t) = 0, t > 0,
v(x, 0) = 0.
18
For the source term, expand x in terms of the eigenfunctions:
∞
X
x= bn φn , bn = −2 cos(nπ)/n.
n=1
P
Now solve for v = cn (t)φn (x) using an eigenfunction expansion to get
Abn
c0n (t) + λn cn (t) = − , cn (0) = 0.
π
The solution for this ODE is
Abn −λn t
cn (t) = (e − 1), (17)
λn π
so the solution to the IBVP is
∞
At X
u(x, t) = x+ cn (t)φn (x)
π n=1
with cn ’s given by (17) and bn ’s by (16). Note that the Atx/π term is not a ’particular
solution’ to the PDE, since it only satisfies the boundary conditions and not the PDE.
In the next section, we will use another method that can be used to solve the original
problem directly, which gives us u as an actual sum of a homogeneous and particular solution.
19
4 Inhomogeneous boundary conditions
When boundary conditions are inhomogeneous, the method above will not work. The issue
is that the eigenfunctions must satisfy the homogeneous boundary conditions, so it seems
X
u(x, t) = cn (t)φn (x) (18)
n
should also satisfy the homogeneous BCs. Thus we cannot just substitute u into the
PDE/BCs and solve for cn . For instance, if
u(0, t) = 0, u(π, t) = At
which gets us nowhere. However, the series (18) is still a good starting point.
Lf = −f 00 .
In this case we say the the operator L with the boundary conditions3 is self-adjoint.
The identity generalizes the fact that for a real symmetric matrix A and vectors x, y ∈ Rn ,
The proof of (19) is simple; just integrate by parts twice (left as an exercise).
3
Dirichlet, Neumann or Robin, i.e. α1 f (0) + α2 f 0 (0) = 0 and β1 f (`) + β2 f 0 (`) = 0.
20
4.2 PDE with Inhomogeneous BCs: example
An example will serve to illustrate the idea. We solve the heat equation in [0, π] with a
time-dependent boundary condition:
ut = uxx , x ∈ (0, π), t > 0,
u(0, t) = 0, u(π, t) = At, t > 0, (20)
u(x, 0) = f (x).
The eigenfunctions/values are
φn = sin nx, λn = n2 , n ≥ 1.
The solution has an eigenfunction expansion
∞
X
u(x, t) = cn (t)φn (x).
n=1
The idea is to use the formula for the coefficients, the PDE and some manipulations
(including the identity (19)) to get equations for cn (t).
21
Boundary term details: We know that u has boundary conditions
u(0, t) = 0, u(π, t) = At
cn (0) = an .
(eλn t cn )0 = γn eλn t t
to obtain Z t
−λn t −λn t
c n = an e + γn e eλn s s ds.
0
Evaluating the integral we get
γn
cn (t) = an e−λn t + λn t − 1 + e−λn t .
2
λn
While not required, we can plug in λ2n and γn from (23) we get
2 2A cos(nπ) 2 −n2 t
cn (t) = an e−n t − n t − 1 + e . (25)
πn3
22
The solution is then given by
∞
X
u(x, t) = cn (t)φn (x)
n=1
with cn (t) given by (25) and the an ’s by (24). Note that the first term in the expression (25)
for cn (t) gives the homogeneous solution; the second term is the response to the inhomoge-
neous boundary conditions:
∞ ∞
X
−n2 t 2A X cos nπ 2 −n2 t
u(x, t) = an e φn (x) − n t − 1 + e φn (x).
n=1
π n=1 n3
In fact, this solution is the same as the one we derived using the superposition trick in
section 3.2.
φn (0) = φn (π) = 0.
It follows that u(0, t) = 0 and u(π, t) = 0. But we solved for u using the inhomogeneous
boundary conditions! The apparent contradiction is due to the fact that the equality in the
representation (26) is not pointwise; it is equal in the same sense we had for Fourier series.
Thus when we say that (26) is a solution to the IBVP, it does not mean that the series
satisfies the boundary conditions at the endpoints. However, the right/left limits satisfy
the left/right BCs For example,, for (26) solving (20) we have
even though u(π, t) = 0. This means that the series for u, close to the boundary, is correct;
it just might be incorrect at the boundary exactly). Thus the fact that the series is wrong
at the boundaries is not much of a worry (if handled carefully).
23
5 Robin boundary conditions
Returning to homogeneous problems, we now solve the heat equation with a boundary
condition involving u and ux (Robin). Two new issues arise:
• We will be unable to get explicit solutions for the eigenvalues λn , so a graphical method
must be used to find and estimate them.
• There can be eigenvalues in all of the cases (negative and positive!).
Consider a metal bar of length 1 with temperature fixed at one end, with the other end being
heated. Suppose the temperature u(x, t) satisfies
−ux = −βu.
Heat is added at a rate βu if u > 0 (and lost if u < 0). The value of β determines the
balance between inflow and outflow of heat, so the solution behavior as t → ∞ will depend
on β; we will be able to determine it by looking at the eigenvalues.
For this problems, the eigenvalues cannot be obtained exactly. Instead, we need to use a
graphical argument to locate them.
φ = c1 eµx + c2 e−µx
√
where µ = −λ. Since φ(0) = 0, we need c1 = −c2 , so
φ = eµx − e−µx .
24
We cannot solve for µ here. Instead, rearrange to get
e2µ + 1
β=µ := g(µ).
e2µ − 1
A solution exists for each µ > 0 such that g(µ) = β (draw a horizontal line at β across the
graph of g(µ) for µ > 0. From a plot of g(µ) (check that g(µ) > 1 for µ > 0), it is clear that
there are no positive solutions for β ≤ 1 and exactly one when β > 1.
Note that tan µ has asymptotes at π/2 + nπ. Let I0 = (0, π/2) and let In = (π/2 +
(n − 1)π, π/2 + nπ be the intervals for each of the branches of tan µ (for µ > 0.
First note that in I0 , tan µ starts at 0 and increases to ∞. Since (tan µ)0 = 1 at µ = 0
and (µ/β)0 = 1/β > 1, the line starts above tan µ then intersects it once in I0 (see plot).
For the other intervals, note that tan µ is one-to-one and goes from −∞ to ∞ in each
In , so the line µ/β clearly intersects the branch at a unique point in In .
25
5.2 Solving the PDE
In all cases, there are eigenvalues λn > 0 for n ≥ 1 with eigenfunctions
p
φn = sin λn x, n = 1, 2, · · · .
However, the first eigenvalue is different for each of the three cases, which determines the
behavior of the solution. The details of the eigenvalue problem are in subsection 5.1.
Summary: solution to the eigenvalue problem for (27)-(28) The eigenvalues depend
on β. For all β 6= 0, there is a sequence
λ0 = 0, φ0 = x.
Finally, to satisfy the initial condition, evaluate the series at t = 0 and set it equal to f (x):
∞
X p
f (x) = an φn , with φn = sin λn x. (32)
n=1
26
The φn ’s are an orthogonal basis (a result of the theorem stated in our original discussion of
eigenvalue problems), so we simply take the inner product with φm on both sides to get
∞
X
hf, φm i = an hφn , φm i = am hφm , φm i.
n=1
a00 (t) = 0.
27
Since λn > 0 except for n = 0, all the terms past n = 0 vanish (quickly) as t → ∞. This
suggests that
lim u(x, t) = a0 x
t→∞
i.e. the solution converges to the ’steady state’ a0 x Note that if it happens to be true that
Z 1
xf (x) dx = 0
0
then a0 = 0 and the solution converges to zero. That is, the zero mode is responsible for the
convergence to a non-zero steady state; without it, solutions will just go to zero.
Physical interpretation:
β < 1: More heat leaves through x = 0 than enters the system, so the heat decays to zero.
β = 1: There is a balance between heat entering/leaving the system, so there is a steady
state as t → ∞. Typically, this steady state will be non-zero, which occurs precisely
when Z 1
b0 = 3 xf (x) dx 6= 0.
0
β > 1 Enough heat enters that it collects in the metal bar and the temperature grows
exponentially due to the unstable mode. For most initial conditions, u(x, t) → ∞
as t → ∞ for x ∈ (0, 1). More precisely, the exponential growth rate is −λ0 . The
exception is if f does not have a φ0 component (b0 = 0)
So long as f has a φ0 component (b0 6= 0), no matter how small the coefficient
is to start, it will grow exponentially with time and eventually dominate the solution
(since all the other terms decay).
28
7-
€
c})"\
t(
2
-(\
\,4
1
//
/
6 Equations in other geometries
5
o
2\\
.{
\-z-
r)
d-)
-a
(*-\
t[
)
6.1 Laplace’s equation in a disk
We now solve Laplace’s equation inside a disk of radius R. In polar coordinates, Laplace’s
equation ∆u = 0 for u(r, θ) in the disk becomes
1 1
o
urr + ur + 2 uθθ = 0, r ∈ (0, R), θ ∈ [0, 2π]
/-
r r
Oo
Z
l1
o
Let us assume that u is specified on the boundary of the circle:
u(R, θ) = f (θ).
g
e
tt
\<
\Y
-€
6
f,
(T)
a\
g
(-.
O
\
u = g(r)h(θ).
Since the inhomogeneous part f (r) is at a boundary r = R, we want to look in the other
direction first (θ) where the boundary conditions are homogeneous.
There are no explicit boundary conditions in θ; however, because θ is an angle there are
implied periodic boundary conditions
29
Thus we need to solve
This is an eigenvalue problem with periodic boundary conditions. The solutions are
h0 (θ) = a0 for λ = 0 and
Again, there are no explicit boundary conditions, but we want the solution in the disk to be
finite, so implicitly we have the condition
p(p − 1) + p − n2 = 0 =⇒ p = ±n.
This is just the Fourier series (with coefficients Rn an and Rn bn ) for f (θ), so
Z 2π Z 2π
1 1
an = f (θ) cos nθ dθ, bn = f (θ) sin nθ dθ. (35)
πRn 0 πRn 0
Now we are done. In summary, the series (34) with coefficients (35) is the solution to
1 1
urr + ur + 2 uθθ = 0, r ∈ (0, R), θ ∈ [0, 2π]
r r
30
with boundary condition
u(R, θ) = f (θ)
and implied boundary conditions
Integral formula: This particular problem is a remarkable case where the infinite series
can be simplified. After some calculations, one ends up with Poisson’s integral formula
Z 2π
1 (R2 − r2 )f (φ)
u(r, θ) = dφ.
2π 0 R2 + r2 − 2rR cos(θ − φ)
The formula, however, is not of any use to us here besides looking nice.
7 Appendix
7.1 PDEs with source terms; example
Consider the following IBVP for the heat equation with a time-dependent source:
ut = uxx + e−t , x ∈ (0, π), t > 0,
u(0, t) = 0, u(π, t) = 0, t > 0, (36)
u(x, 0) = f (x).
Refer to the previous notes for the outline of the method.
φn = sin nx, λn = n2 , n ≥ 1.
The eigenfunctions form a basis for L2 [0, π]. Now write all the functions in the PDE in terms
of the eigenfunction basis. The solution has the form
∞
X
u(x, t) = cn (t)φn (x)
n=1
31
The inner product is an integral in x, so the dependence on t causes no trouble. For conve-
nience let us write γn (t) = an e−t where
2
an = (1 − cos(nπ)). (37)
nπ
Note that in this case we also could have just written
∞
X
1= an φn
n=1
and then multiplied by e−t instead of directly computing the expansion of e−t .
using that φ00n = −λn φn . Since {φn } is a basis, the coefficients of φn on either side must be
equal for all n, so
c0n (t) + λn cn (t) = γn (t), n ≥ 1.
From the initial condition:
∞
X ∞
X
u(x, 0) = f (x) =⇒ cn (0)φn (x) = bn φn (x)
n=1 n=1
to obtain Z t
−λn t −λn t
cn (t) = bn e +e eλn s γn (s) ds.
0
We solved for γn before, so the term on the right is
(
t t an
(e−t − e−λn t ) n > 1
Z Z
e−λn t eλn s γn (s) ds = an e−λn t eλn s e−s ds = λn −1
.
0 0 a1 te−t n=1
32
Highlight (word of caution): Some casework may be required in finding the cn ’s, de-
pending on λn and the inhomogeneous term γn . Here, we could get the general solution
to (42) for all n at once, but then had to do some casework to compute because γ1 (t) is a
homogeneous solution, but γn for n > 1 is not.
The first term in square brackets depends only on the initial condition; it is the homogeneous
solution. The second term depends only on the source term (a ’particular’ solution with a
zero initial condition).
g 00 − λg = 0
√
for positive eigenvalues λ > 0. The solutions, with µ = λ, are
g = c1 eµx + c2 e−µx .
Instead, we could choose any linear combination of the two as basis functions. Given some
boundary conditions, we want to choose the basis functions so that one of them vanishes at
each boundary condition. For instance, if the boundary conditions are
g1 (0) = 0, g2 (0) = 0.
33
In a similar way, we find [see homework] that
g2 = sinh(µ(x − 1)).
As another example, if the boundary conditions at x = 0 and x = 1 are
u(0, y) = 0, ux (1, y) = f (y)
then we would choose
gn (x) = an sinh(µn x) + bn cosh(µn (x − 1)).
For each boundary condition, one of the basis functions vanishes:
gn (0) = bn cosh(µn ), gn0 (1) = an cosh(µn ).
The compatibility condition for a general Neumann problem is that the integral of the flux
through the boundary must be zero. Notice that if this condition is satisfied, the solution
is only unique up to a constant. To get a unique solution, we would need to also specify
some other constraint (that would depend on the problem), e.g. the amount of stuff in the
domain: Z
u dA = M0 .
Contrast this with other steady state problems with Dirichlet (u = A) or radiation boundary
conditions, where there is only one solution. For the heat equation with a steady state, we
always have an initial condition that was not a Neumann condition, u(x, 0) = f (x), so the
solution (with boundary conditions) is unique and there is no compatibility condition needed.
34