Chapter 7ode
Chapter 7ode
7.1 Introduction
1
2 Heat and Wave Equations
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 @ 2u
= D :
@t @x2 ;
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 zero, 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 source present along the rod that
generate heat with the rate h(x), the Dirichlet problem reads
(
@u @ 2u
= D @x2 + h(x)
@t : (7.2)
u(0; t) = a; u(L; t) = b
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)
external source external source
u(0; t) = a u(L; t) = b
Neumann B.Cs .
@u
In a Neumann problem, it is assumed that the derivative of u, that is, are 0 at the
@x
boundary points x = 0; L. Therefore, a homogeneous Neumann heat problem reads
8
< @u = D @ 2u + h(x)
@x2
@t
: (7.3)
: (0; t) = 0; @u (L; t) = 0
@u
@x @x
@u
The physical interpretation of the Neumann B.Cs is as follows. First note that @x (x; t)
measures the net flow of heat passing through the point x at time t. Therefore, the homo-
geneous Neumann boundary 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.
7.1 Introduction 3
Robin's BCs.
The general form of mixed or Robin's boundary condition is
8
< a1u(0; t) + b1 @u (0; t) = 0
@x
; (7.4)
: a2u(L; t) + b1 @u (L; t) = 0
@x
where a1; b1 or a2; b2 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
@u
and @x (L; t) = 0.
regardless of the initial heat distribution u(x; 0) = f (x). In particular, for a homogeneous
Dirichlet problem, that is, when a = b = 0 and h(x) = 0, the steady state solution is the
solution to the equation
0 = v 00(x)
;
v(0) = v(L) = 0
which is simply 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 other 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 Neumann problem is more interesting. First of all, we
@u
note that the term @x is proportional 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
@u
points are high, the heat gradient is higher and vice versa Therefore, @x (0; t) = 0, and
@u
@x
(L; t) = 0 mean physically that boundary points x = 0; L are insulated, and thus no heat
exchanges through these two points. 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): Z
1 L
v(x) = u(x; 0) dx: (7.5)
L 0
For a proof of the equation see the problem set.
4 Heat and Wave Equations
We note that in a wave equation, the partial derivative with respect to t is of order 2, and
@u
for this reason the equation is accompanied by 2 initial conditions, i.e., u(x; 0), and @t .
It is simply seen that the problem (7.7) has a closed form solution of the form
Z
1 1 x+ct
u(x; t) = [fodd(x + ct) + fodd(x ¡ ct)] + g (s) ds;
2 2c x¡ct odd
where fodd; godd are the odd extension of functions f ; g respectively and periodic of period
2L, that is, fodd(x + 2L) = fodd(x) and godd(x + 2L) = godd(x). The above formula is called
d'Alembert's solution. Let us verify the formula. First for the boundary condition x = 0.
We have Z
1 1 ct
u(0; t) = [fodd(ct) + fodd(¡ct)] + 2 godd(s) ds = 0;
2 c ¡ct
because f (¡ct) = f (ct) and the integral of the odd function godd on a symmetric domain is
equal to zero. At x = L, we have
fodd(L ¡ ct) = ¡fodd(ct ¡ L) = ¡fodd(ct ¡ L + 2L) = ¡fodd(L + ct):
Similarly, by taking s = v + L, we derive
Z L+ct Z ct
godd(s) ds = godd(v + L) dv:
L¡ct ¡ct
So far, we have shown that the d'Alembert solution satisfies the boundary 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 = D @ 2u
@t @x2
: @u @u
(0; t) = 0; @x (L; t) = 0
@x
Define the energy function
Z L
E(t) = u(x; t) dx:
0
Use the equation and show E 0(t) = 0. Conclude that E(t) is independent of t and thus (7.5).
Problem 7.2. Consider the equation (7.3). We show that there is no steady state solution to the
equation.
a) Show the following relation
Z L Z L
d
u(x; t)dx = h(x)dx:
dt 0 0
6 Heat and Wave Equations
Show the following formula which is known as the conservation of energy of wave function
Z L Z L
E(t) = jg(x)j2 dx + c 2 jf 0(x)j2 dx:
0 0
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
< @ttu = 4@xxu
u(0; t) = u(; t) = 0 :
:
u(x; 0) = sin(3x); @tu(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.
and by that, we reach 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 of 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
< d2
X = ¡X
dx2 : (7.8)
: X(0) = X(L) = 0
Equations of the above form are generally called eigenvalue problems. In fact, we would like
to find non-trivial functions X(x) called eigenfunctions that preserves their 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.
Integration by parts formula, simplifies the left hand side of above relation to
Z L Z L Z L
00 0 L 0
X (x) X(x) = X (x)X(x)j0 ¡ 2
jX (x)j = ¡ jX 0(x)j2:
0 0 0
Note that the boundary term is zero in the above relation due to the boundary conditions
at x = 0; L. We obtain finally Z Z L
L
0 2
jX (x)j = jX(x)j2;
0 0
8 Heat and Wave Equations
and thus 0. Again if = 0, we obtain X 0(x) = 0 that gives in turn X(x) = constant. But
X(0) = 0 that gives X(x) = 0 identically and this
p contradicts the fact that eigenfunctions are
non-trivial. Therefore, > 0 and thus r1;2 = i . The solution to the equation X = ¡X
00
for > 0 is
p p
X(x) = c1 cos( x) + c2 sin( x):
Applying the boundarypcondition X(0) = 0 gives c1 = 0. The second boundary condition
p
X(L) = 0 gives c2 sin( L) = 0. Since c2 must be non-zero (why?) we obtain L =
n2 2
n, and therefore eigenvalues
¡ n of the problems are obtained as n = L2 associated to the
eigenfunctions Xn(x) = sin L x for n = 1; 2; . Note that n starts from 1 and not 0. Also,
there is no linearly independent eigenfunction for negative integers n. The pair (n; Xn) is
called eigenpair of the eigenvalue problem.
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 conditions implies A = 0 and thus X(x) = B a nonzero constant. Without
loss of generality, we can assume X0(x) = 1 (multiplication by arbitrary constant is also an
¡ n n2 2
eigenfunction). For > 0, we obtain
2 2 X n(x) = cos L x and n = L2 , n = 1; 2; . Without loss
n ¡ n
of generality, we can write L2 ; cos L x for n = 0; 1; , as the eigenpair of the Neumann
eigenvalue problem.
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)
(
x2X 00 + xX 0 + 4X = ¡X
X(1) = X(e) = 0
(Note that the substituting x = et transforms the equation to an equation with constant coeffi-
cients)
c)
(
x2X 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.
a)
X 00 + 2X 0 = ¡X
:
X 0(0) = X 0(1) = 0
b)
(
x2X 00 + xX 0 + 4X = ¡X
X 0(1) = X 0(e) = 0
(Note that the substituting x = et transforms the equation to an equation with constant coeffi-
cients)
10 Heat and Wave Equations
c) (
x2X 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 that the eigenvalue problem
8
< d2
X = ¡X
dx2 ;
: X(0) = 0; X(L) + X 0(L) = 0
Show that eigenfunctions are of the form Xn(x) = e¡x sin(!nx), where !n are the solutions to the algebraic
equation tan(!) = ¡!.
Problem 7.13. Consider the following ordinary boundary value problem
(
(1 + x2)X 00 ¡ exX = ¡X
:
X(0) = X(1) = 0
Use the energy method employed in this section to show that the condition > 1 is necessary the problem
has a solution.
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
n
X n
X
f (x) = lim an cos(n!x) + bk sin(n!x);
n!1
k=0 k=1
2
where ! = b ¡ a , and a0; an, and bn are determined by the formula ( 7.12). If x 2 (a; b) in a
discontinuity point of f (x), then
Xn Xn
1
[f (x ) + f (x )] = lim
+ ¡
an cos(n!x) + bk sin(n!x):
2 n!1
k=0 k=1
Furthermore, at x = a; b we have
Xn Xn
1
[f (a ) + f (b )] = lim
+ ¡
an cos(n!a) + bk sin(n!a) =
2 n!1
k=0 k=1
n
X n
X
= lim an cos(n!b) + bk sin(n!b):
n!1
k=0 k=1
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
1
X X 1
n n
f (x) an cos x + bn sin x ;
n=0
L n=1
L
and Z Z Z
L L
1 1 n 1 L n
a0 = f(x); an = f (x) cos x ; bn = f (x) sin x :
2L ¡L L ¡L L L ¡L L
12 Heat and Wave Equations
Remark 7.1. Notice that a0 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 an = 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 bn = 0, n = 1; 2; , and the series contains only
cosine terms (including the constant function for n = 0).
Here a = ¡1; b = 1 and ! = . The function is odd and it is simply seen that f0 = fnc = 0 for
2
all n 1. The sine coefficients are fns = n (1 ¡ cos n) and thus
1
2 X 1 ¡ cos n
f (x) sin(nx): (7.13)
n=1 n
The figure (7.2) shows partial sums S15; S150 of the series in the interval ¡1 < x < 1.
−1 1
−1
Figure 7.2.
We make following observations from the figure
i. Sn(x) approximates the original function more accurately for larger n.
ii. Sn(0) = 0 for all n. In fact, this is the average value of f (0+) and f (0¡).
iii. Sn(1) = Sn(¡1) = 0, the average of f(1+); f (1¡).
iv. Sn(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) = x2 in ¡1 < x < 1 is
1
X
2
x f0 + fnc cos(nx);
n=1
7.4 Fourier series 13
1 4(¡1)n
where f0 = 3 and fnc = n22 . Note that the function is even and fns = 0 for all n. The figure
(7.3) shows the partial sums S2; S20.
−1 1
Figure 7.3.
The plot of S10; S50 are shown in the figure (7.4). Note that Sn(¡1) = Sn(1) = 0.5 for all n
which is the average limits f (¡1+) and f (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
f (1¡) + f (¡1+)
value 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.
14 Heat and Wave Equations
−3 −2 −1 1 2 3
−1
Figure 7.5.
Since fodd is an odd function, 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 fev contains only cosine terms and it is called the cosine Fourier series of f(x).
Since fodd(x) is defined on (¡L; L), its Fourier series is
X1
n
fodd(x) bn sin x ;
n=1
L
where
Z Z
1 L n 2 L n
bn = f (x) sin x = f (x) sin x :
L ¡L odd L L 0 L
On the other hand, since the series represents fodd on (¡L; L), then definitely it represents
f (x) on (0; L) since on (0; L) two function fodd and f are the same. Therefore, we can write
X1 Z L
2 n n
f (x) f (x) sin x sin x :
n=1
L 0 L L
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
1
X 1
X
f(x) an cos(2nx) + bn sin(2nx);
n=0 n=1
where Z Z Z
1 L 1
1 1
a0 = f = x = ; an = 2 x cos(2nx) = 0; bn = 2 x sin(2nx) = ¡ ;
0 2 0 0 n
and thus 1
1 X 1
f(x) ¡ sin(2nx):
2 n=1 n
The graph is shown in the figure (7.6).
1. 0
0. 5
−1 0 −0 5
. . 0. 5 1. 0 1. 5 2. 0
Figure 7.6.
Notice that the series is periodic with the period 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
−1 0 −0 5
. . 0. 5 1. 0 1. 5 2. 0
Figure 7.7.
Note that regardless of 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 greater 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
1
here is equal to 2 .
16 Heat and Wave Equations
Now let us obtain the sine Fourier series of the function. The odd extension of the
function f (x) in (0; 1) is fodd = x in (¡1; 1). Therefore we can write
X1 Z 1 X1
2(¡1)n+1
f (x) 2 x sin(nx) sin(nx) = sin(nx):
n=1 0 n=1
n
1. 0
0. 5
−3 −2 −1 1 2 3
−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 fev(x) = jxj that is
X1 Z 1 1
1 X 2((¡1)n ¡ 1)
f (x) f + 2 x cos(nx) cos(nx) = + 2 2
cos(nx):
n=1 0 2 n=1
n
1. 0
0. 5
−3 −2 −1 1 2 3
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
¡1 < x < 0
b) f (x) = 1
x¡1 0<x<1
7.4 Fourier series 17
c) f (x) = cos(x), ¡ 2 < x < 2
Problem 7.15. write the original and the cosine Fourier series of the function f(x) = sin(x), 0 < x < .
Problem 7.16. Write the sine Fourier series of the function f (x) = cos(x), 0 < x < 2 .
Problem 7.17.
a) Find coefficients bn such that
1
X
x2 = bn sin(nx); 0 < x <
n=1
b) Find coefficients an such that
1
X
x2 = an cos(nx); 0 < x <
n=0
2 1 1 1 1 1
=1¡ + ¡ + ¡ +
12 4 9 16 25 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
1 1 1
= 1 ¡ + ¡ + :
4 3 5 7
Problem 7.21. Find the Fourier series of the function f(x) = x3 in x 2 (¡; ) and deduce the
following identity
3 1 1 1
= 1 ¡ 3 + 3 ¡ 3 + :
32 3 5 7
Problem 7.22. Let f(x) = e¡x on (0; 1).
a) Write down the Fourier series of f and draw S5(x); S10(x) on (¡2; 2).
b) Write down the complex form of the Fourier series.
c) Write down the sine Fourier series of f and draw S5(x); S10(x) on (¡3; 3).
d) Write down the cosine Fourier series of f and draw S2(x); S10(x) on (¡3; 3).
18 Heat and Wave Equations
¡
Problem 7.23. Let f(x) = cos(x) on 0; 2 .
a) Write down the Fourier series of f and draw S3(x); S5(x); S6(x) on (¡; ). How the series
behave near x = 0 and x = /2?
b) Write down the sine Fourier series of f and draw S3(x); S5(x); S6(x) on (¡; ). How the series
behave near x = 0 and x = /2?
c) Write down the cosine Fourier series of f and draw S3(x); S5(x); S6(x) on (¡; ).
d) For the partial sum Sn 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 problem by Fourier series method
00
y +y=1
:
y(0) = y(1) = 0
Let us assume that the solution u(x; t) is of the form u(x; t) = T (t) X(x), for some 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) X 00(x)
= : (7.15)
DT (t) X(x)
Since t and x are independent variables, the equality (7.16) holds if and only if we have
T 0(t) X 00(x)
= = ¡; (7.16)
DT (t) X(x)
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 condition 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 condition at x = L, we have
X(L) = 0, and therefore, we reach the following Dirichlet eigenvalue problem for X(x)
00
X = ¡X
: (7.17)
X(0) = X(L) = 0
n2 2
As we saw in above the obtained
¡ n eigenvalue problem has the eigenvalues n = L2 , and
eigenfunctions Xn(x) = sin L x for n = 1; 2; . In this way, we obtain infinitely many
solutions
n2 2
¡ Dt n
un(x; t) = e L2 sin x :
L
It is simply verified that un(x; t) satisfies both the differential equation and the boundary
conditions (it is left as a simple exercise to the reader). However, un(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
1
X 1
X n2 2
¡ Dt n
u (x; t) = bnun(x; t) = bn e L2 sin x :
n=1 n=1
L
20 Heat and Wave Equations
(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 bn the solution satisfies
the initial condition as well. At t = 0, we have
X1 n
f (x) = bn sin x ;0<x<L
n=1
L
and thus bn must be the coefficients of the sine Fourier series of the function f (x), that is,
Z
2 L n
bn = f (x) sin x dx:
L 0 L
Therefore, the true solution to the homogeneous Dirichlet heat problem is
X1 Z L ¡ n22 Dt
2 n n
u(x; t) = f (x) sin x dx e L2
sin x : (7.18)
n=1
L 0 L L
t=0 t=0
1. 0 1. 0
t = 0. 5
t=1 t = 0. 5
0. 5 0. 5
t=2 t=1
t=2
1 π 1 π
π π
2 2
Figure 7.10.
The separated solution u(x; t) = X(x) T (t) results to the following eigenvalue problem for
X(x) 00
X = ¡X
:
X 0(0) = 0; X 0(L) = 0
n2 2
As we saw before, the above eigenvalue problem has the eigenvalues n = L2 , and the
¡ n
eigenfunctions Xn(x) = cos L x for n = 0; 1; 2; . The associate equation for T (t), that is
n2 2
¡ Dt
T = ¡DT has the solution Tn(t) = e
0
and thus the solution can be written in the
L2
series form
X1 n2 2
¡ Dt n
u(x; t) = an e L2 cos x :
n=0
L
22 Heat and Wave Equations
Notice that in this case n starts form 0 not 1. The coefficients an are determined by the aid
of the initial condition u(x; 0), i.e.,
X1 n
f (x) = an cos x :
n=0
L
The above series implies that an must be the cosine Fourier series of f (x), that is,
Z n
2 L
a0 = f ; an = f (x) cos x ; n = 1; 2; :
L 0 L
Therefore, we obtain
X 1 Z L ¡ n22 Dt
2 n n
u(x; t) = f + f(x) cos x e L2 cos x :
n=1
L 0 L L
Note that as we expected for Neumann heat problem
lim u(x; t) = f:
n!1
Z
2 2(cos(n) ¡ 1) 5 n=3
an = (x + 5 cos(3x)) cos(nx) dx = 2
+ ;
0 n 0 n=
/3
Therefore, the solution is
X1
2(cos(n) ¡ 1) ¡n2t
u(x; t) = + 5e cos(3x) +
¡9t
e cos(nx):
2 n=1
n2
As we expect, we have the following steady state solution
lim u(t; x) = f = :
t!1 2
The separation of variables leads to the following equations for T (t) and X(x)
00
00 X = ¡X
T = ¡c22T ; :
X(0) = X(L) = 0
n2 2
As before, the associated
¡ n eigenvalue problem has eigenvalues n = L2 , and the eigenfunc-
tions Xn(x) = sin L x . Then the associated time equation has the solution
n n
Tn(t) = An cos ct + Bn sin ct ;
L L
and thus the solution to the wave problem is
X1 h i
n n n
u(t; x) = An cos ct + Bn sin ct sin x :
n=1
L L L
In order that the above series to be the true solution to the problem, the coefficients An; Bn
must be determined such that u(x; t) satisfies the given initial conditions. Applying the first
initial condition leads to the relation
X1
n
f (x) = An sin x ;
n=1
L
and thus Z
2 L n
An = f (x) sin x dx:
L 0 L
Similarly, from the relation
nc n
X1
g(x) = Bn sin x ;
n=1
L L
For L = , we obtain
4(1 ¡ cos(n))
An = ; Bn(0) = 0;
n3
and thus
X1
4(1 ¡ cos(n))
u(x; t) = cos(cnt) sin(nx): (7.24)
n=1
n3
p
The figure (7.11) shows the solution for some values of t and for c = 1 (the left) and c = 2
(the right). As it is observed from the figure, the factor ¡c determines the speed of the traveling
2 2
wave. Moreover, the solution is c periodic, that is, u x; t + c = u(x; t).
24 Heat and Wave Equations
t=0 t=0
2
t = π/4 2
1 t = 5π/4
1
1 π
π
−1 2
t = 5π/4
−2 1
2
π π
t=π −1 t=π
Figure 7.11.
What is the relation 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 trigonometric identities to write
X1 1 h i
n n 1X n n
An cos ct sin x = An sin (x + ct) + sin (x ¡ ct) : (7.25)
n=1
L L 2 n=1
L L
Note that
1
X
n
An sin x = fodd(x);
n=1
L
Similarly, we have
1
X n n 1 X 1 h n n i
Bn sin ct sin x = B cos (x + ct) ¡ cos (x ¡ ct) ; (7.26)
n=1
L L 2 n=1 n L L
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 ordinary 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
@tu = D@xxu
;
u(0; t) = u(L; t) = 0
is
X1 n2 2
¡ 2 Dt n
uh(x; t) = bn e L sin x :
n=1
L
For a particular solution, we notice that all source terms are independent of time t. Then we
can assume a particular solution of the form up = v(x). Substituting this into the equation
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
X1 n2 2
¡ Dt n
u(x; t) = uh(x; t) + v(x) = bn e L2 sin x + v(x):
n=1
L
and therefore v(x) = 1 ¡ e¡x. Therefore, the general solution to the equation is
1
X 2 2
u(x; t) = bn e¡n Dt sin(nx) + 1 ¡ e¡x:
n=1
.
1 0
t
lim
→∞
.
0 5
u e (x
)
.
0 5 .
1 0
Figure 7.12.
Theorem 7.2. Let f (x) be an admissible function as defined in the section of Fourier
series, and let (fn) be the sine Fourier coefficients of f (x). Then the sequence of partial
sums
Xn
2 2 2 n
Sn(x; t) = fj e¡n t/L sin x ; (7.34)
j=1
L
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. 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 u(x; t) = f (x): (7.37)
t!0
Problems
Problem 7.27. Consider the equation
@tu = 10¡4 @xxu; 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 boundary 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
point x (in the vertical direction) at time t follows the equation
@ttu = 4@xxu:
If the initial displacement u(x; 0) is 0 and the initial velocity is @tu(x; 0) = 10¡2(1 ¡ cos(4x)), draw the
1
displacement function of the point x = 3 for t > 0.
28 Heat and Wave Equations
iv.
8
< @ttu = @xxu + sin(2x); 0<x<1
u(0; t) = u(1; t) = 0
:
u(x; 0) = 0; @tu(x; 0) = 0
v. 8
>
< @ttu = c2 @xxu
u(0; t) = ¡1; u(1; t) = 1
>
: u(x; 0) = 2x ¡ 1; @tu(x; 0) = sin(2x) ¡ sin(3x)