You are on page 1of 12

Chapter 2

Introduction to Partial Dierential


Equations
2.1 Basic properties of PDES
Partial dierential equations involve partial derivatives of a function, say, u, with respect to
more than one independent variable. Often the variables may represent spatial coordinates, say,
x, y, and z, and time t. In other cases the variables may be completely dierent, for example,
in a model of the energy of a system as a function of temperature and pressure. Examples of
partial dierential equations are:
u
t

2
u
x
2
= 0 , (2.1)
u
x

_
u
t
_
2
= 0 , (2.2)

2
u
x
2

1
v
2

2
u
t
2
= 0 , (2.3)

2
u
x
2
+
1
c
2

2
u
t
2
= 5x
2
, (2.4)
(a
2
x
2
)
u
2
x
2
be
t
u
t
cxtu = 0 , (2.5)

3
u
x
3
k
u
t
= 0 . (2.6)
In all of the examples above, u is a function of two independent variables, x and t. Sometimes
for the partial derivatives we will use a subscript to indicate partial dierentiation with respect
to the given variable, for example,
19
20 Lecture Notes on Mathematical Methods
u
t
=
u
t
,
u
xx
=

2
u
x
2
.
Using this notation the PDE from Eq. (2.1) could be written
u
t
+u
xx
= 0 . (2.7)
2.2 Boundary and initial conditions
Recall from Chapter 1 that the general solution of an n
th
order ODE contains n constants of
integration, and only when this auxiliary information is supplied do we obtain a unique solution.
With partial dierential equations, instead of specifying constants one must provide additional
functions. More precisely, if the equation is of n
th
order in a given variable, then one must
provide n functions of the remaining variables in order to determine the specic solution. For
example, Eq. (2.3) is second order in x and rst order in t, so in this case we must provide
two functions of t (i.e., the variable other than x), and also one function of x. We will see an
example of this in Sec. 2.3.
In the example of the harmonic oscillator from Sec. 1.4, we had a second order ODE
(Eq. 1.69), and as a result we needed to specify two constants of integration, namely, the initial
position and speed, u(t
0
) and u

(t
0
). In this example these were initial conditions, i.e., both
values were specied for the same time, t
0
.
Let us now extend this the case of more than one variable. Suppose we have a function u
of x and t (position and time), and the equation is second order in both x and t. The initial
conditions could be of the form
u(x, t
0
) = f(x) , (2.8)
u
t
(x, t
0
) = g(x) , (2.9)
u(x
0
, t) = a(t) , (2.10)
u
x
(x
0
, t) = b(t) , (2.11)
where f(x) and g(x) are specied functions of x, a(t) and b(t) are given functions of t, t
0
represents a specic time and x
0
represents a given position. So here two of the initial
conditions refer to time and two of them to the spatial coordinate x.
In many problems, we do not have initial conditions for at least some of the variables,
but rather, boundary conditions. For example, instead of specifying u(x
0
, t) and u(x
0
, t) as in
Eqs. (2.10) and (2.11), we might be given the value of u at two dierent values of x, say, x = 0
and x = L:
Introduction to PDEs 21
u(0, t) = A(t) , (2.12)
u(L, t) = B(t) . (2.13)
As remarked in Sec. 1.2, when boundary (as opposed to initial) conditions are imposed, one may
nd that this restricts the possible solutions. We will see an example of this in the following
section.
2.3 The heat equation, separation of variables
In this section we will solve a simple but important partial dierential equation, the heat equation,
which describes the temperature of a system as a function of space and time. In doing so we
will introduce the method of separation of variables and use this to convert a PDE containing
two variables into two ODEs, one for each of the variables. The problem will also illustrate
many features that will will return to and extend later in the course, such as eigenvalues and
eigenfunctions.
Consider a metal rod of length L that is insulated on the sides, so that heat can ow only
along the rod and in or out each end. Our goal is to describe the temperature u of the rod as a
function of time t and as a function of the position along the rod, x, where t 0 and 0 x L.
One can show that the temperature of a body can be described as a function of space and time
by the heat equation, which in one spatial dimension can be written
u
t

2
u
x
2
= q(x, t) . (2.14)
Here is a positive constant called the thermal diusivity, which is related to the density and
thermal properties of the material, and the nonhomogeneous term q(x, t) corresponds to heat
generated in the rod itself, e.g., if an electric current is passing through it. A derivation of the
heat equation can be found in many texts, such as Ref. [4].
For now we will consider the case where there is no heat generated or removed inside the
rod, so we are left with the homogeneous heat equation,
u
t

2
u
x
2
= 0 . (2.15)
2.3.1 Specifying initial and boundary conditions
We will specify the initial temperature at t = 0 by a given function of position:
u(x, 0) = f(x) . (2.16)
Since the equation is rst order in time we only need to provide one function of x, and so there
is no distinction here between an initial value or boundary value for this variable.
22 Lecture Notes on Mathematical Methods
The equation is second order in x, however, so we need to provide two functions of time. In
this example we will take them to be homogeneous boundary conditions on the values of u,
u(0, t) = 0 , (2.17)
u(L, t) = 0 . (2.18)
Since they refer to two dierent positions, 0 and L, Eqs. (2.17) and (2.18) constitute boundary
(as opposed to initial) conditions, and this will have important consequences for the solutions
that we nd.
The fact that we have chosen the right-hand sides of Eqs. (2.17) and (2.18) to be zero, i.e.,
homogeneous boundary conditions, is also important. The method we will use for this problem,
called separation of variables, will work in this case and but will not generally succeed if the
boundary conditions are nonhomogeneous.
2.3.2 Separation of variables
The idea behind the method of separation of variables is to seek solutions (x, t) to our PDE
that can be written as the product of a function only of x, which we will write X(x), and a
function only of t, T(t):
(x, t) = X(x)T(t) . (2.19)
We will nd not one but a family of such product solutions. For the present problem we will nd
an innite number of functions that we can label with an index n, i.e.,
n
(x, t) for n = 1, 2, . . ..
Because the PDE is linear and homogeneous, a linear combination

n
b
n

n
is also a solution.
We will nd the nal answer u(x, t) to our problem as such a superposition with the coecients
of each term chosen so that it satises the initial condition (2.16).
The solution u(x, t) must also satisfy the boundary conditions, Eqs. (2.17) and (2.18), and
these will clearly hold even for arbitrary coecients b
n
as long as all of the product solutions

n
(x, t) satisfy them, i.e.,
n
(0, t) = 0 and
n
(L, t) = 0 for all n. It may seem that imposing
the boundary conditions on all of the product solutions is unnecessary, as the original statement
of the problem only places restrictions on u(x, t), not on the
n
. But it turns out that by
proceeding in this way we will in fact obtain a unique solution to our problem.
For the derivatives required in Eq. (2.15) we have

t
= XT

, (2.20)

x
2
= X

T , (2.21)
where the primes refer to derivatives with respect to either space or time, as appropriate.
Plugging the product solution into the PDE we nd
Introduction to PDEs 23
XT

T = 0 . (2.22)
Dividing both sides of this equation by XT and rearranging terms gives
1

T
=
X

X
. (2.23)
The crucial observation is now that the left-hand side of Eq. (2.23) is only a function of t,
whereas the right-hand side is only a function of x. But x and t are both independent variables;
the only way we can independently vary both of them and still maintain equality of the two
terms is if each side of the equation is a constant (i.e., neither a function of x or t). That is, we
must have
1

T
= , (2.24)
X

X
= , (2.25)
where is called a separation constant. So not only are both sides of (2.23) constant, they are
equal to the same constant, .
If there had been a heat source inside the rod, i.e., q(x, t) in Eq. (2.14) is nonzero, then using
the product solution (x, t) = XT would give
XT

T = q(x, t) . (2.26)
In this case we would not in general be able to separate the equation into a function of x on
one side and a function of t on the other. So we do not only require homogeneous boundary
conditions applied to all product solutions, but to use separation of variables the PDE itself
must also be homogeneous.
2.3.3 Determining the allowed values of
Returning now to Eqs. (2.24) and (2.25) for X and T we will investigate for what values of the
separation constant solutions exist. Suppose is equal to zero. Then the equation for X is
X

= 0 , (2.27)
which has the solution
X = A + Bx , (2.28)
where A and B are constants. If we impose the boundary condition (0, t) = 0, then this implies
XT = (A + 0)T = 0 , (2.29)
24 Lecture Notes on Mathematical Methods
and therefore we nd A = 0. If we then impose (L, t) = 0 we nd
XT = (0 + BL)T = 0 , (2.30)
and then either B = 0 or T = 0. In either case one of the two factors of the product solution is
zero, so we nd (x, t) = 0, and therefore also u(x, t) = 0 for the nal answer. This is called the
trivial solution. Although it formally satises the dierential equation and boundary conditions,
it will not in general satisfy the initial conditions. It is thus not a solution that is usually of
interest, so we will not consider further the possibility of = 0.
If is positive we can write =
2
for some real value , and our dierential equation for
X becomes
X

2
X = 0 . (2.31)
Using the methods from Sec. 1.3 for linear ODEs with constant coecients, we can write down
the general solution as
X = Ae
x
+ B
x
. (2.32)
When we impose the boundary condition (0, t) = 0 we nd
XT = (A + B)T = 0 , (2.33)
and therefore either A = B or T = 0, which would give again the trivial solution. Imposing
(L, t) = 0 implies
XT = A(e
L
e
L
)T = 0 . (2.34)
If the term in parentheses is zero then we have e
L
= e
L
, which is only possible if = 0. But
then =
2
= 0, which we have considered and rejected above. Therefore we must have A = 0
or T = 0, and either implies the trivial solution, (x, t) = 0. So we will also not consider further
the case of > 0.
Finally we consider < 0, so we can write = k
2
where k is a real constant. The equation
for X becomes
X

+ k
2
X = 0 , (2.35)
which has the general solution
X = Acos(kx) + B sin(kx) . (2.36)
Applying the boundary condition (0, t) = 0 gives
(A + 0)T(t) = 0 (2.37)
Introduction to PDEs 25
and if we do not consider T = 0, which will lead to the trivial solution, we must have A = 0.
Applying the boundary condition (L, t) = 0 gives
B sin(kL)T(t) = 0 . (2.38)
Therefore either B = 0 (again the trivial solution) or else we must choose k such that the
sine function is zero, i.e., k = n/L where n is an integer. We do not consider n = 0 since
this always gives sin(0) = 0 (the trivial solution yet again). Furthermore, negative values of
n give the same solution as the corresponding positive value up to an overall minus sign, i.e.,
sin(nx/L) = sin(nx/L). Therefore the solutions with positive and negative n are not
linearly independent and so we only need to consider n > 0.
We will write the solutions X and corresponding to a given value of n with a subscript,
i.e., X
n
and
n
. The values of k and can be labeled in the corresponding way:
k
n
=
n
L
, (2.39)

n
= k
2
n
=
_
n
L
_
2
. (2.40)
(2.41)
We can now return to the equation for the time dependent portion of our product solution,
T. Using
n
= k
2
n
, this can be written
T

+k
2
n
T = 0 . (2.42)
This has the solution
T
n
(t) = e
k
2
n
t
= exp
_

n
2

2
t
L
2
_
, (2.43)
where again we use a subscript n to indicate the value of n used. We can therefore write the
product solutions
n
(x, t) = X
n
(x)T
n
(t) as

n
(x, t) = sin(k
n
x)e
k
2
n
t
. (2.44)
We now use the fact that our PDE is linear, which means that a linear combination of the
product solutions,
u(x, t) =

n=1
b
n

n
(x, t) , (2.45)
is also a solution. Furthermore, because we have imposed the homogeneous boundary conditions
on all of the
n
, the solution u(x, t) formed in this way will satisfy the same conditions for any
values of the coecients b
n
.
26 Lecture Notes on Mathematical Methods
We can now attempt to nd values of the b
n
such that the resulting u(x, t) satises the initial
conditions from Eq. (2.16), namely, u(x, 0) must be equal to some specied function f(x). That
is, we want to determine the b
n
so as to have
u(x, 0) =

n=1
b
n

n
(x, 0) =

n=1
b
n
sin(k
n
x)
= f(x) , (2.46)
where in the nal equality in the rst line above we used the fact that the time-dependent part
of the product solution, e
k
2
n
t
, is equal to unity at t = 0.
It is not obvious whether this approach will work for an arbitrary f(x) in the interval [0, L].
The remarkable fact is that for this problem, and many related ones that we will encounter later
in the course, it is indeed possible to nd coecients b
n
such that arbitrary initial conditions
can be satised. This is because the functions sin(nx/L) form what is called a complete set
of functions for the interval [0, L]. That is, an arbitrary function dened in this interval can
be expressed as a superposition of sines, which is what you have encountered previously when
studying Fourier series. We will return to this question in Chapter 5 where we will state more
precisely what conditions must be satised such that the product solutions
n
have this property.
2.3.4 Determining the coecients b
n
We now need a recipe for determining the values of the b
n
for a given initial value function f(x).
For this we can use the orthogonality relation
_
L
0
sin
_
nx
L
_
sin
_
mx
L
_
dx =
L
2

nm
, (2.47)
where n and m are arbitrary integers. Here we have used the Kronecker delta symbol, dened
as

mn
=
_
1 n = m,
0 otherwise.
(2.48)
The relation (2.47) can easily be veried by exploiting trigonometric identities (see Appendix B)
such as
sina sinb =
1
2
[cos(a b) cos(a + b)] . (2.49)
To nd values of the coecients b
n
for a given initial value function f(x) we multiply both
sides of Eq. (2.46) by sin(mx/L) and integrate from 0 to L:
_
L
0
f(x) sin
_
mx
L
_
dx =
L

n=1
b
n
_
L
0
sin
_
nx
L
_
sin
_
mx
L
_
dx . (2.50)
Introduction to PDEs 27
Here the integral of the sum has been rewritten as the sum of integrals, and the constant b
n
has
been pulled outside the integral. We can now use the orthogonality relation (2.47) which says
that the integral appearing in Eq. (2.50) is (L/2)
mn
, and thus when we carry out the sum from
n = 1 to innity, all of the
nm
will be zero for n = m, and only for the single term with n = m
do we obtain
mm
= 1. We therefore nd
b
n
=
2
L
_
L
0
f(x) sin
_
nx
L
_
dx , (2.51)
where for convenience we have renamed the index m back to n. So the nal answer for the
temperature of the rod as a function of position and time is given by
u(x, t) =

n=1
b
n
sin
_
nx
L
_
exp
_

_
n
L
_
2
t
_
, (2.52)
where the coecients b
n
are determined using Eq. (2.51) for an initial value of the temperature
given by f(x).
Equations (2.51) and (2.52) may seem hard to accept as a nal answer to our problem, in
that we need to do an innite number of integrals to nd all of the coecients b
n
, and then sum
an innite number of terms to nd the temperature. The situation is not as bad as it seems, as
will become clear when we look at some examples.
2.3.5 Examples
Suppose, for example, that the initial temperature of the rod is given as a function of position
by
f(x) = C sin
_
x
L
_
, (2.53)
where C is a constant with units of temperature. Using this f(x) in Eq. (2.51) we nd the
coecients b
n
to be
b
n
=
2
L
_
L
0
C sin
_
x
L
_
sin
_
nx
L
_
dx =
2
L
C
L
2

1n
. (2.54)
But the Kronecker symbol
1n
is only nonzero for n = 1, and therefore we nd b
1
= C and
all the other b
n
are zero. The innite sum thus only contains a single nonzero term, and the
temperature as a function of x and t is
u(x, t) = C sin
_
x
L
_
exp
_

L
_
2
t
_
. (2.55)
Of course this result may seem a bit contrived in that we obtain such a simple answer only
because we chose f(x) to be of the general form sin(nx/L) (with n = 1). What if we had a
constant initial temperature, i.e., f(x) = C? Our formula for the coecients b
n
is then
28 Lecture Notes on Mathematical Methods
b
n
=
2
L
_
L
0
C sin
_
nx
L
_
dx =
2C
L
L
n
cos
_
nx
L
_

L
0
=
_
_
_
0 n even ,
4C
n
n odd.
(2.56)
The sum of terms for u(x, t) therefore starts o like
u(x, t) =
4C

_
e
(/L)
2
t
sin
_
x
L
_
+
1
3
e
(3/L)
2
t
sin
_
3x
L
_
+
1
5
e
(5/L)
2
t
sin
_
5x
L
_
+ . . .
_
.
(2.57)
At t = 0 all of the exponential terms are equal to one, and so for the initial temperature prole,
which should just be u(x, 0) = C, we have
u(x, 0) =
4C

_
sin
_
x
L
_
+
1
3
sin
_
3x
L
_
+
1
5
sin
_
5x
L
_
+ . . .
_
. (2.58)
Such an innite sum is really only useful in practice if one can approximate it using a nite
number of terms. For this to work, each term should make an ever decreasing contribution to
the sum, and the more quickly the terms drop in size the better. In fact the coecients of each
sine term in Eq. (2.58) go as 1/n, which is to say that this sum will converge relatively slowly.
Furthermore it is not obvious that a sum of sines, even with an innite number of terms
will give u(x, 0) = C in 0 < x < L. But in fact this works, as is illustrated in Fig. 2.1. The
three curves in Fig. 2.1(a) show the calculated initial temperature u(x, 0) where the sums are
truncated after n = 3, 9 and 49 terms. Although the curves start to approximate a constant
function, there are still visible oscillations and an overshoot at x = 0 and x = L. As more
terms are included in the sum, the oscillations eventually disappear. Interestingly, however, the
overshoot at 0 and L, called the Gibbs phenomenon, persists even in the limit where the number
of terms becomes innite, although the width of the two spikes at each end becomes vanishingly
small. We will see this eect again in Chapter 4.
The rate of convergence improves, however, when we look at later times. As one can see
from Eq. (2.57), the exponential factor of the n
th
term in the sum is e
(n/L)
2
t
. At large t these
become small, and for larger n the rate at which they decrease is smaller still. That is, for any
given n, if we wait a time
t =
1

_
L
n
_
2
, (2.59)
then the exponential factor for that term will have dropped by e
1
of its initial value. And if
we wait, say, ve times this time, then the n
th
term will have gone down by e
5
0.0067. As
one can see from Eq. (2.59), this characteristic time itself decreases very rapidly for increasing
n. So at later times, the terms with larger n die o much more quickly and the partial sum
becomes a much better approximation. This is illustrated in Figs. 2.1(b)(f).
Introduction to PDEs 29
x
u
(
x
,
t
)
n = 3
n = 9
n = 49
t = 0
0 L
x
u
(
x
,
t
)
t = 1
0 L
x
u
(
x
,
t
)
t = 10
0 L
x
u
(
x
,
t
)
t = 100
0 L
x
u
(
x
,
t
)
t = 200
0 L
x
u
(
x
,
t
)
t = 500
0 L
(a) (b)
(c)
(d)
(e) (f)
Figure 2.1: Temperature of the rod at the times indicated (arbitrary units). For (a) the three curves
correspond to partial sums up to n = 3, 9 and 49; for (b)(f) the solutions have been computed up to
n = 49. The calculation uses L = 1, C = 1, = 0.001.
30 Lecture Notes on Mathematical Methods
2.3.6 Generalising the heated-rod problem
The problem of the heated-rod is extremely important for this course in that it contains elements
of many other areas that we will explore later on. For example, we have done the problem above
by using so-called Dirichlet boundary conditions, i.e., the value of the function u was specied at
two dierent points, x = 0 and x = L. Will will also look at other types of boundary conditions,
where the derivative of the function is used, or a combination of the function and its derivative.
The boundary conditions we considered were homogeneous, but we will also look at the case
of nonhomogeneous boundary conditions. We will see how to convert a problem of that sort into
one with homogeneous boundary conditions, which in general will have the eect of making the
PDE nonhomogeneous. We will also look at PDEs that are intrinsically nonhomogeneous, e.g.,
because of the presence of a source of heat in the rod.
A number of the elements of the problem we have done above will reappear in a similar way
in other problems. For example, the separated equation for the x-dependent part of our solution
above was (from Eq. (2.25)
d
2
dx
2
X = X . (2.60)
This is similar to the familiar problem of a matrix A and a vector y that may appear in an
eigenvalue problem:
Ay = y . (2.61)
Recall that when we multiply a matrix and a vector we get in general another vector, e.g.,
Au = v. But for certain special vectors, called the eigenvectors of A, multiplication by A gives
back a multiple of the original vector, as in Eq. (2.61), and the constant of proportionality is
called the eigenvalue.
The situation is similar with linear operators. We can view Eq. (2.60) as application of a
linear operator L = d
2
/dx
2
to a function X, which results in a multiple of the same function. So
we also call this an eigenvalue problem; X is called the eigenfunction and the eigenvalue.
1
In
our problem with the heated rod, the eigenfunctions were sin(nx/L), but we will see problems
later on with dierent operators and boundary conditions that result in dierent eigenfunctions.
We claimed without proof that the set of sine functions sin(nx/L) n = 1, 2, . . . has a crucial
property, namely, any function in 0 x L can be expressed as a superposition of terms
like sin(nx/L). Such a set of functions is said to be complete. In Chapter 5 we will see that
the eigenfunctions of a second-order dierential operator that satises certain requirements are
guaranteed to be orthogonal, to have real eigenvalues and to form a complete set, and this will
help us to solve a wide variety of problems.
1
Often we may have an equation of a slightly dierent but equivalent form, such as X

= X, i.e., there
might be a minus sign on the right-hand side. In such a case one usually still refers to as the eigenvalue.

You might also like