0% found this document useful (0 votes)
18 views41 pages

Chapter6-Separation.of.variables

Chapter 6 discusses the separation of variables method for solving partial differential equations in physics, particularly focusing on the heat equation. It provides the Fourier series expansion and details the process of solving a one-dimensional heat equation for a metal bar with fixed boundary conditions. The chapter concludes with examples illustrating the temperature distribution in metal bars under different initial and boundary conditions.

Uploaded by

yiz93307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views41 pages

Chapter6-Separation.of.variables

Chapter 6 discusses the separation of variables method for solving partial differential equations in physics, particularly focusing on the heat equation. It provides the Fourier series expansion and details the process of solving a one-dimensional heat equation for a metal bar with fixed boundary conditions. The chapter concludes with examples illustrating the temperature distribution in metal bars under different initial and boundary conditions.

Uploaded by

yiz93307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Chapter 6 Separation of variables

In this chapter, we shall solve various partial differential equations that occur in physics.
The main method is by using seperation of variables and the Fourier series. Let’s list the
Fourier series formula here for convenient reference:

Fourier series expansion:



a0 X h  nπx   nπx i
f (x) = + an cos + bn sin , (6.1)
2 n=1
L L

for the interval −L ≤ x ≤ L. The coefficients are determined by

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

Actually, a lot of the important cases is where f is either even or odd:

Fourier series for even or odd functions:

• If f is even on −L ≤ x ≤ L,
Z L Z L
2 2  nπx 
a0 = f (x) dx, an = f (x) cos dx, bn = 0. (6.3)
L 0 L 0 L

• If f is odd on −L ≤ x ≤ L,
Z L
2  nπx 
a0 = 0, an = 0, bn = f (x) sin dx. (6.4)
L 0 L

6.1 The heat equation

Consider a two-dimensional piece of flat metal, where we wish to measure its temperature
at any point. An example would be a square piece of sides L, shown in Fig. 6.1

1
2 CHAPTER 6. SEPARATION OF VARIABLES

O L x

Figure 6.1

Additionally, we wish to see how its temperature distribution changes over time. There-
fore, the temperature at location (x, y) at time t is given by the function

u(t, x, y). (6.5)

The evolution of the temperature distribution over time is given by the heat equation

∂ 2u ∂ 2u
 
∂u
=σ + . (6.6)
∂t ∂x2 ∂y 2

Alternatively, we can also write

ut = σ (uxx + uyy ) , (6.7)

∂u ∂2u
where ut means ∂t
and uxx means ∂x2
. Sometimes wey may also write

∂u ~ 2 u.
= σ∇ (6.8)
∂t

Our task is is to determine the function u(t, x, y), then we will know the temperature of
the metal at any point and time.

6.1.1 A metal bar with ends kept at zero temperature

Consider the problem of a one-dimensional metal bar of length L along the x-axis (so we
can ignore the y-coordinates). Initially the temperature of the metal bar is uniform at
T0 = 10◦ C. The metal bar is attached at both ends to cold reservoirs of 0◦ C.

Before solving the problem, our everday knowledge knows that the temperature at both
ends will drop first, and the entire metal will eventually cool down to 0◦ C. We can prove
this by solving the heat equation. Since there is no y-direction, the problem is described
6.1. THE HEAT EQUATION 3

by the following:

∂u ∂ 2u
= σ 2 , 0 ≤ x ≤ L, t ≥ 0, (6.9)
∂t ∂x
u(t, 0) = u(t, L) = 0, u(0, x) = f (x), (6.10)

where f (x) is some initial temperature distribution of the bar. Fig. 6.2 shows a visual
representation of the metal bar.

u = 0◦ C
u = 0◦ C

x=0 x=L

Figure 6.2: A metal bar with ends kept at zero temperature.

We solve this problem by separation of variables. That is, we assume that the solution
takes the form

u(t, x) = T (t)X(x). (6.11)

In other words, our two-variable function u(t, x) is actually a single-variable function T (t)
multiplied with another single-variable function X(x). Because of this, note that the
partial derivative takes the form

∂u dT ∂u dX ∂ 2u d2 X
=X , =T , = T . (6.12)
∂t dt ∂x dx ∂x2 dx2

Substituting into Eq. (6.11) gives

dT d2 X
X = σT
dt dx2
1 dT 1 d2 X
= . (6.13)
dx2}
|σT{zdt} |X {z
t only x only

Writing in this form, the left-hand side is a function of t only, and the right-hand side
is a function of x only. So, what function of t can be equal to a function of a different
variable x?

The only possibility is that they are both equal to the same constant. Let us call this
4 CHAPTER 6. SEPARATION OF VARIABLES

constant λ, therefore

1 dT
= λ, (6.14a)
σT dt
1 d2 X
= λ. (6.14b)
X dx2

We can solve (6.14b) using the methods of the previous chapter. But that depends on
whether λ is positive or negative. Let us consider both cases:

• Case 1: If λ is positive, λ = α2 . Then Eq. (6.14b) is rearrange to become

d2 X
= α2 X. (6.15)
dx2

Therefore the solution is

X(x) = A cosh αx + B sinh αx. (6.16)

We check whether it satisfies the boundary condition. Firstly,

u(t, 0) = 0 → X(0) = 0,
0 = A cosh 0 + B sinh 0 → A = 0. (6.17)

The other boundary condition is

u(t, L) = 0 → X(L) = 0,
0 = 0 cosh αL + B sinh αL → B = 0. (6.18)

So we find that A = B = 0. Which gives X = 0. This case does not give a


meaningful solution.

• Case 2: If λ = 0, then the solution is

X = Ax + B, (6.19)

where A and B are constants. The left boundary gives X(0) = 0 which requires
B = 0. The right boundary X(L) = AL = 0 requires A = 0. Therefore Case 2 also
does not give a meaningful solution.

• Case 3: If λ is negative, λ = −k 2 . Then Eq. (6.14b) is rearrange to become

d2 X
= −k 2 X. (6.20)
dx2
6.1. THE HEAT EQUATION 5

Therefore the solution is

X(x) = A cos kx + B sin kx. (6.21)

We check whether it satisfies the boundary condition. Firstly,

u(t, 0) = 0 → X(0) = 0,
0 = A cos 0 + B sin 0 → A = 0. (6.22)

The second condition is

u(t, L) = 0 → X(L) = 0,
0 = 0 cos kL + B sin kL. (6.23)

In this case, we can avoid B = 0 if sin kL is equal to zero. This is possible if

kL = nπ, n = 1, 2, . . . . (6.24)

2 2
Therefore, we now have found that λ is negative where λ = −k 2 = − nLπ2 , and the solution
for X is
 nπx 
X(x) = B sin (6.25)
L

Now we turn to Eq. (6.14a); knowing the value of λ now,

dT n2 π 2 σ
= −λσT = − T. (6.26)
dt L2

The solution is

T (t) = Ce−λσt , (6.27)

where C is an arbitrary constant. Putting the solutions together, we find that


 nπx 
−n2 π 2 σt/L2
u(t, x) = T (t)X(x) = BC e sin
|{z} L
rename=bn
2 2
 nπx 
u(t, x) = bn e−n π σt/L sin , n = 1, 2, . . . (6.28)
L

This solution will work for any positive integer n. So, we shall assume that a complete
6 CHAPTER 6. SEPARATION OF VARIABLES

solution is a sum over all n,


∞  nπx 
−n2 π 2 σt/L
X
u(t, x) = bn e sin . (6.29)
n=1
L

At this point, we have used the two boundary conditions to determine our solution at its
current state. The coefficients bn are finally determined using the last condition, which is
u(0, x) = f (x). Putting t = 0, we have

X  nπx 
u(0, x) = f (x) = bn sin . (6.30)
n=0
L

Therefore this is a Fourier series for the function f (x), which requires a specific function
to be given.

Example 6.1.1:
A metal rod of length L is initially at a temperature T0 for the entire rod. Both
ends attached to zero temperature sources, u = 0. Determine the temperature of
the metal rod as a function of time t and position x.

Ex. 6.1.1 solution:


The rod is initially uniformly at T0 . This means u(0, x) = T0 . The boundary value problem
to be solved is

∂u ∂ 2u
= σ 2 , 0 ≤ x ≤ L, t ≥ 0, (6.31)
∂t ∂x
u(t, 0) = u(t, L) = 0, u(0, x) = T0 , (6.32)

Repeating the steps in the notes above, the result will be


∞  nπx 
2 π 2 σt/L
X
u(t, x) = bn e−n sin . (6.33)
n=1
L

At t = 0, the boundary condition is



X  nπx 
u(0, x) = T0 = bn sin . (6.34)
n=0
L

This is just the Fourier series for a constant on the interval 0 ≤ x ≤ L. Notice that this
is just the right half of Example 5.1.1 in the previous chapter. Therefore we can just use
6.1. THE HEAT EQUATION 7

the solution and restrict it to 0 ≤ x ≤ L.

2T0
bn = (1 − (−1)n ) , (6.35)

therefore our final solution is



2T0 X 1 − (−1)n −n2 π2 σt/L2  nπx 
u(t, x) = e sin . (6.36)
π n=0 n L

Fig. 6.3 plots the solution for t = 0, t = 0.01, t = 0.10, and t = 0.30 for the case
L = 1 and T0 = 10◦ C. We see that as as time increases, the temperature at both ends
drops quickly first. The temperature near the centre drops the slowest because they are the
furthest away from the cold source. Eventually the whole bar will be cooled down to 0◦ C.
#

t=0
12 t = 0.01
t = 0.10
t = 0.30
10

8
u

0
0 0.2 0.4 0.6 0.8 1
x

Figure 6.3: Temperature distribution of a metal bar initialy at uniform temperature 10◦ C,
attached to cold sources of 0◦ C at both ends.
8 CHAPTER 6. SEPARATION OF VARIABLES

6.1.2 Metal bar with insulated ends

From thermodynamics, it is known that temperature differences causes a flow in heat. On


a metal bar, the derivative ∂u∂x
indicates a change in temperature across a point (due to
the definition of a derivative). Therefore, the quantity ∂u
∂x
represents the heat flow along
∂u
the x direction. Similarly, in a 2D metal plate, ∂y indicates the heat flow along the y
direction.

We shall now use this knowledge to solve the problem of a metal bar with insulated ends.
Let us suppose that, initially, the left side of the bar is at zero temperature, and the right
end of the bar is at 10◦ C. Then the function u(t, x) is determined by the boundary value
problem where the derivatives are fixed at the endpoints.

Example 6.1.2:
Solve the boundary value problem

∂u ∂ 2u
= σ 2 , 0 ≤ x ≤ L, t ≥ 0, (6.37)
∂t ∂x
∂u ∂u T0
(t, 0) = (t, L) = 0, u(0, x) = x. (6.38)
∂x ∂x L

Ex. 6.1.2 solution:


Again, we solve this using separation of variables. We assume that the solution takes the
form

u(t, x) = T (t)X(x). (6.39)

Substituting this into the PDE, we have

1 dT 1 d2 X
= . (6.40)
σT dt X dx2

Same as before, we conclude that this equation is only possible if both sides are equal to
the same constant. Therefore

1 dT
=λ (6.41)
σT dt
1 d2 X
= λ. (6.42)
X dx2

There are three cases, depending on whether λ is positive, negative, or zero. We shall
investigate:
6.1. THE HEAT EQUATION 9

• Case 1: If λ is positive, λ = α2 . Eq. (6.42) is rearrange to be

d2 X
= α2 X. (6.43)
dx2

As discussed in the previous Chapter, the solution for X is

X(x) = A cosh kx + B sinh kx, (6.44)


dX
= kA sinh kx + kB cosh kx (6.45)
dx

We check whether it satisfy the boundary conditions. Firstly,

∂u dX
(t, 0) = 0 → (0) = 0,
∂x dx
0 = kA sinh 0 + kB cosh 0 → B = 0. (6.46)

The second boundary condition is

∂u dX
(t, L) = 0 → (L) = 0,
∂x dx
0 = kA sinh kL + 0 cosh kL → A = 0. (6.47)

This does not give any meaningful solution. So λ cannot be positive.

• Case 2: If λ = 0. Then Eq. (6.42) is rearrange to be

d2 X
=0 (6.48)
dx2

The solution is simply

X(x) = Ax + B. (6.49)

Checking the boundary conditions,

dX
(0) = 0 = A → A = 0, (6.50)
dx
X(L) = 0 = AL + 0 → A = 0. (6.51)

a0
This does not impose any constraints on B. Let us rename B = 2
, the possible
solution is

a0
X(x) = . (6.52)
2
10 CHAPTER 6. SEPARATION OF VARIABLES

• Case 3: If λ is negative, λ = −k 2 . Then Eq. (6.42) is arrange to be

d2 X
= −k 2 X (6.53)
dx2

The solution is

X(x) = A cos kx + B sin kx. (6.54)

The boundary conditions are

dX
(0) = 0 = −kA sin 0 + kB cos 0 → B = 0, (6.55)
dx
dX
(L) = 0 = −kA sin kL + 0 cos kL. (6.56)
dx

We can avoid A = 0 if the sine term is zero. This will occur if

kL = nπ, n = 1, 2, . . . (6.57)

Now turn to Eq. (6.41). Knowing the value of λ now,

dT n2 π 2 σ
= −λσT = − T. (6.58)
dt L2

The general solution is

2 π 2 σt/L2
T (t) = Ce−n . (6.59)

Putting our solution together, we have

2 π 2 σt/L2
 nπx 
u(t, x) = T (t)X(x) = BCe−n sin . (6.60)
L

As before, we rename the constants and assume a complete solution is a sum over all n:

a0 X −n2 π 2 t/L2
 nπx 
u(t, x) = + an e cos . (6.61)
2 n=1
L

T0
We now use the final condition u(0, x) = L
x. Then we obtain


T0 a0 X  nπx 
u(0, x) = x = + an cos . (6.62)
L 2 n=1
L

This is a Fourier series expansion for the function f (x) = TL0 x. We have solve this Fourier
series in Example 5.1.2 for the interval −L ≤ x ≤ L. Now we just take the part 0 ≤ x ≤ L
6.1. THE HEAT EQUATION 11

relevant to the metal bar. The solution is



2T0 X (−1)n − 1 −n2 π2 σt/L2  nπx 
u(t, x) = T0 + 2 e cos . (6.63)
π n=1 n2 L

The temperature distribution for t = 0, t = 0.05, t = 0.20, and t = 0.30 is plotted in


Fig. 6.4. We can see that at t = 0, the temperature is given by u(0, x) = TL0 x, according to
the boundary condition. As t increases, the left side of the bar increases in temperature,
while the right side decreases in temperature. Eventually the whole bar will reach a uniform
equilibrium temperature at T0 /2. Physically, we see that since the ends of the bar is
insulated, no heat can enter or leave the bar. So the cold and hot parts of the bar will mix
until it becomes a uniform average temperature of T0 /2. #

10
t=0
t = 0.05
t = 0.20
t = 0.30
8

6
u

0
0 0.2 0.4 0.6 0.8 1
x

Figure 6.4: Temperature distribution of a metal bar with insulated ends.


12 CHAPTER 6. SEPARATION OF VARIABLES

6.1.3 Inclusion of convection and other effects

Suppose the metal bar in question has additional effects. The PDE to be solve is now

∂ 2u
 
∂u ∂u
=σ +η + ξu , 0 ≤ x ≤ L, t ≥ 0, (6.64)
∂t ∂x2 ∂x
u(t, 0) = u(t, L) = 0, u(o, x) = f (x). (6.65)

To solve such a problem, we let

u(t, x) = eαx+βt v(t, x). (6.66)

Substitute into the PDE and collecting the terms, we find that

∂v ∂ 2 v
 
∂v 2 ∂v
βv + = σ α v + 2α + + ηαv + η + ξv
∂t ∂x ∂x2 ∂x
∂ 2v
  
∂v 2 β ∂v
= σ 2 + σ α − + αη + ξ v + (2α + η) (6.67)
∂t ∂x σ ∂x

If the terms in the square brackets become zero, it reduces to the PDE we know how to
solve. Therefore, let us choose α and β to make it zero by solving the equations

β
α2 − + αη + ξ = 0 (6.68)
σ
2α + η = 0. (6.69)

The appropriate α and β are


 
1 1 2
α = − η, β=σ ξ− η . (6.70)
2 4

Then, the expression for u(t, x) becomes

2 /4)t
u(t, x) = e−ηx/2+σ(ξ−η v(t, x) (6.71)

Let us see how the boundary conditions are expressed in this form. The first condition is

2 /4)t
u(t, 0) = 0 = e0+σ(ξ−η v(t, 0) → v(t, 0) = 0. (6.72)

The second condition is

2 /4)t
u(t, L) = 0 = e−ηL/2+σ(ξ−η v(t, L) = 0 → v(t, L) = 0. (6.73)
6.1. THE HEAT EQUATION 13

The third condition is

u(0, x) = f (x) = e−ηx/2+0 v(0, x) → v(0, x) = eηx/2 f (x). (6.74)

Therefore the problem has been reduced to the earlier problem where we can solve by
using the Fourier series method.

Example 6.1.3:
Solve the problem

d2 u
 
∂u ∂u
=4 +2 + 2u , 0 ≤ x ≤ π, t ≥ 0, (6.75)
∂t dx2 ∂x
u(t, 0) = u(t, π) = 0, u(0, x) = sin (3x) . (6.76)

Ex. 6.1.3 solution:


In this case, we have

L = π, σ = 4, η = ξ = 2. (6.77)

Using (6.70), we have

α = −1, β = 4. (6.78)

Therefore we let

u(t, x) = e−x+4t v(t, x). (6.79)

Substituting into the PDE, we find that v satisfies the boundary-value problem

∂v ∂ 2v
= 4 2 , 0 ≤ x ≤ π, t ≥ 0, (6.80)
∂t ∂x
v(t, 0) = v(t, π) = 0, v(0, x) = ex sin(3x). (6.81)

The solution is therefore



2
X
v(x, t) = bn e−4n t sin(nx) (6.82)
n=1
14 CHAPTER 6. SEPARATION OF VARIABLES

The coefficients bn are determined by


Z π
2
bn = ex sin(3x) sin(nx) dx
π 0
12n
=− (1 + eπ (−1)n ) . (6.83)
π(n4 2
+ 16n + 100)

6.2 The wave equation

6.2.1 Separation of variables for the wave equation

Let us consider a wave equation in one spatial direction which is bounded. A wave
equation is given by

∂ 2u 2
2∂ u
= c , 0 ≤ x ≤ L, t ≥ 0. (6.84)
∂t2 ∂x2

We can again apply the idea of separation of variables to solve this problem. As before,
we assume that u takes the form

u(t, x) = T (t)X(x), (6.85)

where T (t) is a function that depends on t only and X(x) is a function that depends on
x only. Substituting Eq. (6.85) into (6.84), we have

d2 T 2 d X
2
X = c T
dt2 dx2
2 2
1 dT 1 dX
2 2
= . (6.86)
|c T{zdt } |X {z dx2 }
t only x only

The terms on the left hand side depend on t only, while the term on the right hand side
depend on x only. The only way that ‘functions’ of two different variables be equal to each
other is that they are equal to the same constant. We let the constant be −λ. Therefore
6.2. THE WAVE EQUATION 15

we have

d2 X
= λX (6.87)
dx2
d2 T
= λc2 T. (6.88)
dt2

Similar to the heat equation, the solution depends on the value of λ:

• Case 1: If λ is positive, λ = α2 . Then Eqs. (6.87) and (6.88) is solved by

X(x) = A cosh αx + B sinh αx, (6.89)


T (t) = C cosh αct + D sinh αct. (6.90)

The constants A, B, C, and D will be determined by boundary or initial conditions.

• Case 2: If λ = 0, Eqs. (6.87) and (6.88) is solved by

X(x) = Ax + B, (6.91)
T (t) = Ct + D. (6.92)

The constants A, B, C, and D will be determined by boundary or initial conditions.

• Case 3: If λ is negative, λ = −k 2 . Then Eqs. (6.87) and (6.88) are solved by

X(x) = A cos kx + B sin kx, (6.93)


T (t) = C cos kct + D sin kct. (6.94)

The constants A, B, C, and D will be determined by boundary or initial conditions.

Note that since the time derivative of Eq. (6.84) is of second order, the boundary condi-
tions may include specifying the value of

du
(6.95)
dt
du
at a certain time or position. Usually at t = 0. The quantity dt
is called the velocity
since it describes how fast u changes over time.
16 CHAPTER 6. SEPARATION OF VARIABLES

Example 6.2.1:
Suppose a string with ends fixed at x = 0 and x = π and initialy has the configu-
ration

u(0, x) = f (x) = x(π − x), 0 ≤ x ≤ π. (6.96)

The string is then released with an initial velocity g(x) = 0. Describe the motion
of the string if c = 1.

Ex. 6.2.1 solution:


The fixed ends of the string means that we have the boundary conditions

u(t, x) = 0 = u(t, L).

Applying separation of variables, the boundary conditions only allows Case 3, with A = 0
and kL = nπ. The solution for X is
 nπx 
X(x) = B sin , n = 1, 2, . . . (6.97)
L

The solution for T is


   
ncπt ncπt
T (t) = C cos + D sin . (6.98)
L L

Given, L = π and c = 1 our solution is

u(t, x) = T (t)X(x) = [CB cos (nt) + DB sin (nt)] sin nx (6.99)

We rename the constants, and assume the complete solution is the sum over all n. There-
fore

X
u(t, x) = [An cos (nt) + Bn sin (nt)] sin nx. (6.100)
n=1

Using the initial condition u(0, x) = x(π − x), we have



X
u(0, x) = x(π − x) = An sin nx (6.101)
n=1

This is the Fourier series expansion for the function f (x) = x(π − x). Therefore our
6.2. THE WAVE EQUATION 17

coefficients An are

4
An = 3
(1 − (−1)n ) . (6.102)
πn

Now we take the derivative of u with respect to t,



∂u X
= [−nAn sin nt + nBn cos nt] sin nx. (6.103)
∂t n=1

∂u
Using the boundary condition ∂t
(0, x) = 0, we just have Bn = 0. Therefore our solution
is

X 4
u(t, x) = 3
(1 − (−1)n ) cos nt sin nx. (6.104)
n=1
πn

Example 6.2.2:
Suppose a string with ends fixed at x = 0 and x = π and initialy has the configura-
tion u(0, x) = 0. The string is then released with an initial velocity g(x) = x(π − x).
Describe the motion of the string if c = 1.

Ex. 6.2.2 solution:


Here we have L = π and c = 1. Applying separation of variables, along with the condition
u(t, 0) = u(t, π) = 0, we obtain, as before,

X
u(t, x) = (An cos nt + Bn sin nt) sin nx (6.105)
n=1

∂u
The the initial condition is ∂t
(0, x) = x(π − x). Therefore


∂u X
(0, x) = x(π − x) = [−nAn sin 0 + nBn cos 0] sin nx
∂t n=1

X
= nBn sin nx. (6.106)
n=1

This is the Fourier series expansion for the function x(π −x) with coefficients bn = (nBn ).
18 CHAPTER 6. SEPARATION OF VARIABLES

Using the coefficient formula, we obtain

4
bn = nBn = 3
(1 − (−1)n )
πn
4
Bn = 4
(1 − (−1)n ). (6.107)
πn

The intial condition u(0, x) = 0 gives An = 0. Therefore our solution is



4 X 1 − (−1)n
u(t, x) = sin nt sin nx. (6.108)
π n=1 n4

Example 6.2.3:
Suppose a string can be described by its vertical displacement as a function of time
t and position x according to the wave equation

∂ 2u 2
2∂ u
= c . (6.109)
∂t2 ∂x2

Its ends are fixed at 0 and π. The string is initially picked up at the middle point
to the position
(
x for 0 ≤ x < π2 ,
f (x) = (6.110)
π−x for π2 ≤ x ≤ π,

and released with an intial velocity g(x) = x(1 + cos x). Describe the motion of the
string if c = 1.

Ex. 6.2.3 solution:


Applying separation of variables, we let u(t, x) = T (t)X(x). Substituting this and c = 1,
into the wave equation, the fixed endpoints again allows Case 3 with A = 0 and kL =
kπ = nπ. Therefore k = n,

X(x) = B sin nx, (6.111)


T (t) = C cos nt + D sin nt. (6.112)
6.2. THE WAVE EQUATION 19

u(t, x) = T (t)X(x) = [C cos nt + D sin nt] B sin nx (6.113)


= (BC cos nt + BD sin nt) sin nx (6.114)
= (An cos nt + Bn sin nt) sin nx, n = 1, 2, . . . (6.115)

where we have renamed the constants An = BC and Bn = BD. We assume the complete
solution to be a sum over all n,

X
u(t, x) = (An cos nt + Bn sin nt) sin nx. (6.116)
n=1

We now apply the initial condition, where u(0, x) = f (x), where f (x) is given by Eq. 6.110.
Therefore

X
u(0, x) = f (x) = (An cos 0 + Bn sin 0) sin nx
n=0
X∞
= An sin nx. (6.117)
n=0

To determine the coefficient, let us suppose that f (x) is the right half of a function
(
−f (x), if − L ≤ x < 0,
F (x) = (6.118)
f (x), if 0 ≤ x ≤ L,

where f (x) is given by (6.110). In other words, we consider f (x) as the right half of an
odd function, so that its Fourier series only contains sine terms. Using the formula (6.2),

1 π
Z
An = f (x) sin nx dx
π −π
Z π
2
= f (x) sin nx dx
π 0
2 π/2 2 π
Z Z
= x sin nx dx + (π − x) sin nx dx
π 0 π π/2
2 π/2
Z π
2 π
Z Z
= x sin nx + 2 sin nx dx + x sin nx dx
π 0 π/2 π π/2
 π/2  π
2 x 1 2h π iπ 2 x 1
= − cos nx + 2 sin nx + − cos nx − − cos nx + 2 sin nx
π n n 0 π n π/2 π n n π/2

2 π nπ 1 nπ π  nπ 
= − cos + 2 sin − cos nπ − cos
π 2n 2 n 2 n 2
 
π π nπ 1 nπ
− − cos nπ + cos + 0 − 2 sin
n 2n 2 n 2
 
2 2 nπ 4 sin(nπ/2)
= sin = .
π n2 2 πn2
20 CHAPTER 6. SEPARATION OF VARIABLES

∂u
To determine Bn , we use the intial velocity, ∂t
(0, x) = g(x) = x(1 + cos x).


∂u X
(t, x) = (−nAn sin nt + nBn cos nt) sin nx
∂t n=1

∂u X
(0, x) = g(x) = nBn sin nx.
∂t n=1

Similar to the above, we consider g(x) as the right half of an odd function. Using the
formula, then this is the Fourier series expansion for the function g(x) with coefficients
nBn . Therefore we use the formula

2 π 2 π
Z Z
nBn = g(x) sin nxdx = x(1 + cos x) sin nx dx
π 0 π 0
2 π
Z
= (x sin nx + x cos x sin nx) dx
π 0
2 π 2 π
Z Z
= x sin nx dx + x cos x sin nx dx
π 0 π 0
2 π
Z
2 n
= − (−1) + x cos x sin nx dx.
n π 0

Using the identity sin nx cos mx = 12 [sin(n + m)x + sin(n − m)x], the second integral is
(
π
− 21 if n = 1,
Z
2
x cos x sin nx dx = (6.119)
π 0 2(−1)n n(n21−1) if n = 2, 3, . . .

Therefore the solution for Bn is


(
3
2
for n = 1
Bn = 2(−1)n (6.120)
n2 (n2 −1)
for n = 2, 3 . . .

Putting the pieces together, the solution for u(t, x) is


 
4 3
u(t, x) = cos t + sin t sin nx
π 2

2(−1)n

X 4 sin(nπ/2) 
= cos nt + 2 2 sin nt sin nx
n=2
πn2 n (n − 1)

#
6.2. THE WAVE EQUATION 21

6.2.2 Wave equation with a forcing term

Consider the problem

∂ 2u 2
2∂ u
= c + F (x),
∂t2 ∂x2
∂u
u(t, 0) = 0, u(t, L) = 0, u(0, x) = f (x), (0, x) = g(x), (6.121)
∂t

where F (x), f (x), and g(x) are some functions of x.

To solve such a problem in the presence of F (x), we try a solution of the form

u(t, x) = v(t, x) + ψ(x). (6.122)

Substitutint into (6.121), our problem has been converted into

2 2
∂v 2∂ v 2d ψ
= c + c + F,
∂t2 ∂x2 dx2
v(t, 0) + ψ(0) = 0 = v(t, L) + ψ(L),
∂v
v(0, x) + ψ(x) = f (x), (0, x) + 0 = g(x). (6.123)
∂t

If we purposely choose

d2 ψ
c2 + F = 0, (6.124)
dx2

then the problem is reduced to


2 2
∂v 2∂ v 2d ψ
= c + c + F,
∂t2 ∂x2 dx2
v(t, 0) + ψ(0) = 0 = v(t, L) + ψ(L),
∂v
v(0, x) + ψ(x) = f (x), (0, x) + 0 = g(x). (6.125)
∂t

We can then solve this using the earlier methods.


22 CHAPTER 6. SEPARATION OF VARIABLES

Example 6.2.4:
Solve the wave equation problem

∂ 2u 2
2∂ u
= c + x,
∂t2 ∂x2
u(t, 0) = u(t, L) = 0,
∂u   πx 
u(0, x) = x(L − x), (0, x) = x 1 + cos . (6.126)
∂t L

Ex. 6.2.4 solution:


Here, we have F (x) = x, f (x) = x(L − x), and g(x) = x 1 + cos πx

L
. We try the solution

u(t, x) = v(t, x) + ψ(x). (6.127)

Substitute this into the problem (6.126), the problem is converted into

∂ 2v 2
2∂ v
2
2d ψ
=c +c + x,
∂t2 ∂x2 dx2
v(t, 0) + ψ(0) = v(t, L) + ψ(L) = 0,
∂v   πx 
v(0, x) + ψ(x) = x(L − x), (0, x) = x 1 + cos . (6.128)
∂t L

We purposely choose ψ to cancel the x term;

d2 ψ x
2
= − 2,
dx c
x3
ψ(x) = − 2 + αx + β. (6.129)
6c

The first boundary condition is

v(t, 0) + ψ(0) = 0 = v(t, 0) − 0 + 0 + β (6.130)

If we choose β = 0, then the boundary condition is v(t, 0) = 0. The second boundary


condition is

L3
v(t, L) + ψ(L) = 0 = v(t, L) − + αL + 0. (6.131)
6c2
L2
If we choose α = 6c2
, then the boundary condition becomes v(t, L) = 0.
6.2. THE WAVE EQUATION 23

Therefore, we have determined ψ to be

x3 L2 x
ψ(x) = − + . (6.132)
6c2 6c2

Our problem has been converted into

∂ 2v 2
2∂ v
= c ,
∂t2 ∂x2
v(t, 0) = 0 = v(t, L),
x3 L2 x ∂v
v(0, x) = f (x) + − , (0, x) = g(x). (6.133)
6c2 6c2 ∂t

We can now solve this using separation of variables. Letting v(t, x) = T (t)X(x). The
fixed endpoints for v gives case 3 with A = 0 and kL = nπ. The solution is
 nπx 
X(x) = B sin , (6.134)
 L   
nπct nπct
T (t) = C cos + D sin . (6.135)
L L

We proceed in the usual way in renaming the constants and assuming a complete solution
is a sum over n,
∞     
X nπct nπct  nπx 
v(t, x) = An cos + Bn sin sin (6.136)
n=1
L L L

x3 L2 x
The initial condition is v(0, x) = x(L − x) + 6c
− 6c2
,


x3 L2 x X  nπx 
v(0, x) = x(L − x) + − 2 = An sin . (6.137)
6c 6c n=1
L

x3 L2 x
We can consider x(L − x) + 6c
− 6c2
to be a right half of an odd function, we use the
formula for the coefficient

2 L x3 L 2 x
Z    nπx 
An = x(L − x) + − 2 sin dx
L 0 6c 6c L
2
= 3
[2 (1 − (−1)n ) + π(−1)n ] . (6.138)
πn

Now the second initial condition is



∂u   πx  X LB
n
(0, x) = x 1 + cos = . (6.139)
∂t L n=1
πnc

πx

We consider x 1 + cos L
as the right half of an odd function. The coefficients are
24 CHAPTER 6. SEPARATION OF VARIABLES

determined by the formula


Z L
nπc 2   πx   nπx 
Bn = x 1 + cos sin dx
L L 0 L L
(
3
2
for n = 1,
Bn = 2(−1)n (6.140)
n2 (n2 −1)
for n = 2, 3, . . .

Finally, putting our solution together, it is

u(t, x) = v(t, x) + ψ(x)


 
8 − 2π 3
= cos t + sin t sin x
π 2

X 4 (1 − (−1)n ) + 2π(−1)n 2(−1)n
 
+ cos nt + 2 2 sin nt sin nx
n=1
n3 π n (n − 1)
x3 L2 x
− + .
6c2 6c2

#
6.2. THE WAVE EQUATION 25

6.2.3 Travelling waves

If t is time and x is position, a function where its graph translates linearly in time is also
a solution to the wave equation. An example is shown in Fig. 6.5. The top figure shows
the graph y = f (x) at time t = 0. At some later time t 6= 0, the graph have moved to the
positive-x direction by ct units. That means, the function of the new graph is given by
f (x − ct)

y A
t=0

x
y A

Some later t

x = ct x
Figure 6.5

More generally, a function of the form

f (kx − ωt), (6.141)

where k and ω are constants satisfies the eave equation. That means, as t changes, the
graph y = f (kx − ωt) shifts along the x-axis. We can calculate the wave velocity by
the following method: First, let u = kx − ωt. Take for example, the point A in Fig. 6.5.
Let us track the motion of one particular point on the graph, f (u0 ) for some choice of u0 .
We have

u0 = kx − ωt
u0 ω
x= + t. (6.142)
k k

This gives the x-coordinate of point A. Assuming ω and k are positive, then as t increases,
26 CHAPTER 6. SEPARATION OF VARIABLES

the x-coordinate of A increases. The velocity of point A is

dx ω
c= = . (wave velocity) (6.143)
dt k

Let us see the differential equation obeyed by a wave. Again, we let u = kx − ωt, so that

f (kx − ωt) = f (u), u = kx − ωt. (6.144)

Take the partial derivative with respect to t. Using the chain rule,

∂f df ∂u df
= = (−ω). (6.145)
∂t du ∂t du

Taking the second partial derivative,

∂ 2f d2 f 2
2d f
= (−ω)(−ω) = ω . (6.146)
∂t2 du2 du2

We do the same by taking partial derivatives with respect to x. The result is

∂ 2f 2
2d f
= k . (6.147)
∂x2 du2

Dividing (6.146) and (6.147),

∂2f 2

∂t2
ω 2 dduf2 ∂ 2f k2 ∂ 2f
∂2f
= → = (6.148)
2
k 2 dduf2 ∂x2 ω 2 ∂t2
∂x2

From Eq. (6.143), ω/k is the wave velocity. Therefore we have shown that the function
satisfies the wave equation

∂ 2f 1 ∂ 2f
= . (6.149)
∂x2 c2 ∂t2
6.3. THE LAPLACE AND POISSON EQUATIONS 27

6.3 The Laplace and Poisson equations

The Laplace and Poisson equation typically occurs in electrostatics, among other fields.
Suppose an electric field is given by a gradient of an electrostatic potential,

~ = −∇Φ.
E ~ (6.150)

Maxwell’s equation is

~ = ρ
~ ·E

0

~ · ∇Φ
~
 ρ
−∇ =
0
ρ
∇2 Φ = − , (6.151)
0

where ρ is the charge density. This is Poisson’s equation. The case where ρ = 0,

∇2 Φ = 0, (6.152)

is called Laplace’s equation.

We consider the two-dimensional case, and use our usual notation u(x, y) instead of Φ.

2 2
~ 2 u = ∂ u + ∂ u = 0.
∇ (6.153)
∂x2 ∂y 2

6.3.1 Dirichlet problem on a rectangle

Suppose we are given a problem as follows:

∂ 2u ∂ 2u
+ = 0, 0 ≤ x ≤ L, 0 ≤ y ≤ K,
∂x2 ∂y 2
u(x, 0) = u(0, y) = u(L, y) = 0, u(x, K) = f (x). (6.154)

Here, the range of x and y in the problem lies in a rectangle of width L and height K.
The boundary conditions are that u = 0 at three of the sides, and the condition on the
top side is u(x, K) = f (x), where f is some function of x. This problem can be visualised
in Fig. 6.6.
28 CHAPTER 6. SEPARATION OF VARIABLES

u = f (x)
K

u=0
u=0 u=0
L x
Figure 6.6: The Dirichlet problem on a rectangle defined by Eq. (6.154).

To perform separation of variables, we let u(x, y) = X(x)Y (y). Substitute into the PDE,
we find that

d2 X d2 Y
Y + X = 0.
dx2 dy 2

Next we divide both sides by XY ,

1 d2 X 1 d2 Y
+ = 0. (6.155)
dx2} Y dy 2
|X {z | {z }
x only y only

The first term is a function of x only, and the second term is a function of y only. The
only way two functions of different variables adds up to zero for any x and y is that the
‘functions’ are constants, each of opposite signs. Therefore there must exist a constant λ
such that

1 d2 X 1 d2 Y
= λ, = −λ. (6.156)
X dx2 Y dy 2

Let’s solve X first, by considering the possible cases:

• Case 1: λ is positive, λ = α2 . Then the solution for X is

X(x) = A cosh αx + B sinh αx. (6.157)

We look at the boundary conditions,

u(0, x) = 0 → X(0) = 0
0 = A cosh 0 + B sinh 0 → A = 0. (6.158)
6.3. THE LAPLACE AND POISSON EQUATIONS 29

The boundary condition on the other side is

u(L, x) = 0 → X(L) = 0
0 = 0 cosh αL + B sinh αL → B = 0. (6.159)

This gives X = 0, which leads to u = 0, which is not a useful solution.

• Case 2: λ = 0. The solution for X is

X(x) = Ax + B. (6.160)

The boundary conditions give

X(0) = 0 = A0 + B → B = 0, (6.161)
X(L) = 0 = AL + 0 → A = 0. (6.162)

Again this gives u = 0. Therefore λ = 0 does not give a useful solution.

• Case 3: λ is negative, λ = −k 2 . The solution for X is

X(x) = A cos kx + B sin kx. (6.163)

The first condition gives

X(0) = A cos 0 + B sin 0 → A = 0. (6.164)

The other boundary condition gives

X(L) = 0 cos kL + B sin kL. (6.165)

We can avoid B = 0 if the sine function is zero. This will happen if

kL = nπ, n = 1, 2, . . . (6.166)

Therefore our solution for X is


 nπx 
X(x) = B sin , n = 1, 2, . . . (6.167)
L
2 2
We now find a solution for Y (y). Knowing now that λ = −k 2 = − nLπ2 , the equation for
Y now becomes

1 d2 Y n2 π 2
= + . (6.168)
Y dy 2 L2
30 CHAPTER 6. SEPARATION OF VARIABLES

The solution for Y is

n2 π 2 y
   nπy 
Y (y) = C cosh + D sinh . (6.169)
L L

The boundary condition at the bottom of the rectangle is

u(x, 0) = 0 → Y (0) = 0,
0 = C cosh 0 + D sinh 0 → C = 0. (6.170)

Therefore the solution for Y is


 nπy 
Y (y) = D sinh . (6.171)
L

Putting together the pieces,


 nπx   nπy 
u(x, y) = X(x)Y (y) = BD sin sinh , n = 1, 2, 3, . . . (6.172)
L L

As usual, we rename the constant BD, and assume the complete solution to be the sum
over all n,

X  nπx   nπy 
u(x, y) = Bn sin sinh . (6.173)
n=1
L L

There is one remaining boundary condition, which is u(x, K) = f (x). Substituting y = K,



X  nπx   nπy 
u(x, K) = f (x) = Bn sin sinh
n=1
L L
X∞ h  nπy i  nπx 
= Bn sinh sin . (6.174)
n=1
L L

This is a Fourier series for the function f (x) with coefficients bn = Bn sinh nπy

L
. Given
a particular f (x) for a problem, we can use the Fourier series formula to determine bn ,
then solve for Bn .

Example 6.3.1:
Solve the Dirichlet problem on a rectangle

∂ 2u ∂ 2u
+ = 0, 0 ≤ x ≤ π, 0 ≤ y ≤ π,
∂x2 ∂y 2
u(x, 0) = u(0, y) = u(π, y) = 0, u(x, π) = x(π − x). (6.175)
6.3. THE LAPLACE AND POISSON EQUATIONS 31

Ex. 6.3.1 solution:


This is the problem (6.154), with K = L = π, and f (x) = x(π − x). Going through the
same separation of variable steps will give the complete solution for u(x, y) as
∞ h
X  nπy i  nπx 
u(x, y) = Bn sinh sin (6.176)
n=1
L L

The boundary condition at y = π is



X
u(x, π) = x(π − x) = [Bn sinh nπ] sin (nx) . (6.177)
n=1

Let us consider f (x) as the right half of an odd function, so that the sine series has
coefficients given by
Z π
2
Bn sinh nπ = x(π − x) sin nx dx
π 0
π
2 π 2
Z Z
=2 x sin nx dx − x sin nx dx,
0 π 0
4
= 3
(1 − (−1)n ) . (6.178)
πn

Therefore,

4(1 − (−1)n
Bn = (6.179)
πn3 sinh nπ

Substituting this Bn into the expression for u,



4 X 1 − (−1)n sinh ny
u(x, y) = sin nx. (6.180)
π n=1 n3 sinh nπ

We have learned how to solve Dirichlet problems on a rectangle where the boundary
conditions on three sides are zero, and one side non-zero. What about the case with two
boundaries non-zero?

We simply split this into two problems with three zero boundaries. For instance, suppose
32 CHAPTER 6. SEPARATION OF VARIABLES

we are given a problem

∂ 2u ∂ 2u
+ = 0, 0 ≤ x ≤ L, 0 ≤ x ≤ K,
∂x2 ∂y 2
u(0, y) = u(x, 0) = 0, u(x, K) = f (x), u(L, y) = g(y), (6.181)

where f (x) and g(y) are non-zero functions of x and y.

To solve this problem, we split u into two parts,

u(x, y) = v(x, y) + w(x, y), (6.182)

where v and w are separately solutions with three zero boundaries:

∂ 2v ∂ 2v
Problem I : + = 0, 0 ≤ x ≤ L, 0 ≤ y ≤ K,
∂x2 ∂y 2
v(0, y) = v(x, 0) = v(x, K) = 0, v(L, y) = g(y). (6.183)
∂ 2w ∂ 2w
Problem II : + = 0, 0 ≤ x ≤ L, 0 ≤ y ≤ K,
∂x2 ∂y 2
w(0, y) = w(x, 0) = w(L, 0) = 0, w(x, K) = f (x) (6.184)

We visualise this in Fig. 6.7.

u = f (x)
K
u = g(y)
u=0

u=0
L x

v=0 w = f (x)
v = g(y)

w=0

w=0
v=0

v=0 w=0
Problem I Problem II

Figure 6.7: Splitting the Dirichlet problem into two simpler problems.
6.3. THE LAPLACE AND POISSON EQUATIONS 33

Then, Problems I and II are solved using the methods already discussed to find v and w.
Then add them up to get the full solution u(x, y) = v(x, y) + w(x, y).

Example 6.3.2:
Solve the problem

∂ 2u ∂ 2u
+ = 0, 0 ≤ x ≤ 2, 0 ≤ y ≤ π,
∂x2 ∂y 2
u(0, y) = u(x, 0) = 0, u(2, y) = sin y, u(x, π) = x sin πx. (6.185)

Ex. 6.3.2 solution:


Split the problem into two simpler problems with three zero boundaries:

∂ 2v ∂ 2v
Problem I : + = 0, 0 ≤ x ≤ 2, 0 ≤ y ≤ π,
∂x2 ∂y 2
v(0, y) = v(x, 0) = v(x, π) = 0, v(2, y) = sin y.
∂ 2w ∂ 2w
Problem II : + = 0, 0 ≤ x ≤ 2, 0 ≤ y ≤ π,
∂x2 ∂y 2
w(0, y) = w(x, 0) = w(2, 0) = 0, w(x, π) = x sin πx.

• Solving Problem I: Separation of variables v(x, y) = X(x)Y (y). Separation of vari-


ables leads to the solution

Y (y) = B sin ny, X(x) = D sinh nx.

Therefore we assume a complete solution for v is



X
v(x, y) = Bn sinh nx sin ny.
n=1

The boundary condition at x = 2 gives



X
v(2, y) = sin y = Bn sin 2n sin ny.
n=1

Comparing both sides of the equation, we conclude that B1 sinh 2 = 1 and Bn = 0


for n 6= 2.

sinh nx
v(x, y) = sin y.
sinh 2
34 CHAPTER 6. SEPARATION OF VARIABLES

• Solving Problem II: Separation of variables lead to the solution


 nπx   nπy 
X(x) = B sin , Y (y) = D sinh .
2 2

Therefore we assume a complete solution is a sum over n,



X  nπy   nπx 
w(x, y) = Bn sinh sin .
n=1
2 2

The boundary condition at y = π is



nπ 2
X    nπx 
w(x, π) = x sin πx = Bn sinh sin .
n=1
2 2

This is a Fourier series expansion with coefficients

nπ 2 2 2
  Z  nπx 
bn = Bn sinh = x sin πx sin dx
2 2 0 2
 2
nπ 16n ((−1)n − 1)
Bn sinh =
2 π 2 (n2 − 4)2
16n((−1)n − 1)
Bn = 2 2 , n 6= 2
π (n − 4)2 sinh (nπ 2 /2)

Notice that the above calculation is only valid for n 6= 2. For the case n = 2, we
start again from the beginning to find that

2π 2 2 2
  Z  
2πx
B2 sinh = x sin πx sin dx
2 2 0 2
 2 Z 2

B2 sinh = x sin2 πx dx
2 0
 2

B2 sinh =1
2
1
B2 =
sinh (nπ 2 /2)

Therefore the solution for w is



X 16n((−1)n − 1) sinh(nπy/2)  nπx 
w(x, y) = sin .
n=1,n6=2
π 2 (n2 − 4)2 sinh(nπ 2 /2) 2
6.3. THE LAPLACE AND POISSON EQUATIONS 35

We have now solved Problems I and II to obtain v and w. The final solution is

u(x, y) = v(x, y) + w(x, y)


sinh nx sin y sin πx sinh πy
= +
sinh 2 sinh π 2

X 16n((−1)n − 1) sinh(nπy/2)  nπx 
+ sin .
n=1,n6=2
π 2 (n2 − 4)2 sinh(nπ 2 /2) 2

6.3.2 Dirichlet problems on a disk

What if we are given a Lapalce equation problem, but the boundary shape is not rectan-
gular. Suppose the boundary is a circle of radius R, as shwon in Fig. 6.8.

x2 + y 2 ≤ ρ2

u = f (φ)

Figure 6.8: Dirichlet problems on a disk.

To solve problems with circular symmetry, we use polar coordinates,

x = r cos φ, y = r sin φ. (6.186)

In polar coordinates, the second partial derivatives are

∂ 2u ∂ 2u ∂ 2 u 1 ∂u 1 ∂ 2u
+ = + + . (6.187)
∂x2 ∂y 2 ∂r2 r ∂r r2 ∂φ2

Therefore, the Laplace equation in these coordinates is

∂ 2 u 1 ∂u 1 ∂ 2u
+ + = 0, (6.188)
∂r2 r ∂r r2 ∂φ2
36 CHAPTER 6. SEPARATION OF VARIABLES

where now u is a function of r and θ; u(r, θ).

A Dirichlet problem on a disk is typically given as follows

∂ 2 u 1 ∂u 1 ∂ 2u
+ + = 0, 0 ≤ r ≤ ρ, −π ≤ φ ≤ π,
∂r2 r ∂r r2 ∂φ2
u(ρ, φ) = f (φ), (6.189)

where f (φ) is a function of φ, depending on what is given by the problem.

We can still solve this using separation of variables,

u(r, φ) = R(r)Φ(φ). (6.190)

Substitute this into the PDE, we get

d2 R 1 dR 1 d2 Φ
Φ + Φ + R = 0. (6.191)
dr2 r dr r2 dφ2

Dividing both sides b RΦ,

1 d2 R 1 dR 1 d2 Φ
+ + =0
R dr2 Rr dr r2 Φ dφ2
2
1 d2 Φ
 
1 2d R dR
r + r + = 0. (6.192)
R dr2 dR Φ dφ2
| {z } | {z }
r only φ only

We have managed to separate the equation into terms depending on r only and terms
depending on φ only. This implies a separation constant λ such that

1 d2 Φ d2 R
 
1 dR
= λ, r2 2 +r = λ. (6.193)
Φ dφ2 R dr dr

We first attempt to solve for Φ. There are the cases

• Case 1: λ is positive, λ = α2 . The solution is

Φ(φ) = A cosh αφ + B sinh αφ. (6.194)

Notice that φ is an angle. Therefore φ + 2π comes back to the same point. The
condition is

Φ(φ + 2π) = Φ(φ). (6.195)

But, cosh αφ 6= cosh α(φ + 2π) and sinh αφ 6= sinh α(φ + 2π). Therefore λ cannot
6.3. THE LAPLACE AND POISSON EQUATIONS 37

be negative.

• Case 2: λ = 0. The solution for Φ is

Φ(φ) = A0 φ + B0 . (6.196)

But Φ(φ + 2π) = A0 φ + 2A0 π + B0 . This combination will still be equal to Φ(φ) if
A = 0. So a possible solution for case 2 is

Φ = B0 . (6.197)

• Case 3: λ is negative, λ = −k 2 . The solution for Φ is

Φ(φ) = A cos kφ + B sin kφ. (6.198)

The condition is

Φ(φ + 2π) = Φ(φ)


A cos(kφ + 2kπ) + B sin(kφ + 2kπ) = A cos kφ + B sin kφ. (6.199)

This is only ossible if k is an integer, k = n, n = 1, 2, . . ..

Therefore only Case 2 and 3 is possible and we have

Φ(φ) = B0 + A cos nφ + B sin nφ. (6.200)

Now we turn to solving R. Knowing now that λ = −k 2 = −n2 , the equation is

d2 R dR
r2 2
+r − n2 R = 0. (6.201)
dr dr

All the terms involve differentiations of r and powers of r. So we guess that our solution
is R(r) = rn . To see whether this is correct, we substitute into Eq. (6.201),

r2 (n − 1)nrn−2 + r nrn−1 − n2 rn
   

= n(n − 1)rn + nrn − n2 rn


= n2 rn − nrn + nrn − n2 rn
= 0. (6.202)

We have confirmed that Eq. (6.201) is solved. We then assemble our solution, u(r, φ) =
R(r)Φ(φ). We rename the constants, and assuming the complete solution is a sum over
38 CHAPTER 6. SEPARATION OF VARIABLES

n,

a0 X n
u(r, φ) = + r (an cos nφ + bn sin nφ) . (6.203)
2 n=1

To determine the constants a0 , an , and bn , we use the boundary condition at r = ρ,



a0 X n
u(ρ, φ) = f (φ) = ρ (an cos nφ + bn sin nφ) . (6.204)
2 n=1

This is a Fourier series for the function f (φ) on the interval 0 ≤ x ≤ 2π. Because all
functions in this problem are periodic, we can shift the interval to −π ≤ φ ≤ π. Therefore
the coefficients are determined by

1 π
Z
a0 = f (φ) dφ, (6.205)
π −π
1 π
Z
n
ρ an = f (φ) cos nφ dφ, (6.206)
π −π
1 π
Z
n
ρ bn = f (φ) sin nφ, dφ. (6.207)
π −π

Example 6.3.3:
Solve the Dirichlet problem on a disk

∂ 2 u 1 ∂u 1 ∂ 2u
+ + = 0, 0 ≤ r ≤ 4, −π ≤ φ ≤ π,
∂r2 r ∂r r2 ∂φ2
u(ρ, φ) = φ2 , (6.208)

Ex. 6.3.3 solution:


Going through the methods outlined above, separation of variables lead to

a0 X n
u(r, φ) = + r (an cos nφ + bn sin nφ) .
2 n=1

At the boundary, r = 4, it is

a0 X n
2
u(4, φ) = φ = + 4 (an cos nφ + bn sin nφ) .
2 n=1
6.3. THE LAPLACE AND POISSON EQUATIONS 39

We first determine a0 using


Z π Z π  π
1 2 2 2 2 1 3 2
a0 = φ dφ = φ dφ = φ = π2.
π −π π 0 π 3 0 3

Next for an ,

1 π 2 2 π 2
Z Z
n
4 an = φ cos nφ dφ = φ cos nφ dφ
π −π π 0
 2  π
2 φ 2 2φ
= + 3 sin nφ + 2 cos nφ
π n n n 0
n
 
2 2π 4(−1)
= cos nπ =
π n2 n2
n
4(−1)
an =
4n n2

Finally, applying the formula for an gives an = 0. The solution is



π2 X (−1)n n
u(r, φ) = +4 2 4n
r cos nφ.
3 n=1
n

6.3.3 Poisson’s equation

We now consider Poisson’s problem of the form

∂ 2u ∂ 2u
+ = P (x, y), 0 ≤ x ≤ L, 0 ≤ y ≤ K,
∂x2 ∂y 2
u(0, y) = u(L, y) = u(x, 0) = u(x, K) = 0. (6.209)

where P (x, y) is some function of x and y.

The boundary conditions at x = 0 and x = L are zero. Our previous experience tells us
that the solution for X(x) is probably a solution of the form
 nπx 
X(x) = B sin , n = 1, 2, . . . . (6.210)
L

Similarly, the boundary conditions at y = 0 and y = K are also zero. By the same
40 CHAPTER 6. SEPARATION OF VARIABLES

reasoning, the solution for Y (y) is probably


 mπx 
Y (y) = D sin , m = 1, 2, . . . (6.211)
L

Putting together u(x, y) = X(x)Y (y), we have


∞ X
X ∞  nπx   mπx 
u(x, y) = cnm sin sin . (6.212)
n=1 m=1
L L

Constructing our solution this way, we have guaranteed that u(x, y) satisfies all four
boundary conditions.

We still need to make sure that this satisfies the full PDE. Substituting into the PDE,
∞ X ∞
∂ 2u X n2 π 2  nπx   mπx 
= − c nm sin sin ,
∂x2 n=1 m=1
L 2 L L
2 ∞ X ∞
∂ u X m2 π 2  nπx   mπx 
= − c nm sin sin . (6.213)
∂y 2 n=1 m=1
L2 L L

So the PDE should be

∂ 2u ∂ 2u
+ = P (x, y)
∂x2 ∂y 2
∞ X ∞  2 2
m2 π 2

X nπ  nπx   mπx 
−cnm 2
+ 2
sin sin = P (x, y). (6.214)
n=1 m=1
L K L L

This is a double Fourier expansion for P (x, y). The coefficients cnm are determined by

L K
n2 π 2 m2 π 2
  Z Z
4  nπx   mπy 
−cnm + = P (x, y) sin sin dxdy. (6.215)
L2 K2 LK 0 0 L K

Example 6.3.4:
Solve the Poisson problem

∂ 2u ∂ 2u
+ = xy 2 , 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,
∂x2 ∂y 2
u(x, 0) = u(x, 1) = u(0, y) = u(1, y) = 0. (6.216)

Ex. 6.3.4 solution:


6.3. THE LAPLACE AND POISSON EQUATIONS 41

Using the same procedure as discussed above, the general solution is


∞ X
X ∞
u(x, y) = cnm sin (nπx) sin (mπy) , (6.217)
n=1 m=1

where the coefficients are to be determined using


Z 5
40 2 2
 nπx   mπy 
cnm =− 2 ∈ xy sin sin dxdy
π (25n2 + 4m2 ) 0 0 2 5
Z 5 Z 2
40 2
 mπy   nπx 
=− 2 y sin dy x sin dx (6.218)
π (25n2 + 4m2 ) 0 5 0 2

We perform the x and y separately, which are


1
(−1)n
Z
x sin(nπx) dx = − , (6.219)
0 nπ
Z 1
2 − m2 π 2 m 2 2(1 − (−1)n ) − m2 π 2 (−1)m
y sin(mπy) dy = (−1) − = (6.220)
0 m3 π 3 m3 π 3 m3 π 3

Putting the results together,

4 2(1 − (−1)n ) − m2 π 2 (−1)m (−1)n


cnm = . (6.221)
π 2 (n2 + m2 ) m3 π 3 nπ

You might also like