44
Last Update: April 4, 2011 Math 201 ES1 Winter 2010 Introduction to Partial Differential Equations Disclaimer: This lecture note tries to provide an alternative approach to the material in Sections 10.1 – 10.6 in the textbook. It is not a replacement of the textbook. Table of contents Introduction to Partial Differential Equations ................................ 1 1. Introduction ...................................................... 1 2. Separation of variables ............................................... 2 2.1. Separation of variables – the idea ..................................... 2 2.2. Eigenvalue problem .............................................. 3 2.3. Separation of variables – the method .................................. 7 3. Fourier series ..................................................... 11 3.1. Introduction .................................................. 11 3.2. Representation of general f ........................................ 12 3.3. Convergence of Fourier series ....................................... 18 3.4. Complex form of the Fourier series (10.3.36) .............................. 20 4. Fourier Cosine and Sine series .......................................... 20 5. The heat equation .................................................. 25 5.1. Heat equation with Neumann boundary condition .......................... 25 5.2. Heat equation with nonhomogeneous boundary condition ..................... 27 5.3. Heat equation with forcing ......................................... 28 5.4. Heat equation in higher dimensions ................................... 30 5.5. Uniqueness of solution ............................................ 32 6. Wave Equations ................................................... 32 6.1. Wave equations with x over a finite interval .............................. 34 6.2. Wave equations with −∞ <x< .................................... 43 1. Introduction. Unlike ordinary differential equations which describe the trajectory of one object as it moves, partial differential equations arise when people model mathematically the collective evolution of many objects. In the latter case, both the evolution in time and the interaction between different objects have to be taken into account, as a consequence, a typical partial differential equation involves both time derivative and spatial derivatives, for example the heat equation: ∂u ∂t (x,t)= β 2 u ∂x 2 (x,t), 0 <x<L, t> 0 (1) u(0,t)= u(L,t)=0, t> 0, (2) u(x, 0) = f (x), 0 < x < L. (3) This equation models the temperature change of a rod of length L. Here u(x, t) represents the tempera- ture at x at time t. The initial condition u(x, 0) = f (x) models the fact that at time t =0, the tempera- ture at x is f (x). For a partial differential equation, initial conditions alone is not enough. In the above heat equation, we also have boundary conditions u(0,t)= u(L, t)=0 which models the fact that the tem- perature at the two ends of the rod is fixed at 0. When instead of a rod we consider a higher dimensional object, then the heat equation reads (we omit the boundary and initial conditions here) ∂u ∂t = β u (4) where u is called the Laplacian of u, defined in two and three dimensions as u = 2 u ∂x 2 + 2 u ∂y 2 and u = 2 u ∂x 2 + 2 u ∂y 2 + 2 u ∂z 2 (5)

Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

  • Upload
    buihanh

  • View
    218

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Last Update: April 4, 2011Math 201 ES1 Winter 2010

Introduction to Partial Differential Equations

Disclaimer: This lecture note tries to provide an alternative approach to the material inSections 10.1 – 10.6 in the textbook. It is not a replacement of the textbook.

Table of contents

Introduction to Partial Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12. Separation of variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.1. Separation of variables – the idea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.2. Eigenvalue problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3. Separation of variables – the method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3. Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2. Representation of general f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.3. Convergence of Fourier series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.4. Complex form of the Fourier series (10.3.36) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

4. Fourier Cosine and Sine series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205. The heat equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.1. Heat equation with Neumann boundary condition . . . . . . . . . . . . . . . . . . . . . . . . . . 255.2. Heat equation with nonhomogeneous boundary condition . . . . . . . . . . . . . . . . . . . . . 275.3. Heat equation with forcing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285.4. Heat equation in higher dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305.5. Uniqueness of solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

6. Wave Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326.1. Wave equations with x over a finite interval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346.2. Wave equations with −∞<x <∞ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

1. Introduction.Unlike ordinary differential equations which describe the trajectory of one object as it moves, partial

differential equations arise when people model mathematically the collective evolution of many objects. Inthe latter case, both the evolution in time and the interaction between different objects have to be takeninto account, as a consequence, a typical partial differential equation involves both time derivative andspatial derivatives, for example the heat equation:

∂u

∂t(x, t) = β

∂2u

∂x2 (x, t), 0 < x < L, t > 0 (1)

u(0, t)= u(L, t)= 0, t > 0, (2)

u(x, 0) = f(x), 0 < x < L. (3)

This equation models the temperature change of a rod of length L. Here u(x, t) represents the tempera-ture at x at time t. The initial condition u(x, 0) = f(x) models the fact that at time t = 0, the tempera-ture at x is f(x). For a partial differential equation, initial conditions alone is not enough. In the aboveheat equation, we also have boundary conditions u(0, t) = u(L, t) = 0 which models the fact that the tem-perature at the two ends of the rod is fixed at 0.

When instead of a rod we consider a higher dimensional object, then the heat equation reads (we omitthe boundary and initial conditions here)

∂u

∂t= β △u (4)

where △u is called the Laplacian of u, defined in two and three dimensions as

△u=∂2u

∂x2+

∂2u

∂y2and △u =

∂2u

∂x2+

∂2u

∂y2+

∂2u

∂z2(5)

Page 2: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

respectively.

Remark 1. The Laplacian is the most important and most useful object in partial differential equations,both in theory and in applications. It appears whenever our equation models the evolution of a largenumber of objects – so large that their motion have to be assumed to be random. For example, suppose amillion ants are moving randomly inside a fixed region, then the density ρ(x, t) – the number of ants persay square meter – is governed by the two dimensional heat equation

∂ρ

∂t= β △ρ. (6)

Of course other terms can be added. Say there are aardvarks wondering around the region eating ants,then a “forcing” term should be added on the right hand side:

∂ρ

∂t= β △ρ + f(x, t) (7)

where f(x, t) describes how many ants are being eaten at location x at time t.

2. Separation of variables.

2.1. Separation of variables – the idea.How to solve PDEs? One approach is to reduce a PDE into ODEs. Let’s look at the one dimensional

heat equation∂u

∂t= β

∂2u

∂x2; u(0, t)= u(L, t)= 0; u(x, 0)= f(x). (8)

How do we reduce it to ODEs? Remember that the difference between an ODE and a PDE is that, theunknown function in an ODE has only one variable, while that in a PDE has more than one. So naturallywe try to “separate the variables”

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

and hope that X, T can be obtained by solving ODEs.

Substitute u= X T into the equation we obtain

X(x)T ′(t)= β X ′′(x) T (t). (10)

The two new unknown functions X, T are still coupled together. Fortunately, we can obtain a single equa-tion for each through the following technique:

We divide both sides by X T to obtain

T ′(t)

β T (t)=

X ′′(x)

X(x). (11)

Now the crucial observation is that, the left hand side depends only on t, while the right hand side isindependent of t – the only possibility is then both sides are constants.

Thus there is a constant λ such that

T ′(t)

β T (t)=λ;

X ′′(x)

X(x)=λ, (12)

or equivalently

T ′−λβ T = 0; X ′′−λX = 0. (13)

Viola! We have successfully decoupled X and T !

But wait a minute. There are some problems here:

1. X is subject to a second order ODE, and we know that second order ODEs need either two initialvalues or a pair of boundary values to make the solution unique. Which one and what are the con-ditions?

2. T is subject to a first order ODE, we need one initial value to solve it. In other words T (0)= ?

Page 3: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

3. What is λ after all?

Although we will spend most of the remaining lectures answering the above questions, we will try to sum-marize the answers there.

1. Recall that we have set u = X(x) T (t), and the boundary condition for the PDE is u(0, t) = u(L,

t)= 0. Substitute u by X T , we reach

X(0)T (t)= X(L)T (t)= 0 (14)

for all t. Thus it is reasonable to ask

X(0) =X(L)= 0. (15)

Thus the full ODE for X is

X ′′−λ X = 0; X(0)= X(L)=0. (16)

2. We try the same thing, the initial value for u suggests

X(x)T (0) = f(x). (17)

But this is not gonna work – The restriction on X is too severe! Put it another way, from this wereach

X(x) = f(x)/T (0) (18)

which means f(x) has to satisfy

f ′′−λ f =0 (19)

which is definitely not a reasonable requirement.The fix of this situation will be revealed in the section about separation of variable together

with the section about Fourier series.Note that in the following we will see that when solving the T equation, the exact value of T (0)

does not need to be specified.

3. Interestingly, the requirement that there are nonzero solutions (it is easily seen that X = 0 isalways a solution – unforunately a useless one) to

X ′′−λ X = 0; X(0)= X(L)= 0, (20)

excludes most values of λ. In other words, for most values of λ, the above ODE has only 0 solu-tion.

Now we start to explore in full details the answers.

2.2. Eigenvalue problem.Recall that to solve the heat equation

∂u

∂t= β

∂2u

∂x2; u(0, t)= u(L, t)= 0; u(x, 0)= f(x). (21)

we tried to find solutions of the form

u= X(x)T (t) (22)

and finally obtained the equation for X to be

X ′′−λ X = 0; X(0)= X(L)= 0, (23)

Our task is then to find nonzero (aka nontrivial) solutions. As we have mentioned, this is only possiblefor some values of λ, such λ’s are called eigenvalues for the system, and the corresponding nonzero solu-tions are called eigenfunctions.

Now we try to find out the eigenvalues/eigenfunctions. Recalling our theory of constant coefficientODEs, we write down the auxiliary equation

r2−λ =0. (24)

Page 4: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

There are three cases:

1. λ > 0. Then the general solution is

X = C1 e λ√

x + C2 e− λ√

x. (25)

Setting X(0) =X(L)= 0 we have

C1 + C2 = 0, (26)

e λ√

L C1 + e− λ√

L C2 = 0. (27)

Solving this we reach C1 = C2 = 0. Therefore for any λ > 0, the only solution is 0. In other words,none of λ > 0 is an eigenvalue.

2. λ = 0. The general solution is

X = C1 +C2 x. (28)

Setting X(0) =X(L)= 0 we reach

C1 = 0 (29)

C1 + C2 L = 0. (30)

Clearly the only possibility is again C1 = C2 = 0. Therefore 0 is not an eigenvalue either.

3. λ < 0. The general solution is

X =C1 cos(

−λ√

x)

+ C2 sin(

−λ√

x)

. (31)

The boundary conditions then give

C1 = 0 (32)

C1 cos(

−λ√

L)

+ C2 sin(

−λ√

L)

= 0. (33)

Thus we have

−λ√

L= n π� λ =−(

n π

L

)2. (34)

for any integer n. Note that ± n yield the same λ, and n = 0� λ = 0. So we should restrict therange of n to positive integers.

Summarizing, the eigenvalues to the problem

X ′′−λ X = 0; X(0)= X(L)= 0, (35)

are

λn =−(

n π

L

)2, n= 1, 2, (36)

The corresponding eigenfunctions are

Xn =C sin(

n πx

L

)

, n = 1, 2, (37)

where C is any nonzero constant.

Remark 2. Note that if X is an eigenfunction corresponding to an eigenvalue λ, then C X is also aneigenfunction corresponding to the same eigenvalue, for any C � 0.

We summarize: When solving

∂u

∂t= β

∂2u

∂x2; u(0, t)= u(L, t)= 0; u(x, 0)= f(x). (38)

by assuming u = X(x)T (t), the only possible nontrivial X’s are

CXn with Xn = sin(

n πx

L

)

, n = 1, 2, (39)

Page 5: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

where C is any nonzero constant.

Now we turn to solving eigenvalue problems. The general procedure is the following: Given an ODEwith a parameter λ,

1. Find the general solution.

2. Subject the general solution to the boundary values and determine the eigenvalues.

Example 3. (10.2.9) Find the eigenvalues and eigenfunctions of

y ′′+ λ y = 0, 0 <x <π; y(0) =0, y ′(π)= 0. (40)

Solution. The auxiliary equation is

r2 +λ =0. (41)

There are three cases.

1. λ > 0. We have

y = C1 cos(

λ√

x)

+ C2 sin(

λ√

x)

. (42)

Subject to the boundary conditions:

C1 = 0 (43)

− λ√

C1 sin(

λ√

π)

+ λ√

C2 cos(

λ√

π)

= 0 (44)

which reduces to

C2 cos(

λ√

π)

=0. (45)

We can take C2� 0 if and only if cos(

λ√

π)

= 0 or equivalently

λ√

π =

(

n +1

2

)

π, n = 0, 1,− 1, 2,− 2, (46)

This leads to

λ =

(

n +1

2

)2

, n =0, 1, 2, (47)

So λ =(n +1/2)2, n = 1, 2, are among the eigenvalues, and the corresponding eigenfunctions are

yn(x)= cn sin

((

n +1

2

)

x

)

, n = 0, 1, 2, (48)

2. λ = 0. The general solution is

y =C1 + C2 x. (49)

Subject to the boundary conditions:

C1 = 0 (50)

C2 = 0. (51)

Thus 0 is not an eigenvalue.

3. λ < 0. The general solution is

y =C1 e −λ√

x + C2 e− −λ√

x. (52)

Subject to boundary conditions,

C1 + C2 = 0 (53)(

−λ√

e −λ√

π)

C1 +(

− −λ√

e− −λ√

x)

C2 = 0. (54)

The only solution is C1 = C2 =0. Thus any λ < 0 is not an eigenvalue.

Page 6: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Summarizing, we have λ= (n + 1/2)2, n = 1, 2, are the eigenvalues, and the corresponding eigenfunctions

are

yn(x)= cn sin

((

n +1

2

)

x

)

, n = 0, 1, 2, (55)

Example 4. (10.2.11) Find the eigenvalues and eigenfunctions for

y ′′+ λ y = 0, 0 <x < 2 π; y(0)= y(2 π), y ′(0) = y ′(2 π). (56)

Solution. Again there are three cases.

1. λ > 0. The general solution is

y = C1 cos(

λ√

x)

+ C2 sin(

λ√

x)

. (57)

Subject to the boundary conditions we have

C1 = C1 cos(

2 λ√

π)

+ C2 sin(

2 λ√

π)

(58)

λ√

C2 = − λ√

C1 sin(

2 λ√

π)

+ λ√

C2 cos(

2 λ√

π)

. (59)

Re-arrange we have(

1− cos(

2 λ√

π))

C1− sin(

2 λ√

π)

C2 = 0 (60)

sin(

2 λ√

π)

C1 +(

1− cos(

2 λ√

π))

C2 = 0. (61)

or equivalently

(

1− cos(

2 λ√

π))

− sin(

2 λ√

π)

sin(

2 λ√

π) (

1− cos(

2 λ√

π))

(

C1

C2

)

= 0. (62)

To be able to have nonzero solution(

C1

C2

)� (

00

)

, the necessary and sufficient condition is

det

(

1− cos(

2 λ√

π))

− sin(

2 λ√

π)

sin(

2 λ√

π) (

1− cos(

2 λ√

π))

=0 (63)

which gives(

1− cos(

2 λ√

π))2

+ sin(

2 λ√

π)2

= 0 (64)

which reduces to

2− 2 cos(

2 λ√

π)

=0� cos(

2 λ√

π)

=1� 2 λ√

π = 2n π� λ = n2, n = 0, 1, 2, (65)

Thus from the case λ > 0 we obtain eigenvalues n2, n = 1, 2, 3, and eigenfunctions an cos(n x) +bn sin(n x).

2. λ = 0. The general solution is

y =C1 + C2 x. (66)

Subject to the boundary conditions:

C1 = C1 + C2 (2π) (67)

C2 = C2. (68)

This leads to C2 = 0 and puts no restriction on the value of C1. Thus 0 is an eigenvalue and thecorresponding eigenfunctions are y0 = a0 for arbitrary a0.

3. λ < 0. The general solution is

y =C1 e −λ√

x + C2 e− −λ√

x. (69)

Page 7: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Subject to boundary conditions:

C1 +C2 = C1 e2 −λ√

π + C2 e−2 −λ√

π (70)

−λ√

C1− −λ√

C2 = −λ√

C1 e2 −λ√

π − −λ√

C2 e−2 −λ√

π. (71)

Canceling −λ√

from the second equation, we obtain

C1−C2 =C1 e2 −λ√

π −C2 e−2 −λ√

π. (72)

Now adding this to the first equation and subtract this from the first equation, we obtain

C1 = C1 e2 −λ√

π (73)

C2 = C2 e−2 −λ√

π (74)

If(

C1

C2

)� (

00

)

, then either

1= e2 −λ√

π (75)

or

1 = e−2 −λ√

π. (76)

Either case, we have λ = 0 which is outside the case under current discussion. In other words, thereis no negative eigenvalue.

Summarizing, the eigenvalues are 0, n2, n= 1, 2, 3, with corresponding eigenfunctions

y0 = a0, yn = an cos(n x) + bn sin(n x), n = 1, 2, 3, (77)

where a0, an, bn are arbitrary constants.

2.3. Separation of variables – the method.Recall our main result from last section: When solving

∂u

∂t= β

∂2u

∂x2; u(0, t)= u(L, t)= 0; u(x, 0)= f(x). (78)

by assuming u = X(x)T (t), the only possible nontrivial X’s are

CXn with Xn = sin(

n πx

L

)

, n = 1, 2, (79)

where C is any nonzero constant.

There is a negative way of looking at this result: If f(x) � C Xn for some n and some C, there is noway that the solution to the PDE can be written as X(x) T (t). In other words, few problems can besolved by setting u = XT .

What saves the day is the following idea: Given a PDE, although it is not possible for u = X T , is itpossible that u is a sum of solutions of the type X T? Somewhat suprisingly, this idea works for a largeclass of PDEs: Linear PDEs.

A PDE is linear if linear combinations of solutions are still solutions. For example, consider our heatequation

∂u

∂t= β

∂2u

∂x2; u(0, t)= u(L, t)= 0; u(x, 0)= f(x). (80)

If u1, u2, , uk solves the above problem with initial values f1(x), , fk(x), then it is easy to verify thatc1 u1 + + ck uk solves the above problem with initial value c1 f1 + + ck fk.

We now can state the following method of separation of variables. The method consists of severalsteps: Given a linear PDE,

1. Separate the variables: u(x, t) =X(x)T (t).

2. Solve the eigenvalue problem to obtain all eigenfunctions Xn.

3. Solve the corresponding Tn.

Page 8: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

4. Write

u(x, t)=∑

an Xn Tn. (81)

5. Determine an through

f(x)= u(x, 0)=∑

an Xn Tn(0). (82)

Example 5. (10.2.15) Consider the heat flow problem

∂u

∂t= β

∂2u

∂x2; u(0, t)= u(L, t)= 0; u(x, 0)= f(x). (83)

with β =3, L =π, f(x)= sinx− 6 sin 4 x. Solve it using separation of variables.Solution.

1. Separate the variables.Write u =X(x)T (t). We reach

T ′ X = 3X ′′T� T ′

3 T=

X ′′

X= λ. (84)

The equations for X and T are then

X ′′−λ X = 0; X(0)= X(π) =0; (85)

T ′− 3λ T = 0; (86)

The value of T (0) does not need to be specified.

2. Solve the eigenvalue problem.

X ′′−λ X = 0; X(0)= X(π) =0; (87)

We discuss the three cases:

i. λ > 0. We have

X = C1 e λ√

x + C2 e− λ√

x. (88)

Subjecting to boundary conditions, we have

C1 +C2 = 0 (89)

C1 e λ√

π + C2e− λ√

π = 0. (90)

We quickly see that no solution except C1 = C2 = 0 exists.

ii. λ= 0. We have

X = C1 + C2 x (91)

which subjecting to boundary conditions gives

C1 = 0, (92)

C1 + C2 π = 0. (93)

It is clear that C1 = C2 = 0.

iii. λ < 0. The general solution is

X =C1 cos(

−λ√

x)

+ C2 sin(

−λ√

x)

. (94)

Subjecting to boundary conditions,

C1 = 0, (95)

C1 cos(

−λ√

π)

+ C2 sin(

−λ√

π)

= 0. (96)

which gives

C1 = 0, C2 sin(

−λ√

π)

= 0. (97)

Page 9: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Therefore nonzero solution exists if and only if sin(

−λ√

π)

= 0, or

λ = λn =−n2, n= 1, 2, 3, . (98)

Summarizing, the eigenvalues are

λn =−n2, n = 1, 2, 3, (99)

with corresponding eigenfunctions

Xn = cn sin(n x), n = 1, 2, 3, (100)

3. With λn obtained, the equation for Tn becomes

Tn′ − 3λn T = 0 (101)

or

Tn′ + 3n2 T = 0. (102)

The solution is given by

Tn(t)= Tn(0) e−3n2t. (103)

4. Now we write

u(x, t)=∑

n=1

Tn(0) cn e−3n2t sin(n x). (104)

From this it is clear that Tn(0) cn can be treated as one single arbitrary constant – the exact valueof Tn(0) never needs to be explicitly found out! Thus we write

u(x, t)=∑

n=1

cn e−3n2t sin(n x). (105)

and will use the initial value to find out cn’s.

5. Equate

sinx− 6 sin 4x = f(x)= u(x, 0)=∑

n=1

cn sin(n x). (106)

One reasonably conclude1 that

c1 =1, c4 =− 6, c2 = c3 = c5 = = 0. (108)

Finally we see that the solution to the problem is given by

u(x, t) = e−3t sinx− 6 e−48t sin 4 x. (109)

Example 6. (10.2.23) Find the formal solution to the heat flow problem

∂u

∂t=2

∂2u

∂x2; u(0, t)= u(1, t)= 0; u(x, 0) = f(x)=

n=1

∞1

n2sinn πx. (110)

Solution.

1. Separate the variables. Write u(x, t)= X(x)T (t), we reach

T ′X = 2X ′′T� T ′

2 T=

X ′′

X= λ. (111)

2. Solve the eigenvalue problem

X ′′−λX =0, X(0)= X(1) =0. (112)

1. Clearly some theory is needed here. For example, why should the representation

sinx− 6 sin4 x=∑

n=1

cn sin(n x) (107)

be unique?

Page 10: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

The discussion is almost identical to that of the above problem so we omit it here. The eigenvaluesare λn =− (n π)

2, n = 1, 2, 3, with eigenfunctions sin(n πx).

3. Solve the equation for Tn:

Tn′ + 2 (n π)

2Tn = 0 (113)

which gives

Tn(t)= Tn(0) e−2(nπ)2t. (114)

4. The solution is then represented as

u(x, t)=∑

n=1

cn e−2(nπ)2t sin(n πx). (115)

5. The initial value suggests∑

n=1

∞1

n2sinn π x=

n=1

cn sin(n π x) (116)

which gives

cn =1

n2. (117)

The solution is then given by

u(x, t)=1

n2e−2(nπ)

2t sin(n πx). (118)

Example 7. (10.2.19) Solve the vibrating string problem

∂2u

∂t2= α2 ∂2u

∂x2, 0< x < L, t > 0; u(0, t)= u(L, t)= 0, u(x, 0) = f(x),

∂u

∂t(x, 0)= g(x) (119)

with

α = 3, L =π, f(x)= 3 sin 2 x+ 12 sin 13 x, g(x)= 0. (120)

Solution.

1. Separate the variables. Write u(x, t)= X(x)T (t). Substitute into the equation, we have

T ′′X = 9 X ′′T� T ′′

9T=

X ′′

X. (121)

As the LHS is dependent only on t and the RHS is independent of t, both ratios must be equal toa same constant λ. Thus the equations for X and T are

X ′′−λX =0, X(0)= X(π)= 0; (122)

T ′′− 9 λT =0. (123)

Similar to the heat equation case, there is no need to specify the initial values T (0), T ′(0).

2. Solve the eigenvalue problem

X ′′−λX =0, X(0)= X(π)= 0; (124)

This is the same problem as appeared in our heat equation example. The eigenvalues and eigen-functions are

λ=−n2, Xn = cn sin(n x), n= 1, 2, (125)

3. Solve the T equation

Tn′′− 9 λn Tn = 0. (126)

Substitute λ=−n2, we have

Tn′′+ 9n2 Tn = 0 (127)

which solution is

Tn(t) =An cos(3n t) +Bn sin(3 n t). (128)

Page 11: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

4. Write down u(x, t):

u(x, t)=∑

n=1

[An cos(3n t)+ Bn sin(3 n t)] cn sin(n x). (129)

It is clear that the constant cn can be absorbed by An and Bn. Thus we have

u(x, t)=∑

n=1

[An cos(3 n t)+ Bn sin(3n t)] sin(n x). (130)

5. To apply the initial values, we compute

u(x, 0)=∑

n=1

An sin(n x) (131)

and∂u

∂t(x, 0)=

n=1

3 n Bn sin(n x). (132)

Now compare with the initial values:

3 sin 2 x+ 12 sin 13 x =∑

n=1

An sin(n x), (133)

0 =∑

n=1

3 nBn sin(n x). (134)

We reasonably conclude that

A2 =3, A13= 12, An = 0 n� 2, 13; Bn = 0 for all n. (135)

Finally the solution is given by

u(x, t)= 3 cos(6 t) sin(2x)+ 12 cos(39 t) sin(13x). (136)

Now what if the initial value f is not given as an explicit sum of eigenfunctions? Can we still carry outseparation of variables? The answer is yes, guaranteed by the theory of Fourier series (and more generallyby the theory of Sturm-Liouville problems).

3. Fourier series.

3.1. Introduction.We have seen the execution of the method of separation of variables.

1. Separate the variables: u(x, t) =X(x)T (t).

2. Solve the eigenvalue problem to obtain all eigenfunctions Xn.

3. Solve the corresponding Tn.

4. Write

u(x, t) =∑

an Xn Tn. (137)

5. Determine an through

f(x)= u(x, 0) =∑

an Xn Tn(0). (138)

In the final step, we need to determine the coefficients an by “expanding” the initial value f(x) into a(possibly infinite) linear combination of the eigenfunctions Xn. In our previous examples, we have onlydealt with f already written into such combinations. Naturally one would like to ask the following ques-tions:

1. How about general f? Can we always write f =∑

an Xn, where Xn are eigenfunctions?

2. As the summation may be infinite, what do we mean by∑

an Xn?

The answers to the two questions form the core of the theory of Sturm-Liouville problems, to which thetheory of Fourier series is a special case.

Page 12: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Definition 8. A Fourier series is the infinite sum

a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n π x

T

}

. (139)

We notice the following:

• This can be written asa0

2X0 +

n=1

{an Xn + bn Yn} (140)

where X0, Xn, Yn are all the eigenfunctions of the problem

X ′′+ λX =0, X(0)= X(2T ), X ′(0) =X ′(2T ). (141)

• If

f =a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n πx

T

}

(142)

in any reasonable interpretation, then f(x) = f(x + 2 T ). That is f has to be a periodic function ofperiod 2 T . In other words, the most we can expect from a Fourier series as presented here is thatit can represent most periodic functions. As we will see soon, this expectation is fulfilled.

In the following we will answer the two questions one by one:

1. How about general f? Can we always write f =∑

an Xn, where Xn are eigenfunctions?

2. As the summation may be infinite, what do we mean by∑

an Xn?

3.2. Representation of general f .Given an arbitrary function f – with the only restriction that it is periodic with period 2 T , for what

a0, an, bn is there any hope to say

f(x)=a0

2+∑

n=1

∞{

an cosn π x

T+ bn sin

nπ x

T

}

? (143)

At first look this is a totally nonsensical question: We are given one single equation with infinitely manyunknowns and are asked to solve it!

However, looking at it a bit longer, one realizes that we are given not “one single” equation, butinfinitely many – fix the value of x and we obtain one equation, and the equality has to hold for all x!

Although there are infinitely many equations, but they are quite hard to analyze. To simplify the situ-ation, we try to get rid of the functions and replace them by numbers. This is fulfilled through “weightedintegration”. That is, we multiply the equation by appropriate functions and then integrate.

Knowledge from linear algebra tells us that we need the same number of equations as the unknowns tomake the system uniquely solvable. Thus we need to find the same number of “appropriate functions” asthe unknowns. Notice that each unknown is “paired” with an eigenfunction:

a0

2with 1, an with cos

n πx

T, bn with sin

n πx

T. (144)

So naturally we try these guys.

• First we multiply the equation by 1 and integrate from −T to T .∫

−T

T

f(x) dx =

−T

T a0

2+∑

n=1

∞{

an cosn π x

T+ bn sin

n π x

T

}

dx

=

−T

T a0

2dx +

n=1

∞{

an

−T

T

cosn πx

Tdx + bn

−T

T

sinn πx

Tdx

}

= a0 T . (145)

So we have

a0 =1

T

−T

T

f(x) dx. (146)

Page 13: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

• Next we multiply the equation by cosm π x

Tfor some 16 m <∞ and integrate from −T to T .

−T

T

f(x) cosm π x

Tdx =

−T

T[

a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n π x

T

}

]

cosm πx

Tdx

=

−T

T a0

2cos

m πx

Tdx +

n=1

∞ ∫

−T

T

an cosn πx

Tcos

m πx

Tdx

+∑

n=1

∞ ∫

−T

T

bn sinn π x

Tcos

m π x

Tdx. (147)

We evaluate them one by one:

◦ First term.∫

−T

T a0

2cos

m π x

Tdx =

a0

2

T

m πsin

m πx

TN −TT = 0; (148)

◦ Second term.∫

−T

T

an cosn π x

Tcos

m π x

Tdx =

−T

T an

2

[

cos

(

(n +m)πx

T

)

+ cos

(

(n−m)π x

T

)]

dx

=

−T

T an

2cos

(

(n + m)π x

T

)

dx +

+

−T

T an

2cos

(

(n−m) πx

T

)

dx. (149)

Now the first term is evaluated similar to the a0 case:∫

−T

T an

2cos

(

(n + m)π x

T

)

dx =a0

2

T

(m + n)πsin

(m + n)πx

TN −TT = 0. (150)

For the second term, there are two cases.

1. n= m. In this case∫

−T

T an

2cos

(

(n−m)π x

T

)

dx =

−T

T am

2dx= am T . (151)

2. n� m. In this case

−T

T an

2cos

(

(n−m)π x

T

)

dx=a0

2

T

(m−n)πsin

(m−n) πx

TN −TT =0. (152)

Summarizing, we have∫

−T

T

an cosn π x

Tcos

m πx

Tdx =

{

Tam n = m

0 n� m. (153)

◦ Last term.∫

−T

T

bn sinn π x

Tcos

m π x

Tdx=

bn

2

−T

T

sin

(

(n + m)π x

T

)

+ sin

(

(n−m)π x

T

)

dx (154)

Similar to the previous case we finally reach

−T

T

bn sinn πx

Tcos

m πx

Tdx= 0. (155)

Putting things together, we have

−T

T

f(x) cosm πx

Tdx = Tam� am =

1

T

−T

T

f(x) cosm πx

Tdx. (156)

Page 14: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

• Finally multiply both sides by sinm π x

Tand integrate, we reach

bm =1

T

−T

T

f(x) sinm π x

Tdx. (157)

So our plan was successful!

Definition 9. Let f be a piecewise continuous function on the interval [− T , T ]. The Fourier series of

f is the trignometric series

f(x)∼ a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n πx

T

}

(158)

with an, bn given by

an =1

T

−T

T

f(x) cosnπ x

Tdx. n = 0, 1, 2, (159)

bn =1

T

−T

T

f(x) sinn πx

Tdx. n =1, 2, (160)

Remark 10. Note that we applied many times “termwise integration”∫

fk�∑

fk (161)

in the above calculation. In calculus we know that this is not automatically true. In our situation, thisfact puts restriction on what we mean by

f =a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n πx

T

}

(162)

in a reasonable way – This “reasonable way” has to allow termwise integration! The symbol “ ∼ ” is used,instead of = , also emphasizes this fact.

Remark 11. In the above calculation, we have used the following relations:∫

−T

T

cosn πx

Tcos

m π x

Tdx=

{

T n= m

0 n� m, (163)

−T

T

sinn πx

Tcos

m π x

Tdx= 0, (164)

−T

T

sinn πx

Tsin

m πx

Tdx =

{

T n = m

0 n� m, (165)

These are called “orthogonality conditions”.In general, if Xn are eigenfunctions of an eigenvalue problem defined by a second order ODE over [a,

b], we have∫

a

b

Xm Xn w dx= 0 (166)

whenever n� m. Here w > 0 is a particular “weight function”.

Remark 12. The interval [ − T , T ] can be replaced by any one period. In other words, instead of∫

−T

T

we can use∫

0

2T,∫

−T −100

T −100, etc.2

Example 13. (10.3.9) Compute the Fourier series for

f(x)= x, − π < x < π. (167)

2. Of course, in the exercises or exams, the function f is always only explicitly given over one period, so we have to usethat particular period. For example, if the problem says, f = x for 0 < x < 2 T and is periodic with period 2 T and blah blah,

then we should replace∫

−T

Tby

0

2Tin all the formulas.

Page 15: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Solution. Note that what’s implicit here is that f is periodic with period 2 π � T = π. We computeeach of the coefficients.

• First

a0 =1

π

−π

π

xdx= 0; (168)

• Next

an =1

π

−π

π

x cos(n x) dx

=1

n π

−π

π

x dsin(n x)

=1

n π

[

x sin(nx) N −ππ −

−π

π

sin(n x) dx

]

= 0. (169)

• Finally

bn =1

π

−π

π

x sin(n x) dx

= − 1

n π

−π

π

x dcos(n x)

= − 1

n π

[

x cos(n x) N −ππ −

−π

π

cos(n x) dx

]

= − 1

n π

[

π (− 1)n− (− π) (− 1)

n]

= − 2 (− 1)n

n

=2 (− 1)

n+1

n. (170)

Summarizing, we have

f(x)∼∑

n=1

∞2 (− 1)

n+1

nsin(n x). (171)

Remark 14. The above calculation can be significantly simplified if we consider the even/oddness of thefunctions.

A function f(x) is even if f(x) = f( − x) for all x, while it is odd if f(x) = − f( − x) for all x. Animportant property is that

−T

T

f(x) g(x)= 0 (172)

if one of f , g is even and the other odd. Furthermore, for a periodic function f with period 2 T , if f(x) =f(−x) for 06 x6 T then f is even, and similar result holds for f odd.

Application of this property to the calculation of Fourier series is immediate after we notice thatcos( n π x

T

)

is even while sin( n π x

T

)

is odd. Thus in the above example, as f(x) = x is odd, we immediately

reach

an =1

π

−π

π

x cos(n x) dx= 0. (173)

Example 15. (10.3.11) Compute the Fourier series for

f(x) =

{

1 − 2< x < 0x 0 <x < 2

. (174)

Solution. This time the period is 2 andn π x

Tbecomes

n π x

2. We compute

• first

a0 =1

2

−2

2

f(x) dx =1

2

−2

0

dx+1

2

0

2

x dx =2� a0

2= 1; (175)

Page 16: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

• next

an =1

2

−2

2

f(x) cos(

n πx

2

)

dx

=1

2

−2

0

cos(

n π x

2

)

dx+1

2

0

2

x cos(

n π x

2

)

dx

=1

n πsin(

n πx

2

) N −20 +

1

n π

0

2

xdsin(

n πx

2

)

= 0+1

n π

[

x sin(

n π x

2

) N 02− ∫0

2

sin(

n πx

2

)

dx

]

=1

n π

2

n πcos(

n π x

2

) N 02=

2

(nπ)2[

(− 1)n− 1

]

; (176)

• and finally

bn =1

2

−2

2

f(x) sin(

nπ x

2

)

dx

=1

2

−2

0

sin(

n π x

2

)

dx +1

2

0

2

x sin(

n πx

2

)

dx

= − 1

n πcos(

n πx

2

) N −20 − 1

n π

0

2

xdcos(

n πx

2

)

= − 1

n π[1− cos(−nπ)]− 1

n π

[

x cos(

n πx

2

) N 02−∫0

2

cos(

n π x

2

)

dx

]

=1

n π

[

(− 1)n− 1

]

− 1

[

2 (− 1)n − 2

n πsin(

n πx

2

) N 02 ]= − 1

n π

[

(− 1)n + 1

]

. (177)

Summarizing, we have

f(x)∼ 1+∑

n=1

∞2

(n π)2[

(− 1)n − 1

]

cos(

n πx

2

)

− 1

n π

[

(− 1)n + 1

]

sin(

n π x

2

)

. (178)

Remark 16. More generally, any set of nonzero functions {fn}n=1∞ satisfying, for some w > 0

a

b

fm fn w dx =0 whenever n� m (179)

is said to be an orthogonal system with respect to weight w on the interval [a, b].If furthermore we have

a

b

fn2 w dx= 1, n = 1, 2, 3, (180)

then {fn} is called an orthonormal system.The main property of an orthogonal system is that if

f(x)∼ c1 f1 + c2 f2 + (181)

then the coefficients can be determined through

cm =

f(x) fm(x) w(x) dx∫

fm2 (x) dx

. (182)

Example 17. (10.3.26, 10.3.27) Show that the set of functions{

cosπ

2x, sin

π

2x, , cos

(2 n− 1)π

2x, sin

(2 n− 1)π

2x,} (183)

Page 17: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

is an orthonormal system on [− 1, 1] with respect to the weight function w(x)≡ 1.Then find the orthogonal expansion for

f(x)=

{

0 − 1 < x < 01 0< x < 1

(184)

in terms of this orthonormal system.Solution.

• Verify orthonormality.

1. Integrating product of different functions gives 0.We compute for n� m, n, m = 1, 2, (note that w =1)∫

−1

1

cos(2n− 1)π x

2cos

(2 m− 1)πx

2· 1 dx =

1

2

−1

1

cos((n + m− 1)πx) dx

+1

2

−1

1

cos((n−m)π x) dx (185)

As neither n + m− 1 nor n−m is zero, we have∫

−1

1

cos((n + m− 1)π x) dx=1

(n +m− 1)πsin((n +m− 1) πx) N −1

1 =0, (186)

−1

1

cos((n−m)πx) dx =1

(n−m)πsin((n−m) πx) dx = 0. (187)

Similarly we compute∫

−1

1

sin(2n− 1)π x

2sin

(2m− 1) πx

2· 1 dx= 0 (188)

for n� m.Finally we can compute

−1

1

cos(2 n− 1)πx

2sin

(2 m− 1)π x

2· 1 dx =0 (189)

Note that this time n= m is OK.

2. Integrating the square of any function in the list gives 1.We compute

−1

1 (

cos(2 n− 1)πx

2

)2

· 1 dx =1

2

−1

1

[1+ cos((2 n− 1)πx)] dx= 1. (190)

Similarly we have∫

−1

1 (

sin(2 n− 1)πx

2

)2

dx = 1. (191)

Thus the set of functions is an orthonormal system.

• Orthogonal expansion for

f(x)=

{

0 − 1 < x < 01 0< x < 1

(192)

Recall that if

f(x)∼ c1 f1 + c2 f2 + (193)

then the coefficients can be determined through

cm =

f(x) fm(x) w(x) dx∫

fm2 (x) dx

. (194)

In case of our system we write

f(x)=∑

n=1

∞ {

an cos(2n− 1) πx

2+ bn sin

(2 n− 1)π x

2

}

(195)

Page 18: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

and compute

an =

−1

1

f(x) cos(2 n− 1)πx

2dx

=

0

1

cos(2 n− 1)π x

2dx

=2

(2 n− 1)πsin

(2 n− 1)πx

2N 01

=2

(2 n− 1)πsin(n π −π/2)

=2 (− 1)

n+1

(2 n− 1)π. (196)

and

bn =

−1

1

f(x) sin(2n− 1)π x

2dx

=

0

1

sin(2n− 1) πx

2dx

= − 2

(2 n− 1)πcos

(2n− 1) πx

2N 01

=2

(2 n− 1)π. (197)

Thus finally we have

f(x)∼∑

n=1

∞2

(2n− 1)π

[

(− 1)n+1 cos

(2 n− 1)πx

2+ sin

(2n− 1) πx

2

]

. (198)

3.3. Convergence of Fourier series.

Theorem 18. (Pointwise convergence) If f and f ′ are piecewise continuous on [ − T , T ], and let f

has Fourier expansion

f(x)∼ a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n πx

T

}

(199)

then we have

a0

2+∑

n=1

∞{

an cosn π x

T+ bn sin

nπ x

T

}

=1

2

[

f(

x+)

+ f(

x−)]

. (200)

In particular, at x=±T, we have

a0

2+∑

n=1

∞{

an cosn π x

T+ bn sin

n πx

T

}

=1

2

[

f(

−T+)

+ f(

T−)]

. (201)

Remark 19. Recall that a function is “piecewise continuous” on [a, b] if it is continuous at every point in

[a, b] except possibly for a finite number of points at which f has a “jump discontinuity”, that is f(

x+)

,

f(

x−)

both exist but are not equal.

Recall that

f(

x+)

= limh>0,h→0

f(x+ h), f(

x−)

= limh<0,h→0

f(x + h)= limh>0,h→0

f(x− h). (202)

Remark 20. In particular, for functions specified in the theorem, we have

f(x)=a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n πx

T

}

(203)

whenever f is continuous at x.

Page 19: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Example 21. (10.3.17) Consider the Fourier series for f(x) with period 2 π and f(x) = x for − π < x <

π. f is continuous for − π < x < π but f(π − ) = π � − π = f(− π + ). As a consequence its Fourier serieswill converge to f with period 2 π and

f (x)=

{

x −π < x < π

0 x=±π(204)

Example 22. (10.3.19) Consider the Fourier series for f(x) with period 4 and

f(x) =

{

1 − 2< x < 0x 0 <x < 2

. (205)

We see that f is continuous for − 2 < x < 0 and 0 < x < 2, while has jump discontinuity at − 2, 0, 2. As aconsequence its Fourier series converges to f with period 4 and

f (x)=

1 − 2< x < 01/2 x= 0x 0< x < 23/2 x=± 2

. (206)

Remark 23. (Gibbs phenomenon, 10.3.39) When jump discontinuities are present, the convergencearound them suffers from the so-called “Gibbs phenomenon”, that is, the partial sum

a0

2+∑

1

N{

an cosn πx

T+ bn sin

n π x

T

}

(207)

always overshoot f by approximately 9% of the size of the jump. As a consequence the convergence is notuniform – which means it may be misleading to use the graph of the partial sum as an indicator of whatthe actually function looks like.

Gibbs phenomenon disappears as soon as the function is continuous everywhere. In fact, in this casethe convergence is uniform:

Theorem 24. (Uniform convergence of Fourier series) Let f be a continuous functions on ( − ∞,

∞) and periodic of period 2 T. If f ′ is piecewise continuous on [−T , T ], then the Fourier series for f con-verges uniformly to f on [ − T , T ] and hence on any interval. That is, for each ε > 0, there exists aninteger N0 (that depends on ε) such that

f(x)−[

a0

2+∑

1

N{

an cosn πx

T+ bn sin

n πx

T

}

]∣

< ε (208)

for all N >N0 and all x∈ (−∞,∞).

For f with appropriate continuity/smoothness, we can differentiate and integrate term by term.

Theorem 25. (Differentiation and Integration)

• Let f(x) be continuous on (−∞,∞) and 2 T-periodic. Let f ′(x) and f ′′(x) be piecewise continuouson [ − T , T ]. Then the Fourier series of f ′(x) can be obtained from that of f through termwise dif-ferentiation.

• Let f(x) be piecewise continuous on [−T , T ]. Then we can integrate its Fourier series termwise.

Remark 26. Note that the integration of a Fourier series is not a Fourier series anymore.

Example 27. (10.3.25 b)) Find the functions represented by the series obtained by the termwise inte-gration of the given series from −π to x.

4

π

n=0

∞sin(2 n +1)x

(2n + 1)∼ f(x) (209)

Page 20: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

with

f(x) =

{

− 1 −π < x < 01 0< x < π

. (210)

Solution. We know that the integrated series represents

−π

x

f(x) dx =

−π

x

− 1 dx − π < x < 0

−π

0

− 1 dx+

0

x

dx 0 < x < π

=

{

− (x + π) − π < x < 0− π + x 0 <x <π

= |x| −π. (211)

3.4. Complex form of the Fourier series (10.3.36).Recall that eiθ = cosθ + sinθ which leads to

cosθ =eiθ + e−iθ

2, sin θ =

eiθ − e−iθ

2 i. (212)

Thus we can write

a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n πx

T

}

=a0

2+∑

n=1

∞an

2

(

ei

nπx

T + e−i

nπx

2

)

+∑

n=1

∞bn

2 i

(

ei

nπx

T − e−i

nπx

2

)

=a0

2+∑

n=1

∞an − i bn

2e

inπx

T +an + i bn

2e−i

nπx

T . (213)

If we set c0 =a0

2, cn =

an − i bn

2, c−n =

an + i bn

2for n = 1, 2, 3, then we have

a0

2+∑

n=1

∞{

an cosn πx

T+ bn sin

n πx

T

}

=∑

−∞

cn ei

nπx

T . (214)

Now we compute

cn =an − i bn

2=

1

2 T

−T

T

f(x)[

cosn π x

T− i sin

n π x

T

]

dx=1

2 T

−T

T

f(x) e−i

nπx

T dx, (215)

and similarly

c−n =1

2 T

−T

T

f(x) ei

nπx

T . (216)

Summarizing, we have the complex Fourier series:

f(x)∼∑

−∞

cn ei

nπx

T , cn =1

2 T

−T

T

f(x) e−i

nπx

T dx. (217)

4. Fourier Cosine and Sine series.

Definition 28. Let f(x) be piecewise continuous on the interval [0, T ]. The Fourier cosine series of f

isa0

2+∑

n=1

an cosn πx

T, (218)

where

an =2

T

0

T

f(x) cos(

n πx

T

)

dx, n = 0, 1, (219)

while the Fourier sine series of f is∑

n=1

bn sinnπ x

T. (220)

where

bn =2

T

0

T

f(x) sin(

n πx

T

)

dx, n = 1, 2, 3, (221)

Page 21: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

From the looks we are tempted to say that a Fourier cosine series is “half” of a Fourier series, and aFourier sine series is “the other half”. In some sense this is indeed true, as we will see now.

Consider a function f defined on the interval [0, T ]. We now extend it to a periodic function withperiod 2T in two ways.

1. We first extend f evenly,

fe(x)=

{

f(x) 0< x < T

f(− x) −T < x < 0(222)

and then extend fe(x) to a 2 T -periodic function fe(x). Now consider the Fourier series of fe. Wecompute

a0 =1

T

−T

T

fe(x) dx=1

T

0

T

f(x) dx +1

T

−T

0

f(− x) dx=2

T

0

T

f(x) dx. (223)

an =1

T

−T

T

fe(x) cosn πx

Tdx

=1

T

0

T

f(x) cosn πx

Tdx +

1

T

−T

0

f(− x) cosn π x

Tdx

=2

T

0

T

f(x) cosn πx

Tdx. (224)

bn =1

T

−T

T

fe(x) sinn πx

Tdx =0 (225)

as fe is even, sinn π x

Tis odd, and the integration is on an interval symmetric with respect to 0.

Thus the Fourier series for fe is

fe∼a0

2+∑

n=1

an cosn πx

T, an =

2

T

0

T

f(x) cos(

n π x

T

)

dx, n =0, 1, (226)

which is exactly the Fourier cosine series of f .

2. We first extend f oddly,

fo(x) =

{

f(x) 0< x < T

− f(−x) −T < x < 0(227)

and then extend fo(x) to a 2 T -periodic function fo(x). Similar to the even extension case, we con-

clude that the Fourier series for fo is exactly the Fourier sine series for f .

Remark 29. An alternative way to understand Fourier cosine and sine series is the following. We noticethe following facts:

• The eigenfunctions for the problem

X ′′−λ X = 0, X(0)= X(T )= 0 (228)

are exactly

sinn πx

T, n= 1, 2, 3, (229)

• The eigenfunctions for the problem

X ′′−λX =0, X ′(0)= X ′(T ) =0 (230)

are exactly

cosn πx

T, n =0, 1, 2, 3, (231)

The general theory of eigenvalue problems guarantees that the set of eigenfunctions form an orthogonalsystem. Thus

{

sinn π x

T

}

is an orthogonal system over [0, T ] with weight w(x) ≡ 1 and so is{

cosn π x

T

}

.

Now recall the property of orthogonal systems:

Page 22: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

If {fn} is an orthogonal system over [a, b] with weight w(x), then any function f definedover [a, b] can be expanded into

f(x)∼∑

cn fn (232)

with

cn =

a

b

f(x) fn(x)w(x) dx

a

b

fn(x)2 w(x) dx

. (233)

When we apply this theory to{

sinn π x

T

}

we obtain

f(x)∼∑

n=1

bn sinn πx

T, (234)

with

bn =

0

T

f(x) sinn πx

Tdx

0

T (

sinn πx

T

)2dx

=2

T

0

T

f(x) sin(

n π x

T

)

dx (235)

as∫

0

T (

sinn π x

T

)2dx=

T

2. (236)

Similarly, when we apply the theory to{

cosn π x

T

}

we obtain the Fourier cosine formulas.

Remark 30. Each of the two approaches have their advantages and disadvantages.

• The first approach, treating Fourier cosine and sine series as special cases of Fourier series, has theadvantage that the convergence theorems of Fourier cosine/sine series can be obtained immediatelyby adapting corresponding theorems for the Fourier series.

• The second approach, treating all three – Fourier series, Fourier cosine series, and Fourier sineseries – as examples of the general theory of eigenfunctions, has the advantage that it revealsdeeper understanding, and makes moving on to general separation of variables, like those will betreated in Math337, easier.

Example 31. (10.4.7) Compute the Fourier sine series for

f(x) =x2, 0< x < π. (237)

Solution. We have T =π. Compute

bn =2

π

0

π

x2 sin(n x) dx

= − 2

n π

0

π

x2 dcos(n x)

= − 2

n π

[

x2 cos(n x) N 0π − 2

0

π

cos(n x)x dx

]

= − 2

n π

[

π2 (− 1)n − 2

n

0

π

x dsin(n x)

]

= − 2

n π

[

π2 (− 1)n − 2

n

(

x sin(n x) N 0π −∫

0

π

sin(n x) dx

)]

= − 2

n π

[

π2 (− 1)n − 2

n

1

ncos(n x) N 0π ]

= − 2

n π

[

π2 (− 1)n − 2

n2

[

(− 1)n − 1

]

]

=2π

n(− 1)

n+1 +4

n3 π

[

(− 1)n− 1

]

. (238)

Page 23: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Therefore the Fourier sine series is

f(x)∼∑

n=1

∞ [

2 π

n(− 1)

n+1 +4

n3 π

[

(− 1)n − 1

]

]

sin(nx). (239)

Example 32. (10.4.13) Compute the Fourier cosine series for

f(x)= ex, 0 <x < 1. (240)

Solution. We have T =1. First

a0 =2

1

0

1

ex dx= 2 (e− 1). (241)

next

an = 2

0

1

ex cos(n πx) dx

= 2

0

1

cos(n πx) dex

= 2

[

cos(n πx) ex N 01 + n π

0

1

ex sin(n π x) dx

]

= 2[

e (− 1)n − 1

]

+2 n π

0

1

sin(n π x) dex

= 2[

e (− 1)n − 1

]

+2 n π

[

ex sin(n πx) N 01−n π

0

1

ex cos(n π x) dx

]

= 2[

e (− 1)n − 1

]

− 2 (n π)2∫

0

1

ex cos(n πx) dx

= 2[

e (− 1)n − 1

]

− (n π)2an. (242)

Therefore

an =2[

e (− 1)n − 1

]

1+ (n π)2. (243)

So the Fourier cosine series is given by

f(x)∼ e− 1 +∑

n=1

∞2[

e (− 1)n − 1

]

1+ (n π)2cos(n πx). (244)

Example 33. (10.4.17) Find the solutio nto the heat flow problem

∂u

∂t= 5

∂2u

∂x2, 0 <x <π, t > 0 (245)

u(0, t) =u(π, t) = 0, t > 0 (246)

u(x, 0) = f(x) =1− cos 2x, 0< x < π. (247)

Solution. We use separation of variables.

1. Separate the variables.Write u =X(x)T (t), the equation becomes

T ′X = 5X ′′T� T ′

5 T=

X ′′

X= λ. (248)

The equations for X and T are then

X ′′−λX =0, X(0)= X(π)= 0; (249)

T ′− 5λ T = 0. (250)

2. Solve the eigenvalue problem

X ′′−λX =0, X(0)= X(π)= 0; (251)

Page 24: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

As we have solved it before, we omit the details. The eigenvalues are − n2, n = 1, 2, 3, , and thecorresponding eigenfunctions are

bn sin(n x), n = 1, 2, 3, (252)

3. Solve the equation for T . For each eigenvalue −n2, the corresponding Tn satisfies

Tn′ + 5n2 Tn = 0� Tn = cn e−5n2t. (253)

4. Write down the expansion for u:

u(x, t)=∑

n=1

cn e−5n2t bn sin(n x). (254)

Clearly the cn’s can be absorbed into the bn’s, so we simply write

u(x, t) =∑

n=1

bn e−5n2t sin(n x). (255)

5. Determine bn using the initial condition. We have

1− cos 2 x= u(x, 0) =∑

n=1

bn sin(n x). (256)

Thus all we need to do is to find the Fourier sine series for 1 − cos 2 x. As the interval is [0, π] wehave T =π. We compute for n = 1, 2, 3,

bn =2

π

0

π

(1− cos 2 x) sin(n x) dx

=2

π

0

π

sin(n x) dx− 2

π

0

π

sin(n x) cos(2x) dx

= − 2

n πcos(n x) N 0π − 1

π

[sin(n + 2) x+ sin(n− 2)x] dx

=2

[

1− (− 1)n]− 1

π

0

π

sin(n +2)x dx− 1

π

0

π

sin(n− 2)x dx. (257)

We evaluate∫

0

π

sin(n + 2)xdx=− 1

n + 2cos(n + 2)x N 0π =

1− (− 1)n+2

n +2. (258)

For the last term, there are two cases.

• If n = 2, then sin(n− 2)x =0 and∫

0

π

sin(n− 2) xdx= 0. (259)

• If n� 2, we compute∫

0

π

sin(n− 2) xdx=− 1

n− 2cos(n− 2)x N 0π =

1− (− 1)n−2

n− 2. (260)

Putting everything together, we have

bn =

(

2

n− 1

n+ 2

)

1− (− 1)n

πn =2

(

2

n− 1

n− 2− 1

n +2

)

1− (− 1)n

πn� 2

. (261)

Noticing that, when n is even, we have 1− (− 1)n = 0. Thus the above formula can be simplified by

setting n = 2 k − 1 to

b2k−1 =

(

2

2 k − 1− 1

2 k − 3− 1

2 k + 1

)

2

π, k = 1, 2, 3, (262)

Page 25: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Putting everything together, the solution is given by

u(x, t)=∑

k=1

∞ (

2

2 k − 1− 1

2 k − 3− 1

2 k + 1

)

2

πe−5(2k−1)

2t sin((2 k − 1)x). (263)

5. The heat equation.

In this final section, we focus on the heat equation. Recall that we have already solved the follow ver-sion of heat equation

∂u

∂t= β

∂2u

∂x2, 0 <x <L, t > 0 (264)

u(0, t)= u(L, t)= 0, t > 0 (265)

u(x, 0)= f(x), 0< x < L. (266)

which models the evolution of temperature of a rod with initial temperature distribution f(x) and withboth ends kept at temperature 0. In the following we will discuss other cases:

• Instead of keeping both ends at temperature 0, we insulate them. In this case the boundary condi-tions become

∂u

∂x(0, t) =

∂u

∂x(L, t)= 0, t > 0. (267)

• Instead of keeping both ends at temperature 0, we keep them at temperatures U1, U2. Theboundary conditions are then

u(0, t)= U1, u(L, t) =U2. (268)

• We heat up or cool down the rod during the process. The equation then becomes

∂u

∂t= β

∂2u

∂x2+ P (x), 0< x < L, t > 0. (269)

• Instead of a rod, we consider say a rectangular plate occupying [0, L] × [0, W ]. The equation thenbecomes two dimensional, and we have more freedom specifying boundary conditions.

5.1. Heat equation with Neumann boundary condition.

Example 34. (10.5.3) Solve

∂u

∂t= 3

∂2u

∂x2, 0< x < π, t > 0 (270)

∂u

∂x(0, t)=

∂u

∂x(π, t) = 0, t > 0, (271)

u(x, 0) = x, 0< x < π. (272)

Solution. We use separation of variables.

1. Separate the variables.

Write u(x, t)= X(x)T (t). Then the equation leads to

T ′X =3 X ′′T� T ′

3 T=

X ′′

X= λ (273)

which gives

X ′′−λ X = 0, X ′(0)= X ′(π)= 0, (274)

T ′− 3λ T = 0. (275)

2. Solve the eigenvalue problem

X ′′−λ X = 0, X ′(0)= X ′(π)= 0, (276)

Page 26: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

We discuss the three cases.

a. λ < 0. The general solution is

X =C1 cos(

−λ√

x)

+ C2 sin(

−λ√

x)

. (277)

We compute

X ′=− −λ√

C1 sin(

−λ√

x)

+ −λ√

C2 cos(

−λ√

x)

. (278)

The boundary conditions then lead to

−λ√

C2 = 0, (279)

− −λ√

C1 sin(

−λ√

π)

+ −λ√

C2 cos(

−λ√

π)

= 0. (280)

Thus C2 = 0, and −λ√

= n. Consequently the eigenvalues are

λn =−n2, n =1, 2, 3, (281)

with corresponding eigenfunctions

Xn = an cos(n x). (282)

b. λ= 0. The general solution is

X = C1 + C2 x (283)

the boundary conditions then gives C2 = 0 which means 0 is an eigenvalue and the corre-sponding eigenfunctions are X0 = a0 for a constant a0.

c. λ > 0. The general solution is

X =C1 e λ√

x + C2 e− λ√

x. (284)

The boundary conditions leads to

λ√

C1− λ√

C2 = 0 (285)

λ√

e λ√

π C1− λ√

e− λ√

π C2 = 0. (286)

Solving it gives C1 = C2 = 0. Therefore there is no positive eigenvalues.

Summarizing, the eigenvalues are

λn =−n2, n = 0, 1, 2, 3, (287)

with eigenfunctions

Xn = an cos(n x), n = 0, 1, 2, 3,3. Solve the equation for Tn:

Tn′ +3 n2 Tn =0� Tn = Tn(0) e−3n2t. (288)

4. Write down the solution

u(x, t)=∑

n=0

an e−3n2t cos(n x). (289)

5. Find out the coefficients. We have

u(x, 0)=∑

n=0

an cos(n x). (290)

All we need to do is to find the cosine series for x: 0 < x < π. We compute3

2 a0 =2

π

0

π

xdx = π, (292)

an =2

π

0

π

x cos(n x) dx =2

n π

[

x sin(n x) N 0π −∫

0

π

sin(n x) dx

]

=2[

(− 1)n − 1

]

n2 π. (293)

Page 27: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Note that (− 1)n − 1= 0 for all n even. Thus we have

a2k = 0, a2k+1 =− 4

(2 k +1)2 π. (294)

Summarizing, we have

u(x, t)=π

2−∑

k=1

∞4

(2 k + 1)2 πe−3(2k+1)

2t cos((2 k + 1)x). (295)

5.2. Heat equation with nonhomogeneous boundary condition.

Example 35. (10.5.7) Solve

∂u

∂t= 2

∂2u

∂x2, 0< x < π, t > 0 (296)

u(0, t) =5, u(π, t)= 10, t > 0 (297)

u(x, 0) = sin 3 x− sin 5x, 0< x < π. (298)

Solution. This time we have to get rid of the nonhomogeneous boundary c onditions first. Since other-wise, say we solve Xn subject to Xn(0) = 5, Xn(π) = 10, then clearly there is no guarantee that the infinitesum

an Xn Tn (299)

will satisfy the same boundary conditions.Therefore, before proceeding with the method of separation of variables, we need to find a function

v(x, t) such that∂v

∂t= 2

∂2v

∂x2, v(0, t)= 5, v(π, t) = 10. (300)

If we can find such v, then u = u− v would satisfy

∂u

∂t= 2

∂2u

∂x2, 0 < x < π, t > 0 (301)

u(0, t)= 0, u(π, t) =0, t > 0 (302)

u(x, 0) = sin 3x− sin 5 x− v(x, 0), 0 <x <π. (303)

which can then be solved using separation of variables.Such v is easy to find. The simplest one is the linear function which takes 5 at 0 and 10 at π:

v(x) =5 +5

πx. (304)

Now u = u− v satisfies

∂u

∂t= 2

∂2u

∂x2, 0< x < π, t > 0 (305)

u(0, t) =0, u(π, t)= 0, t > 0 (306)

u(x, 0) = sin 3 x− sin 5x− 5− 5

πx, 0< x < π. (307)

We use separation of variables.

1. Separate the variables. We reach

X ′′−λX =0, X(0)= X(π)= 0, (308)

T ′− 2λ T = 0. (309)

3. Note that the Fourier cosine series is (for T = π)

f ∼

a0

2+∑

an cos(n x) (291)

We see that our a0 here corresponds to a0/2 in the formula.

Page 28: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

2. Solve the eigenvalue problem

X ′′−λX =0, X(0)= X(π)= 0, (310)

The eigenvalues are λn =−n2, and the eigenfunctions are Xn = bn sin(n x).

3. Solve Tn:

Tn′ +2 n2 Tn =0� Tn = Tn(0) e−2n2t. (311)

4. Write down the solution

u(x, t)=∑

n=1

bn e−2n2t sin(n x). (312)

5. Determine the coefficients. We have

sin 3 x− sin 5x− 5− 5

πx =

n=1

bn sin(n x). (313)

Clearly we only need to find out the Fourier sine series for the function 1 +x

π. We compute

2

π

0

π (

1 +x

π

)

sin(n x) dx = − 2

n π

0

π (

1 +x

π

)

dcos(n x)

= − 2

n π

[

(

1+x

π

)

cos(n x) N 0π − 1

π

0

π

cos(n x) dx

]

= − 2

n π

[

2 (− 1)n− 1

]

. (314)

Putting things together, we have

u(x, t)= e−18t sin(3x)− e−50t sin(5 x) +∑

n=1

∞10

n π

[

2 (− 1)n − 1

]

e−2n2t sin(n x). (315)

Finally

u(x, t) =5 +5

πx+ e−18t sin(3 x)− e−50t sin(5x)+

n=1

∞10

n π

[

2 (− 1)n − 1

]

e−2n2t sin(nx). (316)

or equivalently

u(x, t) = 5 +5

πx − 30

πe−2t sin x +

5

πe−8t sin(2 x) +

(

1 − 10

π

)

e−18t sin(3 x) +5

2πe−32t sin(4 x) −

(

1 +

6

π

)

e−50t sin(5x)+∑

n=6

∞10

n π

[

2 (− 1)n − 1

]

e−2n2t sin(n x). (317)

5.3. Heat equation with forcing.

Example 36. (10.5.13) Find a formal solution to the initial-boundary value problem

∂u

∂t= 2

∂2u

∂x2+ 4x, 0< x < π, t > 0; (318)

u(0, t) = u(π, t)= 0, t > 0, (319)

u(x, 0) = sinx, 0 <x <π. (320)

Solution. The idea is as follows. Find a function w(x) such that

2 w ′′+ 4x =0, w(0)= w(π) =0. (321)

Then u =u−w would satisfy

∂u

∂t= 2

∂2u

∂x2, 0 < x < π, t > 0; (322)

u(0, t) = u(π, t) =0, t > 0, (323)

u(x, 0) = sinx−w(x), 0 < x < π. (324)

Page 29: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

and can be solved by separation of variables.

Now the equation for w is easy to solve: Integrating twice, we have

w(x)=− x3

3+ Ax +B. (325)

Using the boundary conditions, we reach

w(x)=− x3

3+

π2

3x. (326)

Next we carry out separation of variables:

1. Separate the variables:

X ′′−λX =0, X(0)= X(π)= 0; (327)

T ′− 2λ T = 0. (328)

2. Solve the eigenvalue problem

X ′′−λX =0, X(0)= X(π)= 0; (329)

The eigenvalues are λ=−n2, n =1, 2, 3, with corresponding eigenfunctions bn sinn x.

3. Solve the corresponding Tn:

Tn′ + 2n2 Tn = 0� Tn(t) =Tn(0) e−2n2t. (330)

4. Write down

u(x, t)=∑

n=1

bn e−2n2t sin(n x). (331)

5. Determine the coefficients:

sinx +x3

3− π2

3x= u(x, 0) =

n=1

bn sin(n x). (332)

We compute the Fourier sine series forx3

3− π2

3x:

2

π

0

π(

x3

3− π2

3x

)

sin(nx) dx = − 2

n π

0

π(

x3

3− π2

3x

)

dcos(n x)

= − 2

n π

[(

x3

3− π2

3x

)

cos(nx) N 0π − ∫0

π

cos(n x)

(

x2− π2

3

)

dx

]

=2

n π

0

π

x2 cos(n x) dx− π2

3

0

π

cos(n x) dx

=2

n2 π

0

π

x2 dsin(n x)

=2

n2 π

[

x2 sin(n x) N 0π − 2

0

π

x sin(nx) dx

]

= − 4

n2 π

0

π

x sin(n x) dx

=4

n3 π

0

π

x dcos(n x)

=4

n3 π

[

x cos(n x) N 0π −∫

0

π

cos(n x) dx

]

=4

n3 (− 1)n. (333)

Thus

u(x, t) = e−2t sinx +∑

n=1

∞4

n3 (− 1)ne−2n2t sin(n x) (334)

Page 30: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Finally we have

u(x, t)=π2

3x− x3

3+ e−2t sinx+

n=1

∞4

n3 (− 1)ne−2n2t sin(n x) (335)

or equivalently

u(x, t) =π2

3x− x3

3− 3 e−2t sinx+

n=2

∞4

n3 (− 1)ne−2n2t sin(nx). (336)

Remark 37. Note that, when the forcing is a function of both x and t, that is

∂u

∂t= β

∂2u

∂x2+ P (x, t), (337)

or when the forcing is independent of t but the dimension is more than 1, say

∂u

∂t= β

(

∂2u

∂x2+

∂2u

∂y2

)

+P (x, y) (338)

the above method does not work anymore. Instead, one needs to integrate the forcing into the method ofseparation of variables. Such technique will be studied in introductory PDE courses.

5.4. Heat equation in higher dimensions.

Example 38. (10.5.17) Find a formal solution to the initial-boundary value problem

∂u

∂t=

∂2u

∂x2+

∂2u

∂y2, 0 < x < π, 0 < y <π, t > 0 (339)

∂u

∂x(0, y, t) =

∂u

∂x(π, y, t)= 0, 0 < y < π, t > 0 (340)

u(x, 0, t) = u(x, π, t)= 0, 0 < x < π, t > 0 (341)

u(x, y, 0) = y, 0 < x < π, 0 < y < π. (342)

Solution. We follow the procedure of separation of variables.

1. Separate the variables. Write u(x, y, t)= X(x)Y (y)T (t). Substitute into the equation, we have

T ′X Y =T X ′′Y + TX Y ′′. (343)

Divide both sides by T XY :T ′

T=

X ′′

X+

Y ′′

Y. (344)

As the left hand side only depends on t while the right hand side is independent of t, both sideshave to be constant. Applying the same argument one more time, we conclude that

X ′′

X= λ,

Y ′′

Y= µ,

T ′

T= λ+ µ. (345)

The equations for X, Y , T are then

X ′′−λ X = 0, X ′(0)= X ′(π)= 0; (346)

Y ′′− µ Y = 0, Y (0) =Y (π)= 0; (347)

T ′− (λ + µ)T = 0. (348)

2. Solve the eigenvalue problems. Now there are two eigenvalue problems. We solve them one by one.

i. Solve Xn.

X ′′−λ X = 0, X ′(0)= X ′(π)= 0; (349)

We have eigenvalues λn =−n2, n = 0, 1, 2, and eigenfunctions Xn = an cos(n x), n = 1, 2, 3.

ii. Solve Ym.

Y ′′− µ Y = 0, Y (0) =Y (π)= 0; (350)

Page 31: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

We have eigenvalues µm =−m2, m = 1, 2, 3, and eigenfunctions Ym = bm sin(m y), m = 1, 2,3,

3. Solve Tn,m. We have

Tn,m′ +

(

n2 + m2)

Tn,m = 0� Tn,m = Tn,m(0) e−(

n2+m2)

t. (351)

4. Write

u(x, y, t)=∑

n=0

∞∑

m=1

cnm cos(n x) sin(m y) e−(

n2+m2)

t. (352)

5. Compute the coefficients. We have

u(x, y, 0) =∑

n=0

∞∑

m=1

cnm cos(n x) sin(m y) e−(

n2+m2)

t. (353)

To determine the coefficients, we first need to understand the integrations∫

0

π ∫

0

π

cos(n x) sin(m y) cos(n′x) sin(m′ y) dx dy. (354)

We compute∫

0

π ∫

0

π

cos(n x) sin(m y) cos(n′ x) sin(m′ y) dx dy =

[ ∫

0

π

cos(n x) cos(n′x) dx

]

·

·[ ∫

0

π

sin(m y) sin(m′ y) dy

]

. (355)

Recall that for n, n′∈{0, 1, 2, 3, } we have

0

π

cos(n x) cos(n′x) dx=

π n =n′=0π

2n =n′� 0

0 n� n′

, (356)

and for m, m′∈{1, 2, 3, }∫

0

π

sin(m y) sin(m′ y) dy =

{ π

2m =m′

0 m� m′(357)

Therefore

0

π ∫

0

π

cos(n x) sin(m y) cos(n′x) sin(m′ y) dx dy =

π2

2n = n′=0, m = m′

π2

4n = n′� 0, m = m′

0 n� n′ or m� m′

. (358)

As a consequence,

0

π ∫

0

π

u(x, y, 0) cos(n x) sin(m y) dxdy =

π2

2c0m n = 0

π2

4cnm n = 1, 2, 3, . (359)

Now we compute∫

0

π ∫

0

π

y sin(m y) dxdy = π

0

π

y sin(m y) dy

= − π

m

0

π

y dcos(m y)

= − π

m

[

y cos(m y) N 0π − ∫0

π

cos(m y) dy

]

= − π2

m(− 1)

m. (360)

Page 32: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Thus

c0m =2

m(− 1)

m+1. (361)

0

π ∫

0

π

y cos(n x) sin(m y) dx dy =

[ ∫

0

π

cos(nx) dx

][ ∫

0

π

y sin(m y) dy

]

= 0. (362)

Therefore

cnm = 0, n =1, 2, 3, ; m = 1, 2, 3, (363)

Summarizing, we have

u(x, y, t)=2

m

m=1

(− 1)m+1

e−m2t sin(m y). (364)

5.5. Uniqueness of solution.We have seen that we can use separation of varaibles to find a solution of the heat equation (modula

convergence proof). Now as heat equation models a physical process, naturally we ask: Does the solutionobtained describe the real physical process? In other words, is it possible that the physical process,the “real” solution, is some function that cannot be obtained through our method? Now we will show thatsuch things cannot happen, through using the following maximum principle.

Theorem 39. Let u(x, t) be a continuously differentiable function that satisfies the heat equation

∂u

∂t= β

∂2u

∂x2, 0< x < L, t > 0, (365)

and the boundary conditions

u(0, t) =u(L, t)= 0, t > 0. (366)

Then u(x, t) attains its maximum value at t = 0, for some x in [0, L] – that is

maxt>0,06x6L

u(x, t)= max06x6L

u(x, 0). (367)

Using the maximum principle one easily obtains uniqueness of solution:

Theorem 40. the initial-boundary value problem

∂u

∂t= β

∂2u

∂x2, 0 <x <L, t > 0, (368)

u(0, t) =u(L, t) = 0, t > 0, (369)

u(x, 0) = f(x), 0 < x < L. (370)

has at most one continuously differentiable solution.

6. Wave Equations.The wave equation problem we will mainly discuss reads4

∂2u

∂t2= α2 ∂2u

∂x2+ h(x, t), 0 <x < L, t > 0 (371)

u(0, t) =U1 , u(L, t) =U2, t > 0 (372)

u(x, 0) = f(x), 0 <x <L, (373)∂u

∂t(x, 0) = g(x), 0 <x <L. (374)

Notice that instead of one single initial condition u(x, 0) = f(x), we have two. The reason is that the waveequation is a second order differential equation with respect to the variable t (compare: 2nd order ODEneeds two initial conditions: y(0) and y ′(0).)

4. When h = 0, U1 = U2 = 0, “Neumann” boundary condition∂u

∂x= 0 may also be considered.

Page 33: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

The separation of variables procedure for solving the above type of wave equation is exactly the sameas that for the heat equation:

• For the general case:

◦ Step 0: Find w to take care of U1 and U2. Set v = u − w. Note that the initial values willchange to v(x, 0)= f −w;

∂v

∂t(x, 0) = g.

◦ Step 1: Get and solve the eigenvalue problem. Obtain Xn, λn and the range of n.

◦ Step 2: Write

v =∑

range of n

Xn Tn (375)

Expand

h(x, t)=∑

range of n

hn(t)Xn (376)

Substitute v and h back into the equation to find the equation for Tn; Substitute v(x, 0) =∑

Tn(0) Xn and∂v

∂t(x, 0) =

Tn′(0) Xn into the initial conditions to get the initial values for

Tn.

◦ Step 3: Solve Tn.

◦ Step 4: Write down the final answer u = v +w.

• If h(x, t) =h(x) is independent of t, the following conceptually-simler approach can be taken:

◦ Step 0: Find w to take care of h(x), U1 and U2; Set v = u − w. Note that the initial values

will change to v(x, 0)= f −w;∂v

∂t(x, 0)= g.

◦ Step 1: Get and solve the eigenvalue problem. Obtain Xn, λn and the range of n.

◦ Step 2: Solve Tn using the obtained λn.

◦ Step 3: Write down

v =∑

range of n

cn Xn Tn (377)

Absorb all redundant “arbitrarn constants”.

◦ Step 4: Use initial value(s) to determine the coefficients.

◦ Step 5: Write down the final answer u = v +w.

However, the details in solving wave equations are more complicated then that in solving the heat equa-tion. In particular, in the general case, instead of a simple 1st order linear equation, the equation for Tn isa 2nd order nonhomogeneous linear equation whose solution requires undetermined coefficients or evenvariation of parameters.

We will also consider the problem with −∞< x <∞ instead of 0 < x < L, and with h = 0:

∂2u

∂t2= α2 ∂2u

∂x2, −∞< x <∞, t > 0 (378)

u(x, 0) = f(x), −∞< x <∞, (379)∂u

∂t(x, 0) = g(x), −∞< x <∞. (380)

In this case naïve separation of variables would not yield anything useful: What happens to sin( n π x

L

)

when L becomes infinity? Interestingly, in the case solving the wave equation is in fact much easier,through the following simple formula:

u(x, t) =1

2[f(x+ α t) + f(x−α t)] +

1

2 α

x−αt

x+αt

g(y) dy. (381)

Page 34: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

6.1. Wave equations with x over a finite interval.

As there is nothing new in the solution procedure, we will just present a few examples here.

Example 41. (Basic case) Find the formal solution of

∂2u

∂t2= 9

∂2u

∂x2, 0< x < 8, t > 0 (382)

u(0, t)= 0 , u(8, t)= 0, t > 0 (383)

u(x, 0) = x, 0< x < 8, (384)∂u

∂t(x, 0) = 3 + x, 0< x < 8. (385)

Solution.

• Step 1: Eigenvalue problems. We separate variables: u = X(x) T (t). Substitute into the equation weget

T ′′X =9 X ′′T� T ′′

T(t)= 9

X ′′

X(x)� both must be constants. (386)

So

T ′′− 9 λT = 0; X ′′−λ X = 0. (387)

Combining the boundary conditions, we get the eigenvalue problem:

X ′′−λX = 0; X(0)= X(8)= 0. (388)

As this type of problems has been solved in detail in the heat equation section we jump directly to itssolution here:

λn =−(

8

)2, Xn = An sin

(

n π

8x)

, n = 1, 2, 3, (389)

• Step 2: Solve Tn. The equation for Tn is

Tn′′− 9 λn Tn = 0� Tn

′′ +9(

n π

8

)2Tn = 0 (390)

whose characteristic equation is

r2 +9(

n π

8

)2= 0 (391)

leading to r1,2 =± 3 n π

8i. So

Tn = Dn cos

(

3 n π

8t

)

+ En sin

(

3n π

8t

)

. (392)

• Step 3: Write

u(x, t) =∑

range of n

cn Tn Xn

=∑

n=1

cn

[

Dn cos

(

3 n π

8t

)

+ En sin

(

3 n π

8t

)]

An sin(

n π

8x)

=∑

n=1

∞ [

an cos

(

3 nπ

8t

)

+ bn sin

(

3n π

8t

)]

sin(

8x)

. (393)

Note that we have “absorbed” all redundant constants in the last step.

• Step 4: Determine the coefficients.

Page 35: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

The above formula for u(x, t) gives:

u(x, 0) =∑

n=1

an sin(

n π

8x)

, (394)

∂u

∂t(x, 0) =

n=1

∞3n π

8bn sin

(

n π

8x)

. (395)

Comparing against the given initial conditions we have

x =∑

n=1

an sin(

8x)

, 3 +x =∑

n=1

∞3n π

8bn sin

(

n π

8x)

. (396)

That is, an and3 n π

8bn are Fourier sine coefficients of x and 3 + x, respectively, over 0 < x < 8. We

compute

an =2

8

0

8

x sin(

n π

8x)

dx

= − 1

4

8

n π

0

8

xdcos(

n π

8x)

= − 2

n π

[

x cos(

n π

8x)∣

0

8−∫

0

8

cos(

n π

8x)

dx

]

= − 2

n π

[

8 cos(n π)− 8

n πsin(

n π

8

)

0

8]

= − 16

n π

[

(− 1)nπ − 0

]

= (− 1)n+1 16

n π

=

16

n πn odd

− 16

n πn even

. (397)

bn =8

3 n π

2

8

0

8

(3+ x) sin(

n π

8x)

dx

=8

3 n π

[

2

8

0

8

3 sin(

n π

8x)

dx+2

8

0

8

x sin(

n π

8x)

dx

]

=8

3 n π

[

3

4

0

8

sin(

n π

8x)

dx + an

]

=8

3 n π

[

− 3

4

8

n πcos(

8x)

0

8

+ (− 1)n+1 16

n π

]

=8

3 n π

[

− 6

n π(cos(n π)− 1)+ (− 1)

n+1 16

]

=8

3 n π

[

6

nπ+ (− 1)

n+1 22

n π

]

=16

n2 π2+ (− 1)

n+1 176

3n2 π2

=

224

3n2 π2n odd

− 128

3n2 πn even

. (398)

So the final answer is

u(x, t)=∑

n=1

∞ [

an cos

(

3 n π

8t

)

+ bn sin

(

3 nπ

8t

)]

sin(

n π

8x)

. (399)

Page 36: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

with

an =

16

n πn odd

− 16

n πn even

; bn =

224

3n2 π2n odd

− 128

3n2 πn even

. (400)

Example 42. (Basic case with Neumann boundary conditions)

∂2u

∂t2= 4

∂2u

∂x2, 0 < x < 5, t > 0 (401)

∂u

∂x(0, t)= 0 ,

∂u

∂x(5, t)=0, t > 0 (402)

u(x, 0) = 5, 0 <x < 5, (403)

∂u

∂t(x, 0) = sin

(

2 πx

5

)

, 0 <x < 5. (404)

Solution.

• Step 1. As the steps are similar to the previous problem and examples in the heat equation section,we omit the details. The eigenvalue problem

X ′′−λX =0, X ′(0)= X ′(5)= 0. (405)

gives

λn =−(

5

)2, Xn = An cos

(

n π

5x)

, n = 0, 1, 2, 3, (406)

and the T equation is

T ′′− 4 λT =0. (407)

• Step 2. The Tn equation is

Tn′′ +4

(

n π

5

)2Tn = 0 (408)

which needs to be solved in two cases:

n� 0: Tn =Dn cos

(

2n π

5t

)

+En sin

(

2 n π

5t

)

(409)

n = 0: T0 =D0 +E0 t. (410)

• Step 3. We have

u(x, t) = c0 (D0 +E0 t)A0 +∑

n=0

cn

[

Dn cos

(

2 n π

5t

)

+ En sin

(

2 n π

5t

)]

An cos(

n π

5x)

=a0

2+

b0

2t +∑

n=1

∞ [

an cos

(

2 n π

5t

)

+ bn sin

(

2n π

5t

)]

cos(

n π

5x)

. (411)

Note that we have recognized that Fourier cosine series is relavent and have writtenthe solution in a form that is convenient for computation of Fourier cosine series.

• Step 4. Comparing with initial values we have

5 =a0

2+∑

n=1

an cos(

n π

5x)

; (412)

sin

(

2π x

5

)

=b0

2+∑

n=1

∞2n π

5bn cos

(

n π

5x)

. (413)

As 5 is one of the terms ina0

2, a1 cos

( π

5x)

, we see that no computation is needed before con-

cluding a0 = 10, an =0 for all other n.

Page 37: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

For bn we compute

b0 =2

5

0

5

sin

(

2π x

5

)

dx= 0; (414)

bn =5

2n π

2

5

0

5

sin

(

2π x

5

)

cos(

n πx

5

)

d x

=1

2n π

0

5 [

sin

(

(n +2)π x

5

)

− sin

(

(n− 2) πx

5

)]

dx

=1

2n π

[

− 5

(n + 2) πcos

(

(n + 2)πx

5

)∣

0

5

+5

(n− 2)πcos

(

(n− 2)π x

5

)∣

0

5]

=1

2n π

[

− 5

(n + 2) π

[

(− 1)n+2− 1

]

+5

(n− 2)π

[

(− 1)n−2− 1

]

]

=1

2n π

[

(− 1)n − 1

]

[

5

(n− 2)π− 5

(n+ 2)π

]

=1

2n π

[

(− 1)n − 1

] 5

π

4

n2− 4

=[

(− 1)n − 1

] 10

n (n2− 4) π2

=

− 20

n (n2− 4)π2n odd

0 n even. (415)

The above computation is not legitimate when n = 2 dueto the appearance of n − 2 in denomina-tors. We have to computer separately

b2 =5

4 π

2

5

0

5

sin

(

2 πx

5

)

cos

(

2 πx

5

)

dx=1

4 π

0

5

sin

(

4 πx

5

)

dx= 0. (416)

So the general formula is still true when n = 2.

So the final answer is

u(x, t)= 5+∑

n=1

bn sin

(

2 nπ

5t

)

cos(

n π

5x)

(417)

with

bn =

− 20

n (n2− 4) π2n odd

0 n even. (418)

Example 43. (Nonhomogeneous but h =h(x))

∂2u

∂t2=

∂2u

∂x2+ 1, 0 <x < 2, t > 0 (419)

u(0, t) =1 , u(2, t)= 3, t > 0 (420)

u(x, 0) = cosx, 0< x < 2, (421)∂u

∂t(x, 0) = 6, 0 <x < 2. (422)

Solution.

• Step 0. Find w(x) such that

wxx + 1 =0; w(0)= 1, w(2)= 3. (423)

The general solution for w is

w(x)= C1 + C2 x− x2

2. (424)

Page 38: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Using the boundary conditions:

w(0) =1� C1 = 1; w(2)= 3� C1 +2 C2− 2 = 3� C2 = 2. (425)

So

w(x)= 1+ 2 x− x2

2. (426)

Set v = u−w. Then v satisfies

vtt = vxx (427)

v(0, t)= v(2, t) = 0 (428)

v(x, 0) = cos x−(

1+ 2 x− x2

2

)

(429)

vt(x, 0) = 6. (430)

• Step 1. Eigenvalue problems.

We omit details.

λn =−(

n π

2

)2, Xn = An sin

(

n π

2x)

, n =1, 2, 3, (431)

• Step 2. Solve Tn.

Tn′′+(

n π

2

)2Tn = 0 n = 1, 2, 3, (432)

gives

Tn =Dn cos(

n π

2t)

+ En sin(

n π

2t)

. (433)

• Step 3. Write v.

v(x, t)=∑

n=1

∞[

an cos(

n π

2t)

+ bn sin(

n π

2t)]

sin(

n π

2x)

. (434)

• Step 4. Find coefficients.

Comparing with initial conditions we reach

cos x−(

1+ 2x− x2

2

)

=∑

n=1

an sin(

n π

2x)

(435)

6 =∑

n=1

∞n π

2bn sin

(

n π

2x)

. (436)

Now we have

an =2

2

0

2 [

cos x−(

1+ 2x− x2

2

)]

sin(

2x)

dx

=

0

2

cos x sin(

n π

2x)

dx−∫

0

2 (

1+ 2 x− x2

2

)

sin(

n π

2x)

dx. (437)

Note that the two integrals require different techniques – the first one trignometric identities, thesecond one integration by parts. Therefore we’d better calculate them separately.

0

2

cos x sin(

2x)

dx =1

2

0

2 [

sin(

n π

2+ 1)

x + sin(

n π

2− 1)

x]

dx

= − 1

2

[

cos( n π

2+ 1)

xn π

2+ 1

+cos( n π

2− 1)

xn π

2− 1

]∣

0

2

= − 1

2

[

cos(2 +n π)− 1n π

2+ 1

+cos(− 2 +n π)− 1

n π

2− 1

]

= − 1

2

[

(− 1)n cos 2− 1

n π

2+1

+(− 1)

n cos(− 2)− 1n π

2− 1

]

Page 39: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

= − 1

2

[

(− 1)n cos 2− 1

]

[

1n π

2+ 1

+1

n π

2− 1

]

=(− 1)

n+1 cos 2 +1

2

4n π

n2 π2− 4

=

(cos 2 + 1)2 nπ

n2 π2− 4n odd

(1− cos 2)2 nπ

n2 π2− 4n even

. (438)

0

2(

1 + 2x− x2

2

)

sin(

2x)

dx = − 2

n π

0

2(

1+ 2 x− x2

2

)

dcos(

n π

2x)

= − 2

n π

[

(

1 + 2 x − x2

2

)

cos(

n π

2x)

0

2

−∫

0

2

cos(

n π

2x)

d

(

1 +

2 x− x2

2

)

= − 2

n π

[

3 (− 1)n − 1−

0

2

(2− x) cos(

n π

2x)

dx

]

= − 2

n π

[

3 (− 1)n − 1− 2

n π

0

2

(2− x) dsin(

n π

2x)

]

= − 2

n π

{

3 ( − 1)n − 1 − 2

n π

[

(2 − x) sin(

n π

2x)∣

0

2−

0

2

sin(

n π

2x)

d(2−x)

]}

= − 2

n π

[

3 (− 1)n − 1− 2

n π

0

2

sin(

n π

2x)

dx

]

= − 2

n π

[

3 (− 1)n − 1+

4

n2 π2cos(

n π

2x)

0

2]

= − 2

n π

[

3 (− 1)n − 1+

4

n2 π2

(

(− 1)n − 1

)

]

=

8

n π+

16

n3 π3n odd

− 4

nπn even

.

So we have

an =

(cos 2 +1)2n π

n2 π2− 4− 8

n π− 16

n3 π3n odd

(1− cos 2)2n π

n2 π2− 4+

4

n πn even

. (439)

Now compute bn:

bn =2

n π

2

2

0

2

6 sin(

n π

2x)

dx

=12

n π

[

− 2

n πcos(

2x)

0

2]

= − 24

n2 π2

[

(− 1)n − 1

]

=

48

n2 π2n odd

0 n even. (440)

Page 40: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

So

v(x, t)=∑

n=1

∞[

an cos(

n π

2t)

+ bn sin(

n π

2t)]

sin(

n π

2x)

(441)

with

an =

(cos 2+ 1)2 n π

n2 π2− 4− 8

nπ− 16

n3 π3n odd

(1− cos 2)2 n π

n2 π2− 4+

4

nπn even

; bn =

48

n2 π2n odd

0 n even. (442)

• Step 5.

Finally... we get

u(x, t) =1 + 2x− x2

2+∑

n=1

∞[

an cos(

n π

2t)

+ bn sin(

n π

2t)]

sin(

n π

2x)

(443)

with

an =

(cos 2+ 1)2 n π

n2 π2− 4− 8

nπ− 16

n3 π3n odd

(1− cos 2)2 n π

n2 π2− 4+

4

nπn even

; bn =

48

n2 π2n odd

0 n even. (444)

Example 44. (General case)

∂2u

∂t2= 4

∂2u

∂x2+x t, 0< x < π, t > 0 (445)

u(0, t)= 0 , u(π, t) =1 t > 0 (446)

u(x, 0) = x, 0 <x <π, (447)∂u

∂t(x, 0) = 1, 0 <x <π. (448)

Remark. Note that trying to find a “steady-state solution” first would fail this time: No w(x) can pos-sibly satisfy

4 wxx + x t =0, w(0)= 0, w(π)= 1. (449)

Furthermore, any effort of finding w(x, t) such that

wtt =4 wxx + x t, w(0, t)= 0, w(π, t) =1 (450)

in hope of v =u−w satisfying the simple system

∂2v

∂t2= 4

∂2v

∂x2, 0< x <π, t > 0 (451)

v(0, t) =0 , v(π, t) =0 t > 0 (452)

u(x, 0) = x−w(x, 0), 0< x < π, (453)∂u

∂t(x, 0) = 1− ∂w

∂t(x, 0), 0< x < π. (454)

does not make much sense as solving the w equation is not really easier than solving the original u equa-tion.

In summary, in such general case, it is not possible to take care of the boundary conditions and thesource term in one single step. They have to be dealt with separately.

Solution.

• Step 0. Take care of boundary conditions.

Page 41: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

We find w(x) satisfying wxx = 0, w(0) = 0, w(π) = 1. This is easy: w(x) = x/π. Now set v = u −w, we reach

∂2v

∂t2= 4

∂2v

∂x2+ x t, 0 <x <π, t > 0 (455)

v(0, t) =0 , v(π, t) =0 t > 0 (456)

u(x, 0) = x− x/π, 0 < x < π, (457)∂u

∂t(x, 0) = 1, 0 <x <π. (458)

• Step 1. Find the eigenvalue problem and solve it.

Applying separation of variables, we found out that the eigenvalue problem is

X ′′−λ X = 0, X(0)= X(π)= 0 (459)

which leads to (details omitted due to having been done several times before)

λn =−n2, Xn =An sin(n x), n = 1, 2, 3, (460)

• Step 2. Find out equations for Tn.

We write

v(x, t) =∑

n=1

Tn Xn =∑

n=1

Tn(t) sin(n x) (461)

Note that the arbitrary constant An has been “absorbed” into Tn(t).

Substitute into the equation:

∂2v

∂t2=∑

n=1

Tn′′(t) sin(nx); (462)

∂2v

∂x2=∑

n=1

Tn(t) [sin(n x)]′′=−

n=1

n2 Tn(t) sin(n x); (463)

Therefore the equation becomes

x t =∂2v

∂t2− 4

∂2v

∂x2=∑

n=1

∞[

Tn′′+4 n2 Tn

]

sin(n x). (464)

On the other hand, at t =0 we have(

1− 1

π

)

x = v(x, 0)=∑

n=1

Tn(0) sin(nx); (465)

and

1 =∂v

∂t(x, 0)=

n=1

Tn′(0) sin(n x). (466)

Therefore, if we expand x t,(

1− 1

π

)

x, 1 into their Fourier Sine series:

x t =∑

n=1

hn(t) sin(n x); (467)

(

1− 1

π

)

x =∑

n=1

an sin(nx); (468)

1 =∑

n=1

bn sin(n x); (469)

then Tn satisfies the initial value problem

Tn′′+ 4 n2 Tn = hn(t); Tn(0)= an, Tn

′(0) = bn. (470)

Page 42: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Now we compute:

◦ hn(t):

hn(t) =2

π

0

π

(x t) sin(n x) dx

=2 t

π

0

π

x sin(n x) dx

=2 t

π

(

− 1

n

)∫

0

π

x dcos(n x)

= − 2 t

n π

[

x cos(n x)|0π −

0

π

cos(n x) dx

]

= − 2 t

n π

[

π (− 1)n − 0

]

= (− 1)n+1 2

nt. (471)

◦ an:

an =2

π

0

π(

1− 1

π

)

x sin(nx) dx

=

(

1− 1

π

)[

2

π

0

π

x sin(n x) dx

]

=

(

1− 1

π

)

(− 1)n+1 2

n

= (− 1)n+1 2 (π − 1)

n π. (472)

Note that we have taken advantage of the fact that an =(

1− 1

π

)

hn(t)/t.

◦ bn:

bn =2

π

0

π

sin(nx) dx=− 2

n π

[

(− 1)n − 1

]

=2

n π

[

(− 1)n+1

+1]

. (473)

Summarizing, Tn satisfies

Tn′′ +4 n2 Tn =(− 1)

n+1 2

nt; Tn(0)= (− 1)

n+1 2 (π − 1)

n π; Tn

′(0) =2

[

(− 1)n+1 + 1

]

. (474)

• Solve Tn.

As Tn satisfies “nonhomogeneous 2nd order linear constant coefficient equation”, we have tosolve the corresponding homogeneous equation

T ′′+ 4n2 T =0 (475)

first to get its general solution, and then find a particular solution of Tn′′ + 4 n2 Tn = ( − 1)

n+1 2

nt.

Inspecting the right hand side, we conclude that the best approach to get the particular solutionshould be “undetermined coefficients”.

◦ T ′′+ 4n2 T =0. The general solution is

T =C1 cos(2n t) +C2 sin(2n t). (476)

◦ Particular solution. The correct form is

Tp = At. (477)

Substitute into the equation we easily obtain

Tp =(− 1)

n+1

2n3t. (478)

Page 43: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Thus Tn has to be of the form

Tn =C1 cos(2n t) +C2 sin(2n t) +(− 1)

n+1

2 n3t. (479)

Now enforce the initial conditions:

Tn(0)= (− 1)n+1 2 (π − 1)

n π� C1 = (− 1)

n+1 2 (π − 1)

n π; (480)

Tn′(0) =

2

n π

[

(− 1)n+1 + 1

]� 2n C2 +(− 1)

n+1

2 n3=

2

n π

[

(− 1)n+1 +1

]

(481)

which gives

C1 = (− 1)n+1 2 (π − 1)

n π, C2 =

1

n2 π

[

(− 1)n+1

+1]

− (− 1)n+1

4 n4. (482)

Therefore

Tn(t) = ( − 1)n+1 2 (π − 1)

n πcos(2 n t) +

(

1

n2 π

[

( − 1)n+1 + 1

]

− (− 1)n+1

4n4

)

sin(2 n t) +

(− 1)n+1

2n3t. (483)

• Write down the solution. We have

v(x, t) =∑

n=1

∞[

( − 1)n+1 2 (π − 1)

n πcos(2 n t) +

(

1

n2 π

[

( − 1)n+1 + 1

]

− (− 1)n+1

4 n4

)

sin(2 n t) +

(− 1)n+1

2n3t

]

sin(n x), (484)

and

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

π+∑

n=1

∞[

( − 1)n+1 2 (π − 1)

n πcos(2 n t) +

(

1

n2 π

[

( − 1)n+1

+ 1]

(− 1)n+1

4n4

)

sin(2n t)+(− 1)

n+1

2 n3t

]

sin(n x). (485)

6.2. Wave equations with − ∞ < x < ∞.The key to the derivation of the d’Alembert formula

u(x, t) =1

2[f(x+ α t) + f(x−α t)] +

1

2 α

x−αt

x+αt

g(y) dy (486)

is the following observation.Consider the equation

∂2u

∂t2= α2 ∂2u

∂x2. (487)

If we introduce new variables

ξ = x+ α t; η = x−α t, (488)

then the equation is simplified to∂2u

∂ξ∂η= 0 (489)

whose solution is readily obtained

u(ξ, η)= F (ξ)+ G(η). (490)

Back to the x, t variables, we have

u(x, t)= F (x+ α t)+ G(x−α t). (491)

Page 44: Introduction to Partial Differential Equations - ualberta.caxinweiyu/201.ev1.11w/DE_Intro_PDE.pdf · Introduction to Partial Differential Equations ... into account, as a consequence,

Now the initial conditions enforce

F (x)+ G(x)= u(x, 0)= f(x); (492)

α F ′(x)−α G′(x)= ut(x, 0)= g(x). (493)

Integrating the second equation we get

F (x)−G(x)=1

α

[ ∫

x0

x

g(y) dy +C

]

(494)

for x0 arbitrarily chosen.Now F and G can be solved:

F (x)=1

2

{

f(x) +1

α

[ ∫

x0

x

g(y) dy + C

]}

(495)

G(x)=1

2

{

f(x)− 1

α

[ ∫

x0

x

g(y) dy + C

]}

(496)

Recalling the formula for u, we have

u(x, t) = F (x + α t)+ G(x−α t)

=1

2

{

f(x +α t)+1

α

[ ∫

x0

x+αt

g(y) dy + C

]}

+1

2

{

f(x+ α t)− 1

α

[ ∫

x0

x−αt

g(y) dy +C

]}

Note that C represents the same number throughout.

=1

2[f(x + α t)+ f(x−α t)]

+1

[ ∫

x0

x+αt

g(y) dy + C −∫

x0

x−αt

g(y) dy −C

]

=1

2[f(x + α t)+ f(x−α t)] +

1

x−αt

x+αt

g(y) dy. (497)

The application of this formula (called d’Alembert formula) is trivial.

Example 45. Solve over −∞< x <∞, t > 0:

∂2u

∂t2= 4

∂2u

∂x2(498)

u(x, 0) = 3 (499)∂u

∂t(x, 0) = x (500)

Solution. We have α = 2, f = 3, g = x. So

u(x, t) =1

2[3+ 3] +

1

4

x−2t

x+2t

y dy

= 3 +1

8

[

(x+ 2 t)2− (x− 2 t)

2]

= 3 +x t. (501)