Chapter 7
Heat and Wave Equations
In this chapter we present an elementary discussion on partial differential equations including
one dimensional heat and wave equations. The second volume of this bo o k is dedicated
entirely to partial differential equations and studies the rst and second order equations
in great detail. To solve simple heat equations, we need two important tools: 1) eigenvalue
problems 2) Fourier series. We discuss them in sequel.
7.1 Introduction
7.1.1 Heat equation
Consider a conductive rod of length L. We can model this rod as a one dimensional object
running from 0 to L. Assume that the rod is insulated a long (0; L) and it can possibly
exchange heat from its b o undary point x=0 and or x=L. Let u(x;t) denotes the temperature
of the point x at time t. Note there here the function u is a function of two independent
variables x; t, where x 2[0; L] denotes the position along the rod and time t is measured for
t 0. Let the temperature distribution of the rod at time t = 0 is u(x; 0) = f(x). The initial
heat distribution makes generally a flow of heat for t > 0, and thus the temperature changes
with time. In the second volume of the book, we derive the equation that describes u(x; t)
as a partial differential equation which is
@u
@t
= D
@
2
u
@x
2
: (7.1)
The above equation is called a heat equation. He re D > 0 is a positive constant that depends
on the heat capacity, the density and other physical factors of the rod.
The physical interpretation of the equation is clear. Fix x
0
2 (0; L). The term
@u
@t
(x
0
; t)
measures the rate of change of the temperature a t x
0
with respect to t. This quantity is equal
to
@
2
u
@x
2
(x
0
; t). Bu t notice that for fixed t, the term
@u
@x
(x
0
; t) measures the rate of change of
u at x
0
with respect to the adjacent points to x
0
at the fixed t. The term
@u
@x
is als o called
the heat gradient because it measures the difference between x
0
and its neighboring points.
For example if
@u
@x
(x
0
; t
0
) = 0, them the total heat that ows through x
0
at the fixed time t
0
is equal zero. The term
@
2
u
@x
2
(x
0
; t) then measures the acceleration of the heat flow passing
through x
0
at the fixed time t.
1
The equation (7.1) is not complete without the conditions at the boundary points x = 0;
L. In this chapter we consider three important cases:
1. Dirichlet boundary conditions
2. Neumann boundary conditions
3. Mixed or Robin's boundary conditions
Dirichlet B.Cs.
In a Dirichlet problem, the value u (x; t) are known at x = 0; L, and thus the equation reads
(
@u
@t
= D
@
2
u
@x
2
:
u(0; t) = a; u(L; t) = b
;
where we assume that a; b are constant values independent of t. If values a; b are zer o, the
heat problem is called a homogeneous problem. Note that in this case, there is no thermal
source at the boundary and along the rod. If a thermal so urce present along the rod that
generate heat with the rate h(x), the Dirichlet problem reads
(
@u
@t
= D
@
2
u
@x
2
+ h(x)
u(0; t) = a; u(L; t) = b
: (7.2)
Note that here we assumed again that h is independent of t; see the figure (7.1). For more
general cases refer to the second volume of this book.
u(x; t)
x = L
x = 0 h(x)
external s o urce
u(L; t) = b
external sourceexternal s o urce
u(0; t) = a
Figure 7.1.
Neumann B.Cs .
In a Neumann problem, it is assumed that the derivative of u, that is,
@u
@x
are 0 at the
boundary points x = 0; L. Therefore, a homogeneous Neumann heat problem reads
8
<
:
@u
@t
= D
@
2
u
@x
2
+ h(x)
@u
@x
(0; t) = 0;
@u
@x
(L; t) = 0
: (7.3)
The physical interpretation of the Neumann B.Cs is as follows. First note that
@u
@x
(x; t)
measures the ne t flow of heat passing through the point x at time t. Therefore, the homo-
geneous Neumann bo undary condition states that the net heat flow through the end point
is zero. Equivalently, end points can be considered insulated so that it does not allow any
heat escapes or enters through these points.
2 Heat and Wave Equations
Robin's BCs.
The general form of mixed or Robin's boundary condition is
8
<
:
a
1
u(0; t) + b
1
@u
@x
(0; t) = 0
a
2
u(L; t) + b
1
@u
@x
(L; t) = 0
; (7.4)
where a
1
; b
1
or a
2
; b
2
can not be simultaneously zero. Of important cases are when one side
is in Dirichlet condition and another side is in the Neumann condition, like u(x; t) = 0
and
@u
@x
(L; t) = 0.
7.1.2 Steady state solution of the heat equation
A steady state solution to a heat equation is a solution that remain unchanged with respect
to t. Therefor, the steady state is a function only of x. Let v(x ) be the steady state solution
to the equation (7.2). Hence v(x) satisfies the equation
0 = Dv
00
(x) + h(x)
v(0) = a; v(L) = b
:
The above equation is simply solved by integration. We will see later on that
lim
t!1
u(x; t) = v(x);
regardless of the initial heat distribution u(x; 0) = f(x). In particular, for a homogeneous
Dirichlet problem, that is, when a = b = 0 a nd h(x) = 0, the steady state solution is the
solution to the equation
0 = v
00
(x)
v(0) = v(L) = 0
;
which is s imply v(x) 0 for all x. In fact, we expected the latter case based on the common
sense. If u(0; t) = u(L; t)= 0, then the end points are kept at 0 degree for all t > 0. In absence
of any o ther source h(x) along the rod, we expect that all initial thermal energy associate
to u(x; 0) disperses into these two boundary points and the initial temperature approaches
0, the same temperature of the end points (the same thing when you put your food in a
refrigerator).
The steady state solution for a Neum ann problem is more interesting. First of all, we
note that the term
@u
@x
is propo rtional to the rate of heat exchange between adjacent points
and for this it is called the heat gradient. If the tempera tire difference between adjacent
points are high, the heat gradient is higher and vice ve rsa Therefore,
@u
@x
(0; t) = 0, and
@u
@x
(L; t) = 0 mean physically that boundary points x = 0; L are insulated, and thu s no heat
exchanges through these two point s. In absence of any external source term h(x) along the
rod, we expect that the heat approaches to the value equal to the average of the initial heat
distribution u(x; 0):
v(x) =
1
L
Z
0
L
u(x; 0) dx: (7.5)
For a proof of the equation see the problem s et.
7.1 Introduction 3
7.2 Wave equation
Consider a n elastic string of length L. Again we can model this string as a one dimensional
object run ning from x = 0 to x= L in the (x; u)-plane. Assume that the string are fastened at
its boundaries x = 0; L. Let u(x; t) denote the position of the point x at time t in this plane.
If u(x; 0) is the initial displacement of the string a t time t = 0, and
@u
@t
(x; 0) is the initial
velocity of the point x at time t = 0, then the string we be gen erall y in motion for t > 0. The
position function u(x; t) satisfies the following equation which is called a wave equation
@
2
u
@t
2
= c
2
@
2
u
@x
2
(7.6)
A Dirichlet wave pr o blem without any external force has the form
8
>
>
>
>
<
>
>
>
>
:
@
2
u
@t
2
= c
2
@
2
u
@x
2
u(0; t) = u(L; t) = 0
u(x; 0) = f(x);
@u
@t
(x; 0) = g(x)
: (7.7)
We note that in a wave equation, the partial derivative with respect to t is o f order 2, and
for this reason the equation is accompanied by 2 initial conditions, i.e., u(x; 0), and
@u
@t
.
7.2.1 d'Alembert's formula
The wave equation (7.6) admits admits a closed form solution which is know as d'Alembert
solution. To see how the solution is derived, we use the change of variables ξ = x ¡ ct,
η = x + ct. The geometrical reason for using that change of variables will be discussed in the
second volume of this boo k. We note that this change of variables also changes the form of
the differential equation. In fact, we have
@
@t
=
@t
@
+
@t
@
= ¡c
@
+c
@
= c
@
¡
@
:
Similarly,
@
@x
=
@x
@
+
@x
@
=
@
+
@
:
Substituting above formula into the wave differential equation give
@
2
u
@t
2
¡c
2
@
2
u
@x
2
= c
2
@
¡
@
@
¡
@
¡c
2
@
+
@
@
+
@
= ¡2c
2
@
2
u
:
Therefore,
@
2
u
@η
= 0, that implies u = h
1
(ξ) + h
2
(η) for arbitrary twice differentiable functio ns
h
1
; h
2
. Therefore, we can write the solution u in terms of the original variables x; t as
u(x; t) = h
1
(x ¡ct) + h
2
(x + ct):
The above so luti o n is the general solution of the wave equation (7.6). In order to a djust it
to the problem (7.7), we have to choose h
1
; h
2
such that the solution satisfies the boundary
conditions as well as the given initial conditions at t = 0.
4 Heat and Wave Equations
It is simply seen that the problem (7.7) has a closed form solution of the form
u(x; t) =
1
2
[f
odd
(x + ct) + f
odd
(x ¡ct)] +
1
2c
Z
x¡ct
x+ct
g
odd
(s) ds;
where f
odd
; g
odd
are the odd extension o f functions f ; g respectively and periodic of period
2L, that is, f
odd
(x + 2L) = f
odd
(x) and g
odd
(x + 2L) = g
odd
(x). The a bove formula is called
d'Alembert's solution. Let us verify the formula. First for the boundary condition x = 0.
We have
u(0; t) =
1
2
[f
odd
(ct) + f
odd
(¡ct)] +
1
c
2
Z
¡ct
ct
g
odd
(s) ds = 0 ;
because f (¡ct) = f (ct) and the integral of the odd function g
odd
on a symmetric domain is
equal to zero. At x = L, we have
f
odd
(L ¡ct) = ¡f
odd
(ct ¡L) = ¡f
odd
(ct ¡L + 2L) = ¡f
odd
(L + ct):
Similarly, by taking s = v + L, we derive
Z
L¡ct
L+ct
g
odd
(s) ds =
Z
¡ct
ct
g
odd
(v + L) dv:
Let h(v) = g
odd
(v + L). We show h(¡v) = ¡h(v). In fact, we have
h(¡v) = g
odd
(¡v + L) = g
odd
(¡v + 2L ¡L) = g
odd
(¡v ¡L) = ¡g
odd
(v + L) = ¡ h(v):
Therefore, we obtain
Z
¡ct
ct
g
odd
(v + L) dv = 0:
So far, we have shown that the d'Alembert solution satisfies the b o undary conditions at
x = 0; L. The verification that the solution satisfies given initial conditions as well as the
differential equation is left as an exercise to the reader.
Problems
Problem 7.1. Here we prove the formula (7.5). Consider the following Neumann problem
8
<
:
@u
@t
= D
@
2
u
@x
2
@u
@x
(0; t) = 0;
@u
@x
(L; t) = 0
Define the energy function
E(t) =
Z
0
L
u(x; t) dx:
Use the equa tion and show E
0
(t) = 0. Conclude that E(t) is independent of t and thu s (7.5).
Problem 7.2. Consider the equation (7.3). We s how that there is no steady s tate solution to the
equation.
a) Show the following relation
d
dt
Z
0
L
u(x; t)dx =
Z
0
L
h(x)dx:
7.2 Wave equation 5
b) Solve the equation derived in part a) and conclude
Z
0
L
u(x; t) dx =
Z
0
L
h(x)dx
t +
Z
0
L
f(x)dx;
where u(x; 0) = f(x). Conclude that
lim
t!1
u(x; t);
is unbounded.
Problem 7.3. Consider the equation (7.7). The energy of the function u(x; t) is defined as follows
E(t) =
Z
0
L
@u
@t
(x; t)
2
dx + c
2
Z
0
L
@u
@x
(x; t)
2
dx:
Show the following formula which is known as the conservation of energy of wave function
E(t) =
Z
0
L
jg(x)j
2
dx + c
2
Z
0
L
jf
0
(x)j
2
dx:
Problem 7.4. Verify that the d' Alembert solution to the homogeneous wave equation (7.7) satisfies
the initial conditions and the differential equation itself.
Problem 7.5. Consider the following wave equation
8
<
:
@
tt
u = 4@
xx
u
u(0; t) = u(π; t) = 0
u(x; 0) = sin(3x); @
t
u(x; 0) = 0
:
a) Verify that the function u(x; t) = cos(6t) sin(3x) solves the problem.
b) Show that the above solution coincides the d'Alembert's solution.
7.3 Ei genvalue problem
Let us start off by considering the following boundary value problem
(
@u
@t
= D
@
2
u
@x
2
0 < x < L; t > 0
u(0; t) = 0; u(L; t) = 0 t 0
:
The main technique to solve such differential equation is the separation of variables, that is,
to assume the solution u as u(x; t) = X(x) T (t). In fact, there is no a priori reason for that
assumption, but we will see h ow it helps us to solve the equation. Substituting the separated
solution into the differential equation yields
T
0
(t)
DT (t)
=
X
00
(x)
X(x)
:
Evidently, the above equality can be possible o nly if both sides are a constant (the left hand
side is a function of t while the right hand side is a function of x). Let us denote this constant
by ¡λ (the negative sign appears only by historical reason a nd there is no re a l reason for
that). The we obtai n
T
0
(t)
DT (t )
=
X
00
(x)
X(x)
= ¡λ;
6 Heat and Wave Equations
and by that, we re a ch the two equations: T
0
= ¡λT , and X
00
= ¡λX. But the solution u must
satisfies in addition to the equation, the given boundary conditions at x = 0; L , that is,
X(0)T (t) = 0; X(L) T (t) = 0 :
If T (t) is identically zero, then u(x; t) is identically zero, that is in general is not acceptable
(except the initial condition o f the equation is zero and then the solution is trivial). Therefore,
we obtain two boundary conditions for X(x) as X(0) = X(L) = 0. Therefore, we look for
function X(x) that satisfies the following equation
8
<
:
d
2
dx
2
X = ¡λX
X(0) = X(L) = 0
: (7.8)
Equations of the above form are g enerally called eigenvalue problems. In fact, we would like
to find non-trivial fun ctions X(x) called eigenfunctions that preserves th eir structure under
the second order differentiation. The values λ in the above equation are called eigenvalues.
Therefore, solving this type of equations is crucial to solve a partial differential equation.
7.3.1 General Dirichlet eig envalue problem
The most general form of the Dirichlet eigenvalue problem is
a(x) X
00
+ b(x) X
0
+ c(x)X = ¡λX
X(x
0
) = 0; X(x
1
) = 0
;
where a(x) > 0 in the interval [x
0
; x
1
]. As we learned in the previous chapters, we are unable,
in general, to solve equations with the variable coefficients in closed form, and for this, there
is no hope to determine the closed form solutions to the ab ove eigenvalue problem. However,
we can say several important things about the eigenva lues and eigenfunctions of the problem.
The inte rested reader is referred to the s eco nd volume of this bo o k for a detailed discussion
on this subject. Here, we restrict ourselves to simple eigenvalue problem.
Of most impo rtant are the following simple problem (7.8). Let us solve the equation.
The characteristic polynomial is r
2
= ¡λ and thus r
1;2
= ± ¡λ
p
. There are three possible
cases for λ, that are λ < 0, λ = 0, and λ > 0. We first show that there is no eigenfunction for
λ 0. Multiply the equation by X(x) and integrate in the interval [0; L]. We obtain
Z
0
L
X
00
(x) X(x) = ¡λ
Z
0
L
jX(x)j
2
:
Integration by parts formula, simplifies the left h and side of above relation to
Z
0
L
X
00
(x) X(x) = X
0
(x)X(x)j
0
L
¡
Z
0
L
jX
0
(x)j
2
= ¡
Z
0
L
jX
0
(x)j
2
:
Note that the boundary term is zero in the above relation due to the boundary conditions
at x = 0; L. We obtain nally
Z
0
L
jX
0
(x)j
2
= λ
Z
0
L
jX(x)j
2
;
7.3 Eigenvalue problem 7
and thus λ 0. Again if λ = 0, we obt ain X
0
(x) = 0 that gives in turn X(x) = constant. But
X(0) = 0 that gives X(x) = 0 identically and this contradicts the fact that eigenfunctions are
non-trivial. Therefore, λ > 0 and thus r
1;2
= ±i λ
p
. The solution to the equation X
00
= ¡λX
for λ > 0 is
X(x) = c
1
cos( λ
p
x) + c
2
sin( λ
p
x):
Applying the boundary condition X(0) = 0 gives c
1
= 0. The second boundary condition
X(L) = 0 gives c
2
sin( λ
p
L) = 0. Since c
2
must be non-zero (why?) we obtai n λ
p
L =
, a nd therefore eigenvalue s of the problems are obtained as λ
n
=
n
2
π
2
L
2
associated to the
eigenfunctions X
n
(x) = s in
¡
L
x
for n = 1; 2; ···. Note that n starts from 1 a nd not 0. Also,
there is no linearly independent eigenfunction for negative integers n. The pair (λ
n
; X
n
) is
called eigenpair of the eigenvalue problem.
7.3.2 General Neumann eigenvalue problem
For Neum ann eigenvalue problems, the boundary conditions are in the form of Neumann,
and accordingly the problem reads
a(x) X
00
+ b(x) X
0
+ c(x)X = ¡λX
X
0
(x
0
) = 0; X
0
(x
1
) = 0
;
where a(x) > 0 in [x
0
; x
1
] as before. Again, there is no general method to solve the above
eigenvalue problem (with variable coefficients, and for this, we re strict our discussion mainly
to equation with constant coefficients. The simplest eigenvalue problems of the ty pe N eu-
mann is
8
<
:
d
2
dx
2
X = ¡λX
X
0
(0) = X
0
(L) = 0
: (7.9)
It is left to the reader as a simple exercise to verify that in this case λ 0 and there is no
eigenfunction for λ < 0. For λ = 0, we have X
00
(x)= 0, that gives X(x)= Ax +B and applying
the boundary co nditions implies A = 0 and thus X(x) = B a nonzero constant. Without
loss of generality, we can assume X
0
(x) = 1 (multiplication by arbitrary constant is also an
eigenfunction). For λ >0, we obtain X
n
(x)=cos
¡
L
x
and λ
n
=
n
2
π
2
L
2
, n = 1 ; 2;···. Without loss
of generality, we can write
n
2
π
2
L
2
; cos
¡
L
x
for n = 0; 1; ···, as the eigenpair of the Neumann
eigenvalue problem.
7.3.3 Robin's ei genvalue problem
As we saw before, the mixed or Robin's boundary conditions is of the form (7.4) and thus
the general form of a Robin's eigenvalue problem is
8
<
:
a(x) X
00
+ b(x) X
0
+ c(x)X = ¡λX
a
1
X(x
0
) + b
1
X
0
(x
0
) = 0
a
2
X(x
1
) + b
2
X
0
(x
1
) = 0
;
8 Heat and Wave Equations
where a
1
2
+ b
1
2
=/ 0 and a
2
2
+ b
2
2
=/ 0. The simplest case of mixed problem is when one side of the
boundary is Dirichlet and the other side is Neumann, for example X(x
0
) = 0, X
0
(x
1
) = 0.
Let us solve the following eigenvalue problem
8
<
:
d
2
dx
2
X = ¡λX
X(0) = X
0
(L) = 0
: (7.10)
It is left as a simple exercise to the rea der to show that there is no non-trivial eigenfunction
for λ 0. The eigenfunctions of the problem are X
n
(x) = sin
(2n ¡ 1) π
2L
x
and λ
n
=
(2n ¡ 1)
2
π
2
4L
2
for n = 1; 2; ·· ·.
Problems
Problem 7.6. Find eigenvalues an eigenfunctions of the given Dirichlet problems
a)
X
00
+ 2X
0
= ¡λX
X(0) = X(1) = 0
:
b)
(
x
2
X
00
+ xX
0
+ 4 X = ¡λX
X(1) = X(e) = 0
(Note that the s ubstituting x = e
t
transforms the equation to an equation with constant coeffi-
cients)
c)
(
x
2
X
00
+ 3xX
0
+ X = ¡λX
X(1) = X(e) = 0
Problem 7.7. Show that in the eigenvalue problem (7.9), λ 0 and there is no non-trivial eigenfunction
for λ < 0.
Problem 7.8. Find eigenvalues an eigenfunctions of the given Dirichlet problems
a)
X
00
+ 2 X
0
= ¡λX
X
0
(0) = X
0
(1) = 0
:
b)
(
x
2
X
00
+ xX
0
+ 4 X = ¡λX
X
0
(1) = X
0
(e) = 0
(Note that the s ubstituting x = e
t
transforms the equation to an equation with constant coeffi-
cients)
7.3 Eigenvalue problem 9
c)
(
x
2
X
00
+ 3xX
0
+ X = ¡λX
X
0
(1) = X
0
(e) = 0
Problem 7.9. Show that in the eigenvalue problem (7.10), λ > 0 and there is no non-trivial eigenfunction
for λ 0.
Problem 7.10. Show t ha t the eigenvalue p roblem
8
<
:
d
2
dx
2
X = ¡λX
X(0) = 0; X(L) + X
0
(L) = 0
;
has non-trivial eigenfunctions only for λ > 0.
Problem 7.11. Find the eigenvalues and eigenfunctions of the following problem
a)
X
00
= ¡λX
X
0
(0) = X(1) = 0
b)
(
x
2
X
00
+ xX
0
= ¡λX
X(1) = X
0
(e) = 0
Problem 7.12. Consider the following eigenvalue problem
X
00
+ 2 X
0
= ¡λX
X(0) = 0; X( 1) + X
0
(1) = 0
:
Show that eigenf unct ions are of the form X
n
(x)=e
¡x
sin(!
n
x), where !
n
are the solutions to the algebraic
equation tan(!) = ¡!.
Problem 7.13. Consider the following ordinary boundary value problem
(
(1 + x
2
)X
00
¡e
x
X = ¡λX
X(0) = X(1) = 0
:
Use the energy method employed in this section to s how that the condition λ > 1 is necessary the problem
has a so lution.
7.4 Fourier series
We start off by a definition.
Definition 7.1. A function f(x), x 2(a; b) is called piecewise continuous if it is continuous
for all points x 2(a; b) except possibly at finitely many points. In addition, if z 2(a; b) is a
discontinuity point of f (x) t hen both left and right limit exist
f(z
+
) = lim
x!z
+
f(x); f(z
¡
) = lim
x!z
¡
f(x):
Furthermore, the following limits exist
f(a
+
) = lim
x!a
+
f(x); f(a
¡
) = lim
x!b
¡
f(x) :
10 Heat and Wave Equations
A function f (x), a 2(a; b) is called piecewise continuously differentiable if it is continuously
differentiable everywhere in (a; b) except possibly at finitely many point s. If z 2 (a; b) is a
point where f is not continuously differentiable, then right and left derivatives of f at z must
exist. In addition, the right derivative of f(x) at x = a and the left derivative of f (x) at x = b
must exist.
In this section, we always assume that a function is piecewise continuously differe ntiable
(we cal l it admissible by now) in the finite interval (a; b). That is important we note a =/ ¡1,
b =/ 1. It is celebrated work of J. Fourier that a function defined on an finite interval (a; b)
can be represented by a series of trigonometric func tions as
f(x )
X
n= 0
1
a
n
cos(n!x) +
X
n= 1
1
b
n
sin(n!x); (7.11)
for some constants a
n
; b
n
where ! =
2π
b ¡ a
, and the coefficient a
a
; a
n
, and b
n
are
a
0
=
1
b ¡a
Z
a
b
f(x )dx; a
n
=
2
b ¡a
Z
a
b
f(x) cos(n!x)dx; b
n
=
2
b ¡a
Z
a
b
f(x ) sin(n!x)dx: (7.12)
But what is the meaning of notation in the formula? We have the following theorem.
Theorem 7.1. Assume that f(x) is an admissible function (piecewise continuously differ-
entiable) in an finite interval (a; b). If x 2(a; b) is a continuity point of f (x), then
f(x) = lim
n!1
X
k=0
n
a
n
cos(n!x) +
X
k=1
n
b
k
sin(n!x);
where ! =
2π
b ¡ a
, and a
0
; a
n
, and b
n
are determined by the formula ( 7.12). If x 2 (a; b) in a
discontinuity point of f (x), then
1
2
[f (x
+
) + f (x
¡
)] = lim
n!1
X
k=0
n
a
n
cos(n!x) +
X
k=1
n
b
k
sin(n!x):
Furthermore, at x = a; b we have
1
2
[f (a
+
) + f (b
¡
)] = lim
n!1
X
k=0
n
a
n
cos(n!a) +
X
k=1
n
b
k
sin(n!a) =
= lim
n!1
X
k=0
n
a
n
cos(n!b) +
X
k=1
n
b
k
sin(n!b):
In this chapter, we mainly consider the Fourier series of functions defined on a sym-
metric domain (¡L; L). In this setting, the Fourier series is written
f(x)
X
n= 0
1
a
n
cos
L
x
+
X
n=1
1
b
n
sin
L
x
;
and
a
0
=
1
2L
Z
¡L
L
f(x); a
n
=
1
L
Z
¡L
L
f(x ) cos
L
x
; b
n
=
1
L
Z
¡L
L
f(x ) sin
L
x
:
7.4 Fourier series 11
Remark 7.1. Notice that a
0
is equal to f
¯
, the average of f on its domain (¡L; L).
Remark 7.2. If f(x) is an odd function in (¡L; L), then a
n
= 0, n = 0; 1; ···, and the series
contains only sine terms. This fact agrees our expectation since sine is an odd function.
Similarly, if f(x) is an even function then b
n
= 0, n = 1; 2; ···, and the series c o ntains only
cosine terms (including the constant function for n = 0).
Example 7.1. Consider the function
f(x ) =
1 0 < x < 1
¡1 ¡1 < x < 0
:
Here a = ¡1; b = 1 and ! = π. The function is odd and it is s imply seen that f
0
= f
n
c
= 0 for
all n 1. The sine coefficients are f
n
s
=
2
(1 ¡cos nπ) and thus
f(x )
2
π
X
n= 1
1
1 ¡cos
n
sin(nπx): (7.13)
The figure (7.2) s hows partial sums S
15
; S
150
of the series in the interval ¡1 < x < 1.
1 1
1
1
Figure 7.2.
We make following observations from the figure
i. S
n
(x) approximates the original function more accurately for larger n.
ii. S
n
(0) = 0 for all n. In fact, this is the average value of f (0
+
) and f (0
¡
).
iii. S
n
(1) = S
n
(¡1) = 0, the average of f(1
+
); f(1
¡
).
iv. S
n
(x) shows jumps near discontinuity points x = ¡1; 0; 1 regardless of the values of
n. This phenomena is called Gibbs phenomena after the American physicist J. W.
Gibbs. See the appendix for a detailed discussion of this phenomena.
Example 7.2. The series representation of the function f (x) = x
2
in ¡1 < x < 1 is
x
2
f
0
+
X
n= 1
1
f
n
c
cos(nπx);
12 Heat and Wave Equations
where f
0
=
1
3
and f
n
c
=
4(¡1)
n
n
2
π
2
. Note that the function is even and f
n
s
= 0 for all n. The figure
(7.3) shows the partial sums S
2
; S
20
.
1 1
1
Figure 7.3.
Example 7.3. The function
f(x) =
x + 1 ¡1 x 0
1 0 x 1
;
has the following series representation
f(x )
3
4
+
1
π
2
X
n= 1
1
1 ¡cos(nπ)
n
2
cos(nπx) ¡
1
π
X
n= 1
1
cos()
n
sin(nπx):
The plot o f S
10
; S
50
are shown in the figure (7.4). Note that S
n
(¡1) = S
n
(1) = 0.5 for all n
which is the average limits f(¡1
+
) and f(1
¡
).
1 1
1
Figure 7.4.
Let us clarify the convergence of the series at the end points. In the first example, the
end points are x = ±1 and the series converges to the value 0 that is equal to the average
value
f(1
¡
) + f (¡1
+
)
2
. Note that the series (7.13) is periodic with the period T = 2; see the figure
(7.5). Therefore, the series at x = 1 converges to the average of the left and right limits at
this point. A similar argument holds at x = ¡1. Geometrically, we can imagine that f is
defined on a circle and thus the end points x = ±1 coincides on the circle.
7.4 Fourier series 13
3
2
1 1 2 3
1
1
Figure 7.5.
7.4.1 Sine and co sine Fourier series
If a n admissible function is given on (0; L), then we can e xtend it to an odd function f
odd
(x),
or alternatively to an even function f
ev
(x) on (¡L; L). The extensions f
odd
and f
ev
are
respectively de fined by the relations
f
odd
(x) =
f(x) 0 < x < L
¡f(¡x) ¡L < x < 0
; f
ev
(x) =
f(x ) 0 < x < L
f(¡x) ¡L < x < 0
:
Since f
odd
is a n odd f unction, its associated Fourier series contains only sine functions. This
resulted series is called the sine Fourier series of f(x). Similarly, the associated Fourier
series for f
ev
contains only cosine terms and it is called the cosine Fourier series of f(x).
Since f
odd
(x) is defined on (¡L; L), its Fourier series is
f
odd
(x)
X
n= 1
1
b
n
sin
L
x
;
where
b
n
=
1
L
Z
¡L
L
f
odd
(x) sin
L
x
=
2
L
Z
0
L
f(x ) sin
L
x
:
On the other hand, since the series represents f
odd
on (¡ L; L), then definitely it represents
f(x ) on (0; L) since on (0; L) two function f
odd
and f are the s a me. Therefore, we can write
f(x )
X
n= 1
1
2
L
Z
0
L
f(x) sin
L
x
sin
L
x
:
Similarly, the cosine Fourier series of f(x) in (0; L) is
f(x) = f
¯
+
X
n= 1
1
2
L
Z
0
L
f(x ) cos
L
x
cos
L
x
;
where
f
¯
=
1
L
Z
0
L
f(x):
14 Heat and Wave Equations
Example 7.4. Consider the function f (x) = x in (0; 1). The original Fourier series of this
function according to the formula (7.11) is
f(x)
X
n= 0
1
a
n
cos(2nπx) +
X
n=1
1
b
n
sin(2nπx);
where
a
0
= f
¯
=
Z
0
1
x =
1
2
; a
n
= 2
Z
0
L
x cos(2nπx) = 0; b
n
= 2
Z
0
1
x sin(2nπx) = ¡
1
;
and thus
f(x)
1
2
¡
X
n=1
1
1
sin(2nπx):
The graph is shown in the gure (7.6).
1
.
0
0
.
5 0
.
5 1
.
0 1
.
5 2
.
0
0
.
5
1
.
0
Figure 7.6.
Notice that the series is perio dic with the perio d T = 1, that is, f(x + 1) = f(x). The
graph is sketched for n = 10. For higher values of n, the series represent the original function
more accurately. The figure (7.7) is sketched for n = 20.
1
.
0
0
.
5 0
.
5 1
.
0 1
.
5 2
.
0
0
.
5
1
.
0
Figure 7.7.
Note that regardless o f how many terms are used to draw the Fourier series, there is
always an overshoot on the discontinuity points x = 0; 1. This phenomena known as Gibbs
phenomena that we discuss in g reater detail in the second volume of the book. Also note
that at the discontinuity points, the series converges to the average left and right limits that
here is equal to
1
2
.
7.4 Fourier series 15
Now let us obtain the sine Fourier series of the function. The odd extension of the
function f (x) in (0; 1) is f
odd
= x in (¡1; 1). T herefore we can write
f(x )
X
n= 1
1
2
Z
0
1
x s in(nπx)
sin(nπx) =
X
n= 1
1
2(¡1)
n+ 1
sin(nπx):
The figure (7.8) s hows the graph of the series.
3
2
1 1 2 3
1
.
0
0
.
5
0
.
5
1
.
0
Figure 7.8.
Note that the period of the series in this case is T = 2 instead of T = 1 for the original
Fourier series. The sine Fourier series represents the odd extension of the function in
(¡1; 1) and thus the function f (x) in (0; 1). Similarly the cosine Fourier series of f(x) is
done by the even extension f
ev
(x) = jxj that is
f(x ) f
¯
+
X
n= 1
1
2
Z
0
1
x cos(nπx)
cos(nπx) =
1
2
+
X
n= 1
1
2((¡1)
n
¡1)
n
2
π
2
cos(nπx):
The figure (7.9) s hows the series.
3
2
1 1 2 3
0
.
5
1
.
0
Figure 7.9.
Problems
Problem 7.14. Find the Fourier series of the following functions
a) f (x) =
1 0 < x < 1
¡1 ¡1 < x < 0
b) f(x) =
1 ¡1 < x < 0
x ¡ 1 0 < x < 1
16 Heat and Wave Equations
c) f(x) = cos(x), ¡
π
2
< x <
π
2
Problem 7.15. write the original and the cosine Fourier series of the f unct ion f (x) = sin(x), 0 < x < π.
Problem 7.16. Write th e sine Fourier series of the function f (x) = co s(x), 0 < x <
π
2
.
Problem 7.17.
a) Find coefficients b
n
such that
x
2
=
X
n=1
1
b
n
sin(nx); 0 < x < π
b) Find coefficients a
n
such that
x
2
=
X
n=0
1
a
n
cos(nx); 0 < x < π
Problem 7.18. Consider the function f (x) = x on 0 < x < 1.
a) Find the cosine Fourier series of f .
b) Find the sine Fourier series of f .
c) Find the complex Fourier series of f .
d) If S
n
(x) is the partial sum of the Fourier series of f on (0; 1), what is the value of lim
n! 1
S
n
(0)?
e) Prove the following identity
π
2
8
=
1
1
2
+
1
3
2
+
1
5
2
+
1
7
2
+ ···
Problem 7.19. Let f(x) = x
2
on (0; 1).
a) Write down the Fourier series of f and draw S
3
(x); S
5
(x); S
6
(x) on (¡2; 2). What is the value
of the series at x = 0; 1. How does the series behave near x = 0 and x = 1?
b) Writ e down the complex form of the Fourier series of f.
c) Write down t he sine Fourier series of f and draw S
3
(x); S
5
(x); S
6
(x) on (¡2; 2).
d) Writ e down the cosine Fourier series of f and draw S
3
(x); S
5
(x); S
6
(x) on (¡2; 2).
e) Use the Fourier series of x
2
on (¡1; 1) to show:
π
2
12
= 1 ¡
1
4
+
1
9
¡
1
16
+
1
25
¡
1
36
+ ···
Problem 7.20. Write down the Fourier series of the function f(x) = x for x 2(0; 2) and f(x + 2)= f (x)
and deduce the following identity called Leibniz's formula
π
4
= 1 ¡
1
3
+
1
5
¡
1
7
+ ···:
Problem 7.21. Find the Fourier series of the function f(x) = x
3
in x 2 (¡π; π) and deduce the
following identity
π
3
32
= 1 ¡
1
3
3
+
1
5
3
¡
1
7
3
+ ···:
Problem 7.22. Let f(x) = e
¡x
on (0; 1).
a) Write down the Fourier series of f and draw S
5
(x); S
10
(x) on (¡2; 2).
b) Writ e down the complex form of the Fourier series.
c) Write down t he sine Fourier series of f and draw S
5
(x); S
10
(x) on (¡3; 3).
d) Writ e down the cosine Fourier series of f and draw S
2
(x); S
10
(x) on (¡3; 3).
7.4 Fourier series 17
Problem 7.23. Let f(x) = cos(x) on
¡
0;
π
2
.
a) Write down the Fourier series of f and draw S
3
(x); S
5
(x); S
6
(x) on (¡π; π). How the series
behave near x = 0 and x = π /2?
b) Writ e down the sine Fourier series of f and draw S
3
(x); S
5
(x); S
6
(x) on (¡π; π). How the series
behave near x = 0 and x = π /2?
c) Write down t he cosine Fourier series of f and draw S
3
(x); S
5
(x); S
6
(x) on (¡π; π).
d) For the partial sum S
n
of the part (a), find the the square error for n = 3; 5; 6.
Problem 7.24. Find the cosine Fourier series for the function f (x) = sin(x) on (0; π).
Problem 7.25. Let us solve the following boundary pro blem by Fourier series method
y
00
+ y = 1
y(0) = y(1) = 0
:
i. Assume that the solution to the equation is written as
y(x) =
X
n=1
1
Y
n
sin(nπx):
Substitute y(x) into the equation and find coefficients Y
n
.
ii. Show that the obtained series is absolutely convergent.
iii. Why is this series a true solution to the given problem?
Problem 7.26. Show t ha t the trivial solution y(x) = 0, is the unique solution to the problem
y
00
+ sin(πx)y = 0
y(0) = y(1) = 0
:
18 Heat and Wave Equations
7.5 Solution to heat a nd wave equations
7.5.1 Homogeneous Dirichlet h e at problems
Consider the following Dirichlet problem
8
<
:
@
t
u = D@
xx
u for 0 < x < L; t > 0
u(0; t) = u(L; t) = 0 for t 0
u(x; 0) = f(x) for 0 < x < L
: (7.14)
Let us assume that the solution u(x; t) is of the form u(x; t) = T (t) X(x), for so me unknown
functions T (t) and X(x). We do not know in advance if the assumption is true. This solution
is called a separated solution. Substituting u into the equation leads to the following equation
T
0
(t)
DT (t)
=
X
00
(x)
X(x)
: (7.15)
Since t and x are independent variables, the equality (7.16) holds if and only if we have
T
0
(t)
DT (t )
=
X
00
(x)
X(x)
= ¡λ; (7.16)
for some constant λ. The negative sign in the front of λ is just for historical convention.
Therefore, we obtain two equations for T , and X
T
0
= ¡λDT ; X
00
= ¡λX:
Moreover, according to the c o ndition u(0; t) = 0, we derive X(0)T (t) = 0. Since T (t) can
not be identically zero, we obtain X(0) = 0. For the boundary co ndition at x = L, we have
X(L) = 0, and therefore, we reach the following Dirichlet eigenvalue problem for X(x)
X
00
= ¡λX
X(0) = X(L) = 0
: (7.17)
As we saw in above the obtained eigenvalue problem has th e eigenvalues λ
n
=
n
2
π
2
L
2
, and
eigenfunctions X
n
(x) = sin
¡
L
x
for n = 1; 2; ···. In this way, we obtain infinitely many
solutions
u
n
(x; t) = e
¡
n
2
π
2
L
2
Dt
sin
L
x
:
It is simply verified that u
n
(x; t) satisfies both the d iffer ential equation and the boundary
conditions (it is left as a simple exercise to the reader). However, u
n
(x; t) does not satisfies the
initial condition in general. Is the obtained solution wrong? Here we see hoe the superposition
principle helps us to write the correct solution. Thanks to the linearity of the differential
equation, we can write the solution to the problem as a linear combination in the series form
u (x; t) =
X
n= 1
1
b
n
u
n
(x; t) =
X
n= 1
1
b
n
e
¡
n
2
π
2
L
2
Dt
sin
L
x
:
7.5 Solution to heat and wave equations 19
(the technicality that we are using the superposition of infinitely many terms is resolved in
the second volume of this book). Now, let us see for what values of b
n
the solution satisfies
the initial condition as well. At t = 0, we have
f(x ) =
X
n= 1
1
b
n
sin
L
x
; 0 < x < L
and thus b
n
must be the coefficients of the sine Fourier series of the function f(x), that is,
b
n
=
2
L
Z
0
L
f(x ) sin
L
x
dx:
Therefore, the true solution to the homogeneous Dirichlet heat problem is
u(x; t) =
X
n= 1
1
2
L
Z
0
L
f(x) sin
L
x
dx
e
¡
n
2
π
2
L
2
Dt
sin
L
x
: (7.18)
Example 7.5. Consider the following heat problem
8
<
:
@
t
u = D@
xx
u 0 < x < π; t > 0
u(0; t) = u(π; t) = 0 t 0
u(x; 0) = 2 sin(3x) ¡3 sin(4x) 0 < x < π
: (7.19)
Here L = π and D = 1, and thus the solution is
u(t; x) =
X
n= 1
1
b
n
e
¡Dn
2
t
sin(nx): (7.20)
To determine b
n
, we use the init ial condition, that i s,
2 sin(3x) ¡3 sin(4x) =
X
n= 1
1
b
n
sin(nx);
and thus b
3
= 2, b
4
= ¡3 and b
n
= 0 for n =/ 3; 4. The solution is then
u(x; t) = 2e
¡9Dt
sin(3x) ¡3e
¡16Dt
sin(4x):
Here we could determine b
n
by the simple match. However, if the initial condition is not an
eigenfunction of the associated eigenvalue, we have to use the Fourier series as the formula
(7.18). Consider the following problem
8
<
:
@
t
u = D@
xx
u 0 < x < π; t > 0
u(0; t) = u(π; t) = 0 t 0
u(x; 0) = 1 0 < x < π
:
Here the coefficients b
n
are
b
n
=
2
π
Z
0
π
sin(nx) dx =
2(1 ¡cos())
:
The figure (7.10) at the left shows u(x; t) for some values of t and D = 1. The right fig ure
shows the solution for D = 2.
20 Heat and Wave Equations
1
2
π
π
0
.
5
1
.
0
t
= 0
t
= 0
.
5
t
= 1
t
= 2
1
2
π
π
0
.
5
1
.
0
t
= 0
t
= 0
.
5
t
= 1
t
= 2
Figure 7.10.
We have the following observations from the graph of solution:
a) The solut ion is smooth for t > 0 even the initial data is discontinuous. In the a bove
example the initial data is discontinuous at x = 0; π, however, for any t > 0, regardless
of how small t is, the solution is smooth.
b) The solution approaches zero in long term. This is due to th e ex ponential factor
e
¡Dn
2
t
in the solution. Note that the zero solution is the steady state solution u
e
to
the problem. Here the positive factor D > 0 determines the speed that the sol ution
u(x; t) approaches zero.
c) It takes longer time for the mid point x =
π
2
to lose its initial heat than points adjacent
to the end points.
d) More te rms of the series needed to catch the initial data more accurately because of
the discontinuity at the end points.
7.5.2 Homogeneous Neumann heat pr oblem
Fir the problem
8
<
:
@
t
u = D@
xx
u for 0 < x < L; t > 0
@
x
u(0; t) = @
x
u(L; t) = 0 for t 0
u(x; 0) = f(x) for 0 < x < L
:
The separated solution u(x; t) = X(x) T (t) results to the following eigenvalue problem for
X(x)
X
00
= ¡λX
X
0
(0) = 0; X
0
(L) = 0
:
As we saw before, the above eigenvalue problem has the eigenvalues λ
n
=
n
2
π
2
L
2
, and the
eigenfunctions X
n
(x) = cos
¡
L
x
for n = 0; 1; 2; ···. The associate equation f o r T (t), that is
T
0
= ¡λDT has the solution T
n
(t) = e
¡
n
2
π
2
L
2
Dt
and thus the solution can be written in the
series form
u(x; t) =
X
n= 0
1
a
n
e
¡
n
2
π
2
L
2
Dt
cos
L
x
:
7.5 Solution to heat and wave equations 21
Notice that in this case n starts form 0 not 1. The c oefficients a
n
are determined by the aid
of the initial condition u(x; 0), i.e.,
f(x ) =
X
n= 0
1
a
n
cos
L
x
:
The above series implies that a
n
must be the cosine Fourier series of f(x), that is,
a
0
= f
¯
; a
n
=
2
L
Z
0
L
f(x ) cos
L
x
; n = 1 ; 2; ···:
Therefore, we obtain
u(x; t) = f
¯
+
X
n= 1
1
2
L
Z
0
L
f(x) cos
L
x
e
¡
n
2
π
2
L
2
Dt
cos
L
x
:
Note that as we expected for Neumann heat problem
lim
n!1
u(x; t) = f
¯
:
Example 7.6. Let us solve the following N eum ann heat problem
8
<
:
@
t
u = @
xx
u 0 < x < π; t > 0
@
x
u(0; t) = @
x
u(π; t) = 0 t 0
u(x; 0) = x + 5 cos(3x) 0 < x < π
: (7.21)
For L = π, we obtain the so lution
u(t; x) = f
¯
+
X
n= 1
1
a
n
e
¡n
2
t
cos(nx):
We have f
¯
=
π
2
and
a
n
=
2
π
Z
0
π
(x + 5 cos(3 x)) cos(nx) dx =
2(cos() ¡1 )
πn
2
+
5 n = 3
0 n =/ 3
;
Therefore, the solution is
u(x; t) =
π
2
+ 5e
¡9t
cos(3x) +
X
n= 1
1
2(cos() ¡1)
πn
2
e
¡n
2
t
cos(nx):
As we expect, we have the following steady state solution
lim
t!1
u(t; x) = f
¯
=
π
2
:
7.5.3 Homogeneous Dirichlet wave problems
In previous section, we saw that a wave problem has a closed form solution called D'Alem-
bert solution. Here we a pply the separ ation of variable technique to write the solution in
series form. Consider the following problem
8
>
>
<
>
>
:
@
tt
u = c
2
@
xx
u
u(0; t) = u(L; t) = 0
u(x; 0) = f(x); @
t
u(x; 0) = g(x)
: (7.22)
22 Heat and Wave Equations
The separation of variables leads to the following equations for T (t) and X(x)
T
00
= ¡c
2
λ
2
T
;
X
00
= ¡λX
X(0) = X(L) = 0
:
As before, the associated e igenvalue problem has eigenvalues λ
n
=
n
2
π
2
L
2
, an d the eigenfunc-
tions X
n
(x) = sin
¡
L
x
. Then the associated time equation has the solution
T
n
(t) = A
n
cos
L
ct
+ B
n
sin
L
ct
;
and thus the solution to the wave problem is
u(t; x) =
X
n= 1
1
h
A
n
cos
L
ct
+ B
n
sin
L
ct
i
sin
L
x
:
In order that the above series to be the true solution to the problem, the co efficients A
n
; B
n
must be determined such that u(x; t) satisfies the given initial conditions. Applying the first
initial condition leads to the relation
f(x ) =
X
n= 1
1
A
n
sin
L
x
;
and thus
A
n
=
2
L
Z
0
L
f(x ) sin
L
x
dx:
Similarly, from the relation
g(x) =
X
n= 1
1
B
n
nπc
L
sin
L
x
;
the coefficients B
n
are determined by the formula
B
n
=
2
nπc
Z
0
L
g(x) sin
L
x
dx:
Example 7.7. Consider the following wave problem
8
>
>
<
>
>
:
@
tt
u = c
2
@
xx
u 0 < x < π
u(0; t) = u(π; t) = 0
u(x; 0) = x(π ¡x); @
t
u(x; 0) = 0 0 < x < π
: (7.23)
For L = π, we obtain
A
n
=
4(1 ¡cos())
n
3
π
; B
n
(0) = 0;
and thus
u(x; t) =
X
n= 1
1
4(1 ¡cos())
n
3
π
cos(cnt) sin(nx): (7.24)
The figure (7.11) shows the solution for some values of t and for c = 1 (the left) and c = 2
p
(the right). As it is observed from the figure, the factor c determines the speed of th e traveling
wave. Moreover, the soluti o n is
2π
c
periodic, that is , u
¡
x; t +
2π
c
= u(x; t).
7.5 Solution to heat and wave equations 23
1
2
π
π
2
1
1
2
t
= 0
t
=
π
t
=
π/
4
t
= 5
π/
4
1
2
π
π
1
1
2
t
= 0
t
= 5
π/
4
t
=
π
Figure 7.11.
What is the rel a tion between the d' Alembert solution and the series solution found
above? In order to show that the series solution is the same as the d'Alembert solution,
we use the trig o nometric identities to write
X
n= 1
1
A
n
cos
L
ct
sin
L
x
=
1
2
X
n= 1
1
A
n
h
sin
L
(x + ct)
+ sin
L
(x ¡ct)
i
: (7.25)
Note that
X
n= 1
1
A
n
sin
L
x
= f
odd
(x);
where f
odd
is the odd extension of f in [¡L; L], and thus
X
n= 1
1
A
n
cos
L
ct
sin
L
x
=
1
2
[f
odd
(x + ct) + f
odd
(x ¡ct)]:
Similarly, we have
X
n= 1
1
B
n
sin
L
ct
sin
L
x
=
1
2
X
n= 1
1
B
n
h
cos
L
(x + ct)
¡cos
L
(x ¡ct)
i
; (7.26)
On the other hand, we have
Z
x¡ct
x +ct
g
odd
(s)ds =
X
n= 1
1
B
n
nπc
L
Z
x¡ct
x+ct
sin
L
s
=
=
X
n= 1
1
B
n
c
h
cos
L
(x ¡ct)
¡cos
L
(x + ct)
i
Therefore
X
n= 1
1
B
n
sin
L
ct
sin
L
x
=
1
2c
Z
x¡ct
x+ct
g
odd
(s) ds:
Putting together the obtained formula, we reach
u(t; x) =
1
2
[f
odd
(x + ct) + f
odd
(x ¡ct)] +
1
2c
Z
x¡ct
x+ct
g
odd
(s) ds; (7.27)
24 Heat and Wave Equations
that is the d'Alembert fo rmula.
7.5.4 Non-homogeneous problems
Consider a simple heat equation with the nonzero Dirichlet boundary condition, that is,
8
<
:
@
t
u = D@
xx
u + h(x)
u(0; t) = a; u(L; t) = b
u(x; 0) = f(x)
:
In the above equation, we have three source terms, one heat source (or sink) at x = 0, one at
x = L and another one which is distributed along the rod is h(x). Like ord inary differential
equations, the logic to solve linear non-homogeneous equations is to add a particular solution
to the homogeneous solution. The associated homogeneous solution which is solution to the
equation
@
t
u = D@
xx
u
u(0; t) = u(L; t) = 0
;
is
u
h
(x; t) =
X
n= 1
1
b
n
e
¡
n
2
π
2
L
2
Dt
sin
L
x
:
For a particular solution, we notice that all source terms are independent of time t. Then we
can assume a pa rtic ular solution of the f o rm u
p
= v(x). Substituting this into the e quation
results to
0 = Dv
00
+ h(x)
v(0) = a; v(L) = b
:
The above is a simple ordinary equation for v(x) and is solved by double integration. The
general solution is then
u(x; t) = u
h
(x; t) + v(x) =
X
n= 1
1
b
n
e
¡
n
2
π
2
L
2
Dt
sin
L
x
+ v(x):
To determine coefficients b
n
, we use the initial condition and obtain
f(x ) =
X
n= 1
1
b
n
sin
L
x
+ v(x);
and thus
b
n
=
2
L
Z
0
L
[f (x) ¡v(x)] s in
L
x
dx:
Example 7.8. Consider the following problem
8
>
>
<
>
>
:
@
t
u = @
xx
u + e
¡x
0 < x < 1
u(0; t) = 0; u(1 ; t) = 1 ¡e
¡1
t 0
u(x; 0) = 1 0 < x < 1
: (7.28)
7.5 Solution to heat and wave equations 25
The equation of the particular solution is
(
¡v
00
= e
¡x
v(0) = 0; v(1) = 1 ¡e
¡1
; (7.29)
and therefore v(x) = 1 ¡e
¡x
. The refore, the general so luti o n to the equati o n is
u(x; t) =
X
n= 1
1
b
n
e
¡n
2
π
2
Dt
sin(nπx) + 1 ¡e
¡x
:
The coefficients b
n
are determined by the formula
b
n
= 2
Z
0
1
e
¡x
sin(nπx) dx =
2πn
π
2
n
2
+ 1
(1 ¡e
¡1
cos()):
Note that u(t; x)
!
!
t!1
v(x), and thus v(x) is the steady state solution u
e
; see the figure
(7.12).
0
.
5 1
.
0
0
.
5
1
.
0
lim
t
u
e
(
x
)
Figure 7.12.
Example 7.9. Consider the following problem
8
>
>
<
>
>
:
@
tt
u = @
xx
u + π
2
sin(2πx) 0 < x < 1
u(0; t) = u(1; t) = 0
u(x; 0) = 0; @
t
u(x; 0) = 0
: (7.30)
The particular solution to the problem is obtained by solving the equation
(
¡v
00
= π
2
sin(2πx)
v(0) = v(1) = 0
: (7.31)
Clearly we have v(x) =
1
4
sin(2πx) and thus
u(x; t) =
1
4
sin(2πx) +
X
n= 1
1
[A
n
cos(nπt) + B
n
sin(nπt)] sin(nπx): (7.32)
Applying initial conditions gives B
n
= 0 and A
n
= ¡
1
4
1 n = 2
0 n =/ 2
, and finally
u(x; t) =
1
4
sin(2πx)(1 ¡cos(2πt)): (7.33)
26 Heat and Wave Equations
The non-homogeneous Neumann problem is not as trivial as Dirichlet problem. In
the problem set, we solve an example of it.
7.5.5 Convergen ce of sol u tions
The following theorems states the main result about the convergence of the series solutions
derived in this chapter. The detailed discussion is given in the second volume of this book.
Theorem 7.2. Let f(x) be an admissible function as defined in the section of Fourier
series, and let (f
n
) be the sine Fourier coefficients of f (x). Then the sequence of partial
sums
S
n
(x; t) =
X
j=1
n
f
j
e
¡n
2
π
2
t/L
2
sin
L
x
; (7.34)
converges pointwise in = (0; 1) ×(0; L). Furthermore, the limit function u(t; x) is C
1
with
respect to t and C
2
with respect to x.
Theorem 7.3. Assume that u (t; x) is defined by the series
u(x; t) =
X
n=1
1
f
n
e
¡n
2
π
2
t/L
2
sin
L
x
(7.35)
Fix t 2[0; 1), then the following relations hold
lim
x#0
u(x; t) = lim
x"L
u(x; t) = 0: (7.36)
Theorem. Assume that x 2(0; L) is a continuity point for the initial data f( x). Then the
series solution (7:35) satisfies the relation
lim
t!0
u(x; t) = f (x): (7.37)
Problems
Problem 7.27. Consider the equation
@
t
u = 10
¡4
@
xx
u; 0 < x < 1; t > 0:
a) Assuming that the end points are kept at zero degree and the initial data u(x; 0) is 100x(1 ¡x).
Find the solution u(x; t) for t > 0 and x 2(0; 1). Draw the temperature of the point x = 0.5 in t 0.
b) Solve the above problem if the b oundary points x = 0; 1 are insulated. How many terms of the
series of u(x; t) are needed to guarantee that the partial sum approximate the true solution within
10
¡6
error.
Problem 7.28. Consider an elastic string fastened at its boundary x = 0; 1. The displacement of the
po int x (in the vertical direction) at time t follows the equation
@
tt
u = 4@
xx
u:
If the initial displacement u(x; 0) is 0 and the initial velocity is @
t
u(x; 0) = 10
¡2
(1 ¡cos(4πx)), draw the
displacement function of the point x =
1
3
for t > 0.
7.5 Solution to heat and wave equations 27
Problem 7.29. The following equation is called damped wave equation
@
tt
u + 2ξ@
t
u = c
2
@
xx
u;
where ξ > 0 is the damping factor. Assume that boundary points x = 0; 1 are fastened. Find u(t; x) if
the initial displacement is u(x; 0) = x(1 ¡x), and the initial velocity is @
t
u(x; 0) = 0 in 0 < x < 1. What
is the limit lim
t!1
u(t; x).
Problem 7.30. Find the solution to the following damped wave equation
8
<
:
@
tt
u + @
t
u=@
xx
u
u(0; t)=u(1; t)=0
u(x; 0)=2 sin (2πx); @
t
u(x; 0)= sin (πx)
Problem 7.31. Solve th e following homogeneo us problems
i.
8
<
:
@
t
u = @
xx
u
u(0; t) = u(1; t) = 0
u(x; 0) = cos(2πx)
ii.
8
<
:
@
t
u = 3@
xx
u
@
x
u(0; t) = @
x
u(2; t) = 0
u(x; 0) = x sin(πx)
iii.
8
<
:
@
t
u = @
xx
u
u(1; t) = u(2; t) = 0
u(x; 1) = x ¡1
iv.
8
<
:
@
tt
u = 4@
xx
u; 0 < x < 1
u(0; t) = u(1; t) = 0
u(x; 0) = 1; @
t
u(x; 0) = x
v.
8
<
:
@
tt
u = @
xx
u; π < x < 2π
u(π; t) = u(2π; t) = 0
u(x; 0) = x sin(x); @
t
u(x; 0) = 0
vi.
8
<
:
@
tt
u = @
xx
u; 0 < x < π
u(0; 0) = u(π; 0) = 0
u(x; 1) = 0; @
t
u(x; 1) = 2
Problem 7.32. Solve th e following non-homog eneo us problems
i.
8
<
:
@
t
u = @
xx
u + cos(x) ¡3 cos(3x)
@
x
u(0; t) = @
x
u(π; t) = 0
u(x; 0) = 0
ii.
8
<
:
@
t
u = @
xx
u
u(0; t) = 1; u(1; t) = 1
u(x; 0) = sin(πx)
iii.
8
>
>
<
>
>
:
@
t
u = @
xx
u ¡e
¡x
u(0; t) = 0; u(π; t) = 1
u(x; 0) = e
¡x
28 Heat and Wave Equations
iv.
8
<
:
@
tt
u = @
xx
u + sin(2πx); 0 < x < 1
u(0; t) = u(1; t) = 0
u(x; 0) = 0; @
t
u(x; 0) = 0
v.
8
>
>
<
>
>
:
@
tt
u = c
2
@
xx
u
u(0; t) = ¡1; u(1; t) = 1
u(x; 0) = 2x ¡1; @
t
u(x; 0) = sin(2πx) ¡sin(3πx)
Problem 7.33. Consider the following heat problem
8
<
:
@
t
u = @
xx
u ¡u
u(0; t) = 0; u(1; t) = sinh(1)
u(0; x) = x + sinh(x)
;
a) Find the steady state solution u
e
(x) to the problem.
b) Writ e the solution to the problem as u(x; t) = v(x) + u
h
(x; t) and obtain the equation for w.
c) Solve the problem to find u(x; t).
Problem 7.34. Consider the following problem
8
<
:
@
t
u = @
xx
u + 2@
x
u
u(0; t) = u(1; t) = 0
u(x; 0) = 1
:
Solve the problem by the separation of variable technique.
Problem 7.35. Consider the following non-homogeneous Neumann problem
8
<
:
@u
@t
=
@
2
u
@x
2
@u
@x
(0; t) = α;
@u
@x
(L; t) = β
:
Verify that the solution to the equation is of the form
u(x; t) = αx +
β ¡α
2L
x
2
+
β ¡α
L
t + c
0
+
X
n=1
1
c
n
e
¡n
2
π
2
t/L
2
cos
L
x
:
7.5 Solution to heat and wave equations 29