Diffyqs PDF
Diffyqs PDF
by Jiří Lebl
Typeset in LATEX.
c
Copyright
2008–2018 Jiří Lebl
This work is dual licensed under the Creative Commons Attribution-Noncommercial-Share Alike
4.0 International License and the Creative Commons Attribution-Share Alike 4.0 International
License. To view a copy of these licenses, visit http://creativecommons.org/licenses/
by-nc-sa/4.0/ or http://creativecommons.org/licenses/by-sa/4.0/ or send a letter
to Creative Commons PO Box 1866, Mountain View, CA 94042, USA.
You can use, print, duplicate, share this book as much as you want. You can base your own notes
on it and reuse parts if you keep the license the same. You can assume the license is either the
CC-BY-NC-SA or CC-BY-SA, whichever is compatible with what you wish to do, your derivative
works must use at least one of the licenses.
During the writing of these notes, the author was in part supported by NSF grant DMS-0900885
and DMS-1362337.
The date is the main identifier of version. The major version / edition number is raised only if there
have been substantial changes. Edition number started at 5, that is, version 5.0, as it was not kept
track of before.
Introduction 5
0.1 Notes about these notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
0.2 Introduction to differential equations . . . . . . . . . . . . . . . . . . . . . . . . . 7
0.3 Classification of differential equations . . . . . . . . . . . . . . . . . . . . . . . . 13
3
4 CONTENTS
Index 367
Introduction
Introduction
Chapter 1
Chapter 2
Chapter 8 Chapter 4
Chapter 5
There are some references in chapters 4 and 5 to material from chapter 3 (some linear algebra),
but these references are not absolutely essential and can be skimmed over, so chapter 3 can safely
be dropped, while still covering chapters 4 and 5. The textbook was originally made for two types
of courses. Either at 4 hours a week for a semester (Math 286 at UIUC):
5
6 INTRODUCTION
Introduction, chapter 1, chapter 2, chapter 3, chapter 4 (w/o § 4.10), chapter 5 (or 6 or 7 or 8).
For a shorter version (3 hours a week) of the above course, skip chapters 4 and 5. The second
type of the course at 3 hours a week (Math 285 at UIUC) was:
Introduction, chapter 1, chapter 2, chapter 4 (w/o § 4.10), (and maybe chapter 5, 6, or 7).
The complete book can be covered at a reasonably fast pace at approximately 75 lectures, not
accounting for exams, review, or time spent in computer lab. A two quarter course can be easily run
with the material, and if one does not rush, a two semester course. For example:
Semester 1: Introduction, chapter 1, chapter 2, chapter 6, chapter 7, (and perhaps bits of 4).
Semester 2: Chapter 3, chapter 8, chapter 4, chapter 5.
The chapter on Laplace transform (chapter 6), the chapter on Sturm-Liouville (chapter 5), the
chapter on power series (chapter 7), and the chapter on nonlinear systems (chapter 8), are more or
less interchangeable time-wise. If chapter 8 is covered it may be best to place it right after chapter 3.
If time is short, the first two sections of chapter 7 make a reasonable self-contained unit.
I taught the UIUC courses using the IODE software (http://www.math.uiuc.edu/iode/).
IODE is a free software package that works with Matlab (proprietary) or Octave (free software).
Unfortunately IODE is not kept up to date at this point, and may have trouble running on newer
versions of Matlab. The graphs in the book were made with the Genius software (see http:
//www.jirka.org/genius.html). I used Genius in class to show these (and other) graphs.
This book is available from http://www.jirka.org/diffyqs/. Check there for any possible
updates or errata. The LATEX source is also available for possible modification and customization.
Acknowlegements: Firstly, I would like to acknowledge Rick Laugesen. I used his handwritten
class notes the first time I taught Math 286. My organization of this book through chapter 5, and the
choice of material covered, is heavily influenced by his notes. Many examples and computations
are taken from his notes. I am also heavily indebted to Rick for all the advice he has given me,
not just on teaching Math 286. For spotting errors and other suggestions, I would also like to
acknowledge (in no particular order): John P. D’Angelo, Sean Raleigh, Jessica Robinson, Michael
Angelini, Leonardo Gomes, Jeff Winegar, Ian Simon, Thomas Wicklund, Eliot Brenner, Sean
Robinson, Jannett Susberry, Dana Al-Quadi, Cesar Alvarez, Cem Bagdatlioglu, Nathan Wong,
Alison Shive, Shawn White, Wing Yip Ho, Joanne Shin, Gladys Cruz, Jonathan Gomez, Janelle
Louie, Navid Froutan, Grace Victorine, Paul Pearson, Jared Teague, Ziad Adwan, Martin Weilandt,
Sönmez Şahutoğlu, Pete Peterson, Thomas Gresham, Prentiss Hyde, Jai Welch, Simon Tse, Andrew
Browning, James Choi, Dusty Grundmeier, John Marriott, Jim Kruidenier, Barry Conrad, Wesley
Snider, Colton Koop, Sarah Morse, Erik Boczko, Asif Shakeel, Chris Peterson, Nicholas Hu, Paul
Seeburger, Jonathan McCormick, and probably others I have forgotten. Finally I would like to
acknowledge NSF grants DMS-0900885 and DMS-1362337.
0.2. INTRODUCTION TO DIFFERENTIAL EQUATIONS 7
dx
+ x = (− sin t + cos t) + (cos t + sin t) = 2 cos t.
dt
Yay! We got precisely the right hand side. But there is more! We claim x = cos t + sin t + e−t is also
a solution. Let us try,
dx
= − sin t + cos t − e−t .
dt
8 INTRODUCTION
mathematical model. That is, we translate the real world situation into a set of differential equations.
Then we apply mathematics to get some sort of a mathematical solution. There is still something
left to do. We have to interpret the results. We have to figure out what the mathematical solution
says about the real world problem we started with.
Learning how to formulate the mathematical Real world problem
model and how to interpret the results is what
your physics and engineering classes do. In this abstract interpret
course we will focus mostly on the mathematical
analysis. Sometimes we will work with simple real solve
Mathematical Mathematical
world examples, so that we have some intuition
model solution
and motivation about what we are doing.
Let us look at an example of this process. One of the most basic differential equations is the
standard exponential growth model. Let P denote the population of some bacteria on a Petri dish.
We assume that there is enough food and enough space. Then the rate of growth of bacteria is
proportional to the population—a large population grows quicker. Let t denote time (say in seconds)
and P the population. Our model is
dP
= kP,
dt
for some positive constant k > 0.
Example 0.2.1: Suppose there are 100 bacteria at time 0 and 200 bacteria 10 seconds later. How
many bacteria will there be 1 minute from time 0 (in 60 seconds)?
First we have to solve the equation. We claim that a solution is given by
P(t) = Cekt ,
Therefore, 2 = e10k or ln 2
10
= k ≈ 0.069. So we know that
At one minute, t = 60, the population is P(60) = 6400. See Figure 2 on the next page.
10 INTRODUCTION
Let us talk about the interpretation of the results. Does our solution mean that there must
be exactly 6400 bacteria on the plate at 60s? No! We made assumptions that might not be true
exactly, just approximately. If our assumptions are reasonable, then there will be approximately
6400 bacteria. Also, in real life P is a discrete quantity, not a real number. However, our model has
no problem saying that for example at 61 seconds, P(61) ≈ 6859.35.
Normally, the k in P0 = kP is known, and 0 10 20 30 40 50 60
be (exercise)
2000 2000
y(x) = Ce−kx .
0.2. INTRODUCTION TO DIFFERENTIAL EQUATIONS 11
Exercise 0.2.1: Check that the y given is really a solution to the equation.
Next, take the second order differential equation
d2 y
= −k2 y,
dx2
for some constant k > 0. The general solution for this equation is
Note that because we have a second order differential equation, we have two constants in our general
solution.
Exercise 0.2.2: Check that the y given is really a solution to the equation.
And finally, take the second order differential equation
d2 y
= k2 y,
dx2
for some constant k > 0. The general solution for this equation is
or
y(x) = D1 cosh(kx) + D2 sinh(kx).
For those that do not know, cosh and sinh are defined by
e x + e−x
cosh x = ,
2
e x − e−x
sinh x = .
2
These functions are sometimes easier to work with than exponentials. They have some nice familiar
properties such as cosh 0 = 1, sinh 0 = 0, and dx d
cosh x = sinh x (no that is not a typo) and
d
dx
sinh x = cosh x.
Exercise 0.2.3: Check that both forms of the y given are really solutions to the equation.
An interesting note about cosh: The graph of cosh is the exact shape a hanging chain will make.
This shape is called a catenary. Contrary to popular belief this is not a parabola. If you invert the
graph of cosh it is also the ideal arch for supporting its own weight. For example, the gateway
arch in Saint Louis is an inverted graph of cosh—if it were just a parabola it might fall down. The
formula used in the design is inscribed inside the arch:
0.2.4 Exercises
Exercise 0.2.4: Show that x = e4t is a solution to x000 − 12x00 + 48x0 − 64x = 0.
Exercise 0.2.5: Show that x = et is not a solution to x000 − 12x00 + 48x0 − 64x = 0.
2
Exercise 0.2.6: Is y = sin t a solution to dy
dt
= 1 − y2 ? Justify.
Exercise 0.2.7: Let y00 + 2y0 − 8y = 0. Now try a solution of the form y = erx for some (unknown)
constant r. Is this a solution for some r? If so, find all such r.
Exercise 0.2.8: Verify that x = Ce−2t is a solution to x0 = −2x. Find C to solve for the initial
condition x(0) = 100.
Exercise 0.2.9: Verify that x = C1 e−t + C2 e2t is a solution to x00 − x0 − 2x = 0. Find C1 and C2 to
solve for the initial conditions x(0) = 10 and x0 (0) = 0.
Exercise 0.2.10: Find a solution to (x0 )2 + x2 = 4 using your knowledge of derivatives of functions
that you know from basic calculus.
Note: Exercises with numbers 101 and higher have solutions in the back of the book.
Exercise 0.2.103: Let xy00 − y0 = 0. Try a solution of the form y = xr . Is this a solution for some r?
If so, find all such r.
the equation is of first order. If the highest derivative that appears is the second derivative, then the
equation is of second order. For example, Newton’s law of cooling above is a first order equation,
while the Mechanical vibrations equation is a second order equation. The equation governing
transversal vibrations in a beam,
∂4 y ∂2 y
a4 4 + 2 = 0,
∂x ∂t
is a fourth order partial differential equation. It is fourth order since at least one derivative is the
fourth derivative. It does not matter that derivatives with respect to t are only second order.
In the first chapter we will start attacking first order ordinary differential equations, that is,
equations of the form dx dy
= f (x, y). In general, lower order equations are easier to work with and
have simpler behavior, which is why we start with them.
We also distinguish how the dependent variables appear in the equation (or system). In particular,
we say an equation is linear if the dependent variable (or variables) and their derivatives appear
linearly, that is only as first powers, they are not multiplied together, and no other functions of the
dependent variables appear. In other words, the equation is a sum of terms, where each term is some
function of the independent variables or some function of the independent variables multiplied by a
dependent variable or its derivative. Otherwise the equation is called nonlinear. For example, an
ordinary differential equation is linear if it can be put into the form
dn y dn−1 y dy
an (x) n
+ an−1 (x) n−1
+ · · · + a1 (x) + a0 (x)y = b(x). (2)
dx dx dx
The functions a0 , a1 , . . . , an are called the coefficients. The equation is allowed to depend arbitrarily
on the independent variables. So
d2 y dy 1
ex 2
+ sin(x) + x2 y = (3)
dx dx x
is still a linear equation as y and its derivatives only appear linearly.
All the equations and systems given above as examples are linear. It may not be immediately
obvious for Maxwell’s equations unless you write out the divergence and curl in terms of partial
derivatives. Let us see some nonlinear equations. For example Burger’s equation,
∂y ∂y ∂2 y
+ y = ν 2,
∂t ∂x ∂x
∂y
is a nonlinear second order partial differential equation. It is nonlinear because y and ∂x are
multiplied together. The equation
dx
= x2 (4)
dt
is a nonlinear first order differential equation as there is a power of the dependent variable x.
A linear equation may further be called homogeneous, if all terms depend on the dependent
variable. That is, if there is no term that is a function of the independent variables alone. Otherwise
0.3. CLASSIFICATION OF DIFFERENTIAL EQUATIONS 15
the equation is called nonhomogeneous or inhomogeneous. For example, Newton’s law of cooling,
Transport equation, Wave equation, above are homogeneous, while Mechanical vibrations equation
above is nonhomogeneous. A homogeneous linear ODE can be put into the form
dn y dn−1 y dy
an (x) + an−1 (x) + · · · + a1 (x) + a0 (x)y = 0.
dxn dxn−1 dx
Compare to (2) and notice there is no function b(x).
If the coefficients of a linear equation are actually constant functions, then the equation is said to
have constant coefficients. The coefficients are the functions multiplying the dependent variable(s)
or one of its derivatives, not the function standing alone. That is, a constant coefficient ODE is
dn y dn−1 y dy
an + a n−1 + · · · + a1 + a0 y = b(x),
dxn dxn−1 dx
where a0 , a1 , . . . , an are all constants, but b may depend on the independent variable x. The
Mechanical vibrations equation above is constant coefficient nonhomogeneous second order ODE.
Same nomenclature applies to PDEs, so the Transport equation, Heat equation and Wave equation
are all examples of constant coefficient linear PDEs.
Finally, an equation (or system) is called autonomous if the equation does not depend on
the independent variable. Usually here we only consider ordinary differential equations and the
independent variable is then thought of as time. Autonomous equation means an equation that does
not change with time. For example, Newton’s law of cooling is autonomous, so is equation (4). On
the other hand, Mechanical vibrations or (3) are not autonomous.
0.3.1 Exercises
Exercise 0.3.1: Classify the following equations. Are they ODE or PDE? Is it an equation or a
system? What is the order? Is it linear or nonlinear, and if it is linear, is it homogeneous, constant
coefficient? If it is an ODE, is it autonomous?
d2 x
a) sin(t) 2 + cos(t)x = t2
dt
∂u ∂u
b) + 3 = xy
∂x ∂y
c) y + 3y + 5x = 0, x00 + x − y = 0
00
∂2 u ∂2 u
d) 2 + u 2 = 0
∂t ∂s
e) x00 + tx2 = t
d4 x
f) 4 = 0
dt
16 INTRODUCTION
Exercise 0.3.3: Suppose F is a linear function, that is, F(x, y) = ax + by for constants a and b.
What is the classification of equations of the form F(y0 , y) = 0.
Exercise 0.3.4: Write down an explicit example of a third order, linear, nonconstant coefficient,
nonautonomous, nonhomogeneous system of two ODE such that every derivative that could appear,
does appear.
Exercise 0.3.101: Classify the following equations. Are they ODE or PDE? Is it an equation or a
system? What is the order? Is it linear or nonlinear, and if it is linear, is it homogeneous, constant
coefficient? If it is an ODE, is it autonomous?
∂2 v ∂2 v
a) 2 + 3 2 = sin(x)
∂x ∂y
dx
b) + cos(t)x = t2 + t + 1
dt
d7 F
c) 7 = 3F(x)
dx
d) y00 + 8y0 = 1
e) x00 + tyx0 = 0, y00 + txy = 0
∂u ∂2 u
f) = 2 + u2
∂t ∂s
Exercise 0.3.102: Write down the general zeroth order linear ordinary differential equation. Write
down the general solution.
Chapter 1
y0 = f (x). (1.1)
that is Z
y(x) = f (x) dx + C.
This y(x) is actually the general solution. So to solve (1.1), we find some antiderivative of f (x) and
then we add an arbitrary constant to get the general solution.
Now is a good time to discuss a point about calculus notation and terminology. Calculus
textbooks muddy the waters by talking about the integral as primarily the so-called indefinite
17
18 CHAPTER 1. FIRST ORDER ODES
integral. The indefinite integral is really the antiderivative (in fact the whole one-parameter family
of antiderivatives). There really exists only one integral and that is the definite integral. The only
reason for the indefinite integral notation is that we can always write an antiderivative as a (definite)
integral. That is, by the fundamental theorem of calculus we can always write f (x) dx + C as
R
Z x
f (t) dt + C.
x0
Hence the terminology to integrate when we may really mean to antidifferentiate. Integration is
just one way to compute the antiderivative (and it is a way that always works, see the following
examples). Integration is defined as the area under the graph, it only happens to also compute
antiderivatives. For sake of consistency, we will keep using the indefinite integral notation when we
want an antiderivative, and you should always think of the definite integral as a way to write it.
Example 1.1.1: Find the general solution of y0 = 3x2 .
Elementary calculus tells us that the general solution must be y = x3 + C. Let us check by
differentiating: y0 = 3x2 . We got precisely our equation back.
Normally, we also have an initial condition such as y(x0 ) = y0 for some two numbers x0 and y0
(x0 is usually 0, but not always). We can then write the solution as a definite integral in a nice way.
Suppose our problem is y0 = f (x), y(x0 ) = y0 . Then the solution is
Z x
y(x) = f (s) ds + y0 . (1.2)
x0
Let us check! We compute y0 = f (x), via the fundamental theorem ofRcalculus, and by Jupiter, y is a
x0
solution. Is it the one satisfying the initial condition? Well, y(x0 ) = x f (x) dx + y0 = y0 . It is!
0
Do note that the definite integral and the indefinite integral (antidifferentiation) are completely
different beasts. The definite integral always evaluates to a number. Therefore, (1.2) is a formula
we can plug into the calculator or a computer, and it will be happy to calculate specific values for us.
We will easily be able to plot the solution and work with it just like with any other function. It is not
so crucial to always find a closed form for the antiderivative.
Example 1.1.2: Solve
2
y0 = e−x , y(0) = 1.
By the preceding discussion, the solution must be
Z x
2
y(x) = e−s ds + 1.
0
Here is a good way to make fun of your friends taking second semester calculus. Tell them to find
the closed form solution. Ha ha ha (bad math joke). It is not possible (in closed form). There is
absolutely nothing wrong with writing the solution as a definite integral. This particular integral is
in fact very important in statistics.
1.1. INTEGRALS AS SOLUTIONS 19
y0 = f (y).
If we replace e−kD with an arbitrary constant C we can get rid of the absolute value bars (which we
can do as D was arbitrary). In this way, we also incorporate the solution y = 0. We get the same
general solution as we guessed before, y = Cekx .
Example 1.1.4: Find the general solution of y0 = y2 .
First we note that y = 0 is a solution. We can now assume that y , 0. Write
dx 1
= 2.
dy y
20 CHAPTER 1. FIRST ORDER ODES
We integrate to get
−1
x=+ C.
y
We solve for y = C−x
1
. So the general solution is
1
y= or y = 0.
C−x
Note the singularities of the solution. If for example C = 1, then the solution “blows up” as we
approach x = 1. Generally, it is hard to tell from just looking at the equation itself how the solution
is going to behave. The equation y0 = y2 is very nice and defined everywhere, but the solution is
only defined on some interval (−∞, C) or (C, ∞).
Classical problems leading to differential equations solvable by integration are problems dealing
with velocity, acceleration and distance. You have surely seen these problems before in your
calculus class.
Example 1.1.5: Suppose a car drives at a speed et/2 meters per second, where t is time in seconds.
How far did the car get in 2 seconds (starting at t = 0)? How far in 10 seconds?
Let x denote the distance the car traveled. The equation is
x0 = et/2 .
We just integrate this equation to get that
x(t) = 2et/2 + C.
We still need to figure out C. We know that when t = 0, then x = 0. That is, x(0) = 0. So
0 = x(0) = 2e0/2 + C = 2 + C.
Thus C = −2 and
x(t) = 2et/2 − 2.
Now we just plug in to get where the car is at 2 and at 10 seconds. We obtain
x(2) = 2e2/2 − 2 ≈ 3.44 meters, x(10) = 2e10/2 − 2 ≈ 294 meters.
Example 1.1.6: Suppose that the car accelerates at a rate of t2 m/s2 . At time t = 0 the car is at the 1
meter mark and is traveling at 10 m/s. Where is the car at time t = 10.
Well this is actually a second order problem. If x is the distance traveled, then x0 is the velocity,
and x00 is the acceleration. The equation with initial conditions is
x00 = t2 , x(0) = 1, x0 (0) = 10.
What if we say x0 = v. Then we have the problem
v0 = t2 , v(0) = 10.
Once we solve for v, we can integrate and find x.
Exercise 1.1.1: Solve for v, and then solve for x. Find x(10) to answer the question.
1.1. INTEGRALS AS SOLUTIONS 21
1.1.1 Exercises
Exercise 1.1.2: Solve dy
dx
= x2 + x for y(1) = 3.
Exercise 1.1.3: Solve dy
dx
= sin(5x) for y(0) = 2.
Exercise 1.1.4: Solve dy
dx
= 1
x2 −1
for y(0) = 0.
Exercise 1.1.5: Solve y0 = y3 for y(0) = 1.
Exercise 1.1.6 (little harder): Solve y0 = (y − 1)(y + 1) for y(0) = 3.
Exercise 1.1.7: Solve dy
dx
= 1
y+1
for y(0) = 0.
Exercise 1.1.8 (harder): Solve y00 = sin x for y(0) = 0, y0 (0) = 2.
Exercise 1.1.9: A spaceship is traveling at the speed 2t2 + 1 km/s (t is time in seconds). It is pointing
directly away from earth and at time t = 0 it is 1000 kilometers from earth. How far from earth is it
at one minute from time t = 0?
Exercise 1.1.10: Solve dx
dt
= sin(t2 ) + t, x(0) = 20. It is OK to leave your answer as a definite
integral.
Exercise 1.1.11: A dropped ball accelerates downwards at a constant rate 9.8 meters per second
squared. Set up the differential equation for the height above ground h in meters. Then supposing
h(0) = 100 meters, how long does it take for the ball to hit the ground.
Exercise 1.1.12: Find the general solution of y0 = e x , and then y0 = ey .
Exercise 1.1.101: Solve dy
dx
= e x + x and y(0) = 10.
Exercise 1.1.102: Solve x0 = 1
x2
, x(1) = 1.
Exercise 1.1.103: Solve x0 = 1
cos(x)
, x(0) = π2 .
Exercise 1.1.104: Sid is in a car traveling at speed 10t + 70 miles per hour away from Las Vegas,
where t is in hours. At t = 0, Sid is 10 miles away from Vegas. How far from Vegas is Sid 2 hours
later?
Exercise 1.1.105: Solve y0 = yn , y(0) = 1, where n is a positive integer. Hint: You have to consider
different cases.
Exercise 1.1.106: The rate of change of the volume of a snowball that is melting is proportional to
the surface area of the snowball. Suppose the snowball is perfectly spherical. Then the volume (in
centimeters cubed) of a ball of radius r centimeters is 4/3 πr3 . The surface area is 4πr2 . Set up the
differential equation for how r is changing. Then, suppose that at time t = 0 minutes, the radius
is 10 centimeters. After 5 minutes, the radius is 8 centimeters. At what time t will the snowball be
completely melted.
Exercise 1.1.107: Find the general solution to y0000 = 0. How many distinct constants do you need?
22 CHAPTER 1. FIRST ORDER ODES
y0 = f (x, y).
In general, we cannot simply solve these kinds of equations explicitly. It would be nice if we could
at least figure out the shape and behavior of the solutions, or if we could find approximate solutions.
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-3 -2 -1 0 1 2 3
To get an idea of how the solutions behave, we draw such lines at lots of points in the plane,
not just the point (2, 1.5). Usually we pick a grid of such points fine enough so that it shows the
behavior, but not too fine so that we can still recognize the individual lines. See Figure 1.2 on the
next page. We call this picture the slope field of the equation. Usually in practice, one does not do
this by hand, but has a computer do the drawing.
Suppose we are given a specific initial condition y(x0 ) = y0 . A solution, that is, the graph of the
solution, would be a curve that follows the slopes. For a few sample solutions, see Figure 1.3 on the
facing page. It is easy to roughly sketch (or at least imagine) possible solutions in the slope field,
just from looking at the slope field itself.
1.2. SLOPE FIELDS 23
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
-1 -1 -1 -1
-2 -2 -2 -2
-3 -3 -3 -3
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
Figure 1.2: Slope field of y0 = xy. Figure 1.3: Slope field of y0 = xy with a graph
of solutions satisfying y(0) = 0.2, y(0) = 0, and
y(0) = −0.2.
By looking at the slope field we can get a lot of information about the behavior of solutions. For
example, in Figure 1.3 we can see what the solutions do when the initial conditions are y(0) > 0,
y(0) = 0 and y(0) < 0. Note that a small change in the initial condition causes quite different
behavior. We can see this behavior just from the slope field imagining what solutions ought to do.
On the other hand, plotting a few solutions of the equation y0 = −y, we see that no matter what y(0)
is, all solutions tend to zero as x tends to infinity. See Figure 1.4. Again that behavior should be
clear from simply from looking at the slope field itself.
-3 -2 -1 0 1 2 3
3 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-3 -2 -1 0 1 2 3
What do you think is the answer? The answer seems to be yes to both does it not? Well, pretty
much. But there are cases when the answer to either question can be no.
Since generally the equations we encounter in applications come from real life situations, it
seems logical that a solution always exists. It also has to be unique if we believe our universe is
deterministic. If the solution does not exist, or if it is not unique, we have probably not devised the
correct model. Hence, it is good to know when things go wrong and why.
Example 1.2.1: Attempt to solve:
1
y0 = , y(0) = 0.
x
Integrate to find the general solution y = ln |x| + C. The solution does not exist at x = 0. See
Figure 1.5. The equation may have been written as the seemingly harmless xy0 = 1.
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
-1 -1 -1 -1
-2 -2 -2 -2
-3 -3 -3 -3
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
Figure 1.5: Slope field of y0 = 1/x. Figure 1.6: Slope field of y0 = 2 |y| with two solu-
p
See Figure 1.6 on the preceding page. Note that y = 0 is a solution. But another solution is the
function
x2
if x ≥ 0,
y(x) =
−x2 if x < 0.
It is hard to tell by staring at the slope field that the solution is not unique. Is there any hope? Of
course there is. We have the following theorem, known as Picard’s theorem∗ .
Theorem 1.2.1 (Picard’s theorem on existence and uniqueness). If f (x, y) is continuous (as a
function of two variables) and ∂∂yf exists and is continuous near some (x0 , y0 ), then a solution to
exists (at least for some small interval of x’s) and is unique.
Note that the problems y0 = 1/x, y(0) = 0 and y0 = 2 |y|, y(0) = 0 do not satisfy the hypothesis
p
of the theorem. Even if we can use the theorem, we ought to be careful about this existence business.
It is quite possible that the solution only exists for a short while.
Example 1.2.3: For some constant A, solve:
y0 = y2 , y(0) = A.
We know how to solve this equation. First assume that A , 0, so y is not equal to zero at least
for some x near 0. So x0 = 1/y2 , so x = −1/y + C, so y = C−x
1
. If y(0) = A, then C = 1/A so
1
y= 1/A
.
−x
If A = 0, then y = 0 is a solution.
For example, when A = 1 the solution “blows up” at x = 1. Hence, the solution does not exist
for all x even if the equation is nice everywhere. The equation y0 = y2 certainly looks nice.
For most of this course we will be interested in equations where existence and uniqueness holds,
and in fact holds “globally” unlike for the equation y0 = y2 .
1.2.3 Exercises
Exercise 1.2.1: Sketch slope field for y0 = e x−y . How do the solutions behave as x grows? Can you
guess a particular solution by looking at the slope field?
Exercise 1.2.2: Sketch slope field for y0 = x2 .
Exercise 1.2.3: Sketch slope field for y0 = y2 .
∗
Named after the French mathematician Charles Émile Picard (1856–1941)
26 CHAPTER 1. FIRST ORDER ODES
a) b) c)
Exercise 1.2.7 (challenging): Take y0 = f (x, y), y(0) = 0, where f (x, y) > 1 for all x and y. If the
solution exists for all x, can you say what happens to y(x) as x goes to positive infinity? Explain.
Exercise 1.2.8 (challenging): Take (y − x)y0 = 0, y(0) = 0. a) Find two distinct solutions. b) Explain
why this does not violate Picard’s theorem.
Exercise 1.2.9: Suppose y0 = f (x, y). What will the slope field look like, explain and sketch an
example, if you have the following about f (x, y). a) f does not depend on y. b) f does not depend
on x. c) f (t, t) = 0 for any number t. d) f (x, 0) = 0 and f (x, 1) = 1 for all x.
Exercise 1.2.10: Find a solution to y0 = |y|, y(0) = 0. Does Picard’s theorem apply?
Exercise 1.2.11: Take an equation y0 = (y − 2x)g(x, y) + 2 for some function g(x, y). Can you solve
the problem for the initial condition y(0) = 0, and if so what is the solution?
Exercise 1.2.101: Sketch the slope field of y0 = y3 . Can you visually find the solution that satisfies
y(0) = 0?
Exercise 1.2.102: Is it possible to solve y0 = xy for y(0) = 0? Is the solution unique?
Exercise 1.2.103: Is it possible to solve y0 = x
x2 −1
for y(1) = 0?
Exercise 1.2.104: Match equations y = sin x, y = cos y, y0 = y cos(x) to slope fields. Justify.
0 0
a) b) c)
Unfortunately this method no longer works for the general form of the equation y0 = f (x, y).
Integrating both sides yields Z
y= f (x, y) dx + C.
y0 = f (x)g(y),
for some functions f (x) and g(y). Let us write the equation in the Leibniz notation
dy
= f (x)g(y).
dx
Then we rewrite the equation as
dy
= f (x) dx.
g(y)
Now both sides look like something we can integrate. We obtain
Z Z
dy
= f (x) dx + C.
g(y)
If we can find closed form expressions for these two integrals, we can, perhaps, solve for y.
Example 1.3.1: Take the equation
y0 = xy.
First note that y = 0 is a solution, so assume y , 0 from now on. Write the equation as dy
dx
= xy, then
Z Z
dy
= x dx + C.
y
x2
ln |y| = + C.
2
28 CHAPTER 1. FIRST ORDER ODES
Or
x2 x2 x2
|y| = e 2 +C = e 2 eC = De 2 ,
where D > 0 is some constant. Because y = 0 is a solution and because of the absolute value we
actually can write:
x2
y = De 2 ,
for any number D (including zero or negative).
We check: x2
x2
y = Dxe = x De 2 = xy.
0 2
Yay!
We should be a little bit more careful with this method. You may be worried that we were
integrating in two different variables. We seemed to be doing a different operation to each side. Let
us work this method out more rigorously. Take
dy
= f (x)g(y).
dx
We rewrite the equation as follows. Note that y = y(x) is a function of x and so is dy
dx
!
1 dy
= f (x).
g(y) dx
We integrate both sides with respect to x.
Z Z
1 dy
dx = f (x) dx + C.
g(y) dx
We use the change of variables formula.
Z Z
1
dy = f (x) dx + C.
g(y)
And we are done.
We integrate to get
y2 x2
+ ln |y| = + C,
2 2
or perhaps the easier looking expression (where D = 2C)
y2 + 2 ln |y| = x2 + D.
It is not easy to find the solution explicitly as it is hard to solve for y. We, therefore, leave the
solution in this form and call it an implicit solution. It is still easy to check that an implicit solution
satisfies the differential equation. In this case, we differentiate with respect to x to get
!
2
y 2y +
0
= 2x.
y
It is simple to see that the differential equation holds. If you want to compute values for y, you
might have to be tricky. For example, you can graph x as a function of y, and then flip your paper.
Computers are also good at some of these tricks.
We note that the above equation also has the solution y = 0. The general solution is y2 + 2 ln |y| =
x + C together with y = 0. These outlying solutions such as y = 0 are sometimes called singular
2
solutions.
1.3.3 Examples
Example 1.3.2: Solve x2 y0 = 1 − x2 + y2 − x2 y2 , y(1) = 0.
First factor the right hand side to obtain
x2 y0 = (1 − x2 )(1 + y2 ).
Example 1.3.3: Bob made a cup of coffee, and Bob likes to drink coffee only once it will not burn
him at 60 degrees. Initially at time t = 0 minutes, Bob measured the temperature and the coffee was
89 degrees Celsius. One minute later, Bob measured the coffee again and it had 85 degrees. The
temperature of the room (the ambient temperature) is 22 degrees. When should Bob start drinking?
Let T be the temperature of the coffee, and let A be the ambient (room) temperature. Newton’s
law of cooling states that the rate at which the temperature of the coffee is changing is proportional
to the difference between the ambient temperature and the temperature of the coffee. That is,
dT
= k(A − T ),
dt
for some constant k. For our setup A = 22, T (0) = 89, T (1) = 85. We separate variables and
integrate (let C and D denote arbitrary constants)
1 dT
= −k,
T − A dt
ln(T − A) = −kt + C, (note that T − A > 0)
T − A = De , −kt
T = A + D e−kt .
That is, T = 22 + D e−kt . We plug in the first condition: 89 = T (0) = 22 + D, and hence D = 67.
So T = 22 + 67 e−kt . The second condition says 85 = T (1) = 22 + 67 e−k . Solving for k we get
k = − ln 85−22
67
≈ 0.0616. Now we solve for the time t that gives us a temperature of 60 degrees. That
60−22
ln
is, we solve 60 = 22 + 67e−0.0616t to get t = − 0.0616
67
≈ 9.21 minutes. So Bob can begin to drink the
coffee at just over 9 minutes from the time Bob made it. That is probably about the amount of time
it took us to calculate how long it would take.
2
Example 1.3.4: Find the general solution to y0 = −xy 3
(including singular solutions).
First note that y = 0 is a solution (a singular solution). So assume that y , 0 and write
−3 0
y = x,
y2
3 x2
= + C,
y 2
3 6
y= 2 = 2 .
x /2 + C x + 2C
1.3.4 Exercises
Exercise 1.3.1: Solve y0 = x/y.
dx
Exercise 1.3.3: Solve = (x2 − 1) t, for x(0) = 0.
dt
dx
Exercise 1.3.4: Solve = x sin(t), for x(0) = 1.
dt
dy
Exercise 1.3.5: Solve = xy + x + y + 1. Hint: Factor the right hand side.
dx
Exercise 1.3.6: Solve xy0 = y + 2x2 y, where y(1) = 1.
dy y2 + 1
Exercise 1.3.7: Solve = , for y(0) = 1.
dx x2 + 1
dy x2 + 1
Exercise 1.3.8: Find an implicit solution for = , for y(0) = 1.
dx y2 + 1
Exercise 1.3.9: Find an explicit solution for y0 = xe−y , y(0) = 1.
Exercise 1.3.10: Find an explicit solution for xy0 = e−y , for y(1) = 1.
Exercise 1.3.11: Find an explicit solution for y0 = ye−x , y(0) = 1. It is alright to leave a definite
2
The word “linear” means linear in y and y0 ; no higher powers nor functions of y or y0 appear. The
dependence on x can be more complicated.
Solutions of linear equations have nice properties. For example, the solution exists wherever
p(x) and f (x) are defined, and has the same regularity (read: it is just as nice). But most importantly
for us right now, there is a method for solving linear first order equations.
The trick is to rewrite the left hand side of (1.3) as a derivative of a product of y with another
function. To this end we find a function r(x) such that
dh i
r(x)y0 + r(x)p(x)y = r(x)y .
dx
This is the left hand side of (1.3) multiplied by r(x). So if we multiply (1.3) by r(x), we obtain
dh i
r(x)y = r(x) f (x).
dx
Now we integrate both sides. The right hand side does not depend on y and the left hand side is
written as a derivative of a function. Afterwards, we solve for y. The function r(x) is called the
integrating factor and the method is called the integrating factor method.
We are looking for a function r(x), such that if we differentiate it, we get the same function back
multiplied by p(x). That seems like a job for the exponential function! Let
R
r(x) = e p(x) dx
.
We compute:
y0 + p(x)y = f (x),
R R R
e y + e p(x) dx p(x)y = e
p(x) dx 0 p(x) dx
f (x),
d h R p(x) dx i R
e y =e p(x) dx
f (x),
dx Z
R R
e p(x) dx
y= e p(x) dx
f (x) dx + C,
R
Z R !
y = e− p(x) dx
e p(x) dx
f (x) dx + C .
1.4. LINEAR EQUATIONS AND THE INTEGRATING FACTOR 33
Of course, to get a closed form formula for y, we need to be able to find a closed form formula
for the integrals appearing above.
Example 1.4.1: Solve
2
y0 + 2xy = e x−x , y(0) = −1.
R
First note that p(x) = 2x and f (x) = e x−x . The integrating factor is r(x) = e = e x . We
2 p(x) dx 2
Next, we solve for the initial condition −1 = y(0) = 1 + C, so C = −2. The solution is
2 2
y = e x−x − 2e−x .
R
p(x)dx
Note that we do not care which antiderivative we take when computing e . You can always
add a constant of integration, but those constants will not matter in the end.
Exercise 1.4.1: Try it! Add a constant of integration to the integral in the integrating factor and
show that the solution you get in the end is the same as what we got above.
An advice: Do not try to remember the formula itself, that is way too hard. It is easier to
remember the process and repeat it.
Since we cannot always evaluate the integrals in closed form, it is useful to know how to write
the solution in definite integral form. A definite integral is something that you can plug into a
computer or a calculator. Suppose we are given
You should be careful to properly use dummy variables here. If you now plug such a formula into a
computer or a calculator, it will be happy to give you numerical answers.
34 CHAPTER 1. FIRST ORDER ODES
Exercise 1.4.3: Write the solution of the following problem as a definite integral, but try to simplify
as far as you can. You will not be able to find the solution in closed form.
2
y0 + y = e x −x , y(0) = 10.
Remark 1.4.1: Before we move on, we should note some interesting properties of linear equations.
First, for the linear initial value problem y0 + p(x)y = f (x), y(x0 ) = y0 , there is always an explicit
formula (1.4) for the solution. Second, it follows from the formula (1.4) that if p(x) and f (x)
are continuous on some interval (a, b), then the solution y(x) exists and is differentiable on (a, b).
Compare with the simple nonlinear example we have seen previously, y0 = y2 , and compare to
Theorem 1.2.1.
Example 1.4.2: Let us discuss a common simple application of linear equations. This type of
problem is used often in real life. For example, linear equations are used in figuring out the
concentration of chemicals in bodies of water (rivers and lakes).
A 100 liter tank contains 10 kilograms of salt dissolved in 60 liters of 5 L/min, 0.1 kg/L
water. Solution of water and salt (brine) with concentration of 0.1 kilograms
per liter is flowing in at the rate of 5 liters a minute. The solution in the
tank is well stirred and flows out at a rate of 3 liters a minute. How much
salt is in the tank when the tank is full?
Let us come up with the equation. Let x denote the kilograms of salt
60 L
in the tank, let t denote the time in minutes. For a small change ∆t in time,
10 kg of salt
the change in x (denoted ∆x) is approximately
rate in = 5,
concentration in = 0.1,
rate out = 3,
x x
concentration out = = .
volume 60 + (5 − 3)t
Our equation is, therefore,
dx x
= (5 × 0.1) − 3 .
dt 60 + 2t
1.4. LINEAR EQUATIONS AND THE INTEGRATING FACTOR 35
dx 3
(60 + 2t)3/2 + (60 + 2t)3/2 x = 0.5(60 + 2t)3/2 ,
dt 60 + 2t
d h i
(60 + 2t)3/2 x = 0.5(60 + 2t)3/2 ,
dt Z
(60 + 2t)3/2 x = 0.5(60 + 2t)3/2 dt + C,
(60 + 2t)3/2
Z
x = (60 + 2t)−3/2
dt + C(60 + 2t)−3/2 ,
2
1
x = (60 + 2t)−3/2 (60 + 2t)5/2 + C(60 + 2t)−3/2 ,
10
60 + 2t
x= + C(60 + 2t)−3/2 .
10
60
10 = x(0) = + C(60)−3/2 = 6 + C(60)−3/2 ,
11.5 11.5
10
or 11.0 11.0
C = 4(603/2 ) ≈ 1859.03.
10.5 10.5
or when t = 20. So 0 5 10 15 20
1.4.1 Exercises
In the exercises, feel free to leave answer as a definite integral if a closed form solution cannot be
found. If you can find a closed form solution, you should give that.
Exercise 1.4.9: Suppose there are two lakes located on a stream. Clean water flows into the first
lake, then the water from the first lake flows into the second lake, and then water from the second
lake flows further downstream. The in and out flow from each lake is 500 liters per hour. The first
lake contains 100 thousand liters of water and the second lake contains 200 thousand liters of water.
A truck with 500 kg of toxic substance crashes into the first lake. Assume that the water is being
continually mixed perfectly by the stream. a) Find the concentration of toxic substance as a function
of time in both lakes. b) When will the concentration in the first lake be below 0.001 kg per liter? c)
When will the concentration in the second lake be maximal?
Exercise 1.4.11: Initially 5 grams of salt are dissolved in 20 liters of water. Brine with concentration
of salt 2 grams of salt per liter is added at a rate of 3 liters a minute. The tank is mixed well and is
drained at 3 liters a minute. How long does the process have to continue until there are 20 grams of
salt in the tank?
Exercise 1.4.12: Initially a tank contains 10 liters of pure water. Brine of unknown (but constant)
concentration of salt is flowing in at 1 liter per minute. The water is mixed well and drained at 1
liter per minute. In 20 minutes there are 15 grams of salt in the tank. What is the concentration of
salt in the incoming brine?
Exercise 1.4.103: Suppose a water tank is being pumped out at 3 L/min. The water tank starts at 10 L
of clean water. Water with toxic substance is flowing into the tank at 2 L/min, with concentration 20t g/L
at time t. When the tank is half empty, how many grams of toxic substance are in the tank (assuming
perfect mixing)?
Exercise 1.4.104: Suppose we have bacteria on a plate and suppose that we are slowly adding a
toxic substance such that the rate of growth is slowing down. That is, suppose that dP
dt
= (2 − 0.1t)P.
If P(0) = 1000, find the population at t = 5.
Exercise 1.4.105: A cylindrical water tank has water flowing in at I cubic meters per second. Let
A be the area of the cross section of the tank in meters. Suppose water is flowing from the bottom of
the tank at a rate proportional to the height of the water level. Set up the differential equation for h,
the height of the water, introducing and naming constants that you need. You should also give the
units for your constants.
38 CHAPTER 1. FIRST ORDER ODES
1.5 Substitution
Note: 1 lecture, §1.6 in [EP], not in [BD]
Just as when solving integrals, one method to try is to change variables to end up with a simpler
equation to solve.
1.5.1 Substitution
The equation
y0 = (x − y + 1)2
is neither separable nor linear. What can we do? How about trying to change variables, so that in
the new variables the equation is simpler. We use another variable v, which we treat as a function of
x. Let us try
v = x − y + 1.
We need to figure out y0 in terms of v0 , v and x. We differentiate (in x) to obtain v0 = 1 − y0 . So
y0 = 1 − v0 . We plug this into the equation to get
1 − v0 = v2 .
In other words, v0 = 1 − v2 . Such an equation we know how to solve by separating variables:
1
dv = dx.
1 − v2
So
1 v + 1
ln = x + C,
2 v − 1
v + 1
= e2x+2C ,
v − 1
or v+1
v−1
= De2x for some constant D. Note that v = 1 and v = −1 are also solutions.
Now we need to “unsubstitute” to obtain
x−y+2
= De2x ,
x−y
and also the two solutions x − y + 1 = 1 or y = x, and x − y + 1 = −1 or y = x + 2. We solve the first
equation for y.
x − y + 2 = (x − y)De2x ,
x − y + 2 = Dxe2x − yDe2x ,
−y + yDe2x = Dxe2x − x − 2,
y (−1 + De2x ) = Dxe2x − x − 2,
Dxe2x − x − 2
y= .
De2x − 1
1.5. SUBSTITUTION 39
and finally
4(x + 1)
v = 4.
v0 −
x
The equation is now linear. We can use the integrating factor method. In particular, we use formula
(1.4). Let us assume that x > 0 so |x| = x. This assumption is OK, as our initial condition is x = 1.
Let us compute the integrating factor. Here p(s) from formula (1.4) is −4(s+1)s
.
−4(s + 1)
Z x
e−4x+4
Rx
!
e1 p(s) ds
= exp ds = e−4x−4 ln(x)+4 = e−4x+4 x−4 = ,
1 s x4
Rx
e− 1
p(s) ds
= e4x+4 ln(x)−4 = e4x−4 x4 .
1.5.4 Exercises
Hint: Answers need not always be in closed form.
7.5 7.5
5 5
5.0 5.0
0 0 2.5 2.5
0.0 0.0
-5 -5
-2.5 -2.5
Figure 1.8: The slope field and some solutions of Figure 1.9: The slope field and some solutions of
x0 = −0.3 (x − 5). x0 = 0.1 x (5 − x).
for some positive k and M. This equation is commonly used to model population if we know the
limiting population M, that is the maximum sustainable population. The logistic equation leads to
less catastrophic predictions on world population than x0 = kx. In the real world there is no such
thing as negative population, but we will still consider negative x for the purposes of the math.
See Figure 1.9 on the preceding page for an example. Note two critical points, x = 0 and x = 5.
The critical point at x = 5 is stable. On the other hand the critical point at x = 0 is unstable.
It is not really necessary to find the exact solutions to talk about the long term behavior of the
solutions. For example, from the above we can easily see that
5 if x(0) > 0,
lim x(t) = if x(0) = 0,
0
t→∞
DNE or −∞ if x(0) < 0.
Where DNE means “does not exist.” From just looking at the slope field we cannot quite decide
what happens if x(0) < 0. It could be that the solution does not exist for t all the way to ∞. Think of
the equation x0 = x2 ; we have seen that solutions only exist for some finite period of time. Same
can happen here. In our example equation above it will actually turn out that the solution does not
exist for all time, but to see that we would have to solve the equation. In any case, the solution does
go to −∞, but it may get there rather quickly.
Often we are interested only in the long term behavior of the solution and we would be doing
unnecessary work if we solved the equation exactly. It is easier to just look at the phase diagram or
phase portrait, which is a simple way to visualize the behavior of autonomous equations. In this
case there is one dependent variable x. We draw the x axis, we mark all the critical points, and then
we draw arrows in between. If f (x) > 0, we draw an up arrow. If f (x) < 0, we draw a down arrow.
x=5
x=0
Armed with the phase diagram, it is easy to sketch the solutions approximately.
Exercise 1.6.1: Try sketching a few solutions simply from looking at the phase diagram. Check
with the preceding graphs if you are getting the type of curves.
Once we draw the phase diagram, we can easily classify critical points as stable or unstable∗ .
∗
The unstable points that have one of the arrows pointing towards the critical point are sometimes called semistable.
1.6. AUTONOMOUS EQUATIONS 45
unstable stable
Since any mathematical model we cook up will only be an approximation to the real world,
unstable points are generally bad news.
Let us think about the logistic equation with harvesting. Suppose an alien race really likes to eat
humans. They keep a planet with humans on it and harvest the humans at a rate of h million humans
per year. Suppose x is the number of humans in millions on the planet and t is time in years. Let M
be the limiting population when no harvesting is done. The number k > 0 is a constant depending
on how fast humans multiply. Our equation becomes
dx
= kx(M − x) − h.
dt
We expand the right hand side and set it to zero
Solving for the critical points, let us call them A and B, we get
p p
kM + (kM)2 − 4hk kM − (kM)2 − 4hk
A= , B= .
2k 2k
Exercise 1.6.2: Draw the phase diagram for different possibilities. Note that these possibilities are
A > B, or A = B, or A and B both complex (i.e. no real solutions). Hint: Fix some simple k and M
and then vary h.
For example, let M = 8 and k = 0.1. When h = 1, then A and B are distinct and positive. The
graph we will get is given in Figure 1.10 on the next page. As long as the population starts above B,
which is approximately 1.55 million, then the population will not die out. It will in fact tend towards
A ≈ 6.45 million. If ever some catastrophe happens and the population drops below B, humans will
die out, and the fast food restaurant serving them will go out of business.
When h = 1.6, then A = B = 4. There is only one critical point and it is unstable. When the
population starts above 4 million it will tend towards 4 million. If it ever drops below 4 million,
humans will die out on the planet. This scenario is not one that we (as the human fast food proprietor)
want to be in. A small perturbation of the equilibrium state and we are out of business. There is no
room for error. See Figure 1.11 on the following page.
Finally if we are harvesting at 2 million humans per year, there are no critical points. The
population will always plummet towards zero, no matter how well stocked the planet starts. See
Figure 1.12 on the next page.
46 CHAPTER 1. FIRST ORDER ODES
0 5 10 15 20 0 5 10 15 20
10.0 10.0 10.0 10.0
Figure 1.10: The slope field and some solutions of Figure 1.11: The slope field and some solutions of
x0 = 0.1 x (8 − x) − 1. x0 = 0.1 x (8 − x) − 1.6.
0 5 10 15 20
10.0 10.0
7.5 7.5
5.0 5.0
2.5 2.5
0.0 0.0
0 5 10 15 20
1.6.1 Exercises
Exercise 1.6.3: Take x0 = x2 . a) Draw the phase diagram, find the critical points, and mark them
stable or unstable. b) Sketch typical solutions of the equation. c) Find lim x(t) for the solution with
t→∞
the initial condition x(0) = −1.
Exercise 1.6.4: Take x0 = sin x. a) Draw the phase diagram for −4π ≤ x ≤ 4π. On this interval
mark the critical points stable or unstable. b) Sketch typical solutions of the equation. c) Find
lim x(t) for the solution with the initial condition x(0) = 1.
t→∞
1.6. AUTONOMOUS EQUATIONS 47
Exercise 1.6.5: Suppose f (x) is positive for 0 < x < 1, it is zero when x = 0 and x = 1, and it is
negative for all other x. a) Draw the phase diagram for x0 = f (x), find the critical points, and mark
them stable or unstable. b) Sketch typical solutions of the equation. c) Find lim x(t) for the solution
t→∞
with the initial condition x(0) = 0.5.
Exercise 1.6.7: A disease is spreading through the country. Let x be the number of people infected.
Let the constant S be the number of people susceptible to infection. The infection rate dx dt
is
proportional to the product of already infected people, x, and the number of susceptible but
uninfected people, S − x. a) Write down the differential equation. b) Supposing x(0) > 0, that is,
some people are infected at time t = 0, what is lim x(t). c) Does the solution to part b) agree with
t→∞
your intuition? Why or why not?
Exercise 1.6.101: Let x0 = (x − 1)(x − 2)x2 . a) Sketch the phase diagram and find critical points.
b) Classify the critical points. c) If x(0) = 0.5 then find lim x(t).
t→∞
Exercise 1.6.102: Let x0 = e−x . a) Find and classify all critical points. b) Find lim x(t) given any
t→∞
initial condition.
If the equation can be solved in closed form, we should do that. But what if we have an equation
that cannot be solved in closed form? What if we want to find the value of the solution at some
particular x? Or perhaps we want to produce a graph of the solution to inspect the behavior. In this
section we will learn about the basics of numerical approximation of solutions.
The simplest method for approximating a solution is Euler’s method∗ . It works as follows: We
take x0 and compute the slope k = f (x0 , y0 ). The slope is the change in y per unit change in x. We
follow the line for an interval of length h on the x axis. Hence if y = y0 at x0 , then we will say that
y1 (the approximate value of y at x1 = x0 + h) will be y1 = y0 + hk. Rinse, repeat! That is, compute
x2 and y2 using x1 and y1 . For an example of the first two steps of the method see Figure 1.13.
-1 0 1 2 3 -1 0 1 2 3
3.0 3.0 3.0 3.0
y2
Figure 1.13: First two steps of Euler’s method with h = 1 for the equation y0 = 3 with initial conditions
y(0) = 1.
The line segments we get are an approximate graph of the solution. Generally it is not exactly the
solution. See Figure 1.14 on the next page for the plot of the real solution and the approximation.
∗
Named after the Swiss mathematician Leonhard Paul Euler (1707–1783). Do note the correct pronunciation of the
name sounds more like “oiler.”
1.7. NUMERICAL METHODS: EULER’S METHOD 49
-1 0 1 2 3
3.0 3.0
2.5 2.5
2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
0.0 0.0
-1 0 1 2 3
y2
Figure 1.14: Two steps of Euler’s method (step size 1) and the exact solution for the equation y0 = 3 with
initial conditions y(0) = 1.
Let us see what happens with the equation y0 = y2/3, y(0) = 1. Let us try to approximate y(2)
using Euler’s method. In Figures 1.13 and 1.14 we have graphically approximated y(2) with step
size 1. With step size 1 we have y(2) ≈ 1.926. The real answer is 3. So we are approximately 1.074
off. Let us halve the step size. Computing y4 with h = 0.5, we find that y(2) ≈ 2.209, so an error of
about 0.791. Table 1.1 on the following page gives the values computed for various parameters.
Exercise 1.7.1: Solve this equation exactly and show that y(2) = 3.
The difference between the actual solution and the approximate solution is called the error. We
usually talk about just the size of the error and we do not care much about its sign. The point is, we
usually do not know the real solution, so we only have a vague understanding of the error. If we
knew the error exactly . . . what is the point of doing the approximation?
We notice that except for the first few times, every time we halved the interval the error
approximately halved. This halving of the error is a general feature of Euler’s method as it is a
first order method. There exists an improved Euler method, see the exercises, that is a second
order method reduces the error to approximately one quarter every time we halve the interval. The
meaning of “second” order is the squaring in 1/4 = 1/2 × 1/2 = (1/2)2 .
To get the error to be within 0.1 of the answer we had to already do 64 steps. To get it to within
0.01 we would have to halve another three or four times, meaning doing 512 to 1024 steps. That is
quite a bit to do by hand. The improved Euler method from the exercises should quarter the error
every time we halve the interval, so we would have to approximately do half as many “halvings”
to get the same error. This reduction can be a big deal. With 10 halvings (starting at h = 1) we
have 1024 steps, whereas with 5 halvings we only have to do 32 steps, assuming that the error was
comparable to start with. A computer may not care about this difference for a problem this simple,
but suppose each step would take a second to compute (the function may be substantially more
50 CHAPTER 1. FIRST ORDER ODES
Error
h Approximate y(2) Error Previous error
1 1.92593 1.07407
0.5 2.20861 0.79139 0.73681
0.25 2.47250 0.52751 0.66656
0.125 2.68034 0.31966 0.60599
0.0625 2.82040 0.17960 0.56184
0.03125 2.90412 0.09588 0.53385
0.015625 2.95035 0.04965 0.51779
0.0078125 2.97472 0.02528 0.50913
difficult to compute than y2/3). Then the difference is 32 seconds versus about 17 minutes. We are
not being altogether fair, a second order method would probably double the time to do each step.
Even so, it is 1 minute versus 17 minutes. Next, suppose that we have to repeat such a calculation
for different parameters a thousand times. You get the idea.
Note that in practice we do not know how large the error is! How do we know what is the right
step size? Well, essentially we keep halving the interval, and if we are lucky, we can estimate the
error from a few of these calculations and the assumption that the error goes down by a factor of
one half each time (if we are using standard Euler).
Exercise 1.7.2: In the table above, suppose you do not know the error. Take the approximate values
of the function in the last two lines, assume that the error goes down by a factor of 2. Can you
estimate the error in the last time from this? Does it (approximately) agree with the table? Now do
it for the first two rows. Does this agree with the table?
Let us talk a little bit more about the example y0 = y2/3, y(0) = 1. Suppose that instead of the
value y(2) we wish to find y(3). The results of this effort are listed in Table 1.2 on the next page for
successive halvings of h. What is going on here? Well, you should solve the equation exactly and
you will notice that the solution does not exist at x = 3. In fact, the solution goes to infinity when
you approach x = 3.
Another case where things go bad is if the solution oscillates wildly near some point. The
solution may exist at all points, but even a much better numerical method than Euler would need
an insanely small step size to approximate the solution with reasonable precision. And computers
might not be able to easily handle such a small step size.
In real applications we would not use a simple method such as Euler’s. The simplest method that
would probably be used in a real application is the standard Runge-Kutta method (see exercises).
That is a fourth order method, meaning that if we halve the interval, the error generally goes down
by a factor of 16 (it is fourth order as 1/16 = 1/2 × 1/2 × 1/2 × 1/2).
1.7. NUMERICAL METHODS: EULER’S METHOD 51
h Approximate y(3)
1 3.16232
0.5 4.54329
0.25 6.86079
0.125 10.80321
0.0625 17.59893
0.03125 29.46004
0.015625 50.40121
0.0078125 87.75769
Table 1.2: Attempts to use Euler’s to approximate y(3) where of y0 = y2/3, y(0) = 1.
Choosing the right method to use and the right step size can be very tricky. There are several
competing factors to consider.
• Computational time: Each step takes computer time. Even if the function f is simple to
compute, we do it many times over. Large step size means faster computation, but perhaps
not the right precision.
• Roundoff errors: Computers only compute with a certain number of significant digits. Errors
introduced by rounding numbers off during our computations become noticeable when the
step size becomes too small relative to the quantities we are working with. So reducing
step size may in fact make errors worse. There is a certain optimum step size such that the
precision increases as we approach it, but then starts getting worse as we make our step size
smaller still. Trouble is: this optimum may be hard to find.
• Stability: Certain equations may be numerically unstable. What may happen is that the
numbers never seem to stabilize no matter how many times we halve the interval. We may
need a ridiculously small interval size, which may not be practical due to roundoff errors or
computational time considerations. Such problems are sometimes called stiff . In the worst
case, the numerical computations might be giving us bogus numbers that look like a correct
answer. Just because the numbers seem to have stabilized after successive halving, does not
mean that we must have the right answer.
We have seen just the beginnings of the challenges that appear in real applications. Numerical
approximation of solutions to differential equations is an active research area for engineers and
mathematicians. For example, the general purpose method used for the ODE solver in Matlab and
Octave (as of this writing) is a method that appeared in the literature only in the 1980s.
52 CHAPTER 1. FIRST ORDER ODES
1.7.1 Exercises
dx
Exercise 1.7.3: Consider = (2t − x)2 , x(0) = 2. Use Euler’s method with step size h = 0.5 to
dt
approximate x(1).
dx
Exercise 1.7.4: Consider = t − x, x(0) = 1. a) Use Euler’s method with step sizes h =
dt
1, 1/2, 1/4, 1/8 to approximate x(1). b) Solve the equation exactly. c) Describe what happens to the
errors for each h you used. That is, find the factor by which the error changed each time you halved
the interval.
Exercise 1.7.5: Approximate the value of e by looking at the initial value problem y0 = y with
y(0) = 1 and approximating y(1) using Euler’s method with a step size of 0.2.
Exercise 1.7.6: Example of numerical instability: Take y0 = −5y, y(0) = 1. We know that the
solution should decay to zero as x grows. Using Euler’s method, start with h = 1 and compute
y1 , y2 , y3 , y4 to try to approximate y(4). What happened? Now halve the interval. Keep halving the
interval and approximating y(4) until the numbers you are getting start to stabilize (that is, until
they start going towards zero). Note: You might want to use a calculator.
The simplest method used in practice is the Runge-Kutta method. Consider dx dy
= f (x, y),
y(x0 ) = y0 , and a step size h. Everything is the same as in Euler’s method, except the computation
of yi+1 and xi+1 .
k1 = f (xi , yi ),
k2 = f xi + h/2, yi + k1 (h/2) , xi+1 = xi + h,
k1 + 2k2 + 2k3 + k4
k3 = f xi + h/2, yi + k2 (h/2) , yi+1 = yi +
h,
6
k4 = f (xi + h, yi + k3 h).
dy
Exercise 1.7.7: Consider = yx2 , y(0) = 1. a) Use Runge-Kutta (see above) with step sizes h = 1
dx
and h = 1/2 to approximate y(1). b) Use Euler’s method with h = 1 and h = 1/2. c) Solve exactly, find
the exact value of y(1), and compare.
Exercise 1.7.101: Let x0 = sin(xt), and x(0) = 1. Approximate x(1) using Euler’s method with step
sizes 1, 0.5, 0.25. Use a calculator and compute up to 4 decimal digits.
Exercise 1.7.102: Let x0 = 2t, and x(0) = 0. a) Approximate x(4) using Euler’s method with step
sizes 4, 2, and 1. b) Solve exactly, and compute the errors. c) Compute the factor by which the
errors changed.
Exercise 1.7.103: Let x0 = xe xt+1 , and x(0) = 0. a) Approximate x(4) using Euler’s method with
step sizes 4, 2, and 1. b) Guess an exact solution based on part a) and compute the errors.
1.7. NUMERICAL METHODS: EULER’S METHOD 53
There is a simple way to improve Euler’s method to make it a second order method by doing
dy
just one extra step. Consider dx = f (x, y), y(x0 ) = y0 , and a step size h. What we do is to pretend we
compute the next step as in Euler, that is, we start with (xi , yi ), we compute a slope k1 = f (xi , yi ),
and then look at the point (xi + h, yi + k1 h). Instead of letting our new point be (xi + h, yi + k1 h), we
compute the slope at that point, call it k2 , and then take the average of k1 and k2 , hoping that the
average is going to be closer to the actual slope on the interval from xi to xi + h. And we are correct,
if we halve the step, the error should go down by a factor of 22 = 4. To summarize, the setup is the
same as for regular Euler, except the computation of yi+1 and xi+1 .
k1 = f (xi , yi ), xi+1 = xi + h,
k1 + k2
k2 = f (xi + h, yi + k1 h), yi+1 = yi + h.
2
dy
Exercise 1.7.104: Consider = x + y, y(0) = 1. a) Use the improved Euler’s method with step
dx
sizes h = /4 and h = /8 to approximate y(1). b) Use Euler’s method with h = 1/4 and h = 1/8. c)
1 1
Solve exactly, find the exact value of y(1). d) Compute the errors, and the factors by which the errors
changed.
54 CHAPTER 1. FIRST ORDER ODES
An interpretation of the setup is that at each point ~v = (M, N) is a vector in the plane, that is, a
direction and a magnitude. As M and N are functions of (x, y), we have a vector field. The particular
1.8. EXACT EQUATIONS 55
vector field ~v that comes from an exact equation is a so-called conservative vector field, that is, a
vector field that comes with a potential function F(x, y), such that
∂F ∂F
!
~v = , .
∂x ∂y
Let γ be a path in the plane starting at (x1 , y1 ) and ending at (x2 , y2 ). If we think of ~v as force, then
the work required to move along γ is
Z Z
~v(~r) · d~r = M dx + N dy = F(x2 , y2 ) − F(x1 , y1 ).
γ γ
That is, the work done only depends on endpoints, that is where we start and where we end. For
example, suppose F is gravitational potential. The derivative of F given by ~v is the gravitational
force. What we are saying is that the work required to move a heavy box from the ground floor to
the roof, only depends on the change in potential energy. That is, the work done is the same no
matter what path we took; if we took the stairs or the elevator. Although if we took the elevator, the
elevator is doing the work for us. The curves F(x, y) = C are those where no work need be done,
such as the heavy box sliding along without accelerating or breaking on a perfectly flat roof, on a
cart with incredibly well oiled wheels.
An exact equation is a conservative vector field, and the implicit solution of this equation is the
potential function.
Integrating, we find A(y) = y2 . We could add a constant of integration if we wanted to, but there is
no need. We found F(x, y) = x2 + y2 . Next for a constant C, we solve
F x, y(x) = C.
√
for y in terms of x. In this case, we obtain y = ± C 2 − x2 as we did before.
Exercise 1.8.1: Why did we not need to add a constant of integration when integrating A0 (y) = 2y?
Add a constant of integration, say 3, and see what F you get. What is the difference from what we
got above, and why does it not matter?
(ii) Differentiate this F in y, and set that equal to N, so that we may find A(y) by integration.
The procedure can also be done by first integrating in y and then differentiating in x. Pretty easy
huh? Let’s try this again.
Example 1.8.2: Consider now 2x + y + xy dxdy
= 0.
OK, so M = 2x + y and N = xy. We try to proceed as before. Suppose F exists. Then
F x (x, y) = 2x + y. We integrate:
F(x, y) = x2 + xy + A(y)
for some function A(y). Differentiate in y and set equal to N:
N = xy = Fy (x, y) = x + A0 (y).
But there is no way to satisfy this requirement! The function xy cannot be written as x plus a
function of y. The equation is not exact; no potential function F exists.
Is there an easier way to check for the existence of F, other than failing in trying to find it? Turns
out there is. Suppose M = F x and N = Fy . Then as long as the second derivatives are continuous,
∂M ∂2 F ∂2 F ∂N
= = = .
∂y ∂y∂x ∂x∂y ∂x
Theorem 1.8.1 (Poincarè). If M and N are continuously differentiable functions of (x, y), and
∂M
∂y
= ∂N
∂x
. Then near any point there is a function F(x, y) such that M = ∂F
∂x
and N = ∂F
∂y
.
∗
Named for the French polymath Jules Henri Poincarè (1854–1912).
1.8. EXACT EQUATIONS 57
The theorem doesn’t give us a global F defined everywhere. In general, we can only find the
potential locally, near some initial point. By this time, we have come to expect this from differential
equations.
Let us return to the example above where M = 2x + y and N = xy. Notice My = 1 and N x = y,
which are clearly not equal. The equation is not exact.
Example 1.8.3: Solve
dy −2x − y
= , y(0) = 1.
dx x−1
We write the equation as
dy
(2x + y) + (x − 1) = 0,
dx
so M = 2x + y and N = x − 1. Then
My = 1 = N x .
The equation is exact. Integrating M in x, we find
F(x, y) = x2 + xy + A(y).
x − 1 = x + A0 (y).
So A0 (y) = −1, and A(y) = −y will work. Take F(x, y) = x2 + xy−y. We wish to solve x2 + xy−y = C.
First let us find C. As y(0) = 1 then F(0, 1) = C. Therefore 02 + 0 × 1 − 1 = C, so C = −1. Now we
solve x2 + xy − y = −1 for y to get
−x2 − 1
y= .
x−1
Example 1.8.4: Solve
y x
− dx + 2 dy = 0, y(1) = 2.
x2 +y 2 x + y2
We leave to the reader to check that My = N x .
This vector field (M, N) is not conservative if considered as a vector field of the entire plane
minus the origin. The problem is that if the curve γ is a circle around the origin, say starting at (1, 0)
and ending at (1, 0) going counterclockwise, then if F existed we would expect
Z Z
−y x
0 = F(1, 0) − F(1, 0) = F x dx + Fy dy = dx + 2 dy = 2π.
γ x +y x + y2
2 2
γ
That is nonsense! We leave the computation of the path integral to the interested reader, or you can
consult your multivariable calculus textbook. So there is no potential function F defined everywhere
outside the origin (0, 0).
58 CHAPTER 1. FIRST ORDER ODES
If we think back to the theorem, it does not guarantee such a function anyway. It only guarantees
a potential function locally, that is only in some region near the initial point. As y(1) = 2 we start at
the point (1, 2). Considering x > 0 and integrating M in x or N in y, we find
F(x, y) = arctan y/x .
The implicit solution is arctan y/x = C. Solving, y = tan(C)x. That is, the solution is a straight line.
Solving y(1) = 2 gives us that tan(C) = 2, and so y = 2x is the desired solution. See Figure 1.16,
and note that the solution only exists for x > 0.
-5.0 -2.5 0.0 2.5 5.0
10 10
5 5
0 0
-5 -5
-10 -10
-5.0 -2.5 0.0 2.5 5.0
y
2 dx + = 0, y(1) = 2, with initial point marked.
x
Figure 1.16: Solution to − x2 +y x2 +y2
dy
dy
r(x)p(x)y − r(x) f (x) + r(x) = 0.
dx
Then M = r(x)p(x)y − r(x) f (x), so My = r(x)p(x), while N = r(x), so N x = r0 (x) = r(x)p(x). In
other words, we have an exact equation. Integrating factors for linear functions are just a special
case of integrating factors for exact equations.
But how do we find the integrating factor u? Well, given an equation
M dx + N dy = 0,
My − N x
u = u0 .
N
My −N x
In particular, N
ought to be a function of x alone (not depend on y). If so, then we have a linear
equation
My − N x
u0 − u = 0.
N
60 CHAPTER 1. FIRST ORDER ODES
M −N
R
Letting P(x) = yN x , we solve using the standard integrating factor method, to find u(x) = Ce P(x) dx .
The constant
R in the solution is not relevant, we need any nonzero solution, we take C = 1. So
u(x) = e P(x) dx
is the integrating factor.
Similarly we could try a function of the form u(y). Then
My − N x
u = −u0 .
M
My −N x
In particular M
ought to be a function of y alone. If so, then we have a linear equation
My − N x
u0 + u = 0.
M
M −N x
R R
Letting Q(y) = yM we find u(y) = Ce− Q(y) dy
, and we can take C = 1. So u(y) = e− Q(y) dy
is the
integrating factor.
Example 1.8.6: Solve
x2 + y2 dy
+ 2y = 0.
x+1 dx
x2 +y2
Let M = x+1
and N = 2y. Compute
2y 2y
My − N x = −0= .
x+1 x+1
As this is not zero, the equation is not exact. We notice
My − N x 2y 1 1
P(x) = = =
N x + 1 2y x + 1
is a function of x alone. We compute the integrating factor
R
e P(x) dx
= eln(x+1) = x + 1.
First compute
My − N x = 2y − y = y.
As this is not zero, the equation is not exact. We observe
My − N x y 1
Q(y) = = 2 =
M y y
xy + 1 dy
y+ = 0.
y dx
The reader should double check that this equation is exact. We follow the procedure for exact
equations
F(x, y) = xy + A(y),
and
xy + 1 1
= x + = x + A0 (y). (1.6)
y y
Consequently A0 (y) = 1y or A(y) = ln y. Thus F(x, y) = xy + ln y. It is not possible to solve
F(x, y) = C for y in terms of elementary functions, so let us be content with the implicit solution:
xy + ln y = C.
We are looking for the general solution and we divided by y above. We should check what happens
when y = 0, as the equation itself makes perfect sense in that case. We plug in y = 0 to find the
equation is satisfied. So y = 0 is also a solution.
1.8.3 Exercises
Exercise 1.8.2: Solve the following exact equations, implicit general solutions will suffice:
a) (2xy + x2 ) dx + (x2 + y2 + 1) dy = 0
b) x5 + y5 dx
dy
=0
c) e + y + 3xy2 dx
x 3 dy
=0
d) (x + y) cos(x) + sin(x) + sin(x)y0 = 0
62 CHAPTER 1. FIRST ORDER ODES
Exercise 1.8.3: Find the integrating factor for the following equations making them into exact
equations:
a) e xy dx + yx e xy dy = 0
b) e y+y
x 3
2 dx + 3x dy = 0
2
c) 4(y2 + x) dx + 2x+2y
y
dy = 0
d) 2 sin(y) dx + x cos(y) dy = 0
Exercise 1.8.4: Suppose you have an equation of the form: f (x) + g(y) dx
dy
= 0.
a) Show it is exact.
b) Find the form of the potential function in terms of f and g.
Exercise 1.8.5: Suppose that we have the equation f (x) dx − dy = 0.
a) Is this equation exact?
b) Find the general solution using a definite integral.
1+xy
dx + 1/y + x dy = 0
Exercise 1.8.6: Find the potential function F(x, y) of the exact equation x
in two different ways.
a) Integrate M in terms of x and then differentiate in y and set to N.
b) Integrate N in terms of y and then differentiate in x and set to M.
Exercise 1.8.7: A function u(x, y) is said to be harmonic function if u xx + uyy = 0.
a) Show that −uy dx + u x dy = 0 is an exact equation. Therefore there exists (at least locally) the
so-called harmonic conjugate function v(x, y) such that v x = −uy and vy = u x .
Verify that the following u are harmonic and find the corresponding harmonic conjugates v:
b) u = 2xy
c) u = e x cos y
d) u = x3 − 3xy2
Exercise 1.8.101: Solve the following exact equations, implicit general solutions will suffice:
a) cos(x) + ye xy + xe xy y0 = 0
b) (2x + y) dx + (x − 4y) dy = 0
c) e x + ey dx
dy
=0
d) (3x2 + 3y) dx + (3y2 + 3x) dy = 0
Exercise 1.8.102: Find the integrating factor for the following equations making them into exact
equations:
a) 1y dx + 3y dy = 0
b) dx − e−x−y dy = 0
c) cos(x) + 1y dx + y12 dy = 0
y2
2
d) 2y + yx dx + (2y + x) dy = 0
Exercise 1.8.103: a) Show that every separable equation y0 = f (x)g(y) can be written as an exact
equation, and verify that it is indeed exact. b) Using this rewrite y0 = xy as an exact equation, solve
it and verify that the solution is the same as it was in Example 1.3.1.
Chapter 2
where p(x) = B(x)/A(x), q(x) = C(x)/A(x), and f (x) = F(x)/A(x). The word linear means that the equation
contains no powers nor functions of y, y0 , and y00 .
In the special case when f (x) = 0, we have a so-called homogeneous equation
If we know two solutions of a linear homogeneous equation, we know a lot more of them.
Theorem 2.1.1 (Superposition). Suppose y1 and y2 are two solutions of the homogeneous equation
(2.2). Then
y(x) = C1 y1 (x) + C2 y2 (x),
also solves (2.2) for arbitrary constants C1 and C2 .
63
64 CHAPTER 2. HIGHER ORDER LINEAR ODES
That is, we can add solutions together and multiply them by constants to obtain new and different
solutions. We call the expression C1 y1 + C2 y2 a linear combination of y1 and y2 . Let us prove this
theorem; the proof is very enlightening and illustrates how linear equations work.
Proof: Let y = C1 y1 + C2 y2 . Then
y00 + py0 + qy = (C1 y1 + C2 y2 )00 + p(C1 y1 + C2 y2 )0 + q(C1 y1 + C2 y2 )
= C1 y001 + C2 y002 + C1 py01 + C2 py02 + C1 qy1 + C2 qy2
= C1 (y001 + py01 + qy1 ) + C2 (y002 + py02 + qy2 )
= C1 · 0 + C2 · 0 = 0.
The proof becomes even simpler to state if we use the operator notation. An operator is an
object that eats functions and spits out functions (kind of like what a function is, but a function eats
numbers and spits out numbers). Define the operator L by
Ly = y00 + py0 + qy.
The differential equation now becomes Ly = 0. The operator (and the equation) L being linear
means that L(C1 y1 + C2 y2 ) = C1 Ly1 + C2 Ly2 . The proof above becomes
Ly = L(C1 y1 + C2 y2 ) = C1 Ly1 + C2 Ly2 = C1 · 0 + C2 · 0 = 0.
Two different solutions to the second equation y00 − k2 y = 0 are y1 = cosh(kx) and y2 = sinh(kx).
Let us remind ourselves of the definition, cosh x = e +e
x −x x −x
2
and sinh x = e −e
2
. Therefore, these are
solutions by superposition as they are linear combinations of the two exponential solutions.
The functions sinh and cosh are sometimes more convenient to use than the exponential. Let us
review some of their properties.
cosh 0 = 1 sinh 0 = 0
d d
cosh x = sinh x sinh x = cosh x
dx dx
cosh2 x − sinh2 x = 1
Exercise 2.1.1: Derive these properties using the definitions of sinh and cosh in terms of exponen-
tials.
Linear equations have nice and simple answers to the existence and uniqueness question.
Theorem 2.1.2 (Existence and uniqueness). Suppose p, q, f are continuous functions on some
interval I, a is a number in I, and a, b0 , b1 are constants. The equation
y00 + p(x)y0 + q(x)y = f (x),
has exactly one solution y(x) defined on the same interval I satisfying the initial conditions
y(a) = b0 , y0 (a) = b1 .
2.1. SECOND ORDER LINEAR ODES 65
For example, the equation y00 + k2 y = 0 with y(0) = b0 and y0 (0) = b1 has the solution
b1
y(x) = b0 cos(kx) + sin(kx).
k
The equation y00 − k2 y = 0 with y(0) = b0 and y0 (0) = b1 has the solution
b1
y(x) = b0 cosh(kx) + sinh(kx).
k
Using cosh and sinh in this solution allows us to solve for the initial conditions in a cleaner way
than if we have used the exponentials.
The initial conditions for a second order ODE consist of two equations. Common sense tells us
that if we have two arbitrary constants and two equations, then we should be able to solve for the
constants and find a solution to the differential equation satisfying the initial conditions.
Question: Suppose we find two different solutions y1 and y2 to the homogeneous equation (2.2).
Can every solution be written (using superposition) in the form y = C1 y1 + C2 y2 ?
Answer is affirmative! Provided that y1 and y2 are different enough in the following sense. We
say y1 and y2 are linearly independent if one is not a constant multiple of the other.
Theorem 2.1.3. Let p, q be continuous functions. Let y1 and y2 be two linearly independent
solutions to the homogeneous equation (2.2). Then every other solution is of the form
y = C1 y1 + C2 y2 .
For example, we found the solutions y1 = sin x and y2 = cos x for the equation y00 + y = 0. It is
not hard to see that sine and cosine are not constant multiples of each other. If sin x = A cos x for
some constant A, we let x = 0 and this would imply A = 0. But then sin x = 0 for all x, which is
preposterous. So y1 and y2 are linearly independent. Hence
y = C1 cos x + C2 sin x
2.1.1 Exercises
Exercise 2.1.2: Show that y = e x and y = e2x are linearly independent.
Exercise 2.1.4: Prove the superposition principle for nonhomogeneous equations. Suppose that y1
is a solution to Ly1 = f (x) and y2 is a solution to Ly2 = g(x) (same linear operator L). Show that
y = y1 + y2 solves Ly = f (x) + g(x).
Exercise 2.1.5: For the equation x2 y00 − xy0 = 0, find two solutions, show that they are linearly
independent and find the general solution. Hint: Try y = xr .
Equations of the form ax2 y00 + bxy0 + cy = 0 are called Euler’s equations or Cauchy-Euler
equations. They are solved by trying y = xr and solving for r (assume that x ≥ 0 for simplicity).
Exercise 2.1.6: Suppose that (b − a)2 − 4ac > 0. a) Find a formula for the general solution
of ax2 y00 + bxy0 + cy = 0. Hint: Try y = xr and find a formula for r. b) What happens when
(b − a)2 − 4ac = 0 or (b − a)2 − 4ac < 0?
Exercise 2.1.7: Same equation as in Exercise 2.1.6. Suppose (b − a)2 − 4ac = 0. Find a formula
for the general solution of ax2 y00 + bxy0 + cy = 0. Hint: Try y = xr ln x for the second solution.
If you have one solution to a second order linear homogeneous equation you can find another
one. This is the reduction of order method.
Exercise 2.1.8 (reduction of order): Suppose y1 is a solution to y00 + p(x)y0 + q(x)y = 0. Show that
R
e− p(x) dx
Z
y2 (x) = y1 (x) 2 dx
y1 (x)
is also a solution.
Note: If you wish to come up with the formula for reduction of order yourself, start by trying
y2 (x) = y1 (x)v(x). Then plug y2 into the equation, use the fact that y1 is a solution, substitute w = v0 ,
and you have a first order linear equation in w. Solve for w and then for v. When solving for w, make
sure to include a constant of integration. Let us solve some famous equations using the method.
Exercise 2.1.9 (Chebyshev’s equation of order 1): Take (1 − x2 )y00 − xy0 + y = 0. a) Show that y = x
is a solution. b) Use reduction of order to find a second linearly independent solution. c) Write
down the general solution.
Exercise 2.1.10 (Hermite’s equation of order 2): Take y00 − 2xy0 + 4y = 0. a) Show that y = 1 − 2x2
is a solution. b) Use reduction of order to find a second linearly independent solution. c) Write
down the general solution.
Exercise 2.1.104: Find the general solution to xy00 + y0 = 0. Hint: Notice that it is a first order
ODE in y0 .
Exercise 2.1.105: Write down an equation (guess) for which we have the solutions e x and e2x . Hint:
Try an equation of the form y00 + Ay0 + By = 0 for constants A and B, plug in both e x and e2x and
solve for A and B.
68 CHAPTER 2. HIGHER ORDER LINEAR ODES
Let us generalize this example into a method. Suppose that we have an equation
ay00 + by0 + cy = 0, (2.3)
2.2. CONSTANT COEFFICIENT SECOND ORDER LINEAR ODES 69
(ii) If r1 = r2 (happens when b2 − 4ac = 0), then (2.3) has the general solution
y = (C1 + C2 x) er1 x .
For another example of the first case, take the equation y00 − k2 y = 0. Here the characteristic
equation is r2 − k2 = 0 or (r − k)(r + k) = 0. Consequently, e−kx and ekx are the two linearly
independent solutions.
Example 2.2.1: Find the general solution of
y00 − 8y0 + 16y = 0.
The characteristic equation is r2 − 8r + 16 = (r − 4)2 = 0. The equation has a double root
r1 = r2 = 4. The general solution is, therefore,
y = (C1 + C2 x) e4x = C1 e4x + C2 xe4x .
Exercise 2.2.2: Check that e4x and xe4x are linearly independent.
That e4x solves the equation is clear. If xe4x solves the equation, then we know we are done. Let
us compute y0 = e4x + 4xe4x and y00 = 8e4x + 16xe4x . Plug in
y00 − 8y0 + 16y = 8e4x + 16xe4x − 8(e4x + 4xe4x ) + 16xe4x = 0.
We should note that in practice, doubled root rarely happens. If coefficients are picked truly
randomly we are very unlikely to get a doubled root.
Let us give a short proof for why the solution xerx works when the root is doubled. This case
r x r1 x
is really a limiting case of when the two roots are distinct and very close. Note that e 2r2 −e −r1
is a
solution when the roots are distinct. When we take the limit as r1 goes to r2 , we are really taking
the derivative of erx using r as the variable. Therefore, the limit is xerx , and hence this is a solution
in the doubled root case.
70 CHAPTER 2. HIGHER ORDER LINEAR ODES
• 1
3−2i
= 1 3+2i
3−2i 3+2i
= 3+2i
13
= 3
13
+ 2
13
i.
We also define the exponential ea+ib of a complex number. We do this by writing down the
Taylor series and plugging in the complex number. Because most properties of the exponential can
be proved by looking at the Taylor series, these properties still hold for the complex exponential.
For example the very important property: e x+y = e x ey . This means that ea+ib = ea eib . Hence if we
can compute eib , we can compute ea+ib . For eib we use the so-called Euler’s formula.
Theorem 2.2.2 (Euler’s formula).
ay00 + by0 + cy = 0.
If the characteristic equation has the roots α ± iβ (when b2 − 4ac < 0), then the general solution is
Example 2.2.2: Find the general solution of y00 + k2 y = 0, for a constant k > 0.
The characteristic equation is r2 + k2 = 0. Therefore, the roots are r = ±ik, and by the theorem,
we have the general solution
y = C1 cos(kx) + C2 sin(kx).
Example 2.2.3: Find the solution of y00 − 6y0 + 13y = 0, y(0) = 0, y0 (0) = 10.
The characteristic equation is r2 − 6r + 13 = 0. By completing the square we get (r − 3)2 + 22 = 0
and hence the roots are r = 3 ± 2i. By the theorem we have the general solution
To find the solution satisfying the initial conditions, we first plug in zero to get
We again plug in the initial condition and obtain 10 = y0 (0) = 2C2 , or C2 = 5. Hence the solution
we are seeking is
y = 5e3x sin(2x).
2.2.3 Exercises
Exercise 2.2.6: Find the general solution of 2y00 + 2y0 − 4y = 0.
Exercise 2.2.7: Find the general solution of y00 + 9y0 − 10y = 0.
Exercise 2.2.8: Solve y00 − 8y0 + 16y = 0 for y(0) = 2, y0 (0) = 0.
Exercise 2.2.9: Solve y00 + 9y0 = 0 for y(0) = 1, y0 (0) = 1.
Exercise 2.2.10: Find the general solution of 2y00 + 50y = 0.
Exercise 2.2.11: Find the general solution of y00 + 6y0 + 13y = 0.
Exercise 2.2.12: Find the general solution of y00 = 0 using the methods of this section.
2.2. CONSTANT COEFFICIENT SECOND ORDER LINEAR ODES 73
Exercise 2.2.13: The method of this section applies to equations of other orders than two. We will
see higher orders later. Try to solve the first order equation 2y0 + 3y = 0 using the methods of this
section.
Exercise 2.2.14: Let us revisit the Cauchy-Euler equations of Exercise 2.1.6 on page 66. Suppose
now that (b − a)2 − 4ac < 0. Find a formula for the general solution of ax2 y00 + bxy0 + cy = 0. Hint:
Note that xr = er ln x .
Exercise 2.2.15: Find the solution to y00 − (2α)y0 + α2 y = 0, y(0) = a, y0 (0) = b, where α, a, and b
are real numbers.
Exercise 2.2.16: Construct an equation such that y = C1 e−2x cos(3x) + C2 e−2x sin(3x) is the general
solution.
Exercise 2.2.105: Find the solution to z00 (t) = −2z0 (t) − 2z(t), z(0) = 2, z0 (0) = −2.
Exercise 2.2.106: Find the solution to y00 − (α + β)y0 + αβy = 0, y(0) = a, y0 (0) = b, where α, β, a,
and b are real numbers, and α , β.
Exercise 2.2.107: Construct an equation such that y = C1 e3x + C2 e−2x is the general solution.
74 CHAPTER 2. HIGHER ORDER LINEAR ODES
It is possible to find the solution by high school algebra, but it would be a pain. The sensible way to
solve a system of equations such as this is to use matrix algebra, see § 3.2. For now we note that the
solution is C1 = −1/4, C2 = 1, and C3 = 1/4. The specific solution to the ODE is
−1 −x 1
y=e + e x + e3x .
4 4
Next, suppose that we have real roots, but they are repeated. Let us say we have a root r repeated
k times. In the spirit of the second order solution, and for the same reasons, we have the solutions
erx , xerx , x2 erx , ..., xk−1 erx .
We take a linear combination of these solutions to find the general solution.
Example 2.3.4: Solve
y(4) − 3y000 + 3y00 − y0 = 0.
We note that the characteristic equation is
r4 − 3r3 + 3r2 − r = 0.
By inspection we note that r4 − 3r3 + 3r2 − r = r(r − 1)3 . Hence the roots given with multiplicity
are r = 0, 1, 1, 1. Thus the general solution is
y = (C1 + C2 x + C3 x2 ) e x + |{z}
C4 .
| {z }
terms coming from r=1 from r=0
The case of complex roots is similar to second order equations. Complex roots always come in
pairs r = α±iβ. Suppose we have two such complex roots, each repeated k times. The corresponding
solution is
(C0 + C1 x + · · · + Ck−1 xk−1 ) eαx cos(βx) + (D0 + D1 x + · · · + Dk−1 xk−1 ) eαx sin(βx).
where C0 , . . . , Ck−1 , D0 , . . . , Dk−1 are arbitrary constants.
Example 2.3.5: Solve
y(4) − 4y000 + 8y00 − 8y0 + 4y = 0.
The characteristic equation is
r4 − 4r3 + 8r2 − 8r + 4 = 0,
2
(r2 − 2r + 2) = 0,
2
(r − 1)2 + 1 = 0.
Hence the roots are 1 ± i, both with multiplicity 2. Hence the general solution to the ODE is
y = (C1 + C2 x) e x cos x + (C3 + C4 x) e x sin x.
The way we solved the characteristic equation above is really by guessing or by inspection. It is not
so easy in general. We could also have asked a computer or an advanced calculator for the roots.
78 CHAPTER 2. HIGHER ORDER LINEAR ODES
2.3.3 Exercises
Exercise 2.3.1: Find the general solution for y000 − y00 + y0 − y = 0.
Exercise 2.3.2: Find the general solution for y(4) − 5y000 + 6y00 = 0.
Exercise 2.3.3: Find the general solution for y000 + 2y00 + 2y0 = 0.
Exercise 2.3.4: Suppose the characteristic equation for a differential equation is (r − 1)2 (r − 2)2 =
0. a) Find such a differential equation. b) Find its general solution.
Exercise 2.3.5: Suppose that a fourth order equation has a solution y = 2e4x x cos x. a) Find such
an equation. b) Find the initial conditions that the given solution satisfies.
Exercise 2.3.6: Find the general solution for the equation of Exercise 2.3.5.
Exercise 2.3.7: Let f (x) = e x − cos x, g(x) = e x + cos x, and h(x) = cos x. Are f (x), g(x), and h(x)
linearly independent? If so, show it, if not, find a linear combination that works.
Exercise 2.3.8: Let f (x) = 0, g(x) = cos x, and h(x) = sin x. Are f (x), g(x), and h(x) linearly
independent? If so, show it, if not, find a linear combination that works.
Exercise 2.3.9: Are x, x2 , and x4 linearly independent? If so, show it, if not, find a linear combina-
tion that works.
Exercise 2.3.10: Are e x , xe x , and x2 e x linearly independent? If so, show it, if not, find a linear
combination that works.
Exercise 2.3.102: Suppose that the characteristic equation of a third order differential equation
has roots ±2i and 3. a) What is the characteristic equation? b) Find the corresponding differential
equation. c) Find the general solution.
√
Exercise 2.3.103: Solve 1001y000 + 3.2y00 + πy0 − 4y = 0, y(0) = 0, y0 (0) = 0, y00 (0) = 0.
Exercise 2.3.104: Are e x , e x+1 , e2x , sin(x) linearly independent? If so, show it, if not find a linear
combination that works.
Exercise 2.3.105: Are sin(x), x, x sin(x) linearly independent? If so, show it, if not find a linear
combination that works.
Exercise 2.3.106: Find an equation such that y = cos(x), y = sin(x), y = e x are solutions.
2.4. MECHANICAL VIBRATIONS 79
This is a linear second order constant coefficient ODE. We set up some terminology about this
equation. We say the motion is
(i) forced, if F . 0 (if F is not identically zero),
(iv) undamped, if c = 0.
This system appears in lots of applications even if it does not at first seem like it. Many real
world scenarios can be simplified to a mass on a spring. For example, a bungee jump setup is
essentially a mass and spring system (you are the mass). It would be good if someone did the math
before you jump off the bridge, right? Let us give two other examples.
Here is an example for electrical engineers. Suppose that we have the
pictured RLC circuit. There is a resistor with a resistance of R ohms, an C
inductor with an inductance of L henries, and a capacitor with a capacitance E L
R
of C farads. There is also an electric source (such as a battery) giving a
voltage of E(t) volts at time t (measured in seconds). Let Q(t) be the charge
80 CHAPTER 2. HIGHER ORDER LINEAR ODES
in coulombs on the capacitor and I(t) be the current in the circuit. The relation between the two is
Q0 = I. By elementary principles we have that LI 0 + RI + Q/C = E. If we differentiate we get
1
LI 00 (t) + RI 0 (t) + I(t) = E 0 (t).
C
This is a nonhomogeneous second order constant coefficient linear equation. Further, as L, R, and C
are all positive, this system behaves just like the mass and spring system. The position of the mass
is replaced by the current. Mass is replaced by the inductance, damping is replaced by resistance
and the spring constant is replaced by one over the capacitance. The change in voltage becomes the
forcing function. Hence for constant voltage this is an unforced motion.
Our next example behaves like a mass and spring system only approxi-
mately. Suppose we have a mass m on a pendulum of length L. We wish to
L find an equation for the angle θ(t). Let g be the force of gravity. Elementary
θ physics mandates that the equation is of the form
g
θ00 + sin θ = 0.
L
Let us derive this equation using Newton’s second law; force equals mass times acceleration.
The acceleration is Lθ00 and mass is m. So mLθ00 has to be equal to the tangential component of the
force given by the gravity, that is mg sin θ in the opposite direction. So mLθ00 = −mg sin θ. The m
curiously cancels from the equation.
Now we make our approximation. For small θ we have that approximately sin θ ≈ θ. This can
be seen by looking at the graph. In Figure 2.1 we can see that for approximately −0.5 < θ < 0.5 (in
radians) the graphs of sin θ and θ are almost the same.
-1.0 -0.5 0.0 0.5 1.0
1.0 1.0
0.5 0.5
0.0 0.0
-0.5 -0.5
-1.0 -1.0
Therefore, when the swings are small, θ is always small and we can model the behavior by the
simpler linear equation
g
θ00 + θ = 0.
L
2.4. MECHANICAL VIBRATIONS 81
Note that the errors that we get from the approximation build up. So after a very long time, the
behavior of the real system might be substantially different from our solution. Also we will see that
in a mass-spring system, the amplitude is independent of the period. This is not true for a pendulum.
Nevertheless, for reasonably short periods of time and small swings (for example if the pendulum is
very long), the approximation is reasonably good.
In real world problems it is often necessary to make these types of simplifications. We must
understand both the mathematics and the physics of the situation to see if the simplification is valid
in the context of the questions we are trying to answer.
mx00 + kx = 0.
√
If we divide by m and let ω0 = k/m, then we can write the equation as
x00 + ω20 x = 0.
By a trigonometric identity, we have that for two different constants C and γ, we have
radians, the usual frequency is given by ω2π0 . It is simply a matter of where we put the constant 2π,
and that is a matter of taste.
The period of the motion is one over the frequency (in cycles per unit time) and hence ω2π0 . That
is the amount of time it takes to complete one full cycle.
Example 2.4.1: Suppose that m = 2 kg and k = 8 N/m. The whole mass and spring setup is sitting
on a truck that was traveling at 1 m/s. The truck crashes and hence stops. The mass was held in place
0.5 meters forward from the rest position. During the crash the mass gets loose. That is, the mass is
now moving forward at 1 m/s, while the other end of the spring is held in place. The mass therefore
starts oscillating. What is the frequency of the resulting oscillation and what is the amplitude. The
units are the mks units (meters-kilograms-seconds).
The setup means that the mass was at half a meter in the positive direction during the crash and
relative to the wall the spring is mounted to, the mass was moving forward (in the positive direction)
at 1 m/s. This gives us the initial conditions.
So the equation with initial conditions is
corresponds to the initial conditions x(0) = A and x0 (0) = ω0 B. Therefore, it is easy to figure out A
and B from the initial conditions. The amplitude and the phase shift can then be computed from A
and B. In the example, we have already found the amplitude C. Let us compute the phase shift. We
know that tan γ = B/A = 1. We take the arctangent of 1 and get π/4 or approximately 0.785. We still
need to check if this γ is in the correct quadrant (and add π to γ if it is not). Since both A and B are
positive, then γ should be in the first quadrant, π/4 radians is in the first quadrant, so γ = π/4.
Note: Many calculators and computer software do not only have the atan function for arctangent,
but also what is sometimes called atan2. This function takes two arguments, B and A, and returns
a γ in the correct quadrant for you.
2.4. MECHANICAL VIBRATIONS 83
0.0 2.5 5.0 7.5 10.0
1.0 1.0
0.5 0.5
0.0 0.0
-0.5 -0.5
-1.0 -1.0
0.0 2.5 5.0 7.5 10.0
mx00 + cx0 + kx = 0,
as
x00 + 2px0 + ω20 x = 0,
where r
k c
ω0 = , p= .
m 2m
The characteristic equation is
r2 + 2pr + ω20 = 0.
Using the quadratic formula we get that the roots are
q
r = −p ± p2 − ω20 .
The form of the solution depends on whether we get complex or real roots. We get real roots if and
only if the following number is nonnegative:
c 2 k c2 − 4km
p2 − ω20 = − = .
2m m 4m2
The sign of p2 − ω20 is the same as the sign of c2 − 4km. Thus we get real roots if and only if c2 − 4km
is nonnegative, or in other words if c2 ≥ 4km.
84 CHAPTER 2. HIGHER ORDER LINEAR ODES
Overdamping
When c2 − 4km > 0, we say the system isqoverdamped. In this case, there are two distinct
q real
roots r1 and r2 . Both roots are negative: As p2 − ω20 is always less than p, then −p ± p2 − ω20 is
negative in either case.
0 25 50 75 The solution is
100
1.5 1.5
Critical damping
When c2 − 4km = 0, we say the system is critically damped. In this case, there is one root of
multiplicity 2 and this root is −p. Our solution is
The behavior of a critically damped system is very similar to an overdamped system. After all a
critically damped system is in some sense a limit of overdamped systems. Since these equations
are really only an approximation to the real world, in reality we are never critically damped, it is a
place we can only reach in theory. We are always a little bit underdamped or a little bit overdamped.
It is better not to dwell on critical damping.
2.4. MECHANICAL VIBRATIONS 85
Underdamping
When c2 − 4km < 0, we say the system is underdamped. In this case, the roots are complex.
q
r = −p ± p2 − ω20
√ q
= −p ± −1 ω20 − p2
= −p ± iω1 ,
q
where ω1 = ω20 − p2 . Our solution is
or
x(t) = Ce−pt cos(ω1 t − γ).
An example plot is given in Figure 2.4. Note that we still have that x(t) → 0 as t → ∞.
1.0
0 5 10 15 20 25 In the figure we also show the envelope curves
30
1.0
−pt
Ce and −Ce−pt . The solution is the oscillating
line between the two envelope curves. The enve-
0.5 0.5
lope curves give the maximum amplitude of the
oscillation at any given point in time. For example
0.0
if you are bungee jumping, you are really inter-
0.0
2.4.4 Exercises
Exercise 2.4.2: Consider a mass and spring system with a mass m = 2, spring constant k = 3, and
damping constant c = 1. a) Set up and find the general solution of the system. b) Is the system
underdamped, overdamped or critically damped? c) If the system is not critically damped, find a c
that makes the system critically damped.
Exercise 2.4.4: Using the mks units (meters-kilograms-seconds), suppose you have a spring with
spring constant 4 N/m. You want to use it to weigh items. Assume no friction. You place the mass
on the spring and put it in motion. a) You count and find that the frequency is 0.8 Hz (cycles per
second). What is the mass? b) Find a formula for the mass m given the frequency ω in Hz.
Exercise 2.4.5: Suppose we add possible friction to Exercise 2.4.4. Further, suppose you do not
know the spring constant, but you have two reference weights 1 kg and 2 kg to calibrate your setup.
You put each in motion on your spring and measure the frequency. For the 1 kg weight you measured
1.1 Hz, for the 2 kg weight you measured 0.8 Hz. a) Find k (spring constant) and c (damping
constant). b) Find a formula for the mass in terms of the frequency in Hz. Note that there may be
more than one possible mass for a given frequency. c) For an unknown object you measured 0.2 Hz,
what is the mass of the object? Suppose that you know that the mass of the unknown object is more
than a kilogram.
Exercise 2.4.6: Suppose you wish to measure the friction a mass of 0.1 kg experiences as it slides
along a floor (you wish to find c). You have a spring with spring constant k = 5 N/m. You take the
spring, you attach it to the mass and fix it to a wall. Then you pull on the spring and let the mass go.
You find that the mass oscillates with frequency 1 Hz. What is the friction?
Exercise 2.4.101: A mass of 2 kilograms is on a spring with spring constant k newtons per meter
with no damping. Suppose the system is at rest and at time t = 0 the mass is kicked and starts
traveling at 2 meters per second. How large does k have to be to so that the mass does not go
further than 3 meters from the rest position?
Exercise 2.4.102: Suppose we have an RLC circuit with a resistor of 100 milliohms (0.1 ohms),
inductor of inductance of 50 millihenries (0.05 henries), and a capacitor of 5 farads, with constant
voltage. a) Set up the ODE equation for the current I. b) Find the general solution. c) Solve for
I(0) = 10 and I 0 (0) = 0.
Exercise 2.4.103: A 5000 kg railcar hits a bumper (a spring) at 1 m/s, and the spring compresses
by 0.1 m. Assume no damping. a) Find k. b) Find out how far does the spring compress when a
10000 kg railcar hits the spring at the same speed. c) If the spring would break if it compresses
further than 0.3 m, what is the maximum mass of a railcar that can hit it at 1 m/s? d) What is the
maximum mass of a railcar that can hit the spring without breaking at 2 m/s?
2.4. MECHANICAL VIBRATIONS 87
Exercise 2.4.104: A mass of m kg is on a spring with k = 3 N/m and c = 2 Ns/m. Find the mass
m0 for which there is critical damping. If m < m0 , does the system oscillate or not, that is, is it
underdamped or overdamped.
88 CHAPTER 2. HIGHER ORDER LINEAR ODES
y00p + 5y0p + 6y p = (Ax + B)00 + 5(Ax + B)0 + 6(Ax + B) = 0 + 5A + 6Ax + 6B = 6Ax + (5A + 6B).
yc = C1 e−2x + C2 e−3x .
1 2 3x − 1 3e−2x − 2e−3x + 3x − 1
y(x) = e−2x − e−3x + = .
3 9 9 9
Exercise 2.5.1: Check that y really solves the equation (2.6) and the given initial conditions.
Note: A common mistake is to solve for constants using the initial conditions with yc and only
add the particular solution y p after that. That will not work. You need to first compute y = yc + y p
and only then solve for the constants using the initial conditions.
A right hand side consisting of exponentials, sines, and cosines can be handled similarly. For
example,
y00 + 2y0 + 2y = cos(2x).
Let us find some y p . We start by guessing the solution includes some multiple of cos(2x). We may
have to also add a multiple of sin(2x) to our guess since derivatives of cosine are sines. We try
y p = A cos(2x) + B sin(2x).
90 CHAPTER 2. HIGHER ORDER LINEAR ODES
The left hand side must equal to right hand side. We group terms and we get that −4A + 4B + 2A = 1
and −4B − 4A + 2B = 0. So −2A + 4B = 1 and 2A + B = 0 and hence A = −1/10 and B = 1/5. So
− cos(2x) + 2 sin(2x)
y p = A cos(2x) + B sin(2x) = .
10
Similarly, if the right hand side contains exponentials we try exponentials. For example, for
Ly = e3x ,
We will plug in and then hopefully get equations that we can solve for A, B, C, D, E, and F. As you
can see this can make for a very long and tedious calculation very quickly. C’est la vie!
There is one hiccup in all this. It could be that our guess actually solves the associated
homogeneous equation. That is, suppose we have
y00 − 9y = e3x .
We would love to guess y = Ae3x , but if we plug this into the left hand side of the equation we get
There is no way we can choose A to make the left hand side be e3x . The trick in this case is to
multiply our guess by x to get rid of duplication with the complementary solution. That is first we
compute yc (solution to Ly = 0)
yc = C1 e−3x + C2 e3x ,
and we note that the e3x term is a duplicate with our desired guess. We modify our guess to
y = Axe3x and notice there is no duplication anymore. Let us try. Note that y0 = Ae3x + 3Axe3x and
y00 = 6Ae3x + 9Axe3x . So
Thus 6Ae3x is supposed to equal e3x . Hence, 6A = 1 and so A = 1/6. We can now write the general
solution as
1
y = yc + y p = C1 e−3x + C2 e3x + xe3x .
6
It is possible that multiplying by x does not get rid of all duplication. For example,
y00 − 6y0 + 9y = e3x .
The complementary solution is yc = C1 e3x + C2 xe3x . Guessing y = Axe3x would not get us anywhere.
In this case we want to guess y p = Ax2 e3x . Basically, we want to multiply our guess by x until all
duplication is gone. But no more! Multiplying too many times will not work.
Finally, what if the right hand side has several terms, such as
Ly = e2x + cos x.
In this case we find u that solves Lu = e2x and v that solves Lv = cos x (that is, do each term
separately). Then note that if y = u + v, then Ly = e2x + cos x. This is because L is linear; we have
Ly = L(u + v) = Lu + Lv = e2x + cos x.
where u1 and u2 are functions and not constants. We are trying to satisfy Ly = tan x. That gives us
one condition on the functions u1 and u2 . Compute (note the product rule!)
We can still impose one more condition at our discretion to simplify computations (we have two
unknown functions, so we should be allowed two conditions). We require that (u01 y1 + u02 y2 ) = 0.
This makes computing the second derivative easier.
y0 = u1 y01 + u2 y02 ,
y00 = (u01 y01 + u02 y02 ) + (u1 y001 + u2 y002 ).
Since y1 and y2 are solutions to y00 + y = 0, we know that y001 = −y1 and y002 = −y2 . (Note: If the
equation was instead y00 + p(x)y0 + q(x)y = 0 we would have y00i = −p(x)y0i − q(x)yi .) So
and hence
y00 + y = Ly = u01 y01 + u02 y02 .
For y to satisfy Ly = f (x) we must have f (x) = u01 y01 + u02 y02 .
So what we need to solve are the two equations (conditions) we imposed on u1 and u2 :
u01 y1 + u02 y2 = 0,
u01 y01 + u02 y02 = f (x).
We now solve for u01 and u02 in terms of f (x), y1 and y2 . We always get these formulas for any
Ly = f (x), where Ly = y00 + p(x)y0 + q(x)y. There is a general formula for the solution we can just
plug into, but it is better to just repeat what we do below. In our case the two equations become
Hence
And thus
u02 = sin(x),
− sin2 (x)
u01 = = − tan(x) sin(x).
cos(x)
Now we need to integrate u01 and u02 to get u1 and u2 .
Z Z
1 sin(x) − 1
u1 = u1 dx =
0
− tan(x) sin(x) dx = ln + sin(x),
sin(x) + 1
2
Z Z
u2 = u2 dx =
0
sin(x) dx = − cos(x).
2.5.4 Exercises
Exercise 2.5.2: Find a particular solution of y00 − y0 − 6y = e2x .
Exercise 2.5.4: Solve the initial value problem y00 + 9y = cos(3x) + sin(3x) for y(0) = 2, y0 (0) = 1.
Exercise 2.5.5: Set up the form of the particular solution but do not solve for the coefficients for
y(4) − 2y000 + y00 = e x .
Exercise 2.5.6: Set up the form of the particular solution but do not solve for the coefficients for
y(4) − 2y000 + y00 = e x + x + sin x.
Exercise 2.5.7: a) Using variation of parameters find a particular solution of y00 − 2y0 + y = e x .
b) Find a particular solution using undetermined coefficients. c) Are the two solutions you found
the same? See also Exercise 2.5.10.
94 CHAPTER 2. HIGHER ORDER LINEAR ODES
Exercise 2.5.8: Find a particular solution of y00 − 2y0 + y = sin(x2 ). It is OK to leave the answer as
a definite integral.
Exercise 2.5.9: For an arbitrary constant c find a particular solution to y00 − y = ecx . Hint: Make
sure to handle every possible real c.
Exercise 2.5.10: a) Using variation of parameters find a particular solution of y00 − y = e x . b) Find
a particular solution using undetermined coefficients. c) Are the two solutions you found the same?
What is going on?
Exercise 2.5.102: a) Find a particular solution to y00 + 2y = e x + x3 . b) Find the general solution.
Exercise 2.5.105: For an arbitrary constant c find the general solution to y00 − 2y = sin(x + c).
2.6. FORCED OSCILLATIONS AND RESONANCE 95
for some nonzero F(t). The setup is again: m is mass, c is friction, k is the spring constant, and F(t)
is an external force acting on the mass.
We are interested in periodic forcing, such as noncentered rotating parts, or perhaps loud sounds,
or other sources of periodic force. Once we learn about Fourier series in chapter 4, we will see that
we cover all periodic functions by simply considering F(t) = F0 cos(ωt) (or sine instead of cosine,
the calculations are essentially the same).
mx00 + kx = F0 cos(ωt).
This equation has the complementary solution (solution to the associated homogeneous equation)
F0
xp = cos(ωt).
m(ω20− ω2 )
F0
x = C1 cos(ω0 t) + C2 sin(ω0 t) + cos(ωt).
m(ω20 − ω2 )
96 CHAPTER 2. HIGHER ORDER LINEAR ODES
Hence
20
x= cos(πt) − cos(4t) .
16 − π 2
A − B A + B
2 sin sin = cos B − cos A
5 5 2 2
to get
4−π 4+π
0 0
! !!
20
x= 2 sin t sin t .
16 − π2 2 2
-5 -5
The function x is a high frequency wave modu-
lated by a low frequency wave.
-10
0 5 10 15 20
-10
Now suppose ω0 = ω. Obviously, we can-
20
Figure 2.5: Graph of 16−π
cos(πt) − cos(4t) . not try the solution A cos(ωt) and then use the
2
method of undetermined coefficients. We notice
that cos(ωt) solves the associated homogeneous
equation. Therefore, we try x p = At cos(ωt) + Bt sin(ωt). This time we need the sine term, since the
second derivative of t cos(ωt) contains sines. We write the equation
F0
x00 + ω2 x = cos(ωt).
m
Plugging x p into the left hand side we get
F0
2Bω cos(ωt) − 2Aω sin(ωt) = cos(ωt).
m
2.6. FORCED OSCILLATIONS AND RESONANCE 97
Hence A = 0 and B = F0
2mω
. Our particular solution is F0
2mω
t sin(ωt) and our general solution is
F0
x = C1 cos(ωt) + C2 sin(ωt) + t sin(ωt).
2mω
The important term is the last one (the particular solution we found). This term grows without
bound as t → ∞. In fact it oscillates between 2mω F0 t
and −F 0t
2mω
. The first two terms only oscillate
q
between ± C12 + C22 , which becomes smaller and smaller in proportion to the oscillations of the
last term as t gets larger. In Figure 2.6 we see the graph with C1 = C2 = 0, F0 = 2, m = 1, ω = π.
By forcing the system in just the right fre-
0 5 10 15 20
quency we produce very wild oscillations. This
5.0 kind of behavior is called resonance or perhaps
5.0
q
where ω1 = ω20 − p2 . In any case, we see that xc (t) → 0 as t → ∞. Furthermore, there can be no
conflicts when trying to solve for the undetermined coefficients by trying x p = A cos(ωt) + B sin(ωt).
Let us plug in and solve for A and B. We get (the tedious details are left to reader)
F0
(ω20 − ω2 )B − 2ωpA sin(ωt) + (ω20 − ω2 )A + 2ωpB cos(ωt) =
cos(ωt).
m
We solve for A and B:
(ω20 − ω2 )F0
A= 2
,
m(2ωp)2 + m(ω20 − ω2 )
2ωpF0
B= 2
.
m(2ωp)2 + m(ω20 − ω2 )
√
We also compute C = A2 + B2 to be
F0
C= q .
2
m (2ωp) + (ω0 − ω )
2 2 2
Or in the alternative notation we have amplitude C and phase shift γ where (if ω , ω0 )
B 2ωp
tan γ = = 2 .
A ω0 − ω2
2.6. FORCED OSCILLATIONS AND RESONANCE 99
Hence we have
F0
xp = q cos(ωt − γ).
2
m (2ωp) + (ω0 − ω )
2 2 2
in Figure 2.8. As you can see the practical resonance amplitude grows as damping gets smaller, and
practical resonance can disappear altogether when damping is large.
0.0 0.5 1.0 1.5 2.0 2.5 3.0
2.5 2.5
2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
0.0 0.0
0.0 0.5 1.0 1.5 2.0 2.5 3.0
Figure 2.8: Graph of C(ω) showing practical resonance with parameters k = 1, m = 1, F0 = 1. The top line
is with c = 0.4, the middle line with c = 0.8, and the bottom line with c = 1.6.
To find the maximum we need to find the derivative C 0 (ω). Computation shows
This is zero either when ω = 0 or when 2p2 + ω2 − ω20 = 0. In other words, C 0 (ω) = 0 when
q
ω= ω20 − 2p2 or ω = 0.
q
It can be shown that if ω20 − 2p2 is positive, then ω20 − 2p2 is the practical resonance frequency
(that is the point where C(ω) is maximal, note that in this case C 0 (ω) > 0 for small ω). If ω = 0 is
the maximum, then there is no practical resonance since we assume ω > 0 in our system. In this
case the amplitude gets larger as the forcing frequency gets smaller.
If practical resonance occurs, the frequency is smaller than ω0 . As the damping c (and hence p)
becomes smaller, the practical resonance frequency goes to ω0 . So when damping is very small, ω0
is a good estimate of the resonance frequency. This behavior agrees with the observation that when
c = 0, then ω0 is the resonance frequency.
The behavior is more complicated if the forcing function is not an exact cosine wave, but for
example a square wave. The reader is encouraged to come back to this section once we have learned
about the Fourier series.
2.6. FORCED OSCILLATIONS AND RESONANCE 101
2.6.3 Exercises
Exercise 2.6.1: Derive a formula for x sp if the equation is mx00 + cx0 + kx = F0 sin(ωt). Assume
c > 0.
Exercise 2.6.2: Derive a formula for x sp if the equation is mx00 +cx0 +kx = F0 cos(ωt)+F1 cos(3ωt).
Assume c > 0.
Exercise 2.6.3: Take mx00 + cx0 + kx = F0 cos(ωt). Fix m > 0, k > 0, and F0 > 0. Consider the
function C(ω). For what values of c (solve in terms of m, k, and F0 ) will there be no practical
resonance (that is, for what values of c is there no maximum of C(ω) for ω > 0)?
Exercise 2.6.4: Take mx00 + cx0 + kx = F0 cos(ωt). Fix c > 0, k > 0, and F0 > 0. Consider the
function C(ω). For what values of m (solve in terms of c, k, and F0 ) will there be no practical
resonance (that is, for what values of m is there no maximum of C(ω) for ω > 0)?
Exercise 2.6.5: Suppose a water tower in an earthquake acts as a mass-spring system. Assume
that the container on top is full and the water does not move around. The container then acts as a
mass and the support acts as the spring, where the induced vibrations are horizontal. Suppose that
the container with water has a mass of m = 10, 000 kg. It takes a force of 1000 newtons to displace
the container 1 meter. For simplicity assume no friction. When the earthquake hits the water tower
is at rest (it is not moving).
Suppose that an earthquake induces an external force F(t) = mAω2 cos(ωt).
a) What is the natural frequency of the water tower?
b) If ω is not the natural frequency, find a formula for the maximal amplitude of the resulting
oscillations of the water container (the maximal deviation from the rest position). The motion will
be a high frequency wave modulated by a low frequency wave, so simply find the constant in front
of the sines.
c) Suppose A = 1 and an earthquake with frequency 0.5 cycles per second comes. What is the
amplitude of the oscillations? Suppose that if the water tower moves more than 1.5 meter from the
rest position, the tower collapses. Will the tower collapse?
Exercise 2.6.101: A mass of 4 kg on a spring with k = 4 N/m and a damping constant c = 1 Ns/m.
Suppose that F0 = 2 N. Using forcing function F0 cos(ωt), find the ω that causes practical resonance
and find the amplitude.
Exercise 2.6.102: Derive a formula for x sp for mx00 + cx0 + kx = F0 cos(ωt) + A, where A is some
constant. Assume c > 0.
Exercise 2.6.103: Suppose there is no damping in a mass and spring system with m = 5, k = 20,
and F0 = 5. Suppose ω is chosen to be precisely the resonance frequency. a) Find ω. b) Find the
amplitude of the oscillations at time t = 100, given the system is at rest at t = 0.
102 CHAPTER 2. HIGHER ORDER LINEAR ODES
Chapter 3
Systems of ODEs
for some functions f1 and f2 . We call the above a system of differential equations. More precisely,
the above is a second order system of ODEs.
Example 3.1.1: Sometimes a system is easy to solve by solving for one variable and then for the
second variable. Take the first order system
y01 = y1 ,
y02 = y1 − y2 ,
or y2 = C1 x
2
e + C2 e−x . The general solution to the system is, therefore,
C1 x
y1 = C1 e x , y2 = e + C2 e−x .
2
We solve for C1 and C2 given the initial conditions. We substitute x = 0 and find that C1 = 1 and
C2 = 3/2. Thus the solution is y1 = e x , and y2 = (1/2)e x + (3/2)e−x .
Generally, we will not be so lucky to be able to solve for each variable separately as in the
example above, and we will have to solve for all variables at once.
k As an example application, let us think of mass and spring
m1 m2 systems again. Suppose we have one spring with constant k, but
two masses m1 and m2 . We can think of the masses as carts,
and we will suppose that they ride along a straight track with no
x1 x2 friction. Let x1 be the displacement of the first cart and x2 be the
displacement of the second cart. That is, we put the two carts somewhere with no tension on the
spring, and we mark the position of the first and second cart and call those the zero positions. Then
x1 measures how far the first cart is from its zero position, and x2 measures how far the second cart
is from its zero position. The force exerted by the spring on the first cart is k(x2 − x1 ), since x2 − x1
is how far the string is stretched (or compressed) from the rest position. The force exerted on the
second cart is the opposite, thus the same thing with a negative sign. Newton’s second law states
that force equals mass times acceleration. So the system of equations governing the setup is
m1 x100 = k(x2 − x1 ),
m2 x200 = −k(x2 − x1 ).
In this system we cannot solve for the x1 or x2 variable separately. That we must solve for both
x1 and x2 at once is intuitively clear, since where the first cart goes depends on exactly where the
second cart goes and vice-versa.
Before we talk about how to handle systems, let us note that in some sense we need only consider
first order systems. Let us take an nth order differential equation
u01 = u2 ,
u02 = u3 ,
..
.
un−1 = un ,
0
We solve this system for u1 , u2 , . . . , un . Once we have solved for the u’s, we can discard u2 through
un and let y = u1 . We note that this y solves the original equation.
For example, take x000 = 2x00 + 8x0 + x + t. Letting u1 = x, u2 = x0 , u3 = x00 , we find the system:
A similar process can be followed for a system of higher order differential equations. For
example, a system of k differential equations in k unknowns, all of order n, can be transformed into
a first order system of n × k equations and n × k unknowns.
Example 3.1.2: We can use this idea in reverse as well. Let us consider the system
x0 = 2y − x, y0 = x,
where the independent variable is t. We wish to solve for the initial conditions x(0) = 1, y(0) = 0.
If we differentiate the second equation we get y00 = x0 . We know what x0 is in terms of x and y,
and we know that x = y0 . So,
y00 = x0 = 2y − x = 2y − y0 .
We now have the equation y00 + y0 − 2y = 0. We know how to solve this equation and we find that
y = C1 e−2t + C2 et . Once we have y we use the equation y0 = x to get x.
x = y0 = −2C1 e−2t + C2 et .
We solve for the initial conditions 1 = x(0) = −2C1 + C2 and 0 = y(0) = C1 + C2 . Hence, C1 = −C2
and 1 = 3C2 . So C1 = −1/3 and C2 = 1/3. Our solution is
2e−2t + et −e−2t + et
x= , y= .
3 3
Exercise 3.1.1: Plug in and check that this really is the solution.
It is useful to go back and forth between systems and higher order equations for other reasons.
For example, the ODE approximation methods are generally only given as solutions for first order
systems. It is not very hard to adapt the code for the Euler method for first order equations to handle
first order systems. We essentially just treat the dependent variable not as a number but as a vector.
In many mathematical computer languages there is almost no distinction in syntax.
The above example is what we call a linear first order system, as none of the dependent variables
appear in any functions or with any higher powers than one. It is also autonomous as the equations
do not depend on the independent variable t.
For autonomous systems we can draw the so-called direction field or vector field. That is, a
plot similar to a slope field, but instead of giving a slope at each point, we give a direction (and a
magnitude). The previous example x0 = 2y − x, y0 = x says that at the point (x, y) the direction in
which we should travel to satisfy the equations should be the direction of the vector (2y − x, x) with
106 CHAPTER 3. SYSTEMS OF ODES
the speed equal to the magnitude of this vector. So we draw the vector (2y − x, x) based at the point
(x, y) and we do this for many points on the xy-plane. We may want to scale down the size of our
vectors to fit many of them on the same direction field. See Figure 3.1.
We can draw a path of the solution in the plane. Suppose the solution is given by x = f (t),
y = g(t). We pick an interval of t (say 0 ≤ t ≤ 2 for our example) and plot all the points f (t), g(t)
for t in the selected range. The resulting picture is called the phase portrait (or phase plane portrait).
The particular curve obtained is called the trajectory or solution curve. See an example plot in
Figure 3.2. In the figure the solution starts at (1, 0) and travels along the vector field for a distance of
2 units of t. We solved this system precisely, so we compute x(2) and y(2) to find x(2) ≈ 2.475 and
y(2) ≈ 2.457. This point corresponds to the top right end of the plotted solution curve in the figure.
-1 0 1 2 3 -1 0 1 2 3
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
-1 -1 -1 -1
-1 0 1 2 3 -1 0 1 2 3
Figure 3.1: The direction field for x0 = 2y− x, y0 = x. Figure 3.2: The direction field for x0 = 2y − x, y0 = x
with the trajectory of the solution starting at (1, 0)
for 0 ≤ t ≤ 2.
Notice the similarity to the diagrams we drew for autonomous systems in one dimension. But
note how much more complicated things become when we allow just one extra dimension.
We can draw phase portraits and trajectories in the xy-plane even if the system is not autonomous.
In this case however we cannot draw the direction field, since the field changes as t changes. For
each t we would get a different direction field.
3.1.1 Exercises
Exercise 3.1.2: Find the general solution of x10 = x2 − x1 + t, x20 = x2 .
Exercise 3.1.3: Find the general solution of x10 = 3x1 − x2 + et , x20 = x1 .
Exercise 3.1.4: Write ay00 + by0 + cy = f (x) as a first order system of ODEs.
Exercise 3.1.5: Write x00 + y2 y0 − x3 = sin(t), y00 + (x0 + y0 )2 − x = 0 as a first order system of ODEs.
3.1. INTRODUCTION TO SYSTEMS OF ODES 107
Exercise 3.1.101: Find the general solution to y01 = 3y1 , y02 = y1 + y2 , y03 = y1 + y3 .
Exercise 3.1.105: Suppose two masses on carts on frictionless surface are at displacements x1 and
x2 as in the example of this section. Suppose initial displacement is x1 (0) = x2 (0) = 0, and initial
velocity is x10 (0) = x20 (0) = a for some number a. Use your intuition to solve the system, explain
your reasoning.
108 CHAPTER 3. SYSTEMS OF ODES
By a vector we usually mean a column vector, that is an m × 1 matrix. If we mean a row vector
we will explicitly say so (a row vector is a 1 × n matrix). We usually denote matrices by upper case
letters and vectors by lower case letters with an arrow such as ~x or ~b. By ~0 we mean the vector of
all zeros.
We define some operations on matrices. We want 1 × 1 matrices to really act like numbers, so
our operations have to be compatible with this viewpoint.
First, we can multiply a matrix by a scalar (a number). We simply multiply each entry in the
matrix by the scalar. For example,
" # " #
1 2 3 2 4 6
2 = .
4 5 6 8 10 12
Matrix addition is also easy. We add matrices element by element. For example,
" # " # " #
1 2 3 1 1 −1 2 3 2
+ = .
4 5 6 0 2 4 4 7 10
A + 0 = A = 0 + A,
A + B = B + A,
(A + B) + C = A + (B + C),
c(A + B) = cA + cB,
(c + d)A = cA + dA.
3.2. MATRICES AND LINEAR SYSTEMS 109
Another useful operation for matrices is the so-called transpose. This operation just swaps rows
and columns of a matrix. The transpose of A is denoted by AT . Example:
" #T 1 4
1 2 3
= 2 5
4 5 6
3 6
For multiplication we want an analogue of a 1. This analogue is the so-called identity matrix.
The identity matrix is a square matrix with 1s on the main diagonal and zeros everywhere else. It is
usually denoted by I. For each size we have a different identity matrix and so sometimes we may
denote the size as a subscript. For example, the I3 would be the 3 × 3 identity matrix
1 0 0
I = I3 = 0 1 0 .
0 0 1
110 CHAPTER 3. SYSTEMS OF ODES
We have the following rules for matrix multiplication. Suppose that A, B, C are matrices of the
correct sizes so that the following make sense. Let α denote a scalar (number).
A(BC) = (AB)C,
A(B + C) = AB + AC,
(B + C)A = BA + CA,
α(AB) = (αA)B = A(αB),
IA = A = AI.
(i) AB , BA in general (it may be true by fluke sometimes). That is, matrices do not commute.
For example, take A = 11 11 and B = 10 02 .
For the last two items to hold we would need to “divide” by a matrix. This is where the matrix
inverse comes in. Suppose that A and B are n × n matrices such that
AB = I = BA.
Then we call B the inverse of A and we denote B by A−1 . If the inverse of A exists, then we call A
invertible. If A is not invertible we sometimes say A is singular.
If A is invertible, then AB = AC does imply that B = C (in particular the inverse of A is unique).
We just multiply both sides by A−1 (on the left) to get A−1 AB = A−1 AC or IB = IC or B = C. It is
−1
also not hard to see that (A−1 ) = A.
Before trying to compute the determinant for larger matrices, let us note the meaning of the
determinant. Consider an n × n matrix as a mapping of the n dimensional euclidean space Rn to
itself, where ~x gets sent to A~x. In particular, a 2 × 2 matrix A is a mapping of the plane to itself. The
determinant of A is the factor by which the area of objects gets changed. If we take the unit square
3.2. MATRICES AND LINEAR SYSTEMS 111
(square of side 1) in the plane, then A takes the square to a parallelogram of area |det(A)|. The sign
of det(A) denotes changing of orientation (negative if the axes get flipped). For example, let
" #
1 1
A= .
−1 1
Then det(A) = 1 + 1 = 2. Let us see where the square with vertices (0, 0), (1, 0), (0, 1), and (1, 1)
gets sent. Clearly (0, 0) gets sent to (0, 0).
" #" # " # " #" # " # " #" # " #
1 1 1 1 1 1 0 1 1 1 1 2
= , = , = .
−1 1 0 −1 −1 1 1 1 −1 1 1 0
a b
The vertical lines above mean absolute value. The matrix c d carries the unit square to the given
parallelogram.
Let us define the determinant for larger matrices. We define Ai j as the matrix A with the ith row
and the jth column deleted. To compute the determinant of a matrix, pick one row, say the ith row
and compute:
Xn
det(A) = (−1)i+ j ai j det(Ai j ).
j=1
We alternately add and subtract the determinants of the submatrices Ai j for a fixed i and all j. For a
3 × 3 matrix, picking the first row, we get det(A) = a11 det(A11 ) − a12 det(A12 ) + a13 det(A13 ). For
example,
1 2 3 " #! " #! " #!
5 6 4 6 4 5
det 4 5 6 = 1 · det − 2 · det + 3 · det
8 9 7 9 7 8
7 8 9
The numbers (−1)i+ j det(Ai j ) are called cofactors of the matrix and this way of computing the
determinant is called the cofactor expansion. It is also possible to compute the determinant by
expanding along columns (picking a column instead of a row above).
Note that a common notation for the determinant is a pair of vertical lines:
" #!
a b a b
c d = det c d .
I personally find this notation confusing as vertical lines usually mean a positive quantity, while
determinants can be negative. I will not use this notation in this book.
One of the most important properties of determinants (in the context of this course) is the
following theorem.
Notice the determinant of the matrix in the denominator of the fraction. The formula only works if
the determinant is nonzero, otherwise we are dividing by zero.
Without changing the solution, we could swap equations in this system, we could multiply any
of the equations by a nonzero number, and we could add a multiple of one equation to another
equation. It turns out these operations always suffice to find a solution.
It is easier to write the system as a matrix equation. The system above can be written as
2 2 2 x1 2
1 1 3 x2 = 5 .
1 4 1 x3 10
3.2. MATRICES AND LINEAR SYSTEMS 113
To solve the system we put the coefficient matrix (the matrix on the left hand side of the equation)
together with the vector on the right and side and get the so-called augmented matrix
2 2 2 2
1 1 3 5 .
1 4 1 10
We apply the following three elementary operations.
(i) Swap two rows.
(ii) Multiply a row by a nonzero number.
(iii) Add a multiple of one row to another row.
We keep doing these operations until we get into a state where it is easy to read off the answer, or
until we get into a contradiction indicating no solution, for example if we come up with an equation
such as 0 = 1.
Let us work through the example. First multiply the first row by 1/2 to obtain
1 1 1 1
1 1 3 5 .
1 4 1 10
Now subtract the first row from the second and third row.
1 1 1 1
0 0 2 4
0 3 0 9
Multiply the last row by 1/3 and the second row by 1/2.
1 1 1 1
0 0 1 2
0 1 0 3
Swap rows 2 and 3.
1 1 1 1
0 1 0 3
0 0 1 2
Subtract the last row from the first, then subtract the second row from the first.
1 0 0 −4
0 1 0 3
0 0 1 2
If we think about what equations this augmented matrix represents, we see that x1 = −4, x2 = 3,
and x3 = 2. We try this solution in the original system and, voilà, it works!
114 CHAPTER 3. SYSTEMS OF ODES
Exercise 3.2.1: Check that the solution above really solves the given equations.
If we write this equation in matrix notation as
A~x = ~b,
where A is the matrix
2 2 2
1 1 3 ~ 2
and b is the vector 5 . The solution can be also computed via the
1 4 1 10
inverse,
~x = A−1 A~x = A−1~b.
One last note to make about linear systems of equations is that it is possible that the solution is
not unique (or that no solution exists). It is easy to tell if a solution does not exist. If during the
row reduction you come up with a row where all the entries except the last one are zero (the last
entry in a row corresponds to the right hand side of the equation) the system is inconsistent and has
no solution. For example for a system of 3 equations and 3 unknowns, if you find a row such as
[ 0 0 0 | 1 ] in the augmented matrix, you know the system is inconsistent.
You generally try to use row operations until the following conditions are satisfied. The first
nonzero entry in each row is called the leading entry.
(i) There is only one leading entry in each column.
(ii) All the entries above and below a leading entry are zero.
Suppose the variables are x1 , x2 , and x3 . Then x2 is the free variable, x1 = 3 − 2x2 , and x3 = 1.
On the other hand if during the row reduction process you come up with the matrix
1 2 13 3
0 0 1 1 ,
0 0 0 3
there is no need to go further. The last row corresponds to the equation 0x1 + 0x2 + 0x3 = 3, which
is preposterous. Hence, no solution exists.
3.2. MATRICES AND LINEAR SYSTEMS 115
3.2.6 Exercises
~x =
1 2 5
Exercise 3.2.2: Solve 3 4 by using matrix inverse.
6
9 −2 −6
Exercise 3.2.3: Compute determinant of −8 3 6 .
10 −2 −6
"1 2 3 1
#
4 0 5 0
Exercise 3.2.4: Compute determinant of 6 0 7 0 . Hint: Expand along the proper row or column
8 0 10 1
to make the calculations simpler.
1 2 3
Exercise 3.2.5: Compute inverse of 1 1 1 .
0 1 0
1 2 3
Exercise 3.2.6: For which h is 4 5 6 not invertible? Is there only one such h? Are there several?
7 8 h
Infinitely many?
h 1 1
Exercise 3.2.7: For which h is 0 h 0 not invertible? Find all such h.
1 1 h
9 −2 −6 1
Exercise 3.2.8: Solve −8 3 6 ~x = 2 .
10 −2 −6 3
5 3 7 2
Exercise 3.2.9: Solve 8 4 4 ~x = 0 .
6 3 3 0
"3 2 3 0# "2#
Exercise 3.2.10: Solve 3 3 3 3
0 2 4 2 ~x = 0
4 .
2 3 4 3 1
where P(t) is a matrix valued function, and ~x(t) and f~(t) are vector valued functions. We will often
suppress the dependence on t and only write ~x 0 = P~x + f~. A solution of the system is a vector
valued function ~x satisfying the vector equation.
For example, the equations
x10 = 2tx1 + et x2 + t2 ,
x1
x20 = − x2 + et ,
t
118 CHAPTER 3. SYSTEMS OF ODES
Theorem 3.3.2. Let ~x 0 = P~x + f~ be a linear system of ODEs. Suppose ~x p is one particular solution.
Then every solution can be written as
~x = ~xc + ~x p ,
where ~xc is a solution to the associated homogeneous equation (~x 0 = P~x).
So the procedure for systems is the same as for single equations. We find a particular solution to
the nonhomogeneous equation, then we find the general solution to the associated homogeneous
equation, and finally we add the two together.
Alright, suppose you have found the general solution of ~x 0 = P~x + f~. Next suppose you are
given an initial condition of the form ~x(t0 ) = ~b for some constant vector ~b. Let X(t) be a fundamental
matrix solution of the associated homogeneous equation (i.e. columns of X(t) are solutions). The
general solution can be written as
~x(t) = X(t) ~c + ~x p (t).
We are seeking a vector ~c such that
In other words, we are solving for ~c the nonhomogeneous system of linear equations
X(t0 ) ~c = ~b − ~x p (t0 ).
x10 = x1 ,
x20 = x1 − x2 ,
with initial conditions x1 (0) = 1, x2 (0) = 2. Let us consider this problem in the language of this
section.
The system is homogeneous, so f~(t) = ~0. We write the system and the initial conditions as
" # " #
0 1 0 1
~x = ~x, ~x(0) = .
1 −1 2
linearly independent, as can be seen by setting t = 0, and noting that the resulting constant vectors
are linearly independent. In matrix notation, a fundamental matrix solution is, therefore,
" t #
e 0
X(t) = 1 t −t .
2
e e
120 CHAPTER 3. SYSTEMS OF ODES
X(0) ~c = ~b,
This new solution agrees with our previous solution from § 3.1.
3.3.1 Exercises
Exercise 3.3.1: Write the system x10 = 2x1 − 3tx2 + sin t, x20 = et x1 + 3x2 + cos t in the form
~x 0 = P(t)~x + f~(t).
Exercise 3.3.2: a) Verify that the system ~x 0 = 13 31 ~x has the two solutions 11 e4t and −1
1 −2t
e .
b) Write down the general solution. c) Write down the general solution in the form x1 =?, x2 =? (i.e.
write down a formula for each element of the solution).
Exercise 3.3.3: Verify that 11 et and −1 e are linearly independent. Hint: Just plug in t = 0.
1 t
1 1 1
Exercise 3.3.4: Verify that 1 e and −1 e and −1 e2t are linearly independent. Hint: You must
t t
0 1 1
be a bit more tricky than in the previous exercise.
h i h 3i
Exercise 3.3.5: Verify that tt2 and tt4 are linearly independent.
Exercise 3.3.6: Take the system x10 + x20 = x1 , x10 − x20 = x2 . a) Write it in the form A~x 0 = B~x for
matrices A and B. b) Compute A−1 and use that to write the system in the form ~x 0 = P~x.
h 2t i h ti
Exercise 3.3.101: Are eet and ee2t linearly independent? Justify.
h i h ti h −t i
Exercise 3.3.102: Are cosh(t)
1 , e1 , and e1 linearly independent? Justify.
Exercise 3.3.104: a) Write x10 = 2tx2 , x20 = 2tx2 in matrix notation. b) Solve and write the solution
in matrix notation.
3.4. EIGENVALUE METHOD 121
~x 0 = P~x,
where P is a constant square matrix. We wish to adapt the method for the single constant coefficient
equation by trying the function eλt . However, ~x is a vector. So we try ~x = ~veλt , where ~v is an
arbitrary constant vector. We plug this ~x into the equation to get
λ~veλt = |{z}
|{z} P~veλt .
~x 0 P~x
We divide by eλt and notice that we are looking for a scalar λ and a vector ~v that satisfy the equation
λ~v = P~v.
To solve this equation we need a little bit more linear algebra, which we now review.
A~v = λ~v.
Let us see how to compute eigenvalues for any matrix. Rewrite the equation for an eigenvalue as
(A − λI)~v = ~0.
This equation has a nonzero solution ~v only if A − λI is not invertible. Were it invertible, we could
write (A − λI)−1 (A − λI)~v = (A − λI)−1~0, which implies ~v = ~0. Therefore, A has the eigenvalue λ if
and only if λ solves the equation
det(A − λI) = 0.
Consequently, we will be able to find an eigenvalue of A without finding a corresponding
eigenvector. An eigenvector will have to be found later, once λ is known.
122 CHAPTER 3. SYSTEMS OF ODES
2 1 1
Example 3.4.2: Find all eigenvalues of 1 2 0 .
0 0 2
We write
2 − λ
2 1 1 1 0 0 1 1
det 1 2 0 − λ 0 1 0 = det 1 2−λ 0 =
0 0 2 0 0 1 0 0 2−λ
It is easy to solve this system of linear equations. We write down the augmented matrix
−1 1 1 0
1 −1 0 0 ,
0 0 −1 0
The entries of ~v have to satisfy the equations v1 − v2 = 0, v3 = 0, and v2 is a free variable. We can
(but nonzero), let v1 = v2 , and of course v3 = 0. For example, if we pick
pick v2 to be arbitrary
1
v2 = 1, then ~v = 1 . Let us verify that ~v really is an eigenvector corresponding to λ = 3:
0
2 1 1 1 3 1
1 2 0 1 = 3 = 3 1 .
0 0 2 0 0 0
Yay! It worked.
3.4. EIGENVALUE METHOD 123
Exercise 3.4.1 (easy): Are eigenvectors unique? Can you find a different eigenvector for λ = 3 in
the example above? How are the two eigenvectors related?
Exercise 3.4.2: When the matrix is 2 × 2 you do not need to write down the augmented matrix and
do row operations when computing eigenvectors (if you have computed the eigenvalues correctly).
Can you see why? Explain. Try it for the matrix 21 12 .
The corresponding fundamental matrix solution is X(t) = [ ~v1 eλ1 t ~v2 eλ2 t ··· ~vn eλn t ]. That
is, X(t) is the matrix whose jth column is ~v j eλ j t .
Example 3.4.4: Consider the system
2 1 1
~x 0 = 1 2 0 ~x.
0 0 2
0 −1 0 −c2 e2t
Note: If we write a homogeneous linear constant coefficient nth order equation as a first order
system (as we did in § 3.1), then the eigenvalue equation
det(P − λI) = 0
is essentially the same as the characteristic equation we got in § 2.2 and § 2.3.
1−λ
" #!
1
det(P − λI) = det = (1 − λ)2 + 1 = λ2 − 2λ + 2 = 0.
−1 1 − λ
P − (1 − i)I ~v = ~0,
" #
i 1
~v = ~0.
−1 i
The equations iv1 + v2 = 0 and −v1 + iv2 = 0 are multiples of each other. So we only need to consider
one of them. After picking v2 = 1, for example, we have an eigenvector ~v = 1i . In similar fashion
we find that 1 is an eigenvector corresponding to the eigenvalue 1 + i.
−i
We could write the solution as
" # " # " #
i (1−i)t −i (1+i)t c1 ie(1−i)t − c2 ie(1+i)t
~x = c1 e + c2 e = .
1 1 c1 e(1−i)t + c2 e(1+i)t
We would then need to look for complex values c1 and c2 to solve any initial conditions. It is perhaps
not completely clear that we get a real solution. We could use Euler’s formula and do the whole
song and dance we did before, but we will not. We will do something a bit smarter first.
We claim that we did not have to look for a second eigenvector (nor for the second eigenvalue).
All complex eigenvalues come in pairs (because the matrix P is real).
First a small side note. The real part of a complex number z can be computed as z+z̄
2
, where the
bar above z means a + ib = a − ib. This operation is called the complex conjugate. If a is a real
3.4. EIGENVALUE METHOD 125
number, then ā = a. Similarly we can bar whole vectors or matrices. If a matrix P is real, then
P = P. We note that P~x = P ~x = P~x. Therefore,
(P − λI)~v = (P − λ̄I)~v.
~x1 = ~ve(a+ib)t
is a solution (complex valued) of ~x 0 = P~x. Euler’s formula shows that ea+ib = ea−ib , and so
ie cos t + et sin t
" # " # " t #
i (1−i)t i t
~x1 = = e cos t − ie sin t = t
t
.
e
1 1 e cos t − iet sin t
Then
" #
et sin t
Re ~x1 = t ,
e cos t
" t #
e cos t
Im ~x1 = ,
−et sin t
c1 e sin t + c2 et cos t
" # " t # " t #
et sin t e cos t
~x = c1 t + c2 = .
e cos t −et sin t c1 et cos t − c2 et sin t
This solution is real-valued for real c1 and c2 . Now we can solve for any initial conditions that we
may have.
Let us summarize as a theorem.
Theorem 3.4.2. Let P be a real-valued constant matrix. If P has a complex eigenvalue a + ib and a
corresponding eigenvector ~v, then P also has a complex eigenvalue a − ib with a corresponding
eigenvector ~v¯ . Furthermore, ~x 0 = P~x has two linearly independent real-valued solutions
For each pair of complex eigenvalues a+ib and a−ib, we get two real-valued linearly independent
solutions. We then go on to the next eigenvalue, which is either a real eigenvalue or another complex
eigenvalue pair. If we have n distinct eigenvalues (real or complex), then we end up with n linearly
independent solutions.
We can now find a real-valued general solution to any homogeneous system where the matrix
has distinct eigenvalues. When we have repeated eigenvalues, matters get a bit more complicated
and we will look at that situation in § 3.7.
3.4.4 Exercises
Exercise 3.4.5 (easy):
Let A be a 3 × 3 matrix with an eigenvalue of 3 and a corresponding
1
eigenvector ~v = −1 . Find A~v.
3
Exercise 3.4.6: a) Find the general solution of x10 = 2x1 , x20 = 3x2 using the eigenvalue method
(first write the system in the form ~x 0 = A~x). b) Solve the system by solving each equation separately
and verify you get the same general solution.
Exercise 3.4.7: Find the general solution of x10 = 3x1 + x2 , x20 = 2x1 + 4x2 using the eigenvalue
method.
Exercise 3.4.8: Find the general solution of x10 = x1 − 2x2 , x20 = 2x1 + x2 using the eigenvalue
method. Do not use complex exponentials in your solution.
9 −2 −6
Exercise 3.4.9: a) Compute eigenvalues and eigenvectors of A = −8 3 6 . b) Find the general
10 −2 −6
0
solution of ~x = A~x.
−2 −1 −1
Exercise 3.4.10: Compute eigenvalues and eigenvectors of 3 2 1 .
−3 −1 0
3.4. EIGENVALUE METHOD 127
a b c
Exercise 3.4.11: Let a, b, c, d, e, f be numbers. Find the eigenvalues of 0 d e .
0 0 f
1 0 3
Exercise 3.4.101: a) Compute eigenvalues and eigenvectors of A = −1 0 1 . b) Solve the system
2 0 2
~x 0 = A~x.
Exercise 3.4.104: Solve x10 = x2 , x20 = −x1 using the eigenvalue method.
128 CHAPTER 3. SYSTEMS OF ODES
0 0
Now suppose that x and y are on the line de-
termined by an eigenvector ~v for an eigenvalue λ.
That is, yx = a~v for some scalar a. Then
-1 -1
" #0 " #
-2 -2
x x
=P = P(a~v) = a(P~v) = aλ~v.
y y
-3 -3
-3 -2 -1 0 1 2 3
2 2 2 2
1 1 1 1
0 0 0 0
-1 -1 -1 -1
-2 -2 -2 -2
-3 -3 -3 -3
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
Figure 3.4: Eigenvectors of P with directions. Figure 3.5: Example source vector field with eigen-
vectors and solutions.
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
-1 -1 -1 -1
-2 -2 -2 -2
-3 -3 -3 -3
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
Figure 3.6: Example sink vector field with eigenvec- Figure 3.7: Example saddle vector field with eigen-
tors and solutions. vectors and solutions.
Case 3. Suppose one eigenvalue is positive and one is negative. For example the matrix 10 −2
1
.
1 1
The eigenvalues are 1 and −2 and corresponding eigenvectors are 0 and −3 . We reverse the
arrows on one line (corresponding to the negative eigenvalue) and we obtain the picture in Figure 3.7.
We call this picture a saddle point.
For the next three cases we will assume the eigenvalues are complex. In this case the eigenvectors
are also complex and we cannot just plot them in the plane.
Case 4. Suppose the eigenvalues are purely imaginary. That is, suppose the eigenvalues are ±ib.
For example, let P = −4
0 1 1 1
0 . The eigenvalues turn out to be ±2i and eigenvectors are 2i and −2i .
130 CHAPTER 3. SYSTEMS OF ODES
Consider the eigenvalue 2i and its eigenvector 2i1 . The real and imaginary parts of ~vei2t are
" # " #
1 i2t cos(2t)
Re e = ,
2i −2 sin(2t)
" # " #
1 i2t sin(2t)
Im e = .
2i 2 cos(2t)
We can take any linear combination of them to get other solutions, which one we take depends on
the initial conditions. Now note that the real part is a parametric equation for an ellipse. Same with
the imaginary part and in fact any linear combination of the two. This is what happens in general
when the eigenvalues are purely imaginary. So when the eigenvalues are purely imaginary, we get
ellipses for the solutions. This type of picture is sometimes called a center. See Figure 3.8.
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
-1 -1 -1 -1
-2 -2 -2 -2
-3 -3 -3 -3
-3 -2 -1 0 1 2 3 -3 -2 -1 0 1 2 3
Figure 3.8: Example center vector field. Figure 3.9: Example spiral source vector field.
Case 5. Now suppose the complex eigenvalues have a positive real part. That is, suppose the
eigenvalues are a ± ib for some a > 0. For example, let P = −4
1 1
1 . The eigenvalues turn out to be
1 ± 2i and eigenvectors are 2i and −2i . We take 1 + 2i and its eigenvector 2i1 and find the real
1 1
and imaginary parts of ~ve(1+2i)t are
" # " #
1 (1+2i)t cos(2t)
Re e =et
,
2i −2 sin(2t)
" # " #
1 (1+2i)t t sin(2t)
Im e =e .
2i 2 cos(2t)
Note the et in front of the solutions. This means that the solutions grow in magnitude while spinning
around the origin. Hence we get a spiral source. See Figure 3.9.
Case 6. Finally suppose the complex eigenvalues have a negative real part. That is, suppose the
eigenvalues are −a ± ib for some a > 0. For example, let P = −1
−1
4 −1 . The eigenvalues turn out to
3.5. TWO DIMENSIONAL SYSTEMS AND THEIR VECTOR FIELDS 131
1
and 2i1 . We take −1 − 2i and its eigenvector 2i1 and find the
be −1 ± 2i and eigenvectors are −2i
real and imaginary parts of ~ve(−1−2i)t are
" # " #
1 (−1−2i)t −t cos(2t)
Re e =e ,
2i 2 sin(2t)
" # " #
1 (−1−2i)t −t − sin(2t)
Im e =e .
2i 2 cos(2t)
Note the e−t in front of the solutions. This means that the solutions shrink in magnitude while
spinning around the origin. Hence we get a spiral sink. See Figure 3.10.
-3 -2 -1 0 1 2 3
3 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-3 -2 -1 0 1 2 3
We summarize the behavior of linear homogeneous two dimensional systems in Table 3.1.
Eigenvalues Behavior
real and both positive source / unstable node
real and both negative sink / stable node
real and opposite signs saddle
purely imaginary center point / ellipses
complex with positive real part spiral source
complex with negative real part spiral sink
3.5.1 Exercises
Exercise 3.5.1: Take the equation mx00 + cx0 + kx = 0, with m > 0, c ≥ 0, k > 0 for the mass-spring
system. a) Convert this to a system of first order equations. b) Classify for what m, c, k do you get
which behavior. c) Can you explain from physical intuition why you do not get all the different kinds
of behavior here?
Exercise 3.5.2: What happens in the case when P = 10 11 ? In this case the eigenvalue is repeated
and there is only one independent eigenvector. What picture does this look like?
Exercise 3.5.3: What happens in the case when P = 11 11 ? Does this look like any of the pictures
we have drawn?
Exercise 3.5.4: Which behaviors are possible if P is diagonal, that is P = a0 0b ? You can assume
that a and b are not zero.
Exercise 3.5.101: Describe the behavior of the following systems without solving:
a) x0 = x + y, y0 = x − y.
b) x10 = x1 + x2 , x20 = 2x2 .
c) x10 = −2x2 , x20 = 2x1 .
d) x0 = x + 3y, y0 = −2x − 4y.
e) x0 = x − 4y, y0 = −4x + y.
Exercise 3.5.102: Suppose that ~x 0 = A~x where A is a 2 by 2 matrix with eigenvalues 2 ± i. Describe
the behavior.
Exercise 3.5.103: Take yx 0 = 00 10 yx . Draw the vector field and describe the behavior. Is it one
of the behaviors that we have seen before?
3.6. SECOND ORDER SYSTEMS AND APPLICATIONS 133
k1 k2 k3 k4
m1 m2 m3
This simple system turns up in unexpected places. For example, our world really consists of
many small particles of matter interacting together. When we try the above system with many more
masses, we obtain a good approximation to how an elastic material behaves. By somehow taking a
limit of the number of masses going to infinity, we obtain the continuous one dimensional wave
equation (that we study in § 4.7). But we digress.
Let us set up the equations for the three mass system. By Hooke’s law we have that the force
acting on the mass equals the spring compression times the spring constant. By Newton’s second
law we have that force is mass times acceleration. So if we sum the forces acting on each mass and
put the right sign in front of each term, depending on the direction in which it is acting, we end up
with the desired system of equations.
This fact follows readily by how we multiply diagonal matrices. As an exercise, you should verify
that MM −1 = M −1 M = I.
Let A = M −1 K. We look at the system ~x 00 = M −1 K~x, or
~x 00 = A~x.
Many real world systems can be modeled by this equation. For simplicity, we will only talk about
the given masses-and-springs problem. We try a solution of the form
~x = ~veαt .
We compute that for this guess, ~x 00 = α2~veαt . We plug our guess into the equation and get
α2~veαt = A~veαt .
By taking the real and imaginary parts (note that ~v is real), we find that ~v cos(ωt) and ~v sin(ωt) are
linearly independent solutions.
If an eigenvalue is zero, it turns out that both ~v and ~vt are solutions, where ~v is an eigenvector
corresponding to the eigenvalue 0.
3.6. SECOND ORDER SYSTEMS AND APPLICATIONS 135
Exercise 3.6.2: Show that if A has a zero eigenvalue and ~v is a corresponding eigenvector, then
~x = ~v(a + bt) is a solution of ~x 00 = A~x for arbitrary constants a and b.
Theorem 3.6.1. Let A be an n × n matrix with n distinct real negative (or zero) eigenvalues we
denote by −ω21 > −ω22 > · · · > −ω2n , and corresponding eigenvectors by ~v1 , ~v2 , . . . , ~vn . If A is
invertible (that is, if ω1 > 0), then
n
X
~x(t) = ~vi ai cos(ωi t) + bi sin(ωi t) ,
i=1
We use this solution and the setup from the introduction of this section even when some of the
masses and springs are missing. For example, when there are only 2 masses and only 2 springs,
simply take only the equations for the two masses and set all the spring constants for the springs
that are missing to zero.
3.6.2 Examples
Example 3.6.1: Suppose we have the system in Figure 3.12, with m1 = 2 kg, m2 = 1 kg, k1 = 4 N/m,
and k2 = 2 N/m.
k1 k2
m1 m2
The two terms in the solution represent the two so-called natural or normal modes of oscillation.
And the two (angular) frequencies are the natural frequencies. The first natural frequency is 1, and
second natural frequency is 2. The two modes are plotted in Figure 3.13.
0.0 2.5 5.0 7.5 10.0 0.0 2.5 5.0 7.5 10.0
2 2 1.0 1.0
1 1 0.5 0.5
0 0 0.0 0.0
-1 -1 -0.5 -0.5
-2 -2 -1.0 -1.0
0.0 2.5 5.0 7.5 10.0 0.0 2.5 5.0 7.5 10.0
Figure 3.13: The two modes of the mass-spring system. In the left plot the masses are moving in unison and
in the right plot are masses moving in the opposite direction.
Example 3.6.2: We have two toy rail cars. Car 1 of mass 2 kg is traveling at 3 m/s towards the
second rail car of mass 1 kg. There is a bumper on the second rail car that engages at the moment
the cars hit (it connects to two cars) and does not let go. The bumper acts like a spring of spring
constant k = 2 N/m. The second car is 10 meters from a wall. See Figure 3.14.
k
m1 m2
10 meters
Figure 3.14: The crash of two rail cars.
We want to ask several questions. At what time after the cars link does impact with the wall
happen? What is the speed of car 2 when it hits the wall?
OK, let us first set the system up. Let t = 0 be the time when the two cars link up. Let x1 be the
displacement of the first car from the position at t = 0, and let x2 be the displacement of the second
car from its original location. Then the time when x2 (t) = 10 is exactly the time when impact with
wall occurs. For this t, x20 (t) is the speed at impact. This system acts just like the system of the
previous example but without k1 . Hence the equation is
" # " #
2 0 00 −2 2
~x = ~x.
0 1 2 −2
or " #
00 −1 1
~x = ~x.
2 −2
We compute the eigenvalues of A. It is not hard to see that the eigenvalues are 0 and √ −3
(exercise). Furthermore, eigenvectors are 11 and −2 respectively (exercise). Then ω2 = 3 and
1
by the second part of the theorem we find our general solution to be
√ √
" # " #
1 1
~x = (a1 + b1 t) + a2 cos( 3 t) + b2 sin( 3 t)
1 −2
√ √
a1 + b1 t + a2 cos(√ 3 t) + b2 sin( √3 t)
" #
=
a1 + b1 t − 2a2 cos( 3 t) − 2b2 sin( 3 t).
We now apply the initial conditions. First the cars start at position 0 so x1 (0) = 0 and x2 (0) = 0.
The first car is traveling at 3 m/s, so x10 (0) = 3 and the second car starts at rest, so x20 (0) = 0. The first
conditions says
+
" #
~0 = ~x(0) = a a
1 2
.
a1 − 2a2
138 CHAPTER 3. SYSTEMS OF ODES
It is not hard to see that a1 = a2 = 0. We set a1 = 0 and a2 = 0 in ~x(t) and differentiate to get
√ √
b1 + √3 b2 cos( √3 t)
" #
0
~x (t) = .
b1 − 2 3 b2 cos( 3 t)
So √
b1 + √3 b2
" # " #
3 0
= ~x (0) = .
0 b1 − 2 3 b2
Solving these two equations we find b1 = 2 and b2 = √13 . Hence the position of our cars is (until the
impact with the wall)
√
2t + √3 sin( 3 t)
1
~x = √ .
2t − √23 sin( 3 t)
Note how the presence of the zero eigenvalue resulted in a term containing t. This means that the
carts will be traveling in the positive direction as time grows, which is what we expect.
What we √ are really interested in is the second expression, the one for x2 . We have x2 (t) =
2t − √23 sin( 3 t). See Figure 3.15 for the plot of x2 versus time.
Just from the graph we can see that time of
0 1 2 3 4 5 6
impact will be a little more than 5 seconds from
12.5
time zero. For this we have √
12.5
to solve the equation
10 = x2 (t) = 2t − √3 sin( 3 t). Using a com-
2
10.0 10.0
puter (or even a graphing calculator) we find that
7.5
timpact ≈ 5.22 seconds.
7.5
That is, we are adding periodic forcing to the system in the direction of the vector F. ~
As before, this system just requires us to find one particular solution ~x p , add it to the general
solution of the associated homogeneous system ~xc , and we will have the general solution to (3.3).
Let us suppose that ω is not one of the natural frequencies of ~x 00 = A~x, then we can guess
~x p = ~c cos(ωt),
where ~c is an unknown constant vector. Note that we do not need to use sine since there are only
second derivatives. We solve for ~c to find ~x p . This is really just the method of undetermined
coefficients for systems. Let us differentiate ~x p twice to get
So
~
~c = (A + ω2 I) (−F).
−1
The equation is
" # " # " # "
# " #
2 0 00 −4 2 0 00 −3 1 0
~x = ~x + cos(3t) or ~x = ~x + cos(3t).
0 1 2 −2 2 2 −2 2
We solved the associated homogeneous equation before and found the complementary solution to be
" # " #
1 1
~xc = a1 cos(t) + b1 sin(t) + a2 cos(2t) + b2 sin(2t) .
2 −1
The natural frequencies are 1 and 2. As 3 is not a natural frequency, we try ~c cos(3t). We invert
(A + 32 I):
" # !−1 " #−1 " 7 −1 #
−3 1 6 1
+3 I
2
= = −1 40
3 .
40
2 −2 2 7 20 20
Hence,
" 7 −1 # " # "1#
0
2 ~ =
−1
~c = (A + ω I) (−F) 40 40
= 20
.
−1 3 −3
20 20
−2 10
Combining with the general solution of the associated homogeneous problem, we get that the
general solution to ~x 00 = A~x + F~ cos(ωt) is
" # " # "1#
1 1
~x = ~xc + ~x p = a1 cos(t) + b1 sin(t) + a2 cos(2t) + b2 sin(2t) + −3
20
cos(3t).
2 −1 10
The constants a1 , a2 , b1 , and b2 must then be solved for using the initial conditions.
Note that given force f~, we write the equation as M~x 00 = K~x + f~ to get the units right. Then we
write ~x 00 = M −1 K~x + M −1 f~. The term ~g = M −1 f~ in ~x 00 = A~x + ~g is in units of force per unit mass.
If ω is a natural frequency of the system resonance occurs because we will have to try a particular
solution of the form
~x p = ~c t sin(ωt) + d~ cos(ωt).
That is assuming that the eigenvalues of the coefficient matrix are distinct. Next, note that the
amplitude of this solution grows without bound as t grows.
3.6.4 Exercises
Exercise 3.6.3: Find a particular solution to
" # " #
00 −3 1 0
~x = ~x + cos(2t).
2 −2 2
3.6. SECOND ORDER SYSTEMS AND APPLICATIONS 141
Exercise 3.6.4 (challenging): Let us take the example in Figure 3.12 on page 135 with the same
parameters as before: m1 = 2, k1 = 4, and k2 = 2, except for m2 , which is unknown. Suppose
that there is a force cos(5t) acting on the first mass. Find an m2 such that there exists a particular
solution where the first mass does not move.
Note: This idea is called dynamic damping. In practice there will be a small amount of damping
and so any transient solution will disappear and after long enough time, the first mass will always
come to a stop.
Exercise 3.6.5: Let us take the Example 3.6.2 on page 137, but that at time of impact, cart 2 is
moving to the left at the speed of 3 m/s. a) Find the behavior of the system after linkup. b) Will the
second car hit the wall, or will it be moving away from the wall as time goes on? c) At what speed
would the first car have to be traveling for the system to essentially stay in place after linkup?
Exercise 3.6.6: Let us take the example in Figure 3.12 on page 135 with parameters m1 = m2 = 1,
k1 = k2 = 1. Does there exist a set of initial conditions for which the first cart moves but the second
cart does not? If so, find those conditions. If not, argue why not.
cos(2t)
1 0 0 −3 0 0
Exercise 3.6.101: Find the general solution to 0 2 0 ~x 00 = 2 −4 0 ~x + 0 .
0 0 3 0 6 −3 0
Exercise 3.6.102: Suppose there are three carts of equal mass m and connected by two springs of
constant k (and no connections to walls). Set up the system and find its general solution.
In other words, the hypothesis of the theorem could be stated as saying that if all the eigenvalues
of P are complete, then there are n linearly independent eigenvectors and thus we have the given
general solution.
If the geometric multiplicity of an eigenvalue is 2 or greater, then the set of linearly independent
eigenvectors is not unique up to multiples as it was before. For example, for the diagonal matrix
A = 30 03 we could also pick eigenvectors 11 and −1
1
, or in fact any pair of two linearly
independent vectors. The number of linearly independent eigenvectors corresponding to λ is the
number of free variables we obtain when solving A~v = λ~v. We pick specific values for those free
variables to obtain eigenvectors. If you pick different values, you may get different eigenvectors.
We must have that v2 = 0. Hence any eigenvector is of the form v01 . Any two such vectors are
linearly dependent, and hence the geometric multiplicity of the eigenvalue is 1. Therefore, the
defect is 1, and we can no longer apply the eigenvalue method directly to a system of ODEs with
such a coefficient matrix.
The key observation we use here is that if λ is an eigenvalue of A of algebraic multiplicity m,
then we can find certain m linearly independent vectors solving the equation (A − λI)m~v = ~0. We
will call these generalized eigenvectors.
Let us continue with the example A = 30 13 and the equation ~x 0 = A~x. We have an eigenvalue
λ = 3 of (algebraic) multiplicity 2 and defect 1. We have found one eigenvector ~v1 = 10 . We have
the solution
~x1 = ~v1 e3t .
In this case, let us try (in the spirit of repeated roots of the characteristic equation for a single
equation) another solution of the form
We differentiate to get
~x2 0 = ~v1 e3t + 3(~v2 + ~v1 t) e3t = (3~v2 + ~v1 ) e3t + 3~v1 te3t .
As we are assuming that ~x2 is a solution, ~x2 0 must equal A~x2 , and
By looking at the coefficients of e3t and te3t we see 3~v2 + ~v1 = A~v2 and 3~v1 = A~v1 . This means that
Therefore, ~x2 is a solution if these two equations are satisfied. The second equation is satisfied as ~v1
is an eigenvector. So, if we can find a ~v2 that solves (A − 3I)~v2 = ~v1 , then we are done. This is just a
bunch of linear equations to solve and we are by now very good at that. Let us solve (A − 3I)~v2 = ~v1 .
Write " #" # " #
0 1 a 1
= .
0 0 b 0
By inspection we see that letting a = 0 (a could be anything in fact) and b = 1 does the job. Hence
we can take ~v2 = 01 . Our general solution to ~x 0 = A~x is
c1 e + c2 te3t
" # " # " # ! " 3t #
1 3t 0 1
~x = c1 e + c2 + t e =
3t
.
0 1 0 c2 e3t
Let us check that we really do have the solution. First x10 = c1 3e3t + c2 e3t + 3c2 te3t = 3x1 + x2 . Good.
Now x20 = 3c2 e3t = 3x2 . Good.
In the example, if we plug (A − 3I)~v2 = ~v1 into (A − 3I)~v1 = ~0 we find
Furthermore, if (A − 3I)~w , ~0, then (A − 3I)~ w is an eigenvector, a multiple of ~v1 . In this 2 × 2 case
2
(A − 3I) is just the zero matrix (exercise). So any vector w ~ = ~0 and we just need
~ solves (A − 3I)2 w
aw~ such that (A − 3I)~w , ~0. Then we could use w ~ for ~v2 , and (A − 3I)~
w for ~v1 .
0
Note that the system ~x = A~x has a simpler solution since A is a so-called upper triangular
matrix, that is every entry below the diagonal is zero. In particular, the equation for x2 does not
depend on x1 . Mind you, not every defective matrix is triangular.
Exercise 3.7.1: Solve ~x 0 = 30 13 ~x by first solving for x2 and then for x1 independently. Check that
you got the same solution as we did above.
Let us describe the general algorithm. Suppose that λ is an eigenvalue of multiplicity 2, defect 1.
First find an eigenvector ~v1 of λ. That is, ~v1 solves (A − λI)~v1 = ~0. Then, find a vector ~v2 such that
(A − λI)~v2 = ~v1 .
3.7. MULTIPLE EIGENVALUES 145
This machinery can also be generalized to higher multiplicities and higher defects. We will not
go over this method in detail, but let us just sketch the ideas. Suppose that A has an eigenvalue λ of
multiplicity m. We find vectors such that
(A − λI)k~v = ~0, but (A − λI)k−1~v , ~0.
Such vectors are called generalized eigenvectors (then ~v1 = (A − λI)k−1~v is an eigenvector). For
every eigenvector ~v1 we find a chain of generalized eigenvectors ~v2 through ~vk such that:
(A − λI)~v1 = ~0,
(A − λI)~v2 = ~v1 ,
..
.
(A − λI)~vk = ~vk−1 .
We form the linearly independent solutions
~x1 = ~v1 eλt ,
~x2 = (~v2 + ~v1 t) eλt ,
..
.
t2 tk−2 tk−1
!
~xk = ~vk + ~vk−1 t + ~vk−2 + · · · + ~v2 + ~v1 eλt .
2 (k − 2)! (k − 1)!
Recall that k! = 1 · 2 · 3 · · · (k − 1) · k is the factorial. We proceed to find chains until we form m
linearly independent solutions (m is the multiplicity). You may need to find several chains for every
eigenvalue.
3.7.3 Exercises
Exercise 3.7.2: Let A = x 0 = A~x.
3 −1 . Find the general solution of ~
5 −3
5 −4 4
Exercise 3.7.3: Let A = 0 3 0 . a) What are the eigenvalues? b) What is/are the defect(s) of the
−2 4 −1
eigenvalue(s)? c) Find the general solution of ~x 0 = A~x.
2 1 0
Exercise 3.7.4: Let A = 0 2 0 . a) What are the eigenvalues? b) What is/are the defect(s) of the
0 0 2
eigenvalue(s)? c) Find the general solution of ~x 0 = A~x in two different ways and verify you get the
same answer.
146 CHAPTER 3. SYSTEMS OF ODES
0 1 2
Exercise 3.7.5: Let A = −1 −2 −2 . a) What are the eigenvalues? b) What is/are the defect(s) of the
−4 4 7
eigenvalue(s)? c) Find the general solution of ~x 0 = A~x.
0 4 −2
Exercise 3.7.6: Let A = −1 −4 1 . a) What are the eigenvalues? b) What is/are the defect(s) of the
0 0 −2
eigenvalue(s)? c) Find the general solution of ~x 0 = A~x.
2 1 −1
Exercise 3.7.7: Let A = −1 0 2 . a) What are the eigenvalues? b) What is/are the defect(s) of the
−1 −2 4
eigenvalue(s)? c) Find the general solution of ~x 0 = A~x.
Exercise 3.7.8: Suppose that A is a 2 × 2 matrix with a repeated eigenvalue λ. Suppose that there
are two linearly independent eigenvectors. Show that A = λI.
1 1 1
Exercise 3.7.101: Let A = 1 1 1 . a) What are the eigenvalues? b) What is/are the defect(s) of the
1 1 1
eigenvalue(s)? c) Find the general solution of ~x 0 = A~x.
1 3 3
Exercise 3.7.102: Let A = 1 1 0 . a) What are the eigenvalues? b) What is/are the defect(s) of the
−1 1 2
eigenvalue(s)? c) Find the general solution of ~x 0 = A~x.
2 0 0
Exercise 3.7.103: Let A = −1 −1 9 . a) What are the eigenvalues? b) What is/are the defect(s) of
0 −1 5
the eigenvalue(s)? c) Find the general solution of ~x 0 = A~x.
Exercise 3.7.104: Let A = [ ab ac ], where a, b, and c are unknowns. Suppose that 5 is a doubled
eigenvalue of defect 1, and suppose that 10 is a corresponding eigenvector. Find A and show that
there is only one solution.
3.8. MATRIX EXPONENTIALS 147
3.8.1 Definition
In this section we present a different way of finding a fundamental matrix solution of a system.
Suppose that we have the constant coefficient equation
~x 0 = P~x,
as usual. Now suppose that this was one equation (P is a number or a 1 × 1 matrix). Then the
solution to this would be
~x = ePt .
The same computation works for matrices when we define ePt properly. First let us write down the
Taylor series for eat for some number a:
∞
(at)2 (at)3 (at)4 X (at)k
eat = 1 + at + + + + ··· = .
2 6 24 k=0
k!
def 1 1 1
e A = I + A + A2 + A3 + · · · + Ak + · · ·
2 6 k!
Let us not worry about convergence. The series really does always converge. We usually write Pt
as tP by convention when P is a matrix. With this small change and by the exact same calculation
as above we have that
d tP
e = PetP .
dt
Now P and hence etP is an n × n matrix. What we are looking for is a vector. In the 1 × 1 case we
would at this point multiply by an arbitrary constant to get the general solution. In the matrix case
we multiply by a column vector ~c.
Theorem 3.8.1. Let P be an n × n matrix. Then the general solution to ~x 0 = P~x is
~x = etP~c,
where ~c is an arbitrary constant vector. In fact ~x(0) = ~c.
148 CHAPTER 3. SYSTEMS OF ODES
Let us check:
d d tP
~x = e ~c = PetP~c = P~x.
dt dt
Hence etP is a fundamental matrix solution of the homogeneous system. If we find a way
to compute the matrix exponential, we will have another method of solving constant coefficient
homogeneous systems. It also makes it easy to solve for initial conditions. To solve ~x 0 = A~x,
~x(0) = ~b, we take the solution
~x = etA~b.
This equation follows because e0A = I, so ~x(0) = e0A~b = ~b.
We mention a drawback of matrix exponentials. In general eA+B , eA eB . The trouble is that
matrices do not commute, that is, in general AB , BA. If you try to prove eA+B , eA eB using the
Taylor series, you will see why the lack of commutativity becomes a problem. However, it is still
true that if AB = BA, that is, if A and B commute, then eA+B = eA eB . We will find this fact useful.
Let us restate this as a theorem to make a point.
Theorem 3.8.2. If AB = BA, then eA+B = eA eB . Otherwise eA+B , eA eB in general.
So we have found a fundamental matrix solution for the system ~x 0 = A~x. Note that this matrix has a
repeated eigenvalue with a defect; there is only one eigenvector for the eigenvalue 3. So we have
found a perhaps easier way to handle this case. In fact, if a matrix A is 2 × 2 and has an eigenvalue
λ of multiplicity 2, then either A is diagonal, or A = λI + B where B2 = 0. This is a good exercise.
Exercise 3.8.1: Suppose that A is 2 × 2 and λ is the only eigenvalue. Show that (A − λI)2 = 0, and
therefore that we can write A = λI + B, where B2 = 0. Hint: First write down what does it mean for
the eigenvalue to be of multiplicity 2. You will get an equation for the entries. Now compute the
square of B.
Matrices B such that Bk = 0 for some k are called nilpotent. Computation of the matrix
exponential for nilpotent matrices is easy by just writing down the first k terms of the Taylor series.
−1 1 2 1 3
eBAB = I + BAB−1 + (BAB−1 ) + (BAB−1 ) + · · ·
2 6
1 1
= BB−1 + BAB−1 + BA2 B−1 + BA3 B−1 + · · ·
2 6
1 2 1 3
= B I + A + A + A + ··· B
−1
2 6
= Be B .
A −1
Given a square matrix A, we can sometimes write A = EDE −1 , where D is diagonal and E
invertible. This procedure is called diagonalization. If we can do that, the computation of the
exponential becomes easy. Adding t into the mix, we can then easily compute the exponential
etA = EetD E −1 .
such details. We let E be the matrix with the eigenvectors as columns. Let λ1 , λ2 , . . . , λn be the
eigenvalues and let ~v1 , ~v2 , . . . , ~vn be the eigenvectors, then E = [ ~v1 ~v2 · · · ~vn ]. Let D be the
diagonal matrix with the eigenvalues on the main diagonal. That is
λ1 0 · · · 0
0 λ2 · · · 0
D = .. .. . . . .
. . . ..
0 0 · · · λn
We compute
The columns of E are linearly independent as these are linearly independent eigenvectors of A.
Hence E is invertible. Since AE = ED, we multiply on the right by E −1 and we get
A = EDE −1 .
The formula (3.4), therefore, gives the formula for computing a fundamental matrix solution etA for
the system ~x 0 = A~x, in the case where we have n linearly independent eigenvectors.
Notice that this computation still works when the eigenvalues and eigenvectors are complex,
though then you will have to compute with complex numbers. It is clear from the definition that if
A is real, then etA is real. So you will only need complex numbers in the computation and you may
need to apply Euler’s formula to simplify the result. If simplified properly the final matrix will not
have any complex numbers in it.
Example 3.8.1: Compute a fundamental matrix solution using the matrix exponentials for the
system " #0 " #" #
x 1 2 x
= .
y 2 1 y
3.8. MATRIX EXPONENTIALS 151
Then compute the particular solution for the initial conditions x(0) = 4 and y(0) = 2.
Let A be the coefficient matrix 12 21 . We first compute (exercise) that the eigenvalues are 3 and
−1 and corresponding eigenvectors are 11 and −1
1
. Hence we write
" #" #" #−1
1 1 e3t 0 1 1
e =
tA
1 −1 0 e−t 1 −1
" #" # " #
1 1 e3t 0 −1 −1 −1
=
1 −1 0 e−t 2 −1 1
" #" #
−1 e3t e−t −1 −1
=
2 e3t −e−t −1 1
# " e3t +e−t e3t −e−t #
−1 −e3t − e−t −e3t + e−t
"
= = e3t −e
2
e3t +e−t .
2
2 −e3t + e−t −e3t − e−t
−t
2 2
The initial conditions are x(0) = 4 and y(0) = 2. Hence, by the property that e0A = I we find that
the particular solution we are looking for is etA~b where ~b is 42 . Then the particular solution we are
looking for is
" # " e3t +e−t e3t −e−t # " # " 3t
2e + 2e−t + e3t − e−t 3e + e−t
# " 3t #
x 4
= e3t −e−t e3t +e−t
2 2 = = .
y 2 2
2 2e3t − 2e−t + e3t + e−t 3e3t − e−t
Clearly, if we plug t = 0 into X(t) [X(0)]−1 we get the identity. We can multiply a fundamental
matrix solution on the right by any constant invertible matrix and we still get a fundamental matrix
solution. All we are doing is changing what the arbitrary constants are in the general solution
~x(t) = X(t) ~c.
3.8.5 Approximations
If you think about it, the computation of any fundamental matrix solution X using the eigenvalue
method is just as difficult as the computation of etA . So perhaps we did not gain much by this new
tool. However, the Taylor series expansion actually gives us a way to approximate solutions, which
the eigenvalue method did not.
152 CHAPTER 3. SYSTEMS OF ODES
The simplest thing we can do is to just compute the series up to a certain number of terms. There
are better ways to approximate the exponential∗ . In many cases however, few terms of the Taylor
series give a reasonable approximation for the exponential and may suffice for the application. For
example, let us compute the first 4 terms of the series for the matrix A = 12 21 .
"5 # " 13 7 #
t2 2 t3 3
" #
1 2 2 2 2
e ≈ I + tA + A + A = I + t
tA
+t + t 7 133 =
3 6
2 6 2 1 2 52 3 6
1 + t + 2 t + 13
5 2
t3 2 t + 2 t2 + 73 t3
" #
= 6
.
2 t + 2 t2 + 37 t3 1 + t + 25 t2 + 136 t3
Just like the scalar version of the Taylor series approximation, the approximation will be better for
small t and worse for larger t. For larger t, we will generally have to compute more terms. Let us see
how we stack up against the real solution with t = 0.1. The approximate solution is approximately
(rounded to 8 decimal places)
0.12 2 0.13 3
" #
1.12716667 0.22233333
e 0.1 A
≈ I + 0.1 A + A + A = .
2 6 0.22233333 1.12716667
And plugging t = 0.1 into the real solution (rounded to 8 decimal places) we get
" #
1.12734811 0.22251069
e0.1 A
= .
0.22251069 1.12734811
Not bad at all! Although if we take the same approximation for t = 1 we get
" #
1 2 1 3 6.66666667 6.33333333
I+A+ A + A = ,
2 6 6.33333333 6.66666667
So the approximation is not very good once we get up to t = 1. To get a good approximation at
t = 1 (say up to 2 decimal places) we would need to go up to the 11th power (exercise).
3.8.6 Exercises
Exercise 3.8.2: Using the matrix exponential, find a fundamental matrix solution for the system
x0 = 3x + y, y0 = x + 3y.
∗
C. Moler and C.F. Van Loan, Nineteen Dubious Ways to Compute the Exponential of a Matrix, Twenty-Five Years
Later, SIAM Review 45 (1), 2003, 3–49
3.8. MATRIX EXPONENTIALS 153
Exercise 3.8.4: Find a fundamental matrix solution for the system x10 = 7x1 + 4x
2 + 12x3 , x2 =
0
0
x1 + 2x2 + x3 , x30 = −3x1 − 2x2 − 5x3 . Then find the solution that satisfies ~x(0) = 1 .
−2
Exercise 3.8.6 (challenging): Suppose AB = BA. Show that under this assumption, eA+B = eA eB .
−1
Exercise 3.8.7: Use Exercise 3.8.6 to show that (eA ) = e−A . In particular this means that eA is
invertible even if A is not.
Exercise 3.8.8: Suppose A is a matrix with eigenvalues −1, 1, and corresponding eigenvectors 11 ,
a fundamental matrix solution to ~x 0 = A~x.
0
1 . a) Find matrix A with these properties. b) Find
c) Solve the system in with initial conditions ~x(0) = 3 .
2
Exercise 3.8.11: Let A = 13 24 . Approximate etA by expanding the power series up to the third
order.
Exercise 3.8.104: Compute the first 3 terms (up to the second degree) of the Taylor expansion of
etA where A = 22 32 (Write as a single matrix). Then use it to approximate e0.1A .
154 CHAPTER 3. SYSTEMS OF ODES
where A is a constant matrix. The first method we look at is the integrating factor method. For
simplicity we rewrite the equation as
where P = −A. We multiply both sides of the equation by etP (being mindful that we are dealing
with matrices that may not commute) to obtain
We notice that PetP = etP P. This fact follows by writing down the series definition of etP :
!
1 1
Pe = P I + tP + (tP) + · · · = P + tP2 + t2 P3 + · · · =
tP 2
2 2
!
1
= I + tP + (tP)2 + · · · P = etP P.
2
We have already seen that dtd etP = PetP . Hence,
d tP
e ~x(t) = etP f~(t).
dt
We can now integrate. That is, we integrate each component of the vector separately
Z
e ~x(t) =
tP
etP f~(t) dt + ~c.
−1
Recall from Exercise 3.8.7 that (etP ) = e−tP . Therefore, we obtain
Z
~x(t) = e−tP
etP f~(t) dt + e−tP~c.
3.9. NONHOMOGENEOUS SYSTEMS 155
Perhaps it is better understood as a definite integral. In this case it will be easy to also solve for
the initial conditions. Consider the equation with initial conditions
Again, the integration means that each component of the vector e sP f~(s) is integrated separately. It is
not hard to see that (3.5) really does satisfy the initial condition ~x(0) = ~b.
Z 0
~x(0) = e−0P
e sP f~(s) ds + e−0P~b = I~b = ~b.
0
(1 + 3t) e2t
" # " #
−3te2t (1 − 3t) e−2t 3te−2t
e =
tP
, e =
−tP
.
3te2t (1 − 3t) e2t −3te−2t (1 + 3t) e−2t
(1 + 3s) e2s
Z t Z t" # " s#
sP ~ −3se2s e
e f (s) ds = 2s 2s ds
0 0 3se (1 − 3s) e 0
(1 + 3s) e3s
Z t" #
= ds
0 3se3s
R t
(1 + 3s) e3s ds
= R t
0
3s
0
3se ds
te3t
" #
= (3t−1) e3t +1 (used integration by parts).
3
156 CHAPTER 3. SYSTEMS OF ODES
Then
Z t
~x(t) = e−tP
e sP f~(s) ds + e−tP~b
0
te3t
" #" # " #" #
(1 − 3t) e−2t 3te−2t (1 − 3t) e−2t 3te−2t 1
= +
(1 + 3t) e−2t (3t−1)3e +1 (1 + 3t) e−2t 0
3t
−3te−2t −3te−2t
te−2t
" # " #
(1 − 3t) e−2t
= et +
− 3 + 13 + t e−2t −3te−2t
2t) e−2t
" #
(1 −
= et .
− 3 + 13 − 2t e−2t
Phew!
Let us check that this really works.
x10 + 5x1 − 3x2 = (4te−2t − 4e−2t ) + 5(1 − 2t) e−2t + et − (1 − 6t) e−2t = et .
Similarly (exercise) x20 + 3x1 − x2 = 0. The initial conditions are also satisfied (exercise).
For systems, the integrating factor method only works if P does not depend on t, that is, P is
constant. The problem is that in general
d h R i R
e P(t) dt
, P(t) e P(t) dt
,
dt
because matrix multiplication is not commutative.
Eigenvector decomposition
For the next method, note that eigenvectors of a matrix give the directions in which the matrix acts
like a scalar. If we solve the system along these directions the computations are simpler as we treat
the matrix as a scalar. We then put those solutions together to get the general solution for the system.
Take the equation
~x 0 (t) = A~x(t) + f~(t). (3.6)
Assume A has n linearly independent eigenvectors ~v1 , ~v2 , . . . , ~vn . Write
That is, we wish to write our solution as a linear combination of eigenvectors of A. If we solve
for the scalar functions ξ1 through ξn we have our solution ~x. Let us decompose f~ in terms of the
eigenvectors as well. We wish to write
That is, we wish to find g1 through gn that satisfy (3.8). Since all the eigenvectors are independent,
the matrix E = [ ~v1 ~v2 · · · ~vn ] is invertible. Write the equation (3.8) as f~ = E~g, where the
components of ~g are the functions g1 through gn . Then ~g = E −1 f~. Hence it is always possible to
find ~g when there are n linearly independent eigenvectors.
We plug (3.7) into (3.6), and note that A~vk = λk~vk .
~x 0 A~x f~
z }| { z }| { z }| {
~v1 ξ10 + ~v2 ξ20 + · · · + ~vn ξn0 = A ~v1 ξ1 + ~v2 ξ2 + · · · + ~vn ξn + ~v1 g1 + ~v2 g2 + · · · + ~vn gn
= A~v1 ξ1 + A~v2 ξ2 + · · · + A~vn ξn + ~v1 g1 + ~v2 g2 + · · · + ~vn gn
= ~v1 λ1 ξ1 + ~v2 λ2 ξ2 + · · · + ~vn λn ξn + ~v1 g1 + ~v2 g2 + · · · + ~vn gn
= ~v1 (λ1 ξ1 + g1 ) + ~v2 (λ2 ξ2 + g2 ) + · · · + ~vn (λn ξn + gn ).
If we identify the coefficients of the vectors ~v1 through ~vn we get the equations
ξ10 = λ1 ξ1 + g1 ,
ξ20 = λ2 ξ2 + g2 ,
..
.
ξn = λn ξn + gn .
0
Each one of these equations is independent of the others. They are all linear first order equations
and can easily be solved by the standard integrating factor method for single equations. That is, for
the kth equation we write
ξk0 (t) − λk ξk (t) = gk (t).
We use the integrating factor e−λk t to find that
dh i
ξk (t) e−λk t = e−λk t gk (t).
dt
We integrate and solve for ξk to get
Z
λk t
ξk (t) = e e−λk t gk (t) dt + Ck eλk t .
If we are looking for just any particular solution, we could set Ck to be zero. If we leave these
constants in, we get the general solution. Write ~x(t) = ~v1 ξ1 (t) + ~v2 ξ2 (t) + · · · + ~vn ξn (t), and we are
done.
Again, as always, it is perhaps better to write these integrals as definite integrals. Suppose that
we have an initial condition ~x(0) = ~b. Take ~a = E −1~b to find ~b = ~v1 a1 + ~v2 a2 + · · · + ~vn an , just like
before. Then if we write
Z t
λk t
ξk (t) = e e−λk s gk (s) ds + ak eλk t ,
0
158 CHAPTER 3. SYSTEMS OF ODES
we actually get the particular solution ~x(t) = ~v1 ξ1 (t) + ~v2 ξ2 (t) + · · · + ~vn ξn (t) satisfying ~x(0) = ~b,
because ξk (0) = ak .
Example 3.9.2: Let A = 13 31 . Solve ~x 0 = A~x + f~ where f~(t) = 2e2t for ~x(0) = −5/16
h ti h 3/16 i
.
1 1
The eigenvalues of A are −2 and 4 and corresponding eigenvectors are −1 and 1 respectively.
This calculation is left as an exercise. We write down the matrix E of the eigenvectors and compute
its inverse (using the inverse formula for 2 × 2 matrices)
" # " #
1 1 1 1 −1
E= , E =−1
.
−1 1 2 1 1
We are looking for a solution of the form ~x = h −1 ξ1 + 11 ξ2 . We first need to write f~ in terms
1
So g1 = et − t and g2 = et + t.
Wei further need to write ~x(0) in terms of the eigenvectors. That is, we wish to write ~x(0) =
h 3/16
−5/16 = −1 a1 + 1 a2 . Hence
1 1
/16 /4
" # "3 # " 1 #
a1
= E −5
−1
= −1 .
a2 /16 /16
So a1 = 1/4 and a2 = −1/16. We plug our ~x into the equation and get that
" # " # " # " # " # " #
1 0 1 0 1 1 1 1
ξ + ξ =A ξ +A ξ + g + g
−1 1 1 2 −1 1 1 2 −1 1 1 2
" # " # " # " #
1 1 1 1 t
= (−2ξ1 ) + 4ξ2 + (e − t) +
t
(e + t).
−1 1 −1 1
et t 1
Z
ξ1 = e −2t
e2t (et − t) dt + C1 e−2t = − + + C1 e−2t .
3 2 4
3.9. NONHOMOGENEOUS SYSTEMS 159
C1 is the constant of integration. As ξ1 (0) = 1/4, then 1/4 = 1/3 + 1/4 + C1 and hence C1 = −1/3.
Similarly
et t
Z
1
ξ2 = e4t
e (e + t) dt + C2 e = − − −
−4t t 4t
+ C2 e4t .
3 4 16
As ξ2 (0) = −1/16 we have −1/16 = −1/3 − 1/16 + C2 and hence C2 = 1/3. The solution is
1 e − et 4t + 1
! " e4t −e−2t 3−12t #
et − e−2t 1 − 2t +
" # ! " # 4t
1
~x(t) = + + − = e−2t +e3 4t +2et 164t−5 .
−1 3 4 1 3 16 3
+ 16
Exercise 3.9.1: Check that x1 and x2 solve the problem. Check both that they satisfy the differential
equation and that they satisfy the initial conditions.
Undetermined coefficients
We also have the method of undetermined coefficients for systems. The only difference here is that
we have to use unknown vectors rather than just numbers. Same caveats apply to undetermined
coefficients for systems as for single equations. This method does not always work. Furthermore
if the right hand side is complicated, we have to solve for lots of variables. Each element of an
unknown vector is an unknown number. So in system of 3 equations if we have say 4 unknown
vectors (this would not be uncommon), then we already have 12 unknown numbers that we need to
solve for. The method can turn into a lot of tedious work. As this method is essentially the same as
it is for single equations, let us just do an example.
~ ~
0
h ti
Example 3.9.3: Let A = −1 ~ = + =
0 e .
−2 1 . Find a particular solution of x A~
x f where f (t) t
Note that we can solve this system in an easier way (can you see how?), but for the purposes of
the example, let us use the eigenvalue method plus undetermined coefficients.
The eigenvalues of A are −1 and 1 and corresponding eigenvectors are 11 and 01 respectively.
Hence our complementary solution is
" # " #
1 −t 0 t
~xc = α1 e + α2 e,
1 1
However, something of the form ~aet appears in the complementary solution. Because we do not
yet know if the vector ~a is a multiple of 01 , we do not know if a conflict arises. It is possible that
160 CHAPTER 3. SYSTEMS OF ODES
there is no conflict, but to be safe we should also try ~btet . Here we find the crux of the difference for
systems. We try both terms ~aet and ~btet in the solution, not just the term ~btet . Therefore, we try
~x = ~aet + ~btet + ~ct + d.
~
Thus we have 8 unknowns. We write ~a = aa12 , ~b = bb12 , ~c = cc12 , and d~ = dd12 . We plug ~x into the
h i h i h i h i
That is, x1 = 12 et , x2 = −tet − t − 1. We would add this to the complementary solution to get the
general solution of the problem. Notice also that both ~aet and ~btet were really needed.
3.9. NONHOMOGENEOUS SYSTEMS 161
Exercise 3.9.2: Check that x1 and x2 solve the problem. Also try setting a2 = 1 and again check
these solutions. What is the difference between the two solutions we can obtain in this way?
As you can see, other than the handling of conflicts, undetermined coefficients works exactly the
same as it did for single equations. However, the computations can get out of hand pretty quickly
for systems. The equation we considered was pretty simple.
~x p = X(t) ~u(t),
where ~u(t) is a vector valued function instead of a constant. We substitute ~x p into (3.9) to obtain
But X(t) is a fundamental matrix solution to the homogeneous problem. So X 0 (t) = A(t)X(t), and
Hence X(t) ~u 0 (t) = f~(t). If we compute [X(t)]−1 , then ~u 0 (t) = [X(t)]−1 f~(t). We integrate to obtain ~u
and we have the particular solution ~x p = X(t) ~u(t). Let us write this as a formula
Z
~x p = X(t) [X(t)]−1 f~(t) dt.
If A is constant and X(t) = etA , then [X(t)]−1 = e−tA . We get a solution ~x p = etA e−tA f~(t) dt,
R
Here A = t21+1 1t −1t is most definitely not constant. Perhaps by a lucky guess, we find that
X = 1t −t1 solves X 0 (t) = A(t)X(t). Once we know the complementary solution we can easily find a
solution to (3.10). First we find
" #
1 1 t
[X(t)] = 2
−1
.
t + 1 −t 1
Next we know a particular solution to (3.10) is
Z
~x p = X(t) [X(t)]−1 f~(t) dt
" #Z " #" #
1 −t 1 1 t t 2
= (t + 1) dt
t 1 t2 + 1 −t 1 1
" #Z " #
1 −t 2t
= dt
t 1 −t2 + 1
" #" #
1 −t t2
=
t 1 − 1 t3 + t
" 1 4 # 3
t
= 2 33 .
3
t +t
Adding the complementary solution we find the general solution to (3.10):
c1 − c2 t + 31 t4
" #" # " 1 4 # " #
1 −t c1 t
~x = + 2 3 3 = .
t 1 c2 3
t +t c2 + (c1 + 1) t + 23 t3
Exercise 3.9.3: Check that x1 = 13 t4 and x2 = 32 t3 + t really solve (3.10).
In the variation of parameters, just like in the integrating factor method we can obtain the general
solution by adding in constants of integration. That is, we will add X(t)~c for a vector of arbitrary
constants. But that is precisely the complementary solution.
and we would try ~b cos(ω1 t) for the problem ~x 00 = A~x + F~1 cos(ω1 t). Then we sum the solutions.
However, if there is duplication with the complementary solution, or the equation is of the form
~
~x 00 = A~x 0 + B~x + F(t), then we need to do the same thing as we do for first order systems.
You will never go wrong with putting in more terms than needed into your guess. You will find
that the extra coefficients will turn out to be zero. But it is useful to save some time and effort.
Eigenvector decomposition
If we have the system
~x 00 = A~x + f~(t),
we can do eigenvector decomposition, just like for first order systems.
Let λ1 , λ2 , . . . , λn be the eigenvalues and ~v1 , ~v2 , . . . , ~vn be eigenvectors. Again form the matrix
E = [ ~v1 ~v2 · · · ~vn ]. Write
ξ100 = λ1 ξ1 + g1 ,
ξ200 = λ2 ξ2 + g2 ,
..
.
ξn = λn ξn + gn .
00
Each one of these equations is independent of the others. We solve each equation using the
methods of chapter 2. We write ~x(t) = ~v1 ξ1 (t) + ~v2 ξ2 (t) + · · · + ~vn ξn (t), and we are done; we
164 CHAPTER 3. SYSTEMS OF ODES
have a particular solution. We find the general solutions for ξ1 through ξn , and again ~x(t) =
~v1 ξ1 (t) + ~v2 ξ2 (t) + · · · + ~vn ξn (t) is the general solution (and not just a particular solution).
Example 3.9.5: Let us do the example from § 3.6 using this method. The equation is
" # " #
00 −3 1 0
~x = ~x + cos(3t).
2 −2 2
. Therefore E = 12 −1
1 1
1
The eigenvalues are −1 and −4, with eigenvectors 2 and −1 and
E −1 = 31 12 −1
1
. Therefore,
" # " #" # "2 #
g1 −1 ~ 1 1 1 0 cos(3t)
= E f (t) = = −2
3
.
g2 3 2 −1 2 cos(3t) 3
cos(3t)
So after the whole song and dance of plugging in, the equations we get are
2
ξ100 = −ξ1 + cos(3t),
3
2
ξ200 = −4 ξ2 − cos(3t).
3
For each equation we use the method of undetermined coefficients. We try C1 cos(3t) for the first
equation and C2 cos(3t) for the second equation. We plug in to get
2
−9C1 cos(3t) = −C1 cos(3t) + cos(3t),
3
2
−9C2 cos(3t) = −4C2 cos(3t) − cos(3t).
3
We solve each of these equations separately. We get −9C1 = −C1 + 2/3 and −9C2 = −4C2 − 2/3. And
hence C1 = −1/12 and C2 = 2/15. So our particular solution is
1/20
" # ! " # ! " #
1 −1 1 2
~x = cos(3t) + cos(3t) = −3 cos(3t).
2 12 −1 15 /10
3.9.4 Exercises
Exercise 3.9.4: Find a particular solution to x0 = x + 2y + 2t, y0 = 3x + 2y − 4, a) using integrating
factor method, b) using eigenvector decomposition, c) using undetermined coefficients.
Exercise 3.9.6: Find the general solution to x100 = −6x1 + 3x2 + cos(t), x200 = 2x1 − 7x2 + 3 cos(t),
a) using eigenvector decomposition, b) using undetermined coefficients.
Exercise 3.9.7: Find the general solution to x100 = −6x1 + 3x2 + cos(2t), x200 = 2x1 − 7x2 + 3 cos(2t),
a) using eigenvector decomposition, b) using undetermined coefficients.
Exercise 3.9.103: Solve x10 = x2 + t, x20 = x1 + t with initial conditions x1 (0) = 1, x2 (0) = 2, using
eigenvector decomposition.
Exercise 3.9.104: Solve x100 = −3x1 + x2 + t, x200 = 9x1 + 5x2 + cos(t) with initial conditions x1 (0) = 0,
x2 (0) = 0, x10 (0) = 0, x20 (0) = 0, using eigenvector decomposition.
166 CHAPTER 3. SYSTEMS OF ODES
Chapter 4
167
168 CHAPTER 4. FOURIER SERIES AND PDES
√ √
Then the general solution is x = A cos( 2 t) + B sin( 2√t). Letting x(0)
√ = 0 still forces A = 0. We
apply the second condition to find 0 = x(π) = B sin( 2 π). As sin( 2 π) , 0 we obtain B = 0.
Therefore x = 0 is the unique solution to this problem.
What is going on? We will be interested in finding which constants λ allow a nonzero solution,
and we will be interested in finding those solutions. This problem is an analogue of finding
eigenvalues and eigenvectors of matrices.
We have to handle the cases λ > 0, λ = 0, λ < 0 separately. First suppose that λ > 0. Then the
general solution to x00 + λx = 0 is
√ √
x = A cos( λ t) + B sin( λ t).
can be taken as x = sin(kt). Just like for eigenvectors, we get all the multiples of an eigenfunction,
so we only need to pick one.
Now suppose that λ = 0. In this case the equation is x00 = 0, and its general solution is x = At + B.
The condition x(0) = 0 implies that B = 0, and x(π) = 0 implies that A = 0. This means that λ = 0
is not an eigenvalue.
Finally, suppose that λ < 0. In this case we have the general solution
√ √
x = A cosh( −λ t) + B sinh( −λ t).
Letting x(0)√ = 0 implies that A = 0 (recall cosh 0 = 1 and sinh 0 = 0). So our solution must be
x = B sinh( −λ t) and satisfy x(π) = 0. This is only possible if B is zero. Why? Because sinh ξ is
only zero when ξ = 0. You should plot sinh to see this fact. We can also see this from the definition
ξ
. Hence eξ = e−ξ , which implies ξ = −ξ and that is only true if
−ξ
of sinh. We get 0 = sinh ξ = e −e2
ξ = 0. So there are no negative eigenvalues.
In summary, the eigenvalues and corresponding eigenfunctions are
√ √ √ √
x0 = −A λ sin( λ t) + B λ cos( λ t).
λ0 = 0 with an eigenfunction x0 = 1.
The following problem is the one that leads to the general Fourier series.
Example 4.1.5: Let us compute the eigenvalues and eigenfunctions of
We have not specified the values or the derivatives at the endpoints, but rather that they are the same
at the beginning and at the end of the interval.
Let us skip λ < 0. The computations are the same as before, and again we find that there are no
negative eigenvalues.
For λ = 0, the general solution is x = At + B. The condition x(−π) = x(π) implies that A = 0
(Aπ + B = −Aπ + B implies A = 0). The second condition x0 (−π) = x0 (π) says nothing about B and
hence λ = 0 is an eigenvalue with a √corresponding√eigenfunction x = 1.
For λ > 0 we get that x = A cos( λ t) + B sin( λ t). Now
√ √ √ √
A cos(− λ π) + B sin(− λ π) = A cos( λ π) + B sin( λ π) .
| {z } | {z }
x(−π) x(π)
The terminology comes from the fact that the integral is a type of inner product. We will expand
on this in the next section. The theorem has a very short, elegant, and illuminating proof so let us
give it here. First, we have the following two equations.
The last equality holds because of the boundary conditions. For example, if we consider (4.1) we
have x1 (a) = x1 (b) = x2 (a) = x2 (b) = 0 and so x20 x1 − x2 x10 is zero at both a and b. As λ1 , λ2 , the
theorem follows.
Exercise 4.1.1 (easy): Finish the proof of the theorem (check the last equality in the proof) for the
cases (4.2) and (4.3).
The function sin(nt) is an eigenfunction for the problem x00 + λx = 0, x(0) = 0, x(π) = 0. Hence
for positive integers n and m we have the integrals
Z π
sin(mt) sin(nt) dt = 0, when m , n.
0
172 CHAPTER 4. FOURIER SERIES AND PDES
Similarly
Z π Z π
cos(mt) cos(nt) dt = 0, when m , n, and cos(nt) dt = 0.
0 0
4.1.5 Application
Let us consider a physical application of an endpoint problem. Suppose we have a tightly stretched
quickly spinning elastic string or rope of uniform linear density ρ, for example in kg/m. Let us put
this problem into the xy-plane and both x and y are in meters. The x axis represents the position
on the string. The string rotates at angular velocity ω, in radians/s2 . Imagine that the whole xy-plane
rotates at angular velocity ω. This way, the string stays in this xy-plane and y measures its deflection
from the equilibrium position, y = 0, on the x axis. Hence the graph of y gives the shape of the
string. We consider an ideal string with no volume, just a mathematical curve. We suppose the
tension on the string is a constant T in Newtons. Assuming that the deflection is small, we can use
Newton’s second law (let us skip the derivation) to get the equation
T y00 + ρω2 y = 0.
To check the units notice that the units of y00 are m/m2 , as the derivative is in terms of x.
Let L be the length of the string (in meters) and the string is fixed at the beginning and end
points. Hence, y(0) = 0 and y(L) = 0. See Figure 4.1.
0 L x
We rewrite the equation as y00 + ρωT y = 0. The setup is similar to Example 4.1.3 on page 168,
2
except for the interval length being L instead of π. We are looking for eigenvalues of y00 + λy =
0, y(0) = 0, y(L) = 0 where λ = ρωT . As before there are no nonpositive eigenvalues. With λ > 0, the
2
√ √
general solution to the equation is y = A cos( λ x) + B sin( λ√x). The condition y(0) √ = 0 implies
that A = 0 as before. The condition y(L) = 0 implies that sin( λ L) = 0 and hence λ L = kπ for
some integer k > 0, so
ρω2 k2 π2
=λ= 2 .
T L
What does this say about the shape of the string? It says that for all parameters ρ, ω, T not
satisfying the above equation, the string is in the equilibrium position, y = 0. When ρωT = kLπ2 , then
2 2 2
the string will “pop out” some distance B. We cannot compute B with the information we have.
Let us assume that ρ and T are fixed and we are changing ω. For most √values of ω the string is
in the equilibrium state. When the angular velocity ω hits a value ω = kπL √ρT , then the string pops
out and has the shape of a sin wave crossing the x axis k − 1 times between the end points. When ω
174 CHAPTER 4. FOURIER SERIES AND PDES
changes again, the string returns to the equilibrium position. The higher the angular velocity, the
more times it crosses the x axis when it is popped out.
For another example, if you have a spinning jump rope (then k = 1 as it is completely “popped
out”) and you pull on the ends to increase the tension, then the velocity also increases for the rope
to stay “popped out”.
4.1.6 Exercises
√ √
Hint for the following exercises: Note that when λ > 0, then cos λ (t − a) and sin λ (t − a) are
also solutions of the homogeneous equation.
Exercise 4.1.2: Compute all eigenvalues and eigenfunctions of x00 + λx = 0, x(a) = 0, x(b) = 0
(assume a < b).
Exercise 4.1.3: Compute all eigenvalues and eigenfunctions of x00 + λx = 0, x0 (a) = 0, x0 (b) = 0
(assume a < b).
Exercise 4.1.4: Compute all eigenvalues and eigenfunctions of x00 + λx = 0, x0 (a) = 0, x(b) = 0
(assume a < b).
Exercise 4.1.5: Compute all eigenvalues and eigenfunctions of x00 + λx = 0, x(a) = x(b), x0 (a) =
x0 (b) (assume a < b).
Exercise 4.1.6: We skipped the case of λ < 0 for the boundary value problem x00 + λx = 0, x(−π) =
x(π), x0 (−π) = x0 (π). Finish the calculation and show that there are no negative eigenvalues.
Exercise 4.1.101: Consider a spinning string of length 2 and linear density 0.1 and tension 3. Find
smallest angular velocity when the string pops out.
Exercise 4.1.102: Suppose x00 + λx = 0 and x(0) = 1, x(1) = 1. Find all λ for which there is more
than one solution. Also find the corresponding solutions (only for the eigenvalues).
Exercise 4.1.103: Suppose x00 + x = 0 and x(0) = 0, x0 (π) = 1. Find all the solution(s) if any exist.
Exercise 4.1.104: Consider x0 + λx = 0 and x(0) = 0, x(1) = 0. Why does it not have any
eigenvalues? Why does any first order equation with two endpoint conditions such as above have
no eigenvalues?
Exercise 4.1.105 (challenging): Suppose x000 + λx = 0 and x(0) = 0, x0 (0) = 0, x(1)√= 0. Suppose
that λ > 0. Find an equation that all such eigenvalues must satisfy. Hint: Note that − λ is a root of
3
r3 + λ = 0.
4.2. THE TRIGONOMETRIC SERIES 175
One way to solve (4.6) is to decompose f (t) as a sum of cosines (and sines) and then solve many
problems of the form (4.7). We then use the principle of superposition, to sum up all the solutions
we got to get a solution to (4.6).
Before we proceed, let us talk a little bit more in detail about periodic functions. A function is
said to be periodic with period P if f (t) = f (t + P) for all t. For brevity we say f (t) is P-periodic.
Note that a P-periodic function is also 2P-periodic, 3P-periodic and so on. For example, cos(t) and
sin(t) are 2π-periodic. So are cos(kt) and sin(kt) for all integers k. The constant functions are an
extreme example. They are periodic for any period (exercise).
Normally we start with a function f (t) defined on some interval [−L, L], and we want to extend
f (t) periodically to make it a 2L-periodic function. We do this extension by defining a new function
F(t) such that for t in [−L, L], F(t) = f (t). For t in [L, 3L], we define F(t) = f (t − 2L), for t in
[−3L, −L], F(t) = f (t + 2L), and so on. To make that work we needed f (−L) = f (L). We could have
also started with f defined only on the half-open interval (−L, L] and then define f (−L) = f (L).
Example 4.2.1: Define f (t) = 1 − t2 on [−1, 1]. Now extend f (t) periodically to a 2-periodic
function. See Figure 4.2 on the following page.
You should be careful to distinguish between f (t) and its extension. A common mistake is to
assume that a formula for f (t) holds for its extension. It can be confusing when the formula for f (t)
is periodic, but with perhaps a different period.
Exercise 4.2.1: Define f (t) = cos t on [−π/2, π/2]. Take the π-periodic extension and sketch its graph.
How does it compare to the graph of cos t?
1.0 1.0
0.5 0.5
0.0 0.0
-0.5 -0.5
-3 -2 -1 0 1 2 3
Therefore,
h~v, w~1 i
a1 = .
w1 , w~1 i
h~
Similarly
h~v, w~2 i
a2 = .
w2 , w~2 i
h~
You probably remember this formula from vector calculus.
Example 4.2.2: Write ~v = 23 as a linear combination of w~1 = −1 and w~2 = 11 .
1
~ 1 and w
First note that w ~ 2 are orthogonal as h~
w1 , w~ 2 i = 1(1) + (−1)1 = 0. Then
h~v, w~1 i 2(1) + 3(−1) −1
a1 = = = ,
w1 , w~1 i 1(1) + (−1)(−1)
h~ 2
h~v, w~2 i 2+3 5
a2 = = = .
w2 , w~2 i 1 + 1 2
h~
Hence " # " # " #
2 −1 1 5 1
= + .
3 2 −1 2 1
4.2. THE TRIGONOMETRIC SERIES 177
This series is called the Fourier series∗ or the trigonometric series for f (t). We write the coefficient
of the eigenfunction 1 as a20 for convenience. We could also think of 1 = cos(0t), so that we only
need to look at cos(kt) and sin(kt).
As for matrices we want to find a projection of f (t) onto the subspaces given by the eigenfunc-
tions. So we want to define an inner product of functions. For example, to find an we want to
compute h f (t) , cos(nt) i. We define the inner product as
Z π
def
h f (t) , g(t) i = f (t) g(t) dt.
−π
With this definition of the inner product, we saw in the previous section that the eigenfunctions
cos(kt) (including the constant eigenfunction), and sin(kt) are orthogonal in the sense that
h cos(mt) , cos(nt) i = 0 for m , n,
h sin(mt) , sin(nt) i = 0 for m , n,
h sin(mt) , cos(nt) i = 0 for all m and n.
By elementary calculus for n = 1, 2, 3, . . . we have h cos(nt) , cos(nt) i = π and h sin(nt) , sin(nt) i =
π. For the constant we get that h 1 , 1 i = 2π. The coefficients are given by
h f (t) , cos(nt) i 1 π
Z
an = = f (t) cos(nt) dt,
h cos(nt) , cos(nt) i π −π
h f (t) , sin(nt) i 1 π
Z
bn = = f (t) sin(nt) dt.
h sin(nt) , sin(nt) i π −π
Compare these expressions with the finite-dimensional example. For a0 we get a similar formula
h f (t) , 1 i 1 π
Z
a0 = 2 = f (t) dt.
h1, 1i π −π
∗
Named after the French mathematician Jean Baptiste Joseph Fourier (1768–1830).
178 CHAPTER 4. FOURIER SERIES AND PDES
Let us check the formulas using the orthogonality properties. Suppose for a moment that
∞
a0 X
f (t) = + an cos(nt) + bn sin(nt).
2 n=1
3 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
The plot of the extended periodic function is given in Figure 4.3. Let us compute the coefficients.
We start with a0 ,
1 π
Z
a0 = t dt = 0.
π −π
4.2. THE TRIGONOMETRIC SERIES 179
We will often use the result from calculus that says that the integral of an odd function over a
symmetric interval is zero. Recall that an odd function is a function ϕ(t) such that ϕ(−t) = −ϕ(t).
For example the functions t, sin t, or (importantly for us) t cos(nt) are all odd functions. Thus
1 π
Z
an = t cos(nt) dt = 0.
π −π
Let us move to bn . Another useful fact from calculus is that the integral of an even function over a
symmetric interval is twice the integral of the same function over half the interval. Recall an even
function is a function ϕ(t) such that ϕ(−t) = ϕ(t). For example t sin(nt) is even.
1 π
Z
bn = t sin(nt) dt
π −π
2 π
Z
= t sin(nt) dt
π 0
#π
1 π
" Z !
2 −t cos(nt)
= + cos(nt) dt
π n t=0 n 0
!
2 −π cos(nπ)
= +0
π n
−2 cos(nπ) 2 (−1)n+1
= = .
n n
We have used the fact that
1
if n even,
cos(nπ) = (−1) =
n
−1 if n odd.
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
-1 -1 -1 -1
-2 -2 -2 -2
-3 -3 -3 -3
-5.0 -2.5 0.0 2.5 5.0 -5.0 -2.5 0.0 2.5 5.0
Figure 4.4: First 3 (left graph) and 20 (right graph) harmonics of the sawtooth function.
3 3
2 2
1 1
0 0
The plot of the extended periodic function is given in Figure 4.5. Now we compute the
coefficients. Let us start with a0
Z π Z π
1 1
a0 = f (t) dt = π dt = π.
π −π π 0
Next,
Z π Z π
1 1
an = f (t) cos(nt) dt = π cos(nt) dt = 0.
π −π π 0
4.2. THE TRIGONOMETRIC SERIES 181
And finally
1 π
Z
bn = f (t) sin(nt) dt
π −π
Z π
1
= π sin(nt) dt
π
" 0 #π
− cos(nt)
=
n t=0
2n
1 − cos(πn) 1 − (−1)n if n is odd,
= = =
n n 0
if n is even.
The Fourier series is
∞ ∞
π X2 π X 2
+ sin(nt) = + sin (2k − 1) t .
2 n=1 n 2 k=1 2k − 1
n odd
Let us write out the first 3 harmonics of the series for f (t).
π 2
+ 2 sin(t) + sin(3t) + · · ·
2 3
The plot of these first three and also of the first 20 terms of the series is given in Figure 4.6.
-5.0 -2.5 0.0 2.5 5.0 -5.0 -2.5 0.0 2.5 5.0
3 3 3 3
2 2 2 2
1 1 1 1
0 0 0 0
-5.0 -2.5 0.0 2.5 5.0 -5.0 -2.5 0.0 2.5 5.0
Figure 4.6: First 3 (left graph) and 20 (right graph) harmonics of the square wave function.
We have so far skirted the issue of convergence. For example, if f (t) is the square wave function,
the equation
∞
π X 2
f (t) = + sin (2k − 1) t .
2 k=1 2k − 1
182 CHAPTER 4. FOURIER SERIES AND PDES
is only an equality for such t where f (t) is continuous. That is, we do not get an equality for
t = −π, 0, π and all the other discontinuities of f (t). It is not hard to see that when t is an integer
multiple of π (which includes all the discontinuities), then
∞
π X 2 π
+ sin (2k − 1) t = .
2 k=1 2k − 1 2
and extend periodically. The series equals this extended f (t) everywhere, including the disconti-
nuities. We will generally not worry about changing the function values at several (finitely many)
points.
We will say more about convergence in the next section. Let us however mention briefly an
effect of the discontinuity. Let us zoom in near the discontinuity in the square wave. Further, let us
plot the first 100 harmonics, see Figure 4.7. While the series is a very good approximation away
from the discontinuities, the error (the overshoot) near the discontinuity at t = π does not seem to
be getting any smaller. This behavior is known as the Gibbs phenomenon. The region where the
error is large does get smaller, however, the more terms in the series we take.
1.75 2.00 2.25 2.50 2.75 3.00 3.25
3.50 3.50
3.25 3.25
3.00 3.00
2.75 2.75
We can think of a periodic function as a “signal” being a superposition of many signals of pure
frequency. For example, we could think of the square wave as a tone of certain base frequency.
This base frequency is called the fundamental frequency. The square wave will be a superposition
of many different pure tones of frequencies that are multiples of the fundamental frequency. In
4.2. THE TRIGONOMETRIC SERIES 183
music, the higher frequencies are called the overtones. All the frequencies that appear are called the
spectrum of the signal. On the other hand a simple sine wave is only the pure tone (no overtones).
The simplest way to make sound using a computer is the square wave, and the sound is very different
from a pure tone. If you ever played video games from the 1980s or so, then you heard what square
waves sound like.
4.2.4 Exercises
Exercise 4.2.3: Suppose f (t) is defined on [−π, π] as sin(5t) + cos(3t). Extend periodically and
compute the Fourier series of f (t).
Exercise 4.2.4: Suppose f (t) is defined on [−π, π] as |t|. Extend periodically and compute the
Fourier series of f (t).
Exercise 4.2.5: Suppose f (t) is defined on [−π, π] as |t|3 . Extend periodically and compute the
Fourier series of f (t).
Exercise 4.2.6: Suppose f (t) is defined on (−π, π] as
−1 if −π < t ≤ 0,
f (t) =
1
if 0 < t ≤ π.
Extend periodically and compute the Fourier series of f (t).
Exercise 4.2.7: Suppose f (t) is defined on (−π, π] as t3 . Extend periodically and compute the
Fourier series of f (t).
Exercise 4.2.8: Suppose f (t) is defined on [−π, π] as t2 . Extend periodically and compute the
Fourier series of f (t).
There is another form of the Fourier series using complex exponentials that is sometimes easier
to work with.
Exercise 4.2.9: Let ∞
a0 X
f (t) = + an cos(nt) + bn sin(nt).
2 n=1
Use Euler’s formula eiθ = cos(θ) + i sin(θ) to show that there exist complex numbers cm such that
X∞
f (t) = cm eimt .
m=−∞
Note that the sum now ranges over all the integers including negative ones. Do not worry about
convergence in this calculation. Hint: It may be better to start from the complex exponential form
and write the series as ∞
X
c0 + cm eimt + c−m e−imt .
m=1
184 CHAPTER 4. FOURIER SERIES AND PDES
Exercise 4.2.101: Suppose f (t) is defined on [−π, π] as f (t) = sin(t). Extend periodically and
compute the Fourier series.
Exercise 4.2.102: Suppose f (t) is defined on (−π, π] as f (t) = sin(πt). Extend periodically and
compute the Fourier series.
Exercise 4.2.103: Suppose f (t) is defined on (−π, π] as f (t) = sin2 (t). Extend periodically and
compute the Fourier series.
Exercise 4.2.104: Suppose f (t) is defined on (−π, π] as f (t) = t4 . Extend periodically and compute
the Fourier series.
4.3. MORE ON THE FOURIER SERIES 185
We compute an and bn as before. After we write down the integrals, we change variables from s
back to t, noting also that ds = Lπ dt.
1 π 1 L
Z Z
a0 = g(s) ds = f (t) dt,
π −π L −L
1 π 1 L
Z Z nπ
an = g(s) cos(ns) ds = f (t) cos t dt,
π −π L −L L
1 π 1 L
Z Z nπ
bn = g(s) sin(ns) ds = f (t) sin t dt.
π −π L −L L
The two most common half periods that show up in examples are π and 1 because of the
simplicity of the formulas. We should stress that we have done no new mathematics, we have only
changed variables. If you understand the Fourier series for 2π-periodic functions, you understand it
for 2L-periodic functions. You can think of it as just using different units for time. All that we are
doing is moving some constants around, but all the mathematics is the same.
Example 4.3.1: Let
f (t) = |t| for −1 < t ≤ 1,
186 CHAPTER 4. FOURIER SERIES AND PDES
-2 -1 0 1 2
1.00 1.00
0.75 0.75
0.50 0.50
0.25 0.25
0.00 0.00
-2 -1 0 1 2
extended periodically. The plot of the periodic extension is given in Figure 4.8. Compute the Fourier
series of f (t).
We want to write f (t) = a20 + ∞ n=1 an cos(nπt) + bn sin(nπt). For n ≥ 1 we note that |t| cos(nπt)
P
is even and hence
Z 1
an = f (t) cos(nπt) dt
−1
Z 1
=2 t cos(nπt) dt
0
1 Z 1
t 1
=2 sin(nπt) −2 sin(nπt) dt
nπ t=0 0 nπ
1 h i1 2 (−1)n − 1 0
if n is even,
= 0 + 2 2 cos(nπt) = =
nπ nπ2 2 −4
t=0
2 2 if n is odd.
n π
Next we find a0 : Z 1
a0 = |t| dt = 1.
−1
You should be able to find this integral by thinking about the integral as the area under the graph
without doing any computation at all. Finally we can find bn . Here, we notice that |t| sin(nπt) is odd
and, therefore, Z 1
bn = f (t) sin(nπt) dt = 0.
−1
Hence, the series is
∞
1 X −4
+ cos(nπt).
2 n=1 n2 π2
n odd
4.3. MORE ON THE FOURIER SERIES 187
Let us explicitly write down the first few terms of the series up to the 3rd harmonic.
1 4 4
− 2 cos(πt) − 2 cos(3πt) − · · ·
2 π 9π
The plot of these few terms and also a plot up to the 20th harmonic is given in Figure 4.9. You
should notice how close the graph is to the real function. You should also notice that there is no
“Gibbs phenomenon” present as there are no discontinuities.
-2 -1 0 1 2 -2 -1 0 1 2
-2 -1 0 1 2 -2 -1 0 1 2
Figure 4.9: Fourier series of f (t) up to the 3rd harmonic (left graph) and up to the 20th harmonic (right
graph).
4.3.2 Convergence
We will need the one sided limits of functions. We will use the following notation
If you are unfamiliar with this notation, limt↑c f (t) means we are taking a limit of f (t) as t approaches
c from below (i.e. t < c) and limt↓c f (t) means we are taking a limit of f (t) as t approaches c from
above (i.e. t > c). For example, for the square wave function
0 if −π < t ≤ 0,
f (t) =
(4.8)
π if 0 < t ≤ π,
. . . , (tk−1 , tk ). Also suppose that all the one sided limits exist, that is, all of f (t0 +), f (t1 −), f (t1 +),
f (t2 −), f (t2 +), . . . , f (tk −) exist and are finite. Then we say f (t) is piecewise continuous.
If moreover, f (t) is differentiable at all but finitely many points, and f 0 (t) is piecewise continuous,
then f (t) is said to be piecewise smooth.
Example 4.3.2: The square wave function (4.8) is piecewise smooth on [−π, π] or any other interval.
In such a case we simply say that the function is piecewise smooth.
Example 4.3.3: The function f (t) = |t| is piecewise smooth.
Example 4.3.4: The function f (t) = 1t is not piecewise smooth on [−1, 1] (or any other interval
containing zero). In fact, it is not even piecewise continuous.
√
Example 4.3.5: The function f (t) = 3 t is not piecewise smooth on [−1, 1] (or any other interval
containing zero). f (t) is continuous, but the derivative of f (t) is unbounded near zero and hence not
piecewise continuous.
Piecewise smooth functions have an easy answer on the convergence of the Fourier series.
Theorem 4.3.1. Suppose f (t) is a 2L-periodic piecewise smooth function. Let
∞
a0 X nπ nπ
+ an cos t + bn sin t
2 n=1 L L
be the Fourier series for f (t). Then the series converges for all t. If f (t) is continuous at t, then
∞
a0 X nπ nπ
f (t) = + an cos t + bn sin t .
2 n=1 L L
Otherwise ∞
f (t−) + f (t+) a0 X nπ nπ
= + an cos t + bn sin t .
2 2 n=1 L L
If we happen to have that f (t) = f (t−)+2 f (t+) at all the discontinuities, the Fourier series converges
to f (t) everywhere. We can always just redefine f (t) by changing the value at each discontinuity
appropriately. Then we can write an equals sign between f (t) and the series without any worry. We
mentioned this fact briefly at the end last section.
Note that the theorem does not say how fast the series converges. Think back to the discussion
of the Gibbs phenomenon in the last section. The closer you get to the discontinuity, the more terms
you need to take to get an accurate approximation to the function.
is a piecewise smooth continuous function and the derivative f 0 (t) is piecewise smooth. Then the
derivative can be obtained by differentiating term by term,
∞
X −an nπ nπ b nπ
n
nπ
f 0 (t) = sin t + cos t .
n=1
L L L L
It is important that the function is continuous. It can have corners, but no jumps. Otherwise the
differentiated series will fail to converge. For an exercise, take the series obtained for the square
wave and try to differentiate the series. Similarly, we can also integrate a Fourier series.
Note that the series for F(t) is no longer a Fourier series as it contains the a20 t term. The
antiderivative of a periodic function need no longer be periodic and so we should not expect a
Fourier series.
and extend to a 2-periodic function. The plot is given in Figure 4.10 on the following page.
This function has one derivative everywhere, but it does not have a second derivative whenever t
is an integer.
190 CHAPTER 4. FOURIER SERIES AND PDES
-2 -1 0 1 2
0.50 0.50
0.25 0.25
0.00 0.00
-0.25 -0.25
-0.50 -0.50
-2 -1 0 1 2
Let us compute the Fourier series coefficients. The actual computation involves several integra-
tion by parts and is left to student.
Z 1 Z 0 Z 1
a0 = f (t) dt =(t + 1) t dt + (1 − t) t dt = 0,
−1 −1 0
Z 1 Z 0 Z 1
an = f (t) cos(nπt) dt = (t + 1) t cos(nπt) dt + (1 − t) t cos(nπt) dt = 0,
−1 −1 0
Z 1 Z 0 Z 1
bn = f (t) sin(nπt) dt = (t + 1) t sin(nπt) dt + (1 − t) t sin(nπt) dt
−1 −1 0
4(1 − (−1)n ) π38n3 if n is odd,
= =
π3 n3
0
if n is even.
This series converges very fast. If you plot up to the third harmonic, that is the function
8 8
sin(πt) + sin(3πt),
π 3 27π3
8
it is almost indistinguishable from the plot of f (t) in Figure 4.10. In fact, the coefficient 27π3 is
3
already just 0.0096 (approximately). The reason for this behavior is the n term in the denominator.
The coefficients bn in this case go to zero as fast as 1/n3 goes to zero.
4.3. MORE ON THE FOURIER SERIES 191
For functions constructed piecewise from polynomials as above, it is generally true that if you
have one derivative, the Fourier coefficients will go to zero approximately like 1/n3 . If you have only
a continuous function, then the Fourier coefficients will go to zero as 1/n2 . If you have discontinuities,
then the Fourier coefficients will go to zero approximately as 1/n. For more general functions the
story is somewhat more complicated but the same idea holds, the more derivatives you have, the
faster the coefficients go to zero. Similar reasoning works in reverse. If the coefficients go to
zero like 1/n2 you always obtain a continuous function. If they go to zero like 1/n3 you obtain an
everywhere differentiable function.
To justify this behavior, take for example the function defined by the Fourier series
∞
X 1
f (t) = 3
sin(nt).
n=1
n
Therefore, the coefficients now go down like 1/n2 , which means that we have a continuous function.
The derivative of f 0 (t) is defined at most points, but there are points where f 0 (t) is not differentiable.
It has corners, but no jumps. If we differentiate again (where we can) we find that the function f 00 (t),
now fails to be continuous (has jumps)
∞
X −1
f 00 (t) = sin(nt).
n=1
n
This function is similar to the sawtooth. If we tried to differentiate the series again we would obtain
∞
X
− cos(nt),
n=1
4.3.5 Exercises
Exercise 4.3.3: Let
0
if −1 < t ≤ 0,
f (t) =
t
if 0 < t ≤ 1,
extended periodically. a) Compute the Fourier series for f (t). b) Write out the series explicitly up to
the 3rd harmonic.
192 CHAPTER 4. FOURIER SERIES AND PDES
extended periodically. a) Compute the Fourier series for f (t). b) Write out the series explicitly up to
the 3rd harmonic.
Exercise 4.3.9: Let
f (t) = et for −1 < t ≤ 1
extended periodically. a) Compute the Fourier series for f (t). b) Write out the series explicitly up to
the 3rd harmonic. c) What does the series converge to at t = 1.
Exercise 4.3.10: Let
f (t) = t2 for −1 < t ≤ 1
extended periodically. a) Compute the Fourier series for f (t). b) By plugging in t = 0, evaluate
∞ ∞
X (−1)n 1 1 X 1 1 1
2
= 1 − + − · · · . c) Now evaluate 2
= 1 + + + ···.
n=1
n 4 9 n=1
n 4 9
extended periodically. a) Compute the Fourier series for f (t). b) Write out the series explicitly up to
the 3rd harmonic.
Extend Fodd (t) and Feven (t) to be 2L-periodic. Then Fodd (t) is called the odd periodic extension of
f (t), and Feven (t) is called the even periodic extension of f (t). For the odd extension we generally
assume that f (0) = f (L) = 0.
Exercise 4.4.2: Check that Fodd (t) is odd and Feven (t) is even. For Fodd , assume f (0) = f (L) = 0.
Example 4.4.1: Take the function f (t) = t (1 − t) defined on [0, 1]. Figure 4.11 on the facing page
shows the plots of the odd and even periodic extensions of f (t).
4.4. SINE AND COSINE SERIES 195
-2 -1 0 1 2 -2 -1 0 1 2
0.3 0.3 0.3 0.3
1 L 2 L
Z nπ Z nπ
bn = f (t) sin t dt = f (t) sin t dt.
L −L L L 0 L
We now write the Fourier series of f (t) as
X∞ nπ
bn sin t .
n=1
L
Similarly, if f (t) is an even 2L-periodic function. For the same exact reasons as above, we find
that bn = 0 and
2 L
Z nπ
an = f (t) cos t dt.
L 0 L
The formula still works for n = 0, in which case it becomes
2 L
Z
a0 = f (t) dt.
L 0
196 CHAPTER 4. FOURIER SERIES AND PDES
where
Z L
2 nπ
bn = f (t) sin t dt.
L 0 L
The even periodic extension of f (t) has the Fourier series
∞
a0 X nπ
Feven (t) = + an cos t ,
2 n=1 L
where
Z L
2 nπ
an = f (t) cos t dt.
L 0 L
The series ∞ a0
+
P nπ P∞ nπ
b
n=1 n sin L
t is called the sine series of f (t) and the series 2
a
n=1 n cos L
t
is called the cosine series of f (t). We often do not actually care what happens outside of [0, L]. In
this case, we pick whichever series fits our problem better.
It is not necessary to start with the full Fourier series to obtain the sine and cosine series. The
sine series is really the eigenfunction expansion of f (t) using eigenfunctions of the eigenvalue
problem x00 + λx = 0, x(0) = 0, x(L) = L. The cosine series is the eigenfunction expansion of f (t)
using eigenfunctions of the eigenvalue problem x00 + λx = 0, x0 (0) = 0, x0 (L) = L. We could have,
therefore, gotten the same formulas by defining the inner product
Z L
h f (t), g(t)i = f (t)g(t) dt,
0
and following the procedure of § 4.2. This point of view is useful, as we commonly use a specific
series that arose because our underlying question led to a certain eigenvalue problem. If the
4.4. SINE AND COSINE SERIES 197
eigenvalue problem is not one of the three we covered so far, you can still do an eigenfunction
expansion, generalizing the results of this chapter. We will deal with such a generalization in
chapter 5.
Example 4.4.2: Find the Fourier series of the even periodic extension of the function f (t) = t2 for
0 ≤ t ≤ π.
We want to write ∞
a0 X
f (t) = + an cos(nt),
2 n=1
where π
2π2
Z
2
a0 = t2 dt = ,
π 0 3
and
#π
2 π 2
Z " Z π
2 21 4
an = t cos(nt) dt = t sin(nt) − t sin(nt) dt
π 0 π n 0 nπ 0
Z π
4 h iπ 4 4(−1)n
= 2 t cos(nt) + 2 cos(nt) dt = .
nπ 0 nπ 0 n2
Note that we have “detected” the continuity of the extension since the coefficients decay as n12 . That
is, the even periodic extension of t2 has no jump discontinuities. It does have corners, since the
derivative, which is an odd function and a sine series, has jumps; it has a Fourier series whose
coefficients decay only as 1n .
Explicitly, the first few terms of the series are
π2 4
− 4 cos(t) + cos(2t) − cos(3t) + · · ·
3 9
Exercise 4.4.3: a) Compute the derivative of the even periodic extension of f (t) above and verify it
has jump discontinuities. Use the actual definition of f (t), not its cosine series! b) Why is it that the
derivative of the even periodic extension of f (t) is the odd periodic extension of f 0 (t)?
4.4.3 Application
Fourier series ties in to the boundary value problems we studied earlier. Let us see this connection
in more detail.
Suppose we have the boundary value problem for 0 < t < L,
for the Dirichlet boundary conditions x(0) = 0, x(L) = 0. By using the Fredholm alternative
(Theorem 4.1.2 on page 172), as long as λ is not an eigenvalue of the underlying homogeneous
198 CHAPTER 4. FOURIER SERIES AND PDES
problem,
there exists a unique solution. Eigenfunctions of this eigenvalue problem are the functions
sin nπL
t . Therefore, to find the solution, we first find the Fourier sine series for f (t). We write x
also as a sine series, but with unknown coefficients. We substitute the series for x into the equation
and solve for the unknown coefficients. If we have the Neumann boundary conditions x0 (0) = 0,
x0 (L) = 0, we do the same procedure using the cosine series.
Let us see how this method works on examples.
Example 4.4.3: Take the boundary value problem for 0 < t < 1,
where f (t) = t on 0 < t < 1, and satisfying the Dirichlet boundary conditions x(0) = 0, x(1) = 0.
We write f (t) as a sine series
∞
X
f (t) = cn sin(nπt),
n=1
where
1
2 (−1)n+1
Z
cn = 2 t sin(nπt) dt = .
0 nπ
We write x(t) as
∞
X
x(t) = bn sin(nπt).
n=1
We plug in to obtain
∞
X ∞
X
x (t) + 2x(t) =
00
−bn n π sin(nπt) + 2
2 2
bn sin(nπt)
n=1 n=1
X∞
= bn (2 − n2 π2 ) sin(nπt)
n=1
∞
X 2 (−1)n+1
= f (t) = sin(nπt).
n=1
nπ
Therefore,
2 (−1)n+1
bn (2 − n2 π2 ) =
nπ
or
2 (−1)n+1
bn = .
nπ(2 − n2 π2 )
We have thus obtained a Fourier series for the solution
∞
X 2 (−1)n+1
x(t) = sin(nπt).
n=1
nπ (2 − n2 π2 )
4.4. SINE AND COSINE SERIES 199
Example 4.4.4: Similarly we handle the Neumann conditions. Take the boundary value problem
for 0 < t < 1,
x00 (t) + 2x(t) = f (t),
where again f (t) = t on 0 < t < 1, but now satisfying the Neumann boundary conditions x0 (0) = 0,
x0 (1) = 0. We write f (t) as a cosine series
∞
c0 X
f (t) = + cn cos(nπt),
2 n=1
where Z 1
c0 = 2 t dt = 1,
0
and
1
2 (−1)n − 1 π−4
Z if n odd,
cn = 2 t cos(nπt) dt = =
2 n2
0 πn
2 2
0 if n even.
We write x(t) as a cosine series
∞
a0 X
x(t) = + an cos(nπt).
2 n=1
We plug in to obtain
∞ h
X i ∞ h
X i
x00 (t) + 2x(t) = −an n2 π2 cos(nπt) + a0 + 2 an cos(nπt)
n=1 n=1
∞
X
= a0 + an (2 − n2 π2 ) cos(nπt)
n=1
∞
1 X −4
= f (t) = + cos(nπt).
2 n=1 π2 n2
n odd
4.4.4 Exercises
Exercise 4.4.4: Take f (t) = (t − 1)2 defined on 0 ≤ t ≤ 1. a) Sketch the plot of the even periodic
extension of f . b) Sketch the plot of the odd periodic extension of f .
Exercise 4.4.5: Find the Fourier series of both the odd and even periodic extension of the function
f (t) = (t − 1)2 for 0 ≤ t ≤ 1. Can you tell which extension is continuous from the Fourier series
coefficients?
Exercise 4.4.6: Find the Fourier series of both the odd and even periodic extension of the function
f (t) = t for 0 ≤ t ≤ π.
Exercise 4.4.7: Find the Fourier series of the even periodic extension of the function f (t) = sin t
for 0 ≤ t ≤ π.
Exercise 4.4.8: Consider
x00 (t) + 4x(t) = f (t),
where f (t) = 1 on 0 < t < 1. a) Solve for the Dirichlet conditions x(0) = 0, x(1) = 0. b) Solve for
the Neumann conditions x0 (0) = 0, x0 (1) = 0.
Exercise 4.4.9: Consider
x00 (t) + 9x(t) = f (t),
for f (t) = sin(2πt) on 0 < t < 1. a) Solve for the Dirichlet conditions x(0) = 0, x(1) = 0. b) Solve
for the Neumann conditions x0 (0) = 0, x0 (1) = 0.
Exercise 4.4.10: Consider
x00 (t) + 3x(t) = f (t), x(0) = 0, x(1) = 0,
where f (t) = n=1 bn sin(nπt). Write the solution x(t) as a Fourier series, where the coefficients are
P∞
given in terms of bn .
Exercise 4.4.11: Let f (t) = t2 (2 − t) for 0 ≤ t ≤ 2. Let F(t) be the odd periodic extension. Compute
F(1), F(2), F(3), F(−1), F(9/2), F(101), F(103). Note: Do not compute using the sine series.
Exercise 4.4.101: Let f (t) = t/3 on 0 ≤ t < 3. a) Find the Fourier series of the even periodic
extension. b) Find the Fourier series of the odd periodic extension.
Exercise 4.4.102: Let f (t) = cos(2t) on 0 ≤ t < π. a) Find the Fourier series of the even periodic
extension. b) Find the Fourier series of the odd periodic extension.
Exercise 4.4.103: Let f (t) be defined on 0 ≤ t < 1. Now take the average of the two extensions
g(t) = Fodd (t)+F
2
even (t)
. a) What is g(t) if 0 ≤ t < 1 (Justify!) b) What is g(t) if −1 < t < 0 (Justify!)
Exercise 4.4.104: Let f (t) = ∞ n=1 n2 sin(nt). Solve x − x = f (t) for the Dirichlet conditions
1 00
P
x(0) = 0 and x(π) = 0.
Exercise 4.4.105 (challenging): Let f (t) = t + ∞ n=1 2n sin(nt). Solve x + πx = f (t) for the Dirichlet
1 00
P
conditions x(0) = 0 and x(π) = 1. Hint: Note that πt satisfies the given Dirichlet conditions.
4.5. APPLICATIONS OF FOURIER SERIES 201
The general solution consists of the complementary solution xc , which solves the associated
homogeneous equation mx00 + cx0 + kx = 0, and a particular solution of (4.9) we call x p . For c > 0,
the complementary solution xc will decay as time goes by. Therefore, we are mostly interested in a
particular solution x p that does not decay and is periodic with the same period as F(t). We call this
particular solution the steady periodic solution and we write it as x sp as before. What is new in this
section is that we consider an arbitrary forcing function F(t) instead of a simple cosine.
For simplicity, let us suppose that c = 0. The problem with c > 0 is very similar. The equation
mx00 + kx = 0
where an and bn are unknowns. We plug x into the differential equation and solve for an and bn in
terms of cn and dn . This process is perhaps best understood by example.
202 CHAPTER 4. FOURIER SERIES AND PDES
Example 4.5.1: Suppose that k = 2, and m = 1. The units are again the mks units (meters-
kilograms-seconds). There is a jetpack strapped to the mass, which fires with a force of 1 newton
for 1 second and then is off for 1 second, and so on. We want to find the steady periodic solution.
The equation is, therefore,
x00 + 2x = F(t),
where F(t) is the step function
0 if −1 < t < 0,
F(t) =
1 if 0 < t < 1,
extended periodically. We write
∞
c0 X
F(t) = + cn cos(nπt) + dn sin(nπt).
2 n=1
We compute
Z 1 Z 1
cn = F(t) cos(nπt) dt = cos(nπt) dt = 0 for n ≥ 1,
−1 0
Z 1 Z 1
c0 = F(t) dt = dt = 1,
−1 0
Z 1
dn = F(t) sin(nπt) dt
−1
Z 1
= sin(nπt) dt
0
" #1
− cos(nπt)
=
nπ t=0
n 2
1 − (−1)
πn if n odd,
= =
πn 0 if n even.
So ∞
1 X 2
F(t) = + sin(nπt).
2 n=1 πn
n odd
We want to try
∞
a0 X
x(t) = + an cos(nπt) + bn sin(nπt).
2 n=1
Once we plug x into the differential equation x00 + 2x = F(t), it is clear that an = 0 for n ≥ 1 as there
are no corresponding terms in the series for F(t). Similarly bn = 0 for n even. Hence we try
∞
a0 X
x(t) = + bn sin(nπt).
2 n=1
n odd
4.5. APPLICATIONS OF FOURIER SERIES 203
2
bn = .
πn(2 − n2 π2 )
We know this is the steady periodic solution as it contains no terms of the complementary solution
and it is periodic with the same period as F(t) itself. See Figure 4.12 for the plot of this solution.
0.4 0.4
0.3 0.3
0.2 0.2
0.1 0.1
0.0 0.0
0.0 2.5 5.0 7.5 10.0
4.5.2 Resonance
Just like when the forcing function was a simple cosine, resonance can still happen. Let us assume
c = 0 and let us discuss only pure resonance. Again, take the equation
When we expand F(t) and find that some of its terms coincide with the complementary solution to
mx00 + kx = 0, we cannot use those terms in the guess. Just like before, they disappear when we plug
them into the left hand side and we get a contradictory equation (such as 0 = 1). That is, suppose
where ω0 = Nπ
L
for some positive integer N. In this case we have to modify our guess and try
∞
a0 Nπ Nπ X nπ nπ
x(t) = + t aN cos t + bN sin t + an cos t + bn sin t .
2 L L n=1
L L
n,N
In other words, we multiply the offending term by t. From then on, we proceed as before.
Of course, the solution is not a Fourierseries (it
is not even periodic)
since it contains these
terms multiplied by t. Further, the terms t aN cos L t + bN sin L t eventually dominate and
Nπ Nπ
lead to wild oscillations. As before, this behavior is called pure resonance or just resonance.
Note that there now may be infinitely many resonance frequencies to hit. That is, as we change
the frequency of F (we change L), different terms from the Fourier series of F may interfere with
the complementary solution and cause resonance. However, we should note that since everything is
an approximation and in particular c is never actually zero but something very close to zero, only
the first few resonance frequencies matter in real life.
Example 4.5.2: We want to solve the equation
where
−1
if −1 < t < 0,
F(t) =
1
if 0 < t < 1,
extended periodically. We note that
∞
X 4
F(t) = sin(nπt).
n=1
πn
n odd
Exercise 4.5.1: Compute the Fourier series of F to verify the above equation.
4.5. APPLICATIONS OF FOURIER SERIES 205
x00p (t) = −6a3 π sin(3πt) − 9π2 a3 t cos(3πt) + 6b3 π cos(3πt) − 9π2 b3 t sin(3πt)+
X∞
+ (−n2 π2 bn ) sin(nπt).
n=1
n odd
n,3
We now plug into the left hand side of the differential equation.
2x00p + 18π2 x p = − 12a3 π sin(3πt) − 18π2 a3 t cos(3πt) + 12b3 π cos(3πt) − 18π2 b3 t sin(3πt)+
+ 18π2 a3 t cos(3πt) + 18π2 b3 t sin(3πt)+
∞
X
+ (−2n2 π2 bn + 18π2 bn ) sin(nπt).
n=1
n odd
n,3
If we simplify we obtain
∞
X
2x00p + 18π x p = −12a3 π sin(3πt) + 12b3 π cos(3πt) +
2
(−2n2 π2 bn + 18π2 bn ) sin(nπt).
n=1
n odd
n,3
This series has to equal to the series for F(t). We equate the coefficients and solve for a3 and bn .
4/(3π) −1
a3 = = 2,
−12π 9π
b3 = 0,
4 2
bn = = for n odd and n , 3.
nπ(18π2 − 2n2 π2 ) π3 n(9 − n2 )
206 CHAPTER 4. FOURIER SERIES AND PDES
That is,
∞
−1 X 2
x p (t) = 2 t cos(3πt) + sin(nπt).
9π n=1
π n(9 − n2 )
3
n odd
n,3
When c > 0, you do not have to worry about pure resonance. That is, there are never any
conflicts and you do not need to multiply any terms by t. There is a corresponding concept of
practical resonance and it is very similar to the ideas we already explored in chapter 2. We will not
go into details here.
4.5.3 Exercises
Exercise 4.5.2: Let F(t) = 12 + ∞ n=1 n2 cos(nπt). Find the steady periodic solution to x + 2x = F(t).
1 00
P
Express your solution as a Fourier series.
Exercise 4.5.3: Let F(t) = ∞ n=1 n3 sin(nπt). Find the steady periodic solution to x + x + x = F(t).
1 00 0
P
Express your solution as a Fourier series.
Exercise 4.5.4: Let F(t) = ∞ n=1 n2 cos(nπt). Find the steady periodic solution to x + 4x = F(t).
1 00
P
Express your solution as a Fourier series.
Exercise 4.5.5: Let F(t) = t for −1 < t < 1 and extended periodically. Find the steady periodic
solution to x00 + x = F(t). Express your solution as a series.
Exercise 4.5.6: Let F(t) = t for −1 < t < 1 and extended periodically. Find the steady periodic
solution to x00 + π2 x = F(t). Express your solution as a series.
Exercise
√ 4.5.101: Let F(t) = sin(2πt) + 0.1 cos(10πt). Find the steady periodic solution to x00 +
2 x = F(t). Express your solution as a Fourier series.
Exercise 4.5.102: Let F(t) = ∞ n=1 e cos(2nt). Find the steady periodic solution to x + 3x = F(t).
−n 00
P
Express your solution as a Fourier series.
Exercise 4.5.103:√ Let F(t) = |t| for −1 ≤ t ≤ 1 extended periodically. Find the steady periodic
solution to x00 + 3 x = F(t). Express your solution as a series.
Exercise 4.5.104: Let F(t) = |t| for −1 ≤ t ≤ 1 extended periodically. Find the steady periodic
solution to x00 + π2 x = F(t). Express your solution as a series.
4.6. PDES, SEPARATION OF VARIABLES, AND THE HEAT EQUATION 207
temperature u
0 L x
insulation
Figure 4.13: Insulated wire.
Let u(x, t) denote the temperature at point x at time t. The equation governing this setup is the
so-called one-dimensional heat equation:
∂u ∂2 u
= k 2,
∂t ∂x
where k > 0 is a constant (the thermal conductivity of the material). That is, the change in heat at a
specific point is proportional to the second derivative of the heat along the wire. This makes sense;
208 CHAPTER 4. FOURIER SERIES AND PDES
if at a fixed t the graph of the heat distribution has a maximum (the graph is concave down), then
heat flows away from the maximum. And vice-versa.
We will generally use a more convenient notation for partial derivatives. We will write ut instead
of ∂u , and we will write u xx instead of ∂∂xu2 . With this notation the heat equation becomes
2
∂t
ut = ku xx .
For the heat equation, we must also have some boundary conditions. We assume that the ends
of the wire are either exposed and touching some body of constant heat, or the ends are insulated.
For example, if the ends of the wire are kept at temperature 0, then the conditions are
If, on the other hand, the ends are also insulated, the conditions are
In other words, heat is not flowing in nor out of the wire at the ends. We always have two conditions
along the x axis as there are two derivatives in the x direction. These side conditions are said to be
homogeneous (that is, u or a derivative of u is set to zero).
We also need an initial condition—the temperature distribution at time t = 0. That is,
u(x, 0) = f (x),
for some known function f (x). This initial condition is not a homogeneous side condition.
Exercise 4.6.1: Verify the principle of superposition for the heat equation.
Superposition also preserves some of the side conditions. In particular, if u1 and u2 are solutions
that satisfy u(0, t) = 0 and u(L, t) = 0, and c1 , c2 are constants, then u = c1 u1 + c2 u2 is still a solution
that satisfies u(0, t) = 0 and u(L, t) = 0. Similarly for the side conditions u x (0, t) = 0 and u x (L, t) = 0.
In general, superposition preserves all homogeneous side conditions.
The method of separation of variables is to try to find solutions that are sums or products of
functions of one variable. For example, for the heat equation, we try to find solutions of the form
That the desired solution we are looking for is of this form is too much to hope for. What is perfectly
reasonable to ask, however, is to find enough “building-block” solutions of the form u(x, t) =
X(x)T (t) using this procedure so that the desired solution to the PDE is somehow constructed from
these building blocks by the use of superposition.
Let us try to solve the heat equation
Let us guess u(x, t) = X(x)T (t). We plug into the heat equation to obtain
We rewrite as
T 0 (t) X 00 (x)
= .
kT (t) X(x)
This equation must hold for all x and all t. But the left hand side does not depend on x and the right
hand side does not depend on t. Hence, each side must be a constant. Let us call this constant −λ
(the minus sign is for convenience later). We obtain the two equations
T 0 (t) X 00 (x)
= −λ = .
kT (t) X(x)
In other words
X 00 (x) + λX(x) = 0,
T 0 (t) + λkT (t) = 0.
The boundary condition u(0, t) = 0 implies X(0)T (t) = 0. We are looking for a nontrivial solution
and so we can assume that T (t) is not identically zero. Hence X(0) = 0. Similarly, u(L, t) = 0
implies X(L) = 0. We are looking for nontrivial solutions X of the eigenvalue problem X 00 + λX = 0,
n2 π2
X(0) = 0, X(L) = 0. We have previously
found that the only eigenvalues are λn = L2 , for integers
n ≥ 1, where eigenfunctions are sin nπ
L
x . Hence, let us pick the solutions
nπ
Xn (x) = sin x .
L
The corresponding T n must satisfy the equation
n2 π2
T n0 (t) + kT n (t) = 0.
L2
By the method of integrating factor, the solution of this problem is
−n2 π2
T n (t) = e L2
kt
.
210 CHAPTER 4. FOURIER SERIES AND PDES
∞
X nπ
f (x) = bn sin x .
n=1
L
That is, we find the Fourier series of the odd periodic extension of f (x). We used the sine series as
it corresponds to the eigenvalue problem for X(x) above. Finally, we use superposition to write the
solution as
X∞ X∞ nπ −n2 π2
u(x, t) = bn un (x, t) = bn sin x e L2 kt .
n=1 n=1
L
Why does this solution work? First note that it is a solution to the heat equation by superposition.
It satisfies u(0, t) = 0 and u(L, t) = 0, because x = 0 or x = L makes all the sines vanish. Finally,
plugging in t = 0, we notice that T n (0) = 1 and so
∞
X ∞
X nπ
u(x, 0) = bn un (x, 0) = bn sin x = f (x).
n=1 n=1
L
Example 4.6.1: Suppose that we have an insulated wire of length 1, such that the ends of the wire
are embedded in ice (temperature 0). Let k = 0.003. Then suppose that initial heat distribution is
u(x, 0) = 50 x (1 − x). See Figure 4.14.
0.00 0.25 0.50 0.75 1.00
12.5 12.5
10.0 10.0
7.5 7.5
5.0 5.0
2.5 2.5
0.0 0.0
We want to find the temperature function u(x, t). Let us suppose we also want to find when (at
what t) does the maximum temperature in the wire drop to one half of the initial maximum of 12.5.
We are solving the following PDE problem:
ut = 0.003 u xx ,
u(0, t) = u(1, t) = 0,
u(x, 0) = 50 x (1 − x) for 0 < x < 1.
We write f (x) = 50 x (1 − x) for 0 < x < 1 as a sine series. That is, f (x) =
P∞
n=1 bn sin(nπx), where
Z 1
200 200 (−1)n 0 if n even,
bn = 2 50 x (1 − x) sin(nπx) dx = 3 3 − =
0 πn πn
3 3 400
π3 n3
if n odd.
0
0.00 t
20
0.25 40
x 60
0.50
80
u(x,t)
0.75 100
1.00
12.5 12.5
11.700
10.400
9.100
10.0 10.0 7.800
6.500
5.200
7.5 7.5 3.900
2.600
1.300
5.0 5.0 0.000
2.5 2.5
0.0 0.0
0 0.25
20
0.50
40 x
60 0.75
t 80
1.00
100
The solution u(x, t), plotted in Figure 4.15 for 0 ≤ t ≤ 100, is given by the series:
∞
X 400
sin(nπx) e−n π 0.003 t .
2 2
u(x, t) =
n=1
πn
3 3
n odd
212 CHAPTER 4. FOURIER SERIES AND PDES
Finally, let us answer the question about the maximum temperature. It is relatively easy to see
that the maximum temperature will always be at x = 0.5, in the middle of the wire. The plot of
u(x, t) confirms this intuition.
If we plug in x = 0.5 we get
∞
X 400
sin(nπ 0.5) e−n π 0.003 t .
2 2
u(0.5, t) =
n=1
πn
3 3
n odd
For n = 3 and higher (remember n is only odd), the terms of the series are insignificant compared
to the first term. The first term in the series is already a very good approximation of the function.
Hence
400 2
u(0.5, t) ≈ 3 e−π 0.003 t .
π
The approximation gets better and better as t gets larger as the other terms decay much faster. Let
us plot the function u(0.5, t), the temperature at the midpoint of the wire at time t, in Figure 4.16.
The figure also plots the approximation by the first term.
0 25 50 75 100
12.5 12.5
10.0 10.0
7.5 7.5
5.0 5.0
2.5 2.5
0 25 50 75 100
Figure 4.16: Temperature at the midpoint of the wire (the bottom curve), and the approximation of this
temperature by using only the first term in the series (top curve).
After t = 5 or so it would be hard to tell the difference between the first term of the series for
u(x, t) and the real solution u(x, t). This behavior is a general feature of solving the heat equation. If
you are interested in behavior for large enough t, only the first one or two terms may be necessary.
Let us get back to the question of when is the maximum temperature one half of the initial
maximum temperature. That is, when is the temperature at the midpoint 12.5/2 = 6.25. We notice on
the graph that if we use the approximation by the first term we will be close enough. We solve
400 −π2 0.003 t
6.25 = e .
π3
4.6. PDES, SEPARATION OF VARIABLES, AND THE HEAT EQUATION 213
That is,
π 3
ln 6.25
t= 400
≈ 24.5.
−π2 0.003
So the maximum temperature drops to half at about t = 24.5.
We mention an interesting behavior of the solution to the heat equation. The heat equation
“smoothes” out the function f (x) as t grows. For a fixed t, the solution is a Fourier series with
−n2 π2
coefficients bn e L2 kt . If t > 0, then these coefficients go to zero faster than any n1p for any power
p. In other words, the Fourier series has infinitely many derivatives everywhere. Thus even if the
function f (x) has jumps and corners, then for a fixed t > 0, the solution u(x, t) as a function of x is
as smooth as we want it to be.
Yet again we try a solution of the form u(x, t) = X(x)T (t). By the same procedure as before we plug
into the heat equation and arrive at the following two equations
X 00 (x) + λX(x) = 0,
T 0 (t) + λkT (t) = 0.
At this point the story changes slightly. The boundary condition u x (0, t) = 0 implies X 0 (0)T (t) = 0.
Hence X 0 (0) = 0. Similarly, u x (L, t) = 0 implies X 0 (L) = 0. We are looking for nontrivial solutions
X of the eigenvalue problem X 00 + λX = 0, X 0 (0) = 0, X 0 (L) = 0. We have previously
found that the
n2 π2
only eigenvalues are λn = L2 , for integers n ≥ 0, where eigenfunctions are cos L x (we include
nπ
and
u0 (x, t) = 1.
We note that un (x, 0) = cos nπ
L
x . Let us write f using the cosine series
∞
a0 X nπ
f (x) = + an cos x .
2 n=1 L
That is, we find the Fourier series of the even periodic extension of f (x).
We use superposition to write the solution as
∞ ∞
a0 X a0 X nπ −n2 π2
u(x, t) = + an un (x, t) = + an cos x e L2 kt .
2 n=1 2 n=1 L
Example 4.6.2: Let us try the same equation as before, but for insulated ends. We are solving the
following PDE problem
ut = 0.003 u xx ,
u x (0, t) = u x (1, t) = 0,
u(x, 0) = 50 x (1 − x) for 0 < x < 1.
For this problem, we must find the cosine series of u(x, 0). For 0 < x < 1 we have
∞ !
25 X −200
50 x (1 − x) = + cos(nπx).
3 n=2
π2 n2
n even
The calculation is left to the reader. Hence, the solution to the PDE problem, plotted in Figure 4.17
on the next page, is given by the series
∞ !
25 X −200
cos(nπx) e−n π 0.003 t .
2 2
u(x, t) = +
3 n=2
πn
2 2
n even
Note in the graph that the temperature evens out across the wire. Eventually, all the terms except
the constant die out, and you will be left with a uniform temperature of 253 ≈ 8.33 along the entire
length of the wire.
4.6.4 Exercises
Exercise 4.6.2: Imagine you have a wire of length 2, with k = 0.001 and an initial temperature
distribution of u(x, 0) = 50x. Suppose that both the ends are embedded in ice (temperature 0). Find
the solution as a series.
4.6. PDES, SEPARATION OF VARIABLES, AND THE HEAT EQUATION 215
0.00 0
5 t
x 0.25
10
0.50 15
0.75 20
u(x,t)
25
1.00
30
12.5
11.700
12.5 10.400
10.0
9.100
7.800
10.0 6.500
7.5
5.200
3.900
7.5 2.600
5.0
1.300
0.000
5.0
2.5
2.5
0.0
0 0.0
0.00
5
10 0.25
15 0.50
20
0.75 x
t 25
30 1.00
Figure 4.17: Plot of the temperature of the insulated wire at position x at time t.
ut = u xx ,
u(0, t) = u(1, t) = 0,
u(x, 0) = 100 for 0 < x < 1.
ut = u xx ,
u x (0, t) = u x (π, t) = 0,
u(x, 0) = 3 cos(x) + cos(3x) for 0 < x < π.
216 CHAPTER 4. FOURIER SERIES AND PDES
1
ut = u xx ,
3
u x (0, t) = u x (π, t) = 0,
10x
u(x, 0) = for 0 < x < π.
π
Exercise 4.6.6: Find a series solution of
ut = u xx ,
u(0, t) = 0, u(1, t) = 100,
u(x, 0) = sin(πx) for 0 < x < 1.
Hint: Use the fact that u(x, t) = 100x is a solution satisfying ut = u xx , u(0, t) = 0, u(1, t) = 100.
Then use superposition.
Exercise 4.6.7: Find the steady state temperature solution as a function of x alone, by letting t → ∞
in the solution from exercises 4.6.5 and 4.6.6. Verify that it satisfies the equation u xx = 0.
Exercise 4.6.8: Use separation variables to find a nontrivial solution to u xx + uyy = 0, where
u(x, 0) = 0 and u(0, y) = 0. Hint: Try u(x, y) = X(x)Y(y).
Exercise 4.6.9 (challenging): Suppose that one end of the wire is insulated (say at x = 0) and the
other end is kept at zero temperature. That is, find a series solution of
ut = ku xx ,
u x (0, t) = u(L, t) = 0,
u(x, 0) = f (x) for 0 < x < L.
Exercise 4.6.10 (challenging): Suppose that the wire is circular and insulated, so there are no ends.
You can think of this as simply connecting the two ends and making sure the solution matches up at
the ends. That is, find a series solution of
ut = ku xx ,
u(0, t) = u(L, t), u x (0, t) = u x (L, t),
u(x, 0) = f (x) for 0 < x < L.
ut = 3u xx ,
u(0, t) = u(π, t) = 0,
u(x, 0) = 5 sin(x) + 2 sin(5x) for 0 < x < π.
ut = 0.1u xx ,
u x (0, t) = u x (π, t) = 0,
u(x, 0) = 1 + 2 cos(x) for 0 < x < π.
Exercise 4.6.104: Use separation of variables (Hint: try u(x, t) = X(x) + T (t)) to find a nontrivial
solution to u x + ut = u.
218 CHAPTER 4. FOURIER SERIES AND PDES
0 L x
The equation that governs this setup is the so-called one-dimensional wave equation:
ytt = a2 y xx ,
for some constant a > 0. Assume that the ends of the string are fixed in place:
Note that we have two conditions along the x axis as there are two derivatives in the x direction.
There are also two derivatives along the t direction and hence we need two further conditions
here. We need to know the initial position and the initial velocity of the string. That is,
wtt = a2 w xx ,
w(0, t) = w(L, t) = 0,
(4.10)
w(x, 0) = 0 for 0 < x < L,
wt (x, 0) = g(x) for 0 < x < L.
4.7. ONE DIMENSIONAL WAVE EQUATION 219
and
ztt = a2 z xx ,
z(0, t) = z(L, t) = 0,
(4.11)
z(x, 0) = f (x) for 0 < x < L,
zt (x, 0) = 0 for 0 < x < L.
The principle of superposition implies that y = w + z solves the wave equation and furthermore
y(x, 0) = w(x, 0) + z(x, 0) = f (x) and yt (x, 0) = wt (x, 0) + zt (x, 0) = g(x). Hence, y is a solution to
ytt = a2 y xx ,
y(0, t) = y(L, t) = 0,
(4.12)
y(x, 0) = f (x) for 0 < x < L,
yt (x, 0) = g(x) for 0 < x < L.
The reason for all this complexity is that superposition only works for homogeneous conditions
such as y(0, t) = y(L, t) = 0, y(x, 0) = 0, or yt (x, 0) = 0. Therefore, we can use separation of
variables to find many building-block solutions solving all the homogeneous conditions. We can
then use them to construct a solution satisfying the remaining nonhomogeneous condition.
Let us start with (4.10). We try a solution of the form w(x, t) = X(x)T (t) again. We plug into the
wave equation to obtain
X(x)T 00 (t) = a2 X 00 (x)T (t).
Rewriting we get
T 00 (t) X 00 (x)
= .
a2 T (t) X(x)
Again, left hand side depends only on t and the right hand side depends only on x. Therefore, both
equal a constant, which we will denote by −λ.
T 00 (t) X 00 (x)
= −λ = .
a2 T (t) X(x)
We solve to get two ordinary differential equations
X 00 (x) + λX(x) = 0,
T 00 (t) + λa2 T (t) = 0.
The conditions 0 = w(0, t) = X(0)T (t) implies X(0) = 0 and w(L, t) = 0 implies that X(L) = 0.
Therefore, the only nontrivial solutions for the first equation are when λ = λn = nLπ2 and they are
2 2
nπ
Xn (x) = sin x .
L
The general solution for T for this particular λn is
nπa nπa
T n (t) = A cos t + B sin t .
L L
220 CHAPTER 4. FOURIER SERIES AND PDES
We also have the condition that w(x, 0) = 0 or X(x)T (0) = 0. This implies that T (0) = 0, which in
turn forces A = 0. It is convenient to pick B = nπa
L
(you will see why in a moment) and hence
L nπa
T n (t) = sin t .
nπa L
Our building-block solutions are
L nπ nπa
wn (x, t) = sin x sin t .
nπa L L
We differentiate in t, that is
∂wn nπ nπa
(x, t) = sin x cos t .
∂t L L
Hence,
∂wn nπ
(x, 0) = sin x .
∂t L
We expand g(x) in terms of these sines as
∞
X nπ
g(x) = bn sin x .
n=1
L
Using superposition we can just write down the solution to (4.10) as a series
∞ ∞
X X L nπ nπa
w(x, t) = bn wn (x, t) = bn sin x sin t .
n=1 n=1
nπa L L
X 00 (x) + λX(x) = 0,
T 00 (t) + λa2 T (t) = 0.
nπ
Xn (x) = sin x .
L
This time the condition on T is T 0 (0) = 0. Thus we get that B = 0 and we take
nπa
T n (t) = cos t .
L
4.7. ONE DIMENSIONAL WAVE EQUATION 221
∞
X nπ
f (x) = cn sin x .
n=1
L
Exercise 4.7.2: Fill in the details in the derivation of the solution of (4.11). Check that the solution
satisfies all the side conditions.
Putting these two solutions together, let us state the result as a theorem.
ytt = a2 y xx ,
y(0, t) = y(L, t) = 0,
(4.13)
y(x, 0) = f (x) for 0 < x < L,
yt (x, 0) = g(x) for 0 < x < L,
where
∞
X nπ
f (x) = cn sin x ,
n=1
L
and
∞
X nπ
g(x) = bn sin x .
n=1
L
Then the solution y(x, t) can be written as a sum of the solutions of (4.10) and (4.11). In other
words,
∞
X L nπ nπa nπ nπa
y(x, t) = bn sin x sin t + cn sin x cos t
n=1
nπa L L L L
∞ nπ
X L nπa nπa
= sin x bn sin t + cn cos t .
n=1
L nπa L L
222 CHAPTER 4. FOURIER SERIES AND PDES
y
0.1
0 2 x
Example 4.7.1: Let us try a simple example of a plucked string. Suppose that a string of length 2
is plucked in the middle such that it has the initial shape given in Figure 4.19. That is
0.1 x
if 0 ≤ x ≤ 1,
f (x) =
0.1 (2 − x) if 1 < x ≤ 2.
The string starts at rest (g(x) = 0). Suppose that a = 1 in the wave equation for simplicity.
We leave it to the reader to compute the sine series of f (x). The series will be
∞
X 0.8 nπ nπ
f (x) = 2 π2
sin sin x .
n=1
n 2 2
Note that sin nπ2
is the sequence 1, 0, −1, 0, 1, 0, −1, . . . for n = 1, 2, 3, 4, . . .. Therefore,
0.8 π 0.8 3π
!
0.8 5π
!
f (x) = 2 sin x − 2 sin x + sin x − ···
π 2 9π 2 25π2 2
The solution y(x, t) is given by
∞
X 0.8 nπ nπ nπ
y(x, t) = sin sin x cos t
n=1
n2 π2 2 2 2
∞
0.8(−1)m+1
! !
X (2m − 1)π (2m − 1)π
= sin x cos t
m=1 (2m − 1) π
2 2 2 2
0.8 π π 0.8 3π
!
3π
!
0.8 5π
!
5π
!
= 2 sin x cos t − 2 sin x cos t + sin x cos t − ···
π 2 2 9π 2 2 25π2 2 2
A plot for 0 < t < 3 is given in Figure 4.20 on the facing page. Notice that unlike the heat
equation, the solution does not become “smoother,” the “sharp edges” remain. We will see the
reason for this behavior in the next section where we derive the solution to the wave equation in a
different way.
Make sure you understand what the plot, such as the one in the figure, is telling you. For each
fixed t, you can think of the function y(x, t) as just a function of x. This function gives you the shape
of the string at time t.
4.7. ONE DIMENSIONAL WAVE EQUATION 223
0
0.0
t
1
0.5
2
x
1.0 3 y(x,t)
1.5 0.10
0.110
2.0 0.088
0.066
0.10 0.05
0.044
0.022
0.000
0.05 0.00 -0.022
y
-0.044
-0.066
-0.088
0.00 -0.05 -0.110
y
-0.05 -0.10
0.0
-0.10 0.5
0 1.0
x
1
1.5
2
t
2.0
3
4.7.1 Exercises
Exercise 4.7.3: Solve
ytt = 9y xx ,
y(0, t) = y(1, t) = 0,
y(x, 0) = sin(3πx) + 41 sin(6πx) for 0 < x < 1,
yt (x, 0) = 0 for 0 < x < 1.
Exercise 4.7.5: Derive the solution for a general plucked string of length L, where we raise the
string some distance b at the midpoint and let go, and for any constant a (in the equation ytt = a2 y xx ).
224 CHAPTER 4. FOURIER SERIES AND PDES
Exercise 4.7.6: Imagine that a stringed musical instrument falls on the floor. Suppose that the
length of the string is 1 and a = 1. When the musical instrument hits the ground the string was in
rest position and hence y(x, 0) = 0. However, the string was moving at some velocity at impact
(t = 0), say yt (x, 0) = −1. Find the solution y(x, t) for the shape of the string at time t.
Exercise 4.7.7 (challenging): Suppose that you have a vibrating string and that there is air resis-
tance proportional to the velocity. That is, you have
ytt = a2 y xx − kyt ,
y(0, t) = y(1, t) = 0,
y(x, 0) = f (x) for 0 < x < 1,
yt (x, 0) = 0 for 0 < x < 1.
Suppose that 0 < k < 2πa. Derive a series solution to the problem. Any coefficients in the series
should be expressed as integrals of f (x).
Exercise 4.7.104: Let’s see what happens when a = 0. Find a solution to ytt = 0, y(0, t) = y(π, t) = 0,
y(x, 0) = sin(2x), yt (x, 0) = sin(x).
4.8. D’ALEMBERT SOLUTION OF THE WAVE EQUATION 225
ytt = a2 y xx . (4.14)
∂ ∂ξ ∂ ∂η ∂ ∂ ∂
= + = + ,
∂x ∂x ∂ξ ∂x ∂η ∂ξ ∂η
∂ ∂ξ ∂ ∂η ∂ ∂ ∂
= + = −a + a .
∂t ∂t ∂ξ ∂t ∂η ∂ξ ∂η
We compute
∂2 y ∂ ∂ ∂y ∂y ∂2 y ∂2 y ∂2 y
! !
y xx = 2 = + + = 2 +2 + 2,
∂x ∂ξ ∂η ∂ξ ∂η ∂ξ ∂ξ∂η ∂η
∂y
2
∂ ∂ ∂y ∂y ∂2 y ∂2 y ∂2 y
! !
ytt = 2 = −a + a −a + a = a2 2 − 2a2 + a2 2 .
∂t ∂ξ ∂η ∂ξ ∂η ∂ξ ∂ξ∂η ∂η
∂ y 2 ∂2 y
In the above computations, we used the fact from calculus that ∂ξ∂η = ∂η∂ξ
. We plug what we got
into the wave equation,
∂2 y
0 = a2 y xx − ytt = 4a2 = 4a2 yξη .
∂ξ∂η
∗
Named after the French mathematician Jean le Rond d’Alembert (1717–1783).
226 CHAPTER 4. FOURIER SERIES AND PDES
Therefore, the wave equation (4.14) transforms into yξη = 0. It is easy to find the general solution
to this equation by integrating twice. Keeping ξ constant, we integrate with respect to η first∗ and
notice that the constant of integration depends on ξ; for each ξ we might get a different constant
of integration. We get yξ = C(ξ). Next, we
R integrate with respect to ξ and notice that the constant
of integration depends on η. Thus, y = C(ξ) dξ + B(η). The solution must, therefore, be of the
following form for some functions A(ξ) and B(η):
The solution is a superposition of two functions (waves) traveling at speed a in opposite directions.
The coordinates ξ and η are called the characteristic coordinates, and a similar technique can be
applied to more complicated hyperbolic PDE.
Yay! RWe’re smoking now. OK, now the boundary conditions. Note that F(x) and G(x) are odd.
x
Also 0 G(s) ds is an even function of x because G(x) is odd (to see this fact, do the substitution
s = −v). So
Z −at Z at
1 1 1 1
y(0, t) = F(−at) − G(s) ds + F(at) + G(s) ds
2 2a 0 2 2a 0
Z at Z at
−1 1 1 1
= F(at) − G(s) ds + F(at) + G(s) ds = 0.
2 2a 0 2 2a 0
Note that F(x) and G(x) are 2L periodic. We compute
Z L−at Z L+at
1 1 1 1
y(L, t) = F(L − at) − G(s) ds + F(L + at) + G(s) ds
2 2a 0 2 2a 0
Z L Z −at
1 1 1
= F(−L − at) − G(s) ds − G(s) ds +
2 2a 0 2a 0
Z L Z at
1 1 1
+ F(L + at) + G(s) ds + G(s) ds
2 2a 0 2a 0
Z at Z at
−1 1 1 1
= F(L + at) − G(s) ds + F(L + at) + G(s) ds = 0.
2 2a 0 2 2a 0
And voilà, it works.
Example 4.8.1: D’Alembert says that the solution is a superposition of two functions (waves)
moving in the opposite direction at “speed” a. To get an idea of how it works, let us work out an
example. Consider the simpler setup
ytt = y xx ,
y(0, t) = y(1, t) = 0,
y(x, 0) = f (x),
yt (x, 0) = 0.
Here f (x) is an impulse of height 1 centered at x = 0.5:
x < 0.45,
0 if 0≤
x < 0.5,
20 (x − 0.45) if 0.45 ≤
f (x) =
20 (0.55 − x) if 0.5 ≤ x < 0.55,
0
if 0.55 ≤ x ≤ 1.
The graph of this impulse is the top left plot in Figure 4.21 on the next page.
Let F(x) be the odd periodic extension of f (x). Then from (4.16) we know that the solution is
given as
F(x − t) + F(x + t)
y(x, t) = .
2
228 CHAPTER 4. FOURIER SERIES AND PDES
It is not hard to compute specific values of y(x, t). For example, to compute y(0.1, 0.6) we notice
x − t = −0.5 and x + t = 0.7. Now F(−0.5) = − f (0.5) = −20 (0.55 − 0.5) = −1 and F(0.7) =
f (0.7) = 0. Hence y(0.1, 0.6) = −1+0
2
= −0.5. As you can see the d’Alembert solution is much easier
to actually compute and to plot than the Fourier series solution. See Figure 4.21 for plots of the
solution y for several different t.
0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00
0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00
0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00
0.00 0.25 0.50 0.75 1.00 0.00 0.25 0.50 0.75 1.00
Figure 4.21: Plot of the d’Alembert solution for t = 0, t = 0.2, t = 0.4, and t = 0.6.
differently. Best approach is to do this in stages. When g(x) = 0 (and hence G(x) = 0) we have the
solution
F(x − at) + F(x + at)
.
2
On the other hand, when f (x) = 0 (and hence F(x) = 0), we let
Z x
H(x) = G(s) ds.
0
4.8.4 Exercises
Exercise 4.8.2: Using the d’Alembert solution solve ytt = 4y xx , 0 < x < π, t > 0, y(0, t) = y(π, t) = 0,
y(x, 0) = sin x, and yt (x, 0) = sin x. Hint: Note that sin x is the odd periodic extension of y(x, 0) and
yt (x, 0).
Exercise 4.8.3: Using the d’Alembert solution solve ytt = 2y xx , 0 < x < 1, t > 0, y(0, t) = y(1, t) = 0,
y(x, 0) = sin5 (πx), and yt (x, 0) = sin3 (πx).
Exercise 4.8.4: Take ytt = 4y xx , 0 < x < π, t > 0, y(0, t) = y(π, t) = 0, y(x, 0) = x(π − x), and
yt (x, 0) = 0. a) Solve using the d’Alembert formula. Hint: You can use the sine series for y(x, 0). b)
Find the solution as a function of x for a fixed t = 0.5, t = 1, and t = 2. Do not use the sine series
here.
Exercise 4.8.5: Derive the d’Alembert solution for ytt = a2 y xx , 0 < x < π, t > 0, y(0, t) = y(π, t) = 0,
y(x, 0) = f (x), and yt (x, 0) = 0, using the Fourier series solution of the wave equation, by applying
an appropriate trigonometric identity.
230 CHAPTER 4. FOURIER SERIES AND PDES
Exercise 4.8.6: The d’Alembert solution still works if there are no boundary conditions and the
initial condition is defined on the whole real line. Suppose that ytt = y xx (for all x on the real line
and t ≥ 0), y(x, 0) = f (x), and yt (x, 0) = 0, where
x < −1,
0 if
x + 1 if −1 ≤ x < 0,
f (x) =
−x + 1 if 0 ≤ x < 1,
if 1 < x.
0
Solve using the d’Alembert solution. That is, write down a piecewise definition for the solution.
Then sketch the solution for t = 0, t = 1/2, t = 1, and t = 2.
Exercise 4.8.101: Using the d’Alembert solution solve ytt = 9y xx , 0 < x < 1, t > 0, y(0, t) =
y(1, t) = 0, y(x, 0) = sin(2πx), and yt (x, 0) = sin(3πx).
Exercise 4.8.102: Take ytt = 4y xx , 0 < x < 1, t > 0, y(0, t) = y(1, t) = 0, y(x, 0) = x − x2 , and
yt (x, 0) = 0. Using the D’Alembert solution find the solution at a) t = 0.1, b) t = 1/2, c) t = 1. You
may have to split your answer up by cases.
Exercise 4.8.103: Take ytt = 100y xx , 0 < x < 4, t > 0, y(0, t) = y(4, t) = 0, y(x, 0) = F(x), and
yt (x, 0) = 0. Suppose that F(0) = 0, F(1) = 2, F(2) = 3, F(3) = 1. Using the D’Alembert solution
find a) y(1, 1), b) y(4, 3), c) y(3, 9).
4.9. STEADY STATE TEMPERATURE AND THE LAPLACIAN 231
ut = ku xx ,
but such that ut = 0 for all x and t. Hence, we are looking for a function of x alone that satisfies
u xx = 0. It is easy to solve this equation by integration and we see that u = Ax + B for some
constants A and B.
Suppose we have an insulated wire, and we apply constant temperature T 1 at one end (say where
x = 0) and T 2 on the other end (at x = L where L is the length of the wire). Then our steady state
solution is
T2 − T1
u(x) = x + T1.
L
This solution agrees with our common sense intuition with how the heat should be distributed in the
wire. So in one dimension, the steady state solutions are basically just straight lines.
Things are more complicated in two or more space dimensions. Let us restrict to two space
dimensions for simplicity. The heat equation in two space variables is
We will use ∆ from now on. The reason for using such a notation is that you can define ∆ to be the
right thing for any number of space dimensions and then the heat equation is always ut = k∆u. The
operator ∆ is called the Laplacian.
OK, now that we have notation out of the way, let us see what does an equation for the steady
state solution look like. We are looking for a solution to (4.18) that does not depend on t, or in other
words ut = 0. Hence we are looking for a function u(x, y) such that
∆u = u xx + uyy = 0.
This equation is called the Laplace equation∗ . Solutions to the Laplace equation are called harmonic
functions and have many nice properties and applications far beyond the steady state heat problem.
Harmonic functions in two variables are no longer just linear (plane graphs). For example,
you can check that the functions x2 − y2 and xy are harmonic. However, if you remember your
∗
Named after the French mathematician Pierre-Simon, marquis de Laplace (1749–1827).
232 CHAPTER 4. FOURIER SERIES AND PDES
multi-variable calculus we note that if u xx is positive, u is concave up in the x direction, then uyy
must be negative and u must be concave down in the y direction. Therefore, a harmonic function can
never have any “hilltop” or “valley” on the graph. This observation is consistent with our intuitive
idea of steady state heat distribution; the hottest or coldest spot will not be inside.
Commonly the Laplace equation is part of a so-called Dirichlet problem∗ . That is, we have a
region in the xy-plane and we specify certain values along the boundaries of the region. We then try
to find a solution u defined on this region such that u agrees with the values we specified on the
boundary.
For simplicity, we consider a rectangular region. Also for simplicity we specify boundary values
to be zero at 3 of the four edges and only specify an arbitrary function at one edge. As we still have
the principle of superposition, we can use this simpler solution to derive the general solution for
arbitrary boundary values by solving 4 different problems, one for each edge, and adding those
solutions together. This setup is left as an exercise.
We wish to solve the following problem. Let h and w be the height and width of our rectangle,
with one corner at the origin and lying in the first quadrant.
(0, h) u=0 (w, h)
∆u = 0, (4.19)
u(0, y) = 0 for 0 < y < h, (4.20)
u(x, h) = 0 for 0 < x < w, (4.21) u=0 ∆u = 0 u=0
u(w, y) = 0 for 0 < y < h, (4.22)
u(x, 0) = f (x) for 0 < x < w. (4.23)
(0, 0) u = f (x) (w, 0)
The method we apply is separation of variables. Again, we will come up with enough building-
block solutions satisfying all the homogeneous boundary conditions (all conditions except (4.23)).
We notice that superposition still works for the equation and all the homogeneous conditions.
Therefore, we can use the Fourier series for f (x) to solve the problem as before.
We try u(x, y) = X(x)Y(y). We plug u into the equation to get
X 00 Y + XY 00 = 0.
We put the Xs on one side and the Ys on the other to get
X 00 Y 00
− = .
X Y
The left hand side only depends on x and the right hand side only depends on y. Therefore, there is
00 00
some constant λ such that λ = −XX = YY . And we get two equations
X 00 + λX = 0,
Y 00 − λY = 0.
∗
Named after the German mathematician Johann Peter Gustav Lejeune Dirichlet (1805–1859).
4.9. STEADY STATE TEMPERATURE AND THE LAPLACIAN 233
Furthermore, the homogeneous boundary conditions imply that X(0) = X(w) = 0 and Y(h) = 0.
Taking the equation for X we have already seen that we have a nontrivial solution if and only if
λ = λn = nwπ2 and the solution is a multiple of
2 2
nπ
Xn (x) = sin x .
w
For these given λn , the general solution for Y (one for each n) is
nπ nπ
Yn (y) = An cosh y + Bn sinh y . (4.24)
w w
We only have one condition on Yn and hence we can pick one of An or Bn to be something convenient.
It will be useful to have Yn (0) = 1, so we let An = 1. Setting Yn (h) = 0 and solving for Bn we get that
− cosh nπh w
Bn = .
nπh
sinh w
After we plug the An and Bn we into (4.24) and simplify by using the identity sinh(α − β) =
sinh(α) cosh(β) − cosh(α) sinh(β), we find
sinh nπ(h−y)
w
Yn (y) = .
sinh nπh
w
As un satisfies (4.19)–(4.22) and any linear combination (finite or infinite) of un also satisfies
(4.19)–(4.22), then u satisfies (4.19)–(4.22). By plugging in y = 0, we see u satisfies (4.23) as well.
Example 4.9.1: Take w = h = π and let f (x) = π. Let us compute the sine series for the function π
(same as the series for the square wave). For 0 < x < π, we have
∞
X 4
f (x) = sin(nx).
n=1
n
n odd
234 CHAPTER 4. FOURIER SERIES AND PDES
Therefore the solution u(x, y), see Figure 4.22, to the corresponding Dirichlet problem is given as
∞ !
X 4 sinh n(π − y)
u(x, y) = sin(nx) .
n=1
n sinh(nπ)
n odd
0.0 0.0 y
0.5
0.5 1.0
x 1.5
1.0 2.0
1.5 2.5
3.0
2.0 u(x,y)
2.5 3.0
3.0 3.142
2.828
2.5
2.514
3.0 2.199
2.0 1.885
2.5 1.571
1.257
1.5
0.943
2.0
0.628
1.0 0.314
1.5 0.000
0.5
1.0
0.0
0.5 0.0
0.5
0.0 1.0
0.0 1.5
0.5
1.0 2.0
1.5 x
2.0 2.5
2.5 3.0
y 3.0
Figure 4.22: Steady state temperature of a square plate with three sides held at zero and one side held at π.
This scenario corresponds to the steady state temperature on a square plate of width π with 3
sides held at 0 degrees and one side held at π degrees. If we have arbitrary initial data on all sides,
then we solve four problems, each using one piece of nonhomogeneous data. Then we use the
principle of superposition to add up all four solutions to have a solution to the original problem.
A different way to visualize solutions of the Laplace equation is to take a wire and bend it so
that it corresponds to the graph of the temperature above the boundary of your region. Cut a rubber
sheet in the shape of your region—a square in our case—and stretch it fixing the edges of the sheet
to the wire. The rubber sheet is a good approximation of the graph of the solution to the Laplace
equation with the given boundary data.
4.9. STEADY STATE TEMPERATURE AND THE LAPLACIAN 235
4.9.1 Exercises
Exercise 4.9.1: Let R be the region described by 0 < x < π and 0 < y < π. Solve the problem
Exercise 4.9.2: Let R be the region described by 0 < x < 1 and 0 < y < 1. Solve the problem
u xx + uyy = 0,
u(x, 0) = sin(πx) − sin(2πx), u(x, 1) = 0,
u(0, y) = 0, u(1, y) = 0.
Exercise 4.9.3: Let R be the region described by 0 < x < 1 and 0 < y < 1. Solve the problem
u xx + uyy = 0,
u(x, 0) = u(x, 1) = u(0, y) = u(1, y) = C.
Hint: Try a solution of the form u(x, y) = X(x) + Y(y) (different separation of variables).
Exercise 4.9.5: Use the solution of Exercise 4.9.4 to solve
u xx + uyy = 0,
u(x, 0) = 0, u(x, h) = f (x),
u(0, y) = 0, u(w, y) = 0.
The solution should be in series form using the Fourier series coefficients of f (x).
Exercise 4.9.7: Let R be the region described by 0 < x < w and 0 < y < h. Solve the problem
u xx + uyy = 0,
u(x, 0) = 0, u(x, h) = 0,
u(0, y) = f (y), u(w, y) = 0.
The solution should be in series form using the Fourier series coefficients of f (y).
236 CHAPTER 4. FOURIER SERIES AND PDES
Exercise 4.9.8: Let R be the region described by 0 < x < w and 0 < y < h. Solve the problem
u xx + uyy = 0,
u(x, 0) = 0, u(x, h) = 0,
u(0, y) = 0, u(w, y) = f (y).
The solution should be in series form using the Fourier series coefficients of f (y).
Exercise 4.9.9: Let R be the region described by 0 < x < 1 and 0 < y < 1. Solve the problem
u xx + uyy = 0,
u(x, 0) = sin(9πx), u(x, 1) = sin(2πx),
u(0, y) = 0, u(1, y) = 0.
Exercise 4.9.10: Let R be the region described by 0 < x < 1 and 0 < y < 1. Solve the problem
u xx + uyy = 0,
u(x, 0) = sin(πx), u(x, 1) = sin(πx),
u(0, y) = sin(πy), u(1, y) = sin(πy).
Exercise 4.9.11 (challenging): Using only your intuition find u(1/2, 1/2), for the problem ∆u = 0,
where u(0, y) = u(1, y) = 100 for 0 < y < 1, and u(x, 0) = u(x, 1) = 0 for 0 < x < 1. Explain.
Exercise 4.9.101: Let R be the region described by 0 < x < 1 and 0 < y < 1. Solve the problem
∞
X 1
∆u = 0, u(x, 0) = sin(nπx), u(x, 1) = 0, u(0, y) = 0, u(1, y) = 0.
n=1
n2
Exercise 4.9.102: Let R be the region described by 0 < x < 1 and 0 < y < 2. Solve the problem
ur = u x xr + uy yr = cos(θ)u x + sin(θ)uy ,
urr = cos(θ)(u xx xr + u xy yr ) + sin(θ)(uyx xr + uyy yr ) = cos2 (θ)u xx + 2 cos(θ) sin(θ)u xy + sin2 (θ)uyy .
Similarly for the θ derivative. Note that we have to use product rule for the second derivative.
uθ = u x xθ + uy yθ = −r sin(θ)u x + r cos(θ)uy ,
uθθ = −r cos(θ)u x − r sin(θ)(u xx xθ + u xy yθ ) − r sin(θ)uy + r cos(θ)(uyx xθ + uyy yθ )
= −r cos(θ)u x − r sin(θ)uy + r2 sin2 (θ)u xx − r2 2 sin(θ) cos(θ)u xy + r2 cos2 (θ)uyy .
238 CHAPTER 4. FOURIER SERIES AND PDES
Θ00 + λΘ = 0,
r2 R00 + rR0 − λR = 0.
Let us first focus on Θ. We know that u(r, θ) ought to be 2π-periodic in θ, that is, u(r, θ) = u(r, θ +2π).
Therefore, the solution to Θ00 + λΘ = 0 must be 2π-periodic. We conclude that λ = n2 for a
nonnegative integer n = 0, 1, 2, 3, . . .. The equation becomes Θ00 + n2 Θ = 0. When n = 0 the
equation is just Θ00 = 0, so we have the general solution Aθ + B. As Θ is periodic, A = 0. For
convenience let us write this solution as
a0
Θ0 =
2
for some constant a0 . For positive n, the solution to Θ00 + n2 Θ = 0 is
Θn = an cos(nθ) + bn sin(nθ),
r2 R00 + rR0 − n2 R = 0.
This equation appeared in exercises before—we solved it in Exercise 2.1.6 and Exercise 2.1.7 on
page 66. The idea is to try a solution r s and if that does not work out try a solution of the form
r s ln r. When n = 0 we obtain
R0 = Ar0 + Br0 ln r = A + B ln r,
Therefore, the solution to (4.25) is to expand g(θ), which is a 2π-periodic function, as a Fourier
series, and then the nth coordinate is multiplied by rn . In other words, to compute an and bn from
the formula we can, as usual, compute
1 π 1 π
Z Z
an = g(θ) cos(nθ) dθ, and bn = g(θ) sin(nθ) dθ.
π −π π −π
Example 4.10.1: Suppose we wish to solve
∆u = 0, 0 ≤ r < 1, −π < θ ≤ π,
u(1, θ) = cos(10 θ), −π < θ ≤ π.
240 CHAPTER 4. FOURIER SERIES AND PDES
1.0 -1.0 x
-0.5
y 0.5 0.0
0.5
0.0
1.0
u(r,theta)
-0.5 1.5
-1.0
1.0 1.200
1.5 0.900
0.600
0.5
0.300
1.0 0.000
-0.300
0.0
-0.600
0.5
-0.900
-0.5
-1.200
-1.500
0.0
-1.0
-0.5
-1.5
-1.0
1.0
-1.5 0.5
-1.0
0.0
-0.5
0.0 -0.5 y
0.5
x 1.0 -1.0
Figure 4.23: The solution of the Dirichlet problem in the disc with cos(10 θ) as boundary data.
The solution is
u(r, θ) = r10 cos(10 θ).
See the plot in Figure 4.23. The thing to notice in this example is that the effect of a high
frequency is mostly felt at the boundary. In the middle of the disc, the solution is very close to zero.
That is because r10 is rather small when r is close to 0.
Example 4.10.2: Let us solve a more difficult problem. Suppose we have a long rod with circular
cross section of radius 1 and we wish to solve the steady state heat problem. If the rod is long
enough we simply need to solve the Laplace equation in two dimensions. Let us put the center of
the rod at the origin and we have exactly the region we are currently studying—a circle of radius
1. For the boundary conditions, suppose in Cartesian coordinates x and y, the temperature on the
boundary is 0 when y < 0, and it is 2y when y > 0.
Let us set up the problem. As y = r sin(θ), then on the circle of radius 1 we have 2y = 2 sin(θ).
So
∆u = 0, 0 ≤ r < 1, −π < θ ≤ π,
2 sin(θ) if 0 ≤ θ ≤ π,
u(1, θ) =
0
if −π < θ < 0.
4.10. DIRICHLET PROBLEM IN THE CIRCLE AND THE POISSON KERNEL 241
We must now compute the Fourier series for the boundary condition. By now the reader has
plentiful experience in computing Fourier series and so we simply state that
∞
2 X −4
u(1, θ) = + sin(θ) + cos(2nθ).
π n=1
π(4n2 − 1)
Exercise 4.10.1: Compute the series for u(1, θ) and verify that it really is what we have just claimed.
Hint: Be careful, make sure not to divide by zero.
We now simply write the solution (see Figure 4.24) by multiplying by rn in the right places.
X −4r2n ∞
2
u(r, θ) = + r sin(θ) + cos(2nθ).
π n=1
π(4n2 − 1)
1.0 x
-0.5
y 0.5 0.0
0.5
0.0
1.0
u(r,theta)
-0.5 2.0
2.000
1.800
2.0 1.5 1.600
1.400
1.200
1.000
1.5 0.800
1.0
0.600
0.400
0.200
0.000
1.0 0.5
0.5 0.0
1.0
0.0 0.5
0.0
-0.5
0.0 -0.5 y
0.5
x 1.0
Figure 4.24: The solution of the Dirichlet problem with boundary data 0 for y < 0 and 2y for y > 0.
242 CHAPTER 4. FOURIER SERIES AND PDES
While the integral will generally not be solvable analytically, it can be evaluated numerically. In fact,
unless the boundary data is given as a Fourier series already, it may be much easier to numerically
evaluate this formula as there is only one integral to evaluate.
The formula also has theoretical applications. For instance, as P(r, θ, α) will have infinitely many
derivatives, then via differentiating under the integral we find that the solution u(r, θ) has infinitely
many derivatives, at least when inside the circle, r < 1. By “having infinitely many derivatives,”
what you should think of is that u(r, θ) has “no corners” and all of its partial derivatives of all orders
exist and also have “no corners.”
We will compute the formula for P(r, θ, α) from the series solution, and this idea can be applied
anytime you have a convenient series solution where the coefficients are obtained via integration.
Hence you can apply this reasoning to obtain such integral kernels for other equations, such as the
heat equation. The computation is long and tedious, but not overly difficult. Since the ideas are
often applied in similar contexts, it is good to understand how this computation works.
What we do is start with the series solution and replace the coefficients with the integrals that
compute them. Then we try to write everything as a single integral. We must use a different dummy
variable for the integration and hence we use α instead of θ.
∞
a0 X n
u(r, θ) = + an r cos(nθ) + bn rn sin(nθ)
2 n=1
Z π
1
= g(α) dα
2π −π
1 π 1 π
X∞ Z ! Z !
+ g(α) cos(nα) dα r cos(nθ) +
n
g(α) sin(nα) dα rn sin(nθ)
n=1
π −π π −π
Z π ∞
1 X
= g(α) + 2 g(α) cos(nα)rn cos(nθ) + g(α) sin(nα)rn sin(nθ) dα
2π −π n=1
Z π ∞
1 X
= 1 + 2 r cos(nα) cos(nθ) + sin(nα) sin(nθ) g(α) dα
n
2π −π n=1
OK, so we have what we wanted, the expression in the parentheses is the Poisson kernel, P(r, θ, α).
However, we can do a lot better. It is still given as a series, and we would really like to have a nice
∗
Named for the French mathematician Siméon Denis Poisson (1781–1840).
4.10. DIRICHLET PROBLEM IN THE CIRCLE AND THE POISSON KERNEL 243
simple expression for it. We must work a little harder. The trick is to rewrite everything in terms of
complex exponentials. Let us work just on the kernel.
∞
X
P(r, θ, α) = 1 + 2 rn cos(nα) cos(nθ) + sin(nα) sin(nθ)
n=1
∞
X
=1+2 rn cos n(θ − α)
n=1
∞
X
=1+ rn ein(θ−α) + e−in(θ−α)
n=1
∞
X ∞
X
i(θ−α) n n
=1+ re + re−i(θ−α) .
n=1 n=1
In the above expression we recognize the geometric series. Recall from calculus that if z is a
complex number where |z| < 1, then
∞
X z
zn = .
n=1
1−z
Note that n starts at 1 and that is why we have the z in the numerator. It is the standard geometric
series multiplied by z. We can use z = rei(θ−α) , as lo and behold |rei(θ−α) | = r < 1. Let us continue
with the computation.
∞
X ∞
n X −i(θ−α) n
P(r, θ, α) = 1 + rei(θ−α) + re
n=1 n=1
i(θ−α) −i(θ−α)
re re
=1+ +
1 − re i(θ−α) 1 − re−i(θ−α)
i(θ−α)
1 − re−i(θ−α) + 1 − re−i(θ−α) rei(θ−α) + 1 − rei(θ−α) re−i(θ−α)
1 − re
=
1 − rei(θ−α) 1 − re−i(θ−α)
1 − r2
=
1 − rei(θ−α) − re−i(θ−α) + r2
1 − r2
= .
1 − 2r cos(θ − α) + r2
Now that’s a formula we can live with. The solution to the Dirichlet problem using the Poisson
kernel is
Z π
1 1 − r2
u(r, θ) = g(α) dα.
2π −π 1 − 2r cos(θ − α) + r2
1
Sometimes the formula for the Poisson kernel is given together with the constant 2π , in which case
we should of course not leave it in front of the integral. Also, often the limits of the integral are
given as 0 to 2π; everything inside is 2π-periodic in α, so this does not change the integral.
244 CHAPTER 4. FOURIER SERIES AND PDES
Let us not leave the Poisson kernel without explaining its geometric meaning. Let s be the
distance from (r, θ) to (1, α). You may recall from calculus that this distance s in polar coordinates
is given precisely by the square root of 1 − 2r cos(θ − α) + r2 . That is, the Poisson kernel is really
the formula
1 − r2
.
s2
One final note we make about the formula is that it is really
(1, α) s
a weighted average of the boundary values. First let us look at
(r, θ)
what happens at the origin, that is when r = 0.
Z π 1
1 1 − 02 r
u(0, 0) = g(α) dα
2π −π 1 − 2(0) cos(θ − α) + 02
Z π
1
= g(α) dα.
2π −π
So u(0, 0) is precisely the average value of g(θ) and therefore the
average value of u on the boundary. This is a general feature
of harmonic functions, the value at some point p is equal to the
average of the values on a circle centered at p.
What the formula says is that the value of the solution at any point in the circle is a weighted
average of the boundary data g(θ). The kernel is bigger when (1, α) is closer to (r, θ). Therefore
when computing u(r, θ) we give more weight to the values g(α) when (1, α) is closer to (r, θ) and
less weight to the values g(α) when (1, α) far from (r, θ).
4.10.4 Exercises
Exercise 4.10.2: Using series solve ∆u = 0, u(1, θ) = |θ|, for −π < θ ≤ π.
Exercise 4.10.3: Using series solve ∆u = 0, u(1, θ) = g(θ) for the following data. Hint: trig
identities.
a) g(θ) = 1/2 + 3 sin(θ) + cos(3θ) b) g(θ) = 3 cos(3θ) + 3 sin(3θ) + sin(9θ)
c) g(θ) = 2 cos(θ + 1) d) g(θ) = sin2 (θ)
Exercise 4.10.4: Using the Poisson kernel, give the solution to ∆u = 0, where u(1, θ) is zero for θ
outside the interval [−π/4, π/4] and u(1, θ) is 1 for θ on the interval [−π/4, π/4].
Exercise 4.10.5: a) Draw a graph for the Poisson kernel as a function of α when r = 1/2 and θ = 0.
b) Describe what happens to the graph when you make r bigger (as it approaches 1). c) Knowing
that the solution u(r, θ) is the weighted average of g(θ) with Poisson kernel as the weight, explain
what your answer to part b means.
Exercise 4.10.6: Take the function g(θ) to be the function xy = cos θ sin θ on the boundary. Use the
series solution to find a solution to the Dirichlet problem ∆u = 0, u(1, θ) = g(θ). Now convert the
solution to Cartesian coordinates x and y. Is this solution surprising? Hint: use your trig identities.
4.10. DIRICHLET PROBLEM IN THE CIRCLE AND THE POISSON KERNEL 245
Exercise 4.10.7: Carry out the computation we needed in the separation of variables and solve
r2 R00 + rR0 − n2 R = 0, for n = 0, 1, 2, 3, . . ..
Exercise 4.10.8 (challenging): Derive the series solution to the Dirichlet problem if the region is a
circle of radius ρ rather than 1. That is, solve ∆u = 0, u(ρ, θ) = g(θ).
Exercise 4.10.9 (challenging): a) Find the solution for ∆u = 0, u(1, θ) = x2 y3 + 5x2 . Write the
answer in Cartesian coordinates.
b) Now solve ∆u = 0, u(1, θ) = xk y` . Write the solution in Cartesian coordinates.
c) Suppose you have a polynomial P(x, y) = mj=0 nk=0 c j,k x j yk , solve ∆u = 0, u(1, θ) = P(x, y) (that
P P
is, write down the formula for the answer). Write the answer in Cartesian coordinates.
Notice the answer is again a polynomial in x and y. See also Exercise 4.10.6.
∞
Exercise 4.10.101: Using series solve ∆u = 0, u(1, θ) = 1 + 1
P
n2
sin(nθ).
n=1
Exercise 4.10.102: Using the series solution find the solution to ∆u = 0, u(1, θ) = 1 − cos(θ).
Express the solution in Cartesian coordinates (that is, using x and y).
Exercise 4.10.103: a) Try and guess a solution to ∆u = −1, u(1, θ) = 0. Hint: try a solution that
only depends on r. Also first, don’t worry about the boundary condition. b) Now solve ∆u = −1,
u(1, θ) = sin(2θ) using superposition.
Exercise 4.10.104 (challenging): Derive the Poisson kernel solution if the region is a circle of
radius ρ rather than 1. That is, solve ∆u = 0, u(ρ, θ) = g(θ).
246 CHAPTER 4. FOURIER SERIES AND PDES
Chapter 5
Eigenvalue problems
247
248 CHAPTER 5. EIGENVALUE PROBLEMS
Once we had this decomposition and found suitable T n (t) such that T n (0) = 1 and T n (t)X(x) were
solutions, the solution to the original problem including the initial condition could be written as
∞
X
u(x, t) = cn T n (t)Xn (x).
n=1
We will try to solve more general problems using this method. First, we will study second order
linear equations of the form
!
d dy
p(x) − q(x)y + λr(x)y = 0. (5.1)
dx dx
Essentially any second order linear equation of the form a(x)y00 + b(x)y0 + c(x)y + λd(x)y = 0 can
be written as (5.1) after multiplying by a proper factor.
Example 5.1.1 (Bessel): Put the following equation into the form (5.1):
x2 y00 + xy0 + λx2 − n2 y = 0.
1
Multiply both sides by x
to obtain
n2 n2
! !
1 2 00 d dy
x y + xy + λx − n y = xy + y + λx −
0 2 2 00 0
y= x − y + λxy = 0.
x x dx dx x
The so-called Sturm-Liouville problem∗ is to seek nontrivial solutions to
!
d dy
p(x) − q(x)y + λr(x)y = 0, a < x < b,
dx dx
(5.2)
α1 y(a) − α2 y0 (a) = 0,
β1 y(b) + β2 y0 (b) = 0.
In particular, we seek λs that allow for nontrivial solutions. The λs that admit nontrivial solutions
are called the eigenvalues and the corresponding nontrivial solutions are called eigenfunctions. The
constants α1 and α2 should not be both zero, same for β1 and β2 .
Theorem 5.1.1. Suppose p(x), p0 (x), q(x) and r(x) are continuous on [a, b] and suppose p(x) > 0
and r(x) > 0 for all x in [a, b]. Then the Sturm-Liouville problem (5.2) has an increasing sequence
of eigenvalues
λ1 < λ2 < λ3 < · · ·
such that
lim λn = +∞
n→∞
and such that to each λn there is (up to a constant multiple) a single eigenfunction yn (x).
Moreover, if q(x) ≥ 0 and α1 , α2 , β1 , β2 ≥ 0, then λn ≥ 0 for all n.
∗
Named after the French mathematicians Jacques Charles François Sturm (1803–1855) and Joseph Liouville
(1809–1882).
5.1. STURM-LIOUVILLE PROBLEMS 249
Problems satisfying the hypothesis of the theorem are called regular Sturm-Liouville problems
and we will only consider such problems here. That is, a regular problem is one where p(x), p0 (x),
q(x) and r(x) are continuous, p(x) > 0, r(x) > 0, q(x) ≥ 0, and α1 , α2 , β1 , β2 ≥ 0. Note: Be careful
about the signs. Also be careful about the inequalities for r and p, they must be strict for all x!
When zero is an eigenvalue, we usually start labeling the eigenvalues at 0 rather than at 1 for
convenience.
Example 5.1.2: The problem y00 + λy, 0 < x < L, y(0) = 0, and y(L) = 0 is a regular Sturm-
Liouville problem. p(x) = 1, q(x) = 0, r(x) = 1, and we have p(x) = 1 > 0 and r(x) = 1 > 0. The
eigenvalues are λn = nLπ2 and eigenfunctions are yn (x) = sin( nπ
2 2
L
x). All eigenvalues are nonnegative
as predicted by the theorem.
Exercise 5.1.1: Find eigenvalues and eigenfunctions for
Identify the p, q, r, α j , β j . Can you use the theorem to make the search for eigenvalues easier? (Hint:
Consider the condition −y0 (0) = 0)
Example 5.1.3: Find eigenvalues and eigenfunctions of the problem
or
h √
√ = tan λ.
λ
Now use a computer to find λn . There are tables available, though using a computer or a graphing
calculator is far more convenient nowadays. Easiest method is to plot the functions h/x and tan x
and see for which √ x they intersect. There is an infinite
√ number of intersections. Denote the first
intersection
√ by√ λ1 , the second intersection by λ2 , etc. . . . For example, when h = 1, we get
λ1 ≈ 0.86, λ2 ≈ 3.43, . . . . That is λ1 ≈ 0.74, λ2 ≈ 11.73, . . . . A plot for h = 1 is given in
√
Figure 5.1. The appropriate eigenfunction (let A = 1 for convenience, then B = h/ λ) is
h
yn (x) = cos( λn x) + √ sin( λn x).
p p
λn
1 1
y1 (x) ≈ cos(0.86 x) + sin(0.86 x), y2 (x) ≈ cos(3.43 x) + sin(3.43 x), ....
0.86 3.43
0 2 4 6
4 4
2 2
0 0
-2 -2
-4 -4
0 2 4 6
1
Figure 5.1: Plot of x and tan x.
5.1.2 Orthogonality
We have seen the notion of orthogonality before. For example, we have shown that sin(nx) are
orthogonal for distinct n on [0, π]. For general Sturm-Liouville problems we will need a more
general setup. Let r(x) be a weight function (any function, though generally we will assume it is
5.1. STURM-LIOUVILLE PROBLEMS 251
positive) on [a, b]. Two functions f (x), g(x) are said to be orthogonal with respect to the weight
function r(x) when Z b
f (x) g(x) r(x) dx = 0.
a
In this setting, we define the inner product as
Z b
def
h f, gi = f (x) g(x) r(x) dx,
a
and then say f and g are orthogonal whenever h f, gi = 0. The results and concepts are again
analogous to finite dimensional linear algebra.
The idea of the given inner product is that those x where r(x) is greater have more weight.
Nontrivial (nonconstant) r(x) arise naturally, for example from a change of variables. Hence, you
could think of a change of variables such that dξ = r(x) dx.
We have the following orthogonality property of eigenfunctions of a regular Sturm-Liouville
problem.
Theorem 5.1.2. Suppose we have a regular Sturm-Liouville problem
!
d dy
p(x) − q(x)y + λr(x)y = 0,
dx dx
α1 y(a) − α2 y0 (a) = 0,
β1 y(b) + β2 y0 (b) = 0.
Let y j and yk be two distinct eigenfunctions for two distinct eigenvalues λ j and λk . Then
Z b
y j (x) yk (x) r(x) dx = 0,
a
that is, y j and yk are orthogonal with respect to the weight function r.
Proof is very similar to the analogous theorem from § 4.1. It can also be found in many books
including, for example, Edwards and Penney [EP].
where yn (x) are eigenfunctions. We wish to find out if we can represent any function f (x) in this way,
and if so, we wish to calculate cn (and of course we would want to know if the sum converges). OK,
so imagine we could write f (x) as (5.3). We will assume convergence and the ability to integrate
the series term by term. Because of orthogonality we have
Z b
h f, ym i = f (x) ym (x) r(x) dx
a
X∞ Z b
= cn yn (x) ym (x) r(x) dx
n=1 a
Z b
= cm ym (x) ym (x) r(x) dx = cm hym , ym i.
a
Hence,
Rb
h f, ym i f (x) ym (x) r(x) dx
cm = = aR b . (5.4)
hym , ym i 2
ym (x) r(x) dx
a
Note that ym are known up to a constant multiple, so we could have picked a scalar multiple
of an eigenfunction such that hym , ym i = 1 (if we had an arbitrary eigenfunction ỹm , divide it by
5.1. STURM-LIOUVILLE PROBLEMS 253
hỹm , ỹm i). When hym , ym i = 1 we have the simpler form cm = h f, ym i as we did for the Fourier
p
series. The following theorem holds more generally, but the statement given is enough for our
purposes.
Theorem 5.1.4. Suppose f is a piecewise smooth continuous function on [a, b]. If y1 , y2 , . . . are
eigenfunctions of a regular Sturm-Liouville problem, one for each eigenvalue, then there exist real
constants c1 , c2 , . . . given by (5.4) such that (5.3) converges and holds for a < x < b.
Example 5.1.4: Take the simple Sturm-Liouville problem
π
y00 + λy = 0, 0<x< ,
2
0 π
y(0) = 0, y = 0.
2
The above is a regular problem and furthermore we know by Theorem 5.1.1 on page 248 that λ ≥ 0.
Suppose λ = 0, then the general solution is y(x) = Ax + B, we plug in the initial conditions
to get 0 = y(0) = B, and 0 = y0 ( π2 ) = A, hence λ = 0 is not an eigenvalue. The general solution,
therefore, is √ √
y(x) = A cos( λ x) + B sin( λ x).
√ √
Plugging in the boundary conditions we get 0 = y(0) = A and 0 = y0 π2 = λ B cos λ π2 . B
√ √
cannot be zero and hence cos λ π2 = 0. This means that λ π2 must be an odd integral multiple of
π
√
2
, i.e. (2n − 1) π2 = λn π2 . Hence
λn = (2n − 1)2 .
We can take B = 1. Hence our eigenfunctions are
yn (x) = sin (2n − 1)x .
Finally we compute
π
π
Z 2
2
sin (2n − 1)x dx = .
0 4
π
So any piecewise smooth function on [0, 2 ] can be written as
∞
X
f (x) = cn sin (2n − 1)x ,
n=1
where R π2
f (x) sin (2n − 1)x dx 4 Z π2
h f, yn i
cn = = Rπ
0
=
f (x) sin (2n − 1)x dx.
hyn , yn i 2
2
sin (2n − 1)x dx π 0
0
Note that the series converges to an odd 2π-periodic (not π-periodic!) extension of f (x).
Exercise 5.1.3 (challenging): In the above example, the function is defined on 0 < x < π2 , yet the
series converges to an odd 2π-periodic extension of f (x). Find out how is the extension defined for
π
2
< x < π.
254 CHAPTER 5. EIGENVALUE PROBLEMS
5.1.5 Exercises
Exercise 5.1.4: Find eigenvalues and eigenfunctions of
Exercise 5.1.5: Expand the function f (x) = x on 0 ≤ x ≤ 1 using eigenfunctions of the system
Exercise 5.1.6: Suppose that you had a Sturm-Liouville problem on the interval [0, 1] and came up
with yn (x) = sin(γnx), where γ > 0 is some constant. Decompose f (x) = x, 0 < x < 1 in terms of
these eigenfunctions.
This problem is not a Sturm-Liouville problem, but the idea is the same.
Exercise 5.1.102: Put the following problems into the standard form for Sturm-Liouville problems,
that is, find p(x), q(x), r(x), α1 , α2 , β1 , and β2 , and decide if the problems are regular or not.
a) xy00 + λy = 0 for 0 < x < 1, y(0) = 0, y(1) = 0,
b)∗ (1 + x2 )y00 + 2xy0 + (λ − x2 )y = 0 for −1 < x < 1, y(−1) = 0, y(1) + y0 (1) = 0.
In a previous version of the book, a typo rendered the equation as (1 + x2 )y00 − 2xy0 + (λ − x2 )y = 0 ending up with
∗
something harder than intended. Try this equation for a further challenge.
5.2. APPLICATION OF EIGENFUNCTION SERIES 255
Write ω4 = λ, so that we do not need to write the fourth root all the time. For X we get the
equation X (4) − ω4 X = 0. The general solution is
The point is that Xn T n is a solution that satisfies all the homogeneous conditions (that is, all
conditions except the initial position). And since and T n (0) = 1, we have
∞
X ∞
X ∞
X
y(x, 0) = bn Xn (x)T n (0) = bn Xn (x) = bn sin(nπx) = f (x).
n=1 n=1 n=1
5.2.1 Exercises
Exercise 5.2.2: Suppose you have a beam of length 5 with free ends. Let y be the transverse
deviation of the beam at position x on the beam (0 < x < 5). You know that the constants are such
that this satisfies the equation ytt + 4y xxxx = 0. Suppose you know that the initial shape of the beam
is the graph of x(5 − x), and the initial velocity is uniformly equal to 2 (same for each x) in the
positive y direction. Set up the equation together with the boundary and initial conditions. Just set
up, do not solve.
Exercise 5.2.3: Suppose you have a beam of length 5 with one end free and one end fixed (the
fixed end is at x = 5). Let u be the longitudinal deviation of the beam at position x on the beam
(0 < x < 5). You know that the constants are such that this satisfies the equation utt = 4u xx . Suppose
you know that the initial displacement of the beam is x−5 50
, and the initial velocity is −(x−5)
100
in the
positive u direction. Set up the equation together with the boundary and initial conditions. Just set
up, do not solve.
Exercise 5.2.4: Suppose the beam is L units long, everything else kept the same as in (5.5). What
is the equation and the series solution?
Exercise 5.2.5: Suppose you have
a4 y xxxx + ytt = 0 (0 < x < 1, t > 0),
y(0, t) = y xx (0, t) = 0,
y(1, t) = y xx (1, t) = 0,
y(x, 0) = f (x), yt (x, 0) = g(x).
That is, you have also an initial velocity. Find a series solution. Hint: Use the same idea as we did
for the wave equation.
Exercise 5.2.101: Suppose you have a beam of length 1 with hinged ends. Let y be the transverse
deviation of the beam at position x on the beam (0 < x < 1). You know that the constants are such
that this satisfies the equation ytt + 4y xxxx = 0. Suppose you know that the initial shape of the beam
is the graph of sin(πx), and the initial velocity is 0. Solve for y.
258 CHAPTER 5. EIGENVALUE PROBLEMS
Exercise 5.2.102: Suppose you have a beam of length 10 with two fixed ends. Let y be the transverse
deviation of the beam at position x on the beam (0 < x < 10). You know that the constants are such
that this satisfies the equation ytt + 9y xxxx = 0. Suppose you know that the initial shape of the beam
is the graph of sin(πx), and the initial velocity is uniformly equal to x(10 − x). Set up the equation
together with the boundary and initial conditions. Just set up, do not solve.
5.3. STEADY PERIODIC SOLUTIONS 259
0 L x
ytt = a2 y xx ,
y(0, t) = 0, y(L, t) = 0, (5.6)
y(x, 0) = f (x), yt (x, 0) = g(x).
where An and Bn were determined by the initial conditions. The natural frequencies of the system
are the (angular) frequencies nπa
L
for integers n ≥ 1.
But these are free vibrations. What if there is an external force acting on the string. Let us
assume say air vibrations (noise), for example a second string. Or perhaps a jet engine. For
simplicity, assume nice pure sound and assume the force is uniform at every position on the string.
Let us say F(t) = F0 cos(ωt) as force per unit mass. Then our wave equation becomes (remember
force is mass times acceleration)
We want to find the solution here that satisfies the above equation and
That is, the string is initially at rest. First we find a particular solution y p of (5.7) that satisfies
y(0, t) = y(L, t) = 0. We define the functions f and g as
∂y p
f (x) = −y p (x, 0), g(x) = − (x, 0).
∂t
We then find solution yc of (5.6). If we add the two solutions, we find that y = yc + y p solves (5.7)
with the initial conditions.
Exercise 5.3.1: Check that y = yc + y p solves (5.7) and the side conditions (5.8).
So the big issue here is to find the particular solution y p . We look at the equation and we make
an educated guess
y p (x, t) = X(x) cos(ωt).
We plug in to get
−ω2 X cos(ωt) = a2 X 00 cos(ωt) + F0 cos(ωt),
or −ω2 X = a2 X 00 + F0 after canceling the cosine. We know how to find a general solution to this
equation (it is a nonhomogeneous constant coefficient equation). The general solution is
ω ω F
0
X(x) = A cos x + B sin x − 2.
a a ω
The endpoint conditions imply X(0) = X(L) = 0. So
F0
0 = X(0) = A − ,
ω2
or A = F0
ω2
, and also
F0 ωL ωL F
0
0 = X(L) = cos + B sin − 2.
ω2 a a ω
Assuming that sin( ωL
a
) is not zero we can solve for B to get
−F0 cos ωL
a
− 1
B= . (5.9)
ω2 sin ωL
a
Therefore,
ω cos ωL
F0 − 1 ω
a
X(x) = 2 cos x − sin x − 1 .
ω ωL
a sin a a
5.3. STEADY PERIODIC SOLUTIONS 261
ωL
F0
ω cos a
−1 ω
y p (x, t) = 2 cos x − sin x − 1 cos(ωt).
ω a sin ωL a
a
Write B = cos(1)−1
sin(1)
for simplicity.
Then plug in t = 0 to get
0
0.0 t
1
2
0.2 3
x 4
0.5 5 y(x,t)
0.8
0.20 0.240
1.0 0.148
0.099
0.20 0.049
0.10
0.000
-0.049
0.10 -0.099
0.00
-0.148
y
-0.197
0.00 -0.254
y
-0.10
-0.10
-0.20
0.0
-0.20
0.2
0 0.5
1 x
2 0.8
3
4 1.0
t
5
F(x+t)+F(x−t)
cos(1)−1
Figure 5.4: Plot of y(x, t) = 2 + cos(x) − sin(1) sin(x) − 1 cos(t).
It is not hard to compute specific values for an odd periodic extension of a function and hence
(5.10) is a wonderful solution to the problem. For example it is very easy to have a computer do it,
unlike a series solution. A plot is given in Figure 5.4.
5.3. STEADY PERIODIC SOLUTIONS 263
Exercise 5.3.3: Suppose h satisfies (5.12). Use Euler’s formula for the complex exponential to
check that u = Re h satisfies (5.11).
we find the depth in centimeters where the seasons are reversed. That is, we get the depth at which
summer is the coldest and winter is the warmest. We get approximately 700 centimeters, which is
approximately 23 feet below ground.
Be careful not to jump to conclusions. The temperature
√ω swings decay rapidly as you dig deeper.
− 2k x
The amplitude of the temperature swings is A0 e . This function decays very quickly as x (the
depth) grows. Let us again take typical parameters as above. We will also assume that our surface
temperature swing is ±15◦ Celsius, that is, A0 = 15. Then the maximum temperature variation at
700 centimeters is only ±0.66◦ Celsius.
You need not dig very deep to get an effective “refrigerator,” with nearly constant temperature.
That is why wines are kept in a cellar; you need consistent temperature. The temperature differential
could also be used for energy. A home could be heated or cooled by taking advantage of the above
fact. Even without the earth core you could heat a home in the winter and cool it in the summer. The
earth core makes the temperature higher the deeper you dig, although you need to dig somewhat
deep to feel a difference. We did not take that into account above.
5.3. STEADY PERIODIC SOLUTIONS 265
5.3.3 Exercises
Exercise 5.3.5: Suppose that the forcing function for the vibrating string is F0 sin(ωt). Derive the
particular solution y p .
Exercise 5.3.6: Take the forced vibrating string. Suppose that L = 1, a = 1. Suppose that the
forcing function is the square wave that is 1 on the interval 0 < x < 1 and −1 on the interval
−1 < x < 0. Find the particular solution. Hint: You may want to use result of Exercise 5.3.5.
Exercise 5.3.7: The units are cgs (centimeters-grams-seconds). For k = 0.005, ω = 1.991 × 10−7 ,
A0 = 20. Find the depth at which the temperature variation is half (±10 degrees) of what it is on the
surface.
Exercise 5.3.8: Derive the solution for underground temperature oscillation without assuming that
T 0 = 0.
Exercise 5.3.101: Take the forced vibrating string. Suppose that L = 1, a = 1. Suppose that
the forcing function is a sawtooth, that is |x| − 12 on −1 < x < 1 extended periodically. Find the
particular solution.
Exercise 5.3.102: The units are cgs (centimeters-grams-seconds). For k = 0.01, ω = 1.991 × 10−7 ,
A0 = 25. Find the depth at which the summer is again the hottest point.
266 CHAPTER 5. EIGENVALUE PROBLEMS
Chapter 6
267
268 CHAPTER 6. THE LAPLACE TRANSFORM
frequency domain. We use the same letter to denote that one function is the Laplace transform of
the other. For example F(s) is the Laplace transform of f (t). Let us define the transform.
Z ∞
def
L{ f (t)} = F(s) = e−st f (t) dt.
0
We note that we are only considering t ≥ 0 in the transform. Of course, if we think of t as time there
is no problem, we are generally interested in finding out what will happen in the future (Laplace
transform is one place where it is safe to ignore the past). Let us compute some simple transforms.
Example 6.1.1: Suppose f (t) = 1, then
Z ∞ " −st #∞ " −st #h
e−sh
!
e e 1 1
L{1} = e dt =
−st
= lim = lim − = .
0 −s t=0 h→∞ −s t=0 h→∞ −s −s s
The limit (the improper integral) only exists if s > 0. So L{1} is only defined for s > 0.
Example 6.1.2: Suppose f (t) = e−at , then
Z ∞ ∞ #∞
e−(s+a)t
Z "
1
L{e } =
−at
e e dt =
−st −at −(s+a)t
e dt = = .
0 0 −(s + a) t=0 s+a
The limit only exists if s + a > 0. So L{e−at } is only defined for s + a > 0.
Example 6.1.3: Suppose f (t) = t, then using integration by parts
Z ∞
L{t} = e−st t dt
" 0 −st #∞
1 ∞ −st
Z
−te
= + e dt
s t=0 s 0
#∞
1 e−st
"
=0+
s −s t=0
1
= 2.
s
Again, the limit only exists if s > 0.
Example 6.1.4: A common function is the unit step function, which is sometimes called the
Heaviside function∗ . This function is generally given as
0 if t < 0,
u(t) =
1 if t ≥ 0.
∗
The function is named after the English mathematician, engineer, and physicist Oliver Heaviside (1850–1925).
Only by coincidence is the function “heavy” on “one side.”
6.1. THE LAPLACE TRANSFORM 269
Let us find the Laplace transform of u(t − a), where a ≥ 0 is some constant. That is, the function
that is 0 for t < a and 1 for t ≥ a.
Z ∞ Z ∞ " −st #∞
e e−as
L{u(t − a)} = e u(t − a) dt =
−st
e dt =
−st
= ,
0 a −s t=a s
where of course s > 0 (and a ≥ 0 as we said before).
By applying similar procedures we can compute the transforms of many elementary functions.
Many basic transforms are listed in Table 6.1.
f (t) L{ f (t)}
C
C s
1
t s2
2
t2 s3
6
t3 s4
n!
tn sn+1
1
e−at s+a
ω
sin(ωt) s2 +ω2
s
cos(ωt) s2 +ω2
ω
sinh(ωt) s2 −ω2
s
cosh(ωt) s2 −ω2
e−as
u(t − a) s
Exercise 6.1.2: Verify the theorem. That is, show that L{A f (t) + Bg(t)} = AL{ f (t)} + BL{g(t)}.
These rules together with Table 6.1 on the preceding page make it easy to find the Laplace
transform of a whole lot of functions already. But be careful. It is a common mistake to think that
the Laplace transform of a product is the product of the transforms. In general
L{ f (t)g(t)} , L{ f (t)}L{g(t)}.
It must also be noted that not all functions have a Laplace transform. For example, the function
1 2
t
does not have a Laplace transform as the integral diverges for all s. Similarly, tan t or et do not
have Laplace transforms.
If the limit exists and is finite (usually zero), then f (t) is of exponential order.
Exercise 6.1.3: Use L’Hopital’s rule from calculus to show that a polynomial is of exponential
order. Hint: Note that a sum of two exponential order functions is also of exponential order. Then
show that tn is of exponential order for any n.
For an exponential order function we have existence and uniqueness of the Laplace transform.
Theorem 6.1.2 (Existence). Let f (t) be continuous and of exponential order for a certain constant
c. Then F(s) = L{ f (t)} is defined for all s > c.
The existence is not difficult to see. Let f (t) be of exponential order, that is | f (t)| ≤ Mect for all
t > 0 (for simplicity t0 = 0). Let s > c, or in other words (c − s) < 0. By the comparison theorem
from calculus, the improper integral defining L{ f (t)} exists if the following integral exists
Z ∞ Z ∞ " (c−s)t #∞
e M
e (Me ) dt = M
−st ct
e (c−s)t
dt = M = .
0 0 c − s t=0 c − s
The transform also exists for some other functions that are not of exponential order, but that
will not be relevant to us. Before dealing with uniqueness, let us note that for exponential order
functions we obtain that their Laplace transform decays at infinity:
lim F(s) = 0.
s→∞
6.1. THE LAPLACE TRANSFORM 271
Theorem 6.1.3 (Uniqueness). Let f (t) and g(t) be continuous and of exponential order. Suppose
that there exists a constant C, such that F(s) = G(s) for all s > C. Then f (t) = g(t) for all t ≥ 0.
Both theorems hold for piecewise continuous functions as well. Recall that piecewise continuous
means that the function is continuous except perhaps at a discrete set of points where it has jump
discontinuities like the Heaviside function. Uniqueness, however, does not “see” values at the
discontinuities. So we can only conclude that f (t) = g(t) outside of discontinuities. For example,
the unit step function is sometimes defined using u(0) = 1/2. This new step function, however, has
the exact same Laplace transform as the one we defined earlier where u(0) = 1.
def
L−1 {F(s)} = f (t).
There is an integral formula for the inverse, but it is not as simple as the transform itself—it requires
complex numbers and path integrals. For us it will suffice to compute the inverse using Table 6.1 on
page 269.
Example 6.1.5: Take F(s) = s+1 1
. Find the inverse Laplace transform.
We look at the table to find ( )
1
L −1
= e−t .
s+1
As the Laplace transform is linear, the inverse Laplace transform is also linear. That is,
Of course, we also have L−1 {AF(s)} = AL−1 {F(s)}. Let us demonstrate how linearity can be used.
Example 6.1.6: Take F(s) = s s+s+1
2
3 +s . Find the inverse Laplace transform.
First we use the method of partial fractions to write F in a form where we can use Table 6.1 on
page 269. We factor the denominator as s(s2 + 1) and write
s2 + s + 1 A Bs + C
= + 2 .
s3 + s s s +1
272 CHAPTER 6. THE LAPLACE TRANSFORM
Putting the right hand side over a common denominator and equating the numerators we get
A(s2 + 1) + s(Bs + C) = s2 + s + 1. Expanding and equating coefficients we obtain A + B = 1, C = 1,
A = 1, and thus B = 0. In other words,
s2 + s + 1 1 1
F(s) = = + 2 .
s +s
3 s s +1
By linearity of the inverse Laplace transform we get
−1 s + s + 1
( 2 ) ( ) ( )
−1 1 1
L =L +L −1
= 1 + sin t.
s3 + s s s2 + 1
Another useful property is the so-called shifting property or the first shifting property
Exercise 6.1.4: Derive the first shifting property from the definition of the Laplace transform.
The shifting property can be used, for example, when the denominator is a more complicated
quadratic that may come up in the method of partial fractions. We complete the square and write
such quadratics as (s + a)2 + b and then use the shifting property.
n o
1
Example 6.1.7: Find L−1 s2 +4s+8 .
First we complete the square to make the denominator (s + 2)2 + 4. Next we find
( )
1 1
L−1
= sin(2t).
s2 + 4 2
In general, we want to be able to apply the Laplace transform to rational functions, that is
functions of the form
F(s)
G(s)
where F(s) and G(s) are polynomials. Since normally, for the functions that we are considering,
the Laplace transform goes to zero as s → ∞, it is not hard to see that the degree of F(s) must be
smaller than that of G(s). Such rational functions are called proper rational functions and we can
always apply the method of partial fractions. Of course this means we need to be able to factor the
denominator into linear and quadratic terms, which involves finding the roots of the denominator.
6.1. THE LAPLACE TRANSFORM 273
6.1.4 Exercises
Exercise 6.1.5: Find the Laplace transform of 3 + t5 + sin(πt).
Exercise 6.1.6: Find the Laplace transform of a + bt + ct2 for some constants a, b, and c.
Exercise 6.1.15: Find the Laplace transform of t sin(ωt). Hint: Several integrations by parts.
Exercise 6.1.103: Find the Laplace transform of te−t (Hint: integrate by parts).
Exercise 6.1.104: Find the Laplace transform of sin(t)e−t (Hint: integrate by parts).
274 CHAPTER 6. THE LAPLACE TRANSFORM
We repeat this procedure for higher derivatives. The results are listed in Table 6.2. The procedure
also works for piecewise smooth functions, that is functions that are piecewise continuous with a
piecewise continuous derivative.
We plug in the initial conditions now—this makes the computations more streamlined—to obtain
s
s2 X(s) − 1 + X(s) = .
s2 +4
We solve for X(s),
s 1
X(s) = + 2 .
(s2 + 1)(s + 4) s + 1
2
1 s 1 s 1
X(s) = − + 2 .
3 s +1 3 s +4 s +1
2 2
1 1
x(t) = cos(t) − cos(2t) + sin(t).
3 3
The procedure for linear constant coefficient equations is as follows. We take an ordinary
differential equation in the time variable t. We apply the Laplace transform to transform the equation
into an algebraic (non differential) equation in the frequency domain. All the x(t), x0 (t), x00 (t), and
so on, will be converted to X(s), sX(s) − x(0), s2 X(s) − sx(0) − x0 (0), and so on. We solve the
equation for X(s). Then taking the inverse transform, if possible, we find x(t).
It should be noted that since not every function has a Laplace transform, not every equation
can be solved in this manner. Also if the equation is not a linear constant coefficient ODE, then by
applying the Laplace transform we may not obtain an algebraic equation.
This function is useful for putting together functions, or cutting functions off. Most commonly
it is used as u(t − a) for some constant a. This just shifts the graph to the right by a. That is, it is a
function that is 0 when t < a and 1 when t ≥ a. Suppose for example that f (t) is a “signal” and you
started receiving the signal sin t at time t = π. The function f (t) should then be defined as
0
if t < π,
f (t) =
sin t if t ≥ π.
276 CHAPTER 6. THE LAPLACE TRANSFORM
-1.0 -0.5 0.0 0.5 1.0
1.00 1.00
0.75 0.75
0.50 0.50
0.25 0.25
0.00 0.00
Hence it is useful to know how the Heaviside function interacts with the Laplace transform. We
have already seen that
e−as
L{u(t − a)} = .
s
This can be generalized into a shifting property or second shifting property.
We can write f (t) = u(t − 1) − u(t − 5). We transform the equation and we plug in the initial
conditions as before to obtain
e−s e−5s
s2 X(s) + X(s) = − .
s s
We solve for X(s) to obtain
e−s e−5s
X(s) = − .
s(s2 + 1) s(s2 + 1)
We leave it as an exercise to the reader to show that
( )
1
L −1
= 1 − cos t.
s(s2 + 1)
e−s
( )
−1
= L−1 e−s L{1 − cos t} = 1 − cos(t − 1) u(t − 1).
L
s(s + 1)
2
Similarly
e−5s
( ) n o
−1
= −1 −5s
= 1 − cos(t − 5) u(t − 5).
L L e L{1 − cos t}
s(s + 1)
2
2 2
1 1
0 0
-1 -1
-2 -2
0 5 10 15 20
Lx = f (t),
where L is a linear constant coefficient differential operator. Then f (t) is usually thought of as input
of the system and x(t) is thought of as the output of the system. For example, for a mass-spring
system the input is the forcing function and output is the behavior of the mass. We would like to
have a convenient way to study the behavior of the system for different inputs.
Let us suppose that all the initial conditions are zero and take the Laplace transform of the
equation, we obtain the equation
A(s)X(s) = F(s).
Solving for the ratio X(s)/F(s) we obtain the so-called transfer function H(s) = 1/A(s).
X(s)
H(s) = .
F(s)
In other words, X(s) = H(s)F(s). We obtain an algebraic dependence of the output of the system
based on the input. We can now easily study the steady state behavior of the system given different
inputs by simply multiplying by the transfer function.
Example 6.2.3: Given x00 + ω20 x = f (t), let us find the transfer function (assuming the initial
conditions are zero).
First, we take the Laplace transform of the equation.
X(s) 1
H(s) = = 2 .
F(s) s + ω20
Let us see how to use the transfer function. Suppose we have the constant input f (t) = 1. Hence
F(s) = 1/s, and
1 1
X(s) = H(s)F(s) = 2 .
s + ω20 s
Taking the inverse Laplace transform of X(s) we obtain
1 − cos(ω0 t)
x(t) = .
ω20
6.2. TRANSFORMS OF DERIVATIVES AND ODES 279
It is sometimes useful (e.g. for computing the inverse transform) to write this as
Z t ( )
−1 1
f (τ) dτ = L F(s) .
0 s
n o
Example 6.2.4: To compute L−1 s(s21+1) we could proceed by applying this integration rule.
( ) Z t ( ) Z t
−1 1 1 1
L = L −1
dτ = sin τ dτ = 1 − cos t.
s s2 + 1 0 s2 + 1 0
Example 6.2.5: An equation containing an integral of the unknown function is called an integral
equation. For example, take Z t
t2 = eτ x(τ) dτ,
0
where we wish to solve for x(t). We apply the Laplace transform and the shifting property to get
2 1 1
3
= L{et x(t)} = X(s − 1),
s s s
where X(s) = L{x(t)}. Thus
2 2
X(s − 1) = or X(s) = .
s2 (s + 1)2
We use the shifting property again
x(t) = 2e−t t.
6.2.6 Exercises
Exercise 6.2.2: Using the Heaviside function write down the piecewise function that is 0 for t < 0,
t2 for t in [0, 1] and t for t > 1.
Exercise 6.2.3: Using the Laplace transform solve
mx00 + cx0 + kx = 0, x(0) = a, x0 (0) = b,
where m > 0, c > 0, k > 0, and c2 − 4km > 0 (system is overdamped).
280 CHAPTER 6. THE LAPLACE TRANSFORM
Exercise 6.2.102: Solve x00 − x = (t2 − 1)u(t − 1) for initial conditions x(0) = 1, x0 (0) = 2 using the
Laplace transform.
Exercise 6.2.103: Find the transfer function for x0 + x = f (t) (assuming the initial conditions are
zero).
282 CHAPTER 6. THE LAPLACE TRANSFORM
6.3 Convolution
Note: 1 or 1.5 lectures, §7.2 in [EP], §6.6 in [BD]
The formula holds only for t ≥ 0. We assumed that f and g are zero (or simply not defined) for
negative t.
The convolution has many properties that make it behave like a product. Let c be a constant and
f , g, and h be functions then
f ∗ g = g ∗ f,
(c f ) ∗ g = f ∗ (cg) = c( f ∗ g),
( f ∗ g) ∗ h = f ∗ (g ∗ h).
The most interesting property for us, and the main result of this section is the following theorem.
Theorem 6.3.1. Let f (t) and g(t) be of exponential type, then
(Z t )
L {( f ∗ g)(t)} = L f (τ)g(t − τ) dτ = L{ f (t)}L{g(t)}.
0
In other words, the Laplace transform of a convolution is the product of the Laplace transforms.
The simplest way to use this result is in reverse.
Example 6.3.3: Suppose we have the function of s defined by
1 1 1
= .
(s + 1)s2 s + 1 s2
We recognize the two entries of Table 6.2. That is
( ) ( )
1 1
L −1
= e−t and L −1
= t.
s+1 s2
Therefore, ( ) Z t
1 1
L −1
= τe−(t−τ) dτ = e−t + t − 1.
s + 1 s2 0
The calculation of the integral involved an integration by parts.
We first apply the Laplace transform to the equation. Denote the transform of x(t) by X(s) and
the transform of f (t) by F(s) as usual.
or in other words
1
X(s) = F(s) .
s2 + ω20
We know ( )
1 sin(ω0 t)
L −1
= .
s2 + ω0
2 ω0
Therefore,
t
sin ω0 (t − τ)
Z
x(t) = f (τ) dτ,
0 ω0
or if we reverse the order t
sin(ω0 τ)
Z
x(t) = f (t − τ) dτ.
0 ω0
Let us notice one more feature of this example. We can now see how Laplace transform handles
resonance. Suppose that f (t) = cos(ω0 t). Then
sin(ω0 τ)
Z t Z t
1
x(t) = cos ω0 (t − τ) dτ = sin(ω0 τ) cos ω0 (t − τ) dτ.
0 ω0 ω0 0
We have computed the convolution of sine and cosine in Example 6.3.2. Hence
! !
1 1 1
x(t) = t sin(ω0 t) = t sin(ω0 t).
ω0 2 2ω0
Note the t in front of the sine. The solution, therefore, grows without bound as t gets large, meaning
we get resonance.
Similarly, we can solve any constant coefficient equation with an arbitrary forcing function f (t)
as a definite integral using convolution. A definite integral, rather than a closed form solution, is
usually enough for most practical purposes. It is not hard to numerically evaluate a definite integral.
where f (t) and g(t) are known functions and x(t) is an unknown we wish to solve for. To find x(t),
we apply the Laplace transform to the equation to obtain
where X(s), F(s), and G(s) are the Laplace transforms of x(t), f (t), and g(t) respectively. We find
F(s)
X(s) = .
1 − G(s)
To find x(t) we now need to find the inverse Laplace transform of X(s).
Example 6.3.5: Solve Z t
x(t) = e + −t
sinh(t − τ)x(τ) dτ.
0
We apply Laplace transform to obtain
1 1
X(s) = + 2 X(s),
s+1 s −1
or
1
s−1 s 1
X(s) = s+1
1
= 2
= 2 − 2 .
1− s2 −1
s −2 s −2 s −2
It is not hard to apply Table 6.1 on page 269 to find
√ 1 √
x(t) = cosh( 2 t) − √ sinh( 2 t).
2
6.3.4 Exercises
Exercise 6.3.1: Let f (t) = t2 for t ≥ 0, and g(t) = u(t − 1). Compute f ∗ g.
Exercise 6.3.2: Let f (t) = t for t ≥ 0, and g(t) = sin t for t ≥ 0. Compute f ∗ g.
Exercise 6.3.3: Find the solution to
for an arbitrary function f (t), where m > 0, c > 0, k > 0, and c2 − 4km > 0 (system is overdamped).
Write the solution as a definite integral.
Exercise 6.3.4: Find the solution to
for an arbitrary function f (t), where m > 0, c > 0, k > 0, and c2 − 4km < 0 (system is underdamped).
Write the solution as a definite integral.
286 CHAPTER 6. THE LAPLACE TRANSFORM
for an arbitrary function f (t), where m > 0, c > 0, k > 0, and c2 = 4km (system is critically
damped). Write the solution as a definite integral.
Exercise 6.3.9: Write down the solution to x00 − 2x = e−t , x(0) = 0, x0 (0) = 0 as a definite integral.
2
2
Hint: Do not try to compute the Laplace transform of e−t .
Exercise 6.3.101: Let f (t) = cos t for t ≥ 0, and g(t) = e−t . Compute f ∗ g.
n o
5
Exercise 6.3.102: Compute L−1 s4 +s 2 using convolution.
Exercise 6.3.104: Solve x000 + x0 = f (t), x(0) = 0, x0 (0) = 0, x00 (0) = 0 using convolution. Write
the result as a definite integral.
6.4. DIRAC DELTA AND IMPULSE RESPONSE 287
2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
0.0 0.0
That is, to have the pulse have “unit mass.” For such a pulse we compute
1 − e−bs
( )
u(t) − u(t − b)
L {ϕ(t)} = L = .
b bs
We generally want b to be very small. That is, we wish to have the pulse be very short and very tall.
By letting b go to zero we arrive at the concept of the Dirac delta function.
The formula should hold if we integrate over any interval that contains 0, not just (−∞, ∞). So δ(t)
is a “function” with all its “mass” at the single point t = 0. In other words, for any interval [c, d]
Z d
1 if the interval [c, d] contains 0, i.e. c ≤ 0 ≤ d,
δ(t) dt =
c 0 otherwise.
Unfortunately there is no such function in the classical sense. You could informally think that δ(t)
is zero for t , 0 and somehow infinite at t = 0.
A good way to think about δ(t) is as a limit of short pulses whose integral is 1. For example,
suppose that we have a square pulse ϕ(t) as above with a = 0, M = 1/b, that is ϕ(t) = u(t)−u(t−b)
b
.
Compute
Z ∞ Z ∞
1 b
Z
u(t) − u(t − b)
ϕ(t) f (t) dt = f (t) dt = f (t) dt.
−∞ −∞ b b 0
If f (t) is continuous at t = 0, then for very small b, the function f (t) is approximately equal to f (0)
on the interval [0, b]. We approximate the integral
Z b Z b
1 1
f (t) dt ≈ f (0) dt = f (0).
b 0 b 0
Hence,
Z ∞ Z b
1
lim ϕ(t) f (t) dt = lim f (t) dt = f (0).
b→0 −∞ b→0 b 0
∗
Named after the English physicist and mathematician Paul Adrien Maurice Dirac (1902–1984).
6.4. DIRAC DELTA AND IMPULSE RESPONSE 289
Let us therefore accept δ(t) as an object that is possible to integrate. We often want to shift δ to
another point, for example δ(t − a). In that case we have
Z ∞
δ(t − a) f (t) dt = f (a).
−∞
Note that δ(a − t) is the same object as δ(t − a). In other words, the convolution of δ(t) with f (t) is
again f (t), Z t
( f ∗ δ)(t) = δ(t − s) f (s) ds = f (t).
0
As we can integrate δ(t), let us compute its Laplace transform.
Z ∞
L {δ(t − a)} = e−st δ(t − a) dt = e−as .
0
In particular,
L {δ(t)} = 1.
Remark 6.4.1: Notice that the Laplace transform of δ(t − a) looks like the Laplace transform of
the derivative of the Heaviside function u(t − a), if we could differentiate the Heaviside function.
First notice
e−as
L u(t − a) = .
s
To obtain what the Laplace transform of the derivative would be we multiply by s, to obtain e−as ,
which is the Laplace transform of δ(t − a). We see the same thing using integration,
Z t
δ(s − a) ds = u(t − a).
0
So in a certain sense
dh i
“ u(t − a) = δ(t − a). ”
dt
This line of reasoning allows us to talk about derivatives of functions with jump discontinuities. We
can think of the derivative of the Heaviside function u(t − a) as being somehow infinite at a, which
is precisely our intuitive understanding of the delta function.
n o
Example 6.4.1: Let us compute L−1 s+1 s
. So far we have always looked at proper rational func-
tions in the s variable. That is, the numerator was always of lower degree than the denominator.
Not so with s+1s
. We write,
−1 s + 1
( ) ( ) ( )
1 −1 1
L =L −1
1+ = L {1} + L
−1
= δ(t) + 1.
s s s
The resulting object is a generalized function and only makes sense when put underneath an
integral.
290 CHAPTER 6. THE LAPLACE TRANSFORM
We simply differentiate twice under the integral∗ , the details are left as an exercise. If we convolve
the entire equation (6.3), the left hand side becomes
(x00 + ω20 x) ∗ f = (x00 ∗ f ) + ω20 (x ∗ f ) = (x ∗ f )00 + ω20 (x ∗ f ).
The right hand side becomes
(δ ∗ f )(t) = f (t).
Therefore y(t) = (x ∗ f )(t) is the solution to
y00 + ω20 y = f (t).
This procedure works in general for other linear equations Lx = f (t). If you determine the impulse
response, you also know how to obtain the output x(t) for any input f (t) by simply convolving the
impulse response and the input f (t).
∗
You should really think of the integral going over (−∞, ∞) rather than over [0, t] and simply assume that f (t) and
x(t) are continuous and zero for negative t.
6.4. DIRAC DELTA AND IMPULSE RESPONSE 291
d4 y
EI = F(x),
dx4
where E and I are constants† and F(x) is the force applied per unit length at position x. The situation
we are interested in is when the force is applied at a single point as in Figure 6.4.
y Fδ(x − a)
x
d4 y
EI = −Fδ(x − a),
dx4
where x = a is the point where the mass is applied. F is the force applied and the minus sign
indicates that the force is downward, that is, in the negative y direction. The end points of the beam
satisfy the conditions,
See § 5.2 for further information about endpoint conditions applied to beams.
Example 6.4.3: Suppose that length of the beam is 2, and suppose that EI = 1 for simplicity.
Further suppose that the force F = 1 is applied at x = 1. That is, we have the equation
d4 y
= −δ(x − 1),
dx4
∗
Named for the Swiss mathematicians Jacob Bernoulli (1654–1705), Daniel Bernoulli —nephew of Jacob—
(1700–1782), and Leonhard Paul Euler (1707–1783).
†
E is the elastic modulus and I is the second moment of area. Let us not worry about the details and simply think
of these as some given constants.
292 CHAPTER 6. THE LAPLACE TRANSFORM
We could integrate, but using the Laplace transform is even easier. We apply the transform in
the x variable rather than the t variable. Let us again denote the transform of y(x) as Y(s).
We notice that y(0) = 0 and y00 (0) = 0. Let us call C1 = y0 (0) and C2 = y000 (0). We solve for Y(s),
−e−s C1 C2
Y(s) = + 2 + 4.
s4 s s
We take the inverse Laplace transform utilizing the second shifting property (6.1) to take the inverse
of the first term.
−(x − 1)3 C2 3
y(x) = u(x − 1) + C1 x + x.
6 6
We still need to apply two of the endpoint conditions. As the conditions are at x = 2 we can simply
replace u(x − 1) = 1 when taking the derivatives. Therefore,
−(2 − 1)3 C2 −1 4
0 = y(2) = + C1 (2) + 23 = + 2C1 + C2 ,
6 6 6 3
and
−3 · 2 · (2 − 1) C2
0 = y00 (2) = + 3 · 2 · 2 = −1 + 2C2 .
6 6
Hence C2 = 2 and solving for C1 using the first equation we obtain C1 = −1
1
4
. Our solution for the
beam deflection is
−(x − 1)3 x x3
y(x) = u(x − 1) − + .
6 4 12
6.4.5 Exercises
Exercise 6.4.1: Solve (find the impulse response) x00 + x0 + x = δ(t), x(0) = 0, x0 (0) = 0.
Exercise 6.4.2: Solve (find the impulse response) x00 + 2x0 + x = δ(t), x(0) = 0, x0 (0) = 0.
Exercise 6.4.3: A pulse can come later and can be bigger. Solve x00 + 4x = 4δ(t − 1), x(0) = 0,
x0 (0) = 0.
Exercise 6.4.4: Suppose that f (t) and g(t) are differentiable functions and suppose that f (t) =
g(t) = 0 for all t ≤ 0. Show that
Exercise 6.4.5: Suppose that Lx = δ(t), x(0) = 0, x0 (0) = 0, has the solution x = e−t for t > 0. Find
the solution to Lx = t2 , x(0) = 0, x0 (0) = 0 for t > 0.
Exercise 6.4.7 (challenging): Solve Example 6.4.3 via integrating 4 times in the x variable.
Exercise 6.4.8: Suppose we have a beam of length 1 simply supported at the ends and suppose that
force F = 1 is applied at x = 34 in the downward direction. Suppose that EI = 1 for simplicity. Find
the beam deflection y(x).
Exercise 6.4.101: Solve (find the impulse response) x00 = δ(t), x(0) = 0, x0 (0) = 0.
Exercise 6.4.102: Solve (find the impulse response) x0 + ax = δ(t), x(0) = 0, x0 (0) = 0.
Exercise 6.4.103: Suppose that Lx = δ(t), x(0) = 0, x0 (0) = 0, has the solution x(t) = cos(t) for
t > 0. Find (in closed form) the solution to Lx = sin(t), x(0) = 0, x0 (0) = 0 for t > 0.
n 2 o
Exercise 6.4.104: Compute L−1 s2s+1 .
If we assume that a solution of a differential equation is written as a power series, then perhaps we
can use a method reminiscent of undetermined coefficients. That is, we will try to solve for the
numbers ak . Before we can carry out this process, let us review some results and concepts about
power series.
7.1.1 Definition
As we said, a power series is an expression such as
∞
X
ak (x − x0 )k = a0 + a1 (x − x0 ) + a2 (x − x0 )2 + a3 (x − x0 )3 + · · · , (7.1)
k=0
295
296 CHAPTER 7. POWER SERIES METHODS
exists, then we say that the series (7.1) converges at x. Note that for x = x0 , the series always
converges to a0 . When (7.1) converges at any other point x , x0 , we say that (7.1) is a convergent
power series. In this case we write
∞
X n
X
ak (x − x0 ) = lim
k
ak (x − x0 )k .
n→∞
k=0 k=0
If the series does not converge for any point x , x0 , we say that the series is divergent.
Example 7.1.1: The series
∞
X 1 k x2 x3
x =1+x+ + + ···
k=0
k! 2 6
is convergent for any x. Recall that k! = 1 · 2 · 3 · · · k is the factorial. By convention we define 0! = 1.
In fact, you may recall that this series converges to e x .
We say that (7.1) converges absolutely at x whenever the limit
n
X
lim |ak | |x − x0 |k
n→∞
k=0
Theorem 7.1.1. For a power series (7.1), there exists a number ρ (we allow ρ = ∞) called the
radius of convergence such that the series converges absolutely on the interval (x0 − ρ, x0 + ρ) and
diverges for x < x0 − ρ and x > x0 + ρ. We write ρ = ∞ if the series converges for all x.
7.1. POWER SERIES 297
x0 − ρ x0 x0 + ρ
Figure 7.1: Convergence of a power series.
See Figure 7.1. In Example 7.1.1 the radius of convergence is ρ = ∞ as the series converges
everywhere. In Example 7.1.2 the radius of convergence is ρ = 1. We note that ρ = 0 is another
way of saying that the series is divergent.
A useful test for convergence of a series is the ratio test. Suppose that
∞
X
ck
k=0
exists. Then the series converges absolutely if L < 1 and diverges if L > 1.
Let us apply this test to the series (7.1). That is we let ck = ak (x − x0 )k in the test. Compute
ak+1 (x − x0 )k+1
ck+1 ak+1
L = lim = lim = n→∞
lim |x − x0 |.
n→∞ ck n→∞ a (x − x )k ak
k 0
Define A by
ak+1
A = lim .
n→∞ ak
Then if 1 > L = A|x − x0 | the series (7.1) converges absolutely. If A = 0, then the series always
converges. If A > 0, then the series converges absolutely if |x − x0 | < 1/A, and diverges if |x − x0 | > 1/A.
That is, the radius of convergence is 1/A. Let us summarize.
Theorem 7.1.2. Let ∞
X
ak (x − x0 )k
k=0
exists. If A = 0, then the radius of convergence of the series is ∞. Otherwise the radius of
convergence is 1/A.
298 CHAPTER 7. POWER SERIES METHODS
where f (k) (x0 ) denotes the kth derivative of f (x) at the point x0 .
-10 -5 0 5 10
3 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-10 -5 0 5 10
Figure 7.2: The sine function and its Taylor approximations around x0 = 0 of 5th and 9th degree.
∗
Named after the English mathematician Sir Brook Taylor (1685–1731).
7.1. POWER SERIES 299
For example, sine is an analytic function and its Taylor series around x0 = 0 is given by
∞
X (−1)n 2n+1
sin(x) = x .
n=0
(2n + 1)!
In Figure 7.2 on the facing page we plot sin(x) and the truncations of the series up to degree 5 and 9.
You can see that the approximation is very good for x near 0, but gets worse for x further away from
0. This is what happens in general. To get a good approximation far away from x0 you need to take
more and more terms of the Taylor series.
Notice that the term corresponding to k = 0 disappeared as it was constant. The radius of conver-
gence of the differentiated series is the same as that of the original.
Example 7.1.4: Let us show that the exponential y = e x solves y0 = y. First write
∞
X 1 k
y = ex = x.
k=0
k!
Now differentiate ∞ ∞
X 1 X 1
y0 = k xk−1 = xk−1 .
k=1
k! k=1
(k − 1)!
We reindex the series by simply replacing k with k + 1. The series does not change, what changes is
simply how we write it. After reindexing the series starts at k = 0 again.
∞ ∞ ∞
X 1 X 1 X 1 k
x =
k−1
x (k+1)−1
= x.
k=1
(k − 1)! k+1=1
(k + 1) − 1 ! k=0
k!
That was precisely the power series for e x that we started with, so we showed that d
dx
[e x ] = ex .
Convergent power series can be added and multiplied together, and multiplied by constants
using the following rules. First, we can add series by adding term by term,
∞ ∞ ∞
X X X
ak (x − x0 )k + bk (x − x0 )k = (ak + bk )(x − x0 )k .
k=0 k=0 k=0
300 CHAPTER 7. POWER SERIES METHODS
This series is called the geometric series. The ratio test tells us that the radius of convergence is 1.
1
The series diverges for x ≤ −1 and x ≥ 1, even though 1−x is defined for all x , 1.
We can use the geometric series together with rules for addition and multiplication of power
series to expand rational functions around a point, as long as the denominator is not zero at x0 . Note
that as for polynomials, we could equivalently use the Taylor series expansion (7.2).
Example 7.1.5: Expand x
1+2x+x2
as a power series around the origin (x0 = 0) and find the radius of
convergence.
7.1. POWER SERIES 301
2
First, write 1 + 2x + x2 = (1 + x)2 = 1 − (−x) . Now we compute
!2
x 1
=x
1 + 2x + x2 1 − (−x)
∞ 2
X
= x (−1) x
k k
k=0∞
X
= x ck xk
k=0
∞
X
= ck xk+1 ,
k=0
where using the formula for the product of series we obtain, c0 = 1, c1 = −1 − 1 = −2, c2 =
1 + 1 + 1 = 3, etc. . . . Therefore
∞
x X
= (−1)k+1 kxk = x − 2x2 + 3x3 − 4x4 + · · ·
1 + 2x + x2 k=1
(−1)k+2 (k + 1) k+1
ak+1
lim = lim k+1
= lim = 1.
k→∞ ak k
k→∞ (−1) k k→∞
7.1.6 Exercises
∞
X
Exercise 7.1.1: Is the power series ek xk convergent? If so, what is the radius of convergence?
k=0
∞
X
Exercise 7.1.2: Is the power series kxk convergent? If so, what is the radius of convergence?
k=0
∞
X
Exercise 7.1.3: Is the power series k!xk convergent? If so, what is the radius of convergence?
k=0
302 CHAPTER 7. POWER SERIES METHODS
∞
X 1
Exercise 7.1.4: Is the power series (x − 10)k convergent? If so, what is the radius of
k=0
(2k)!
convergence?
Exercise 7.1.5: Determine the Taylor series for sin x around the point x0 = π.
Exercise 7.1.6: Determine the Taylor series for ln x around the point x0 = 1, and find the radius of
convergence.
1
Exercise 7.1.7: Determine the Taylor series and its radius of convergence of around x0 = 0.
1+x
x
Exercise 7.1.8: Determine the Taylor series and its radius of convergence of around x0 = 0.
4 − x2
Hint: You will not be able to use the ratio test.
Exercise 7.1.11: Suppose that f is an analytic function such that f (n) (0) = n. Find f (1).
∞
X
Exercise 7.1.101: Is the power series (0.1)n xn convergent? If so, what is the radius of conver-
n=1
gence?
∞
X n!
Exercise 7.1.102 (challenging): Is the power series xn convergent? If so, what is the radius
n=1
nn
of convergence?
Exercise 7.1.105 (challenging): Imagine f and g are analytic functions such that f (k) (0) = g(k) (0)
for all large enough k. What can you say about f (x) − g(x)?
7.2. SERIES SOLUTIONS OF LINEAR SECOND ORDER ODES 303
and solve for the ak to try to obtain a solution defined in some interval around x0 .
The point x0 is called an ordinary point if p(x0 ) , 0. That is, the functions
q(x) r(x)
and
p(x) p(x)
are defined for x near x0 . If p(x0 ) = 0, then we say x0 is a singular point. Handling singular points
is harder than ordinary points and so we now focus only on ordinary points.
Example 7.2.1: Let us start with a very simple example
y00 − y = 0.
Let us try a power series solution near x0 = 0, which is an ordinary point. Every point is an ordinary
point in fact, as the equation is constant coefficient. We already know we should obtain exponentials
or the hyperbolic sine and cosine, but let us pretend we do not know this.
We try
X∞
y= ak xk .
k=0
If we differentiate, the k = 0 term is a constant and hence disappears. We therefore get
∞
X
y =
0
kak xk−1 .
k=1
k=0 k=0
∞
X
= (k + 2) (k + 1) ak+2 xk − ak xk
k=0
∞
X
= (k + 2) (k + 1) ak+2 − ak xk .
k=0
As y00 − y is supposed to be equal to 0, we know that the coefficients of the resulting series must be
equal to 0. Therefore,
ak
(k + 2) (k + 1) ak+2 − ak = 0, or ak+2 = .
(k + 2)(k + 1)
The above equation is called a recurrence relation for the coefficients of the power series. It did
not matter what a0 or a1 was. They can be arbitrary. But once we pick a0 and a1 , then all other
coefficients are determined by the recurrence relation.
Let us see what the coefficients must be. First, a0 and a1 are arbitrary
a0 a1 a2 a0 a3 a1
a2 = , a3 = , a4 = = , a5 = = , ...
2 (3)(2) (4)(3) (4)(3)(2) (5)(4) (5)(4)(3)(2)
So we note that for even k, that is k = 2n we get
a0
ak = a2n = ,
(2n)!
and for odd k, that is k = 2n + 1 we have
a1
ak = a2n+1 = .
(2n + 1)!
Let us write down the series
∞ ∞ ! ∞ ∞
X X a0 2n a1 X 1 X 1
y= ak x =
k
x + x 2n+1
= a0 x + a1
2n
x2n+1 .
k=0 n=0
(2n)! (2n + 1)! n=0
(2n)! n=0
(2n + 1)!
We recognize the two series as the hyperbolic sine and cosine. Therefore,
y = a0 cosh x + a1 sinh x.
Of course, in general we will not be able to recognize the series that appears, since usually there
will not be any elementary function that matches it. In that case we will be content with the series.
7.2. SERIES SOLUTIONS OF LINEAR SECOND ORDER ODES 305
Example 7.2.2: Let us do a more complex example. Suppose we wish to solve Airy’s equation∗ ,
that is
y00 − xy = 0,
near the point x0 = 0. Note that x0 = 0 is an ordinary point.
We try
X∞
y= ak xk .
k=0
We differentiate twice (as above) to obtain
∞
X
y = 00
k (k − 1) ak xk−2 .
k=2
k=2 k=0
X∞ ! ∞
X !
= k (k − 1) ak x k−2
− ak x k+1
.
k=2 k=0
k=1 k=1
∞
X
= 2a2 + (k + 2) (k + 1) ak+2 − ak−1 xk .
k=1
ak−1
(k + 2) (k + 1) ak+2 − ak−1 = 0, or ak+2 = .
(k + 2)(k + 1)
Now we jump in steps of three. First we notice that since a2 = 0 we must have that, a5 = 0, a8 = 0,
a11 = 0, etc. . . . In general a3n+2 = 0.
The constants a0 and a1 are arbitrary and we obtain
a0 a1 a3 a0 a4 a1
a3 = , a4 = , a6 = = , a7 = = , ...
(3)(2) (4)(3) (6)(5) (6)(5)(3)(2) (7)(6) (7)(6)(4)(3)
For ak where k is a multiple of 3, that is k = 3n we notice that
a0
a3n = .
(2)(3)(5)(6) · · · (3n − 1)(3n)
∗
Named after the English mathematician Sir George Biddell Airy (1801–1892).
306 CHAPTER 7. POWER SERIES METHODS
5.0 5.0
2.5 2.5
0.0 0.0
-2.5 -2.5
-5.0 -5.0
-5.0 -2.5 0.0 2.5 5.0
The functions y1 and y2 cannot be written in terms of the elementary functions that you know.
See Figure 7.3 for the plot of the solutions y1 and y2 . These functions have many interesting
7.2. SERIES SOLUTIONS OF LINEAR SECOND ORDER ODES 307
properties. For example, they are oscillatory for negative x (like solutions to y00 + y = 0) and for
positive x they grow without bound (like solutions to y00 − y = 0).
Sometimes a solution may turn out to be a polynomial.
Example 7.2.3: Let us find a solution to the so-called Hermite’s equation of order n∗ is the equation
(2k − 2n)
(k + 2) (k + 1) ak+2 + (−2k + 2n)ak = 0, or ak+2 = ak .
(k + 2)(k + 1)
∗
Named after the French mathematician Charles Hermite (1822–1901).
308 CHAPTER 7. POWER SERIES METHODS
This recurrence relation actually includes a2 = −na0 (which comes about from 2a2 + 2na0 = 0).
Again a0 and a1 are arbitrary.
−2n 2(1 − n)
a2 = a0 , a3 = a1 ,
(2)(1) (3)(2)
2(2 − n) 22 (2 − n)(−n)
a4 = a2 = a0 ,
(4)(3) (4)(3)(2)(1)
2(3 − n) 22 (3 − n)(1 − n)
a5 = a3 = a1 , ...
(5)(4) (5)(4)(3)(2)
Let us separate the even and odd coefficients. We find that
2m (−n)(2 − n) · · · (2m − 2 − n)
a2m = ,
(2m)!
2m (1 − n)(3 − n) · · · (2m − 1 − n)
a2m+1 = .
(2m + 1)!
Let us write down the two series, one with the even powers and one with the odd.
2(−4) 2 22 (−4)(2 − 4) 4 4
y1 (x) = 1 + x + x = 1 − 4x2 + x4 .
2! 4! 3
7.2.1 Exercises
In the following exercises, when asked to solve an equation using power series methods, you should
find the first few terms of the series, and if possible find a general formula for the kth coefficient.
Exercise 7.2.1: Use power series methods to solve y00 + y = 0 at the point x0 = 1.
Exercise 7.2.2: Use power series methods to solve y00 + 4xy = 0 at the point x0 = 0.
Exercise 7.2.3: Use power series methods to solve y00 − xy = 0 at the point x0 = 1.
7.2. SERIES SOLUTIONS OF LINEAR SECOND ORDER ODES 309
Exercise 7.2.4: Use power series methods to solve y00 + x2 y = 0 at the point x0 = 0.
Exercise 7.2.5: The methods work for other orders than second order. Try the methods of this
section to solve the first order system y0 − xy = 0 at the point x0 = 0.
Exercise 7.2.6 (Chebyshev’s equation of order p): a) Solve (1 − x2 )y00 − xy0 + p2 y = 0 using power
series methods at x0 = 0. b) For what p is there a polynomial solution?
Exercise 7.2.7: Find a polynomial solution to (x2 + 1)y00 − 2xy0 + 2y = 0 using power series methods.
Exercise 7.2.8: a) Use power series methods to solve (1 − x)y00 + y = 0 at the point x0 = 0. b) Use
the solution to part a) to find a solution for xy00 + y = 0 around the point x0 = 1.
Exercise 7.2.101: Use power series methods to solve y00 + 2x3 y = 0 at the point x0 = 0.
Exercise 7.2.102 (challenging): We can also use power series methods in nonhomogeneous equa-
tions. a) Use power series methods to solve y00 − xy = 1−x 1
at the point x0 = 0. Hint: Recall the
geometric series. b) Now solve for the initial condition y(0) = 0, y0 (0) = 0.
Exercise 7.2.103: Attempt to solve x2 y00 − y = 0 at x0 = 0 using the power series method of this
section (x0 is a singular point). Can you find at least one solution? Can you find more than one
solution?
310 CHAPTER 7. POWER SERIES METHODS
7.3.1 Examples
Example 7.3.1: Let us first look at a simple first order equation
2xy0 − y = 0.
we obtain
∞
X ! ∞
X !
0 = 2xy − y = 2x
0
kak x k−1
− ak x k
k=1 k=0
X∞
= a0 + (2kak − ak ) xk .
k=1
First, a0 = 0. Next, the only way to solve 0 = 2kak − ak = (2k − 1) ak for k = 1, 2, 3, . . . is for ak = 0
for all k. Therefore we only get the trivial solution y = 0. We need a nonzero solution to get the
general solution.
Let us try y = xr for some real number r. Consequently our solution—if we can find one—may
only make sense for positive x. Then y0 = rxr−1 . So
Therefore r = 1/2, or in other words y = x1/2 . Multiplying by a constant, the general solution for
positive x is
y = Cx1/2 .
If C , 0 then the derivative of the solution “blows up” at x = 0 (the singular point). There is only
one solution that is differentiable at x = 0 and that’s the trivial solution y = 0.
7.3. SINGULAR POINTS AND THE METHOD OF FROBENIUS 311
Not every problem with a singular point has a solution of the form y = xr , of course. But perhaps
we can combine the methods. What we will do is to try a solution of the form
y = xr f (x)
where f (x) is an analytic function.
Example 7.3.2: Suppose that we have the equation
4x2 y00 − 4x2 y0 + (1 − 2x)y = 0,
and again note that x = 0 is a singular point.
Let us try
∞
X ∞
X
y=x r
ak x =
k
ak xk+r ,
k=0 k=0
where r is a real number, not necessarily an integer. Again if such a solution exists, it may only
exist for positive x. First let us find the derivatives
∞
X
y =
0
(k + r) ak xk+r−1 ,
k=0
∞
X
y00 = (k + r) (k + r − 1) ak xk+r−2 .
k=0
4r(r − 1) + 1 = 0.
312 CHAPTER 7. POWER SERIES METHODS
This equation is called the indicial equation. This particular indicial equation has a double root at
r = 1/2.
OK, so we know what r has to be. That knowledge we obtained simply by looking at the
coefficient of xr . All other coefficients of xk+r also have to be zero so
4(k + r) (k + r − 1) + 1 ak − 4(k + r − 1) + 2 ak−1 = 0.
r(x) (π + x2 )
lim x2 = lim x2 2
= lim (π + x2 ) = π.
x→0 p(x) x→0 x x→0
We plug this y into equation (7.3). We collect terms and write everything as a single series.
(ii) The obtained series must be zero. Setting the first coefficient (usually the coefficient of xr ) in
the series to zero we obtain the indicial equation, which is a quadratic polynomial in r.
(iii) If the indicial equation has two real roots r1 and r2 such that r1 − r2 is not an integer, then we
have two linearly independent Frobenius-type solutions. Using the first root, we plug in
∞
X
y1 = x r1
ak x k ,
k=0
and we solve for all ak to obtain the first solution. Then using the second root, we plug in
∞
X
y2 = x r2
bk x k ,
k=0
where we plug y2 into (7.3) and solve for the constants bk and C.
7.3. SINGULAR POINTS AND THE METHOD OF FROBENIUS 315
(vi) Finally, if the indicial equation has complex roots, then solving for ak in the solution
∞
X
y = xr1 ak x k
k=0
results in a complex-valued function—all the ak are complex numbers. We obtain our two
linearly independent solutions∗ by taking the real and imaginary parts of y.
The main idea is to find at least one Frobenius-type solution. If we are lucky and find two, we
are done. If we only get one, we either use the ideas above or even a different method such as
reduction of order (Exercise 2.1.8 on page 66) to obtain a second solution.
We allow p to be any number, not just an integer, although integers and multiples of 1/2 are most
important in applications.
When we plug
X∞
y= ak xk+r
k=0
r(r − 1) + r − p2 = (r − p)(r + p) = 0.
Therefore we obtain two roots r1 = p and r2 = −p. If p is not an integer following the method of
Frobenius and setting a0 = 1, we obtain linearly independent solutions of the form
∞
X (−1)k x2k
y1 = x p
2k k!(k + p)(k − 1 + p) · · · (2 + p)(1 + p)
,
k=0
2
∞
X (−1)k x2k
y2 = x−p .
k=0
22k k!(k − p)(k − 1 − p) · · · (2 − p)(1 − p)
∗
See Joseph L. Neuringera, The Frobenius method for complex roots of the indicial equation, International Journal
of Mathematical Education in Science and Technology, Volume 9, Issue 1, 1978, 71–77.
†
Named after the German astronomer and mathematician Friedrich Wilhelm Bessel (1784–1846).
316 CHAPTER 7. POWER SERIES METHODS
Exercise 7.3.1: a) Verify that the indicial equation of Bessel’s equation of order p is (r−p)(r+p) = 0.
b) Suppose that p is not an integer. Carry out the computation to obtain the solutions y1 and y2
above.
Bessel functions will be convenient constant multiples of y1 and y2 . First we must define the
gamma function Z ∞
Γ(x) = t x−1 e−t dt.
0
Notice that Γ(1) = 1. The gamma function also has a wonderful property
Γ(x + 1) = xΓ(x).
From this property, one can show that Γ(n) = (n − 1)! when n is an integer, so the gamma function
is a continuous version of the factorial. We compute:
As these are constant multiples of the solutions we found above, these are both solutions to Bessel’s
equation of order p. The constants are picked for convenience.
When p is not an integer, J p and J−p are linearly independent. When n is an integer we obtain
∞
X (−1)k x 2k+n
Jn (x) = .
k=0
k!(k + n)! 2
As each linear combination of J p (x) and J−p (x) is a solution to Bessel’s equation of order p, then as
we take the limit as p goes to n, Yn (x) is a solution to Bessel’s equation of order n. It also turns out
that Yn (x) and Jn (x) are linearly independent. Therefore when n is an integer, we have the general
solution to Bessel’s equation of order n
y = AJn (x) + BYn (x),
for arbitrary constants A and B. Note that Yn (x) goes to negative infinity at x = 0. Many mathematical
software packages have these functions Jn (x) and Yn (x) defined, so they can be used just like say
sin(x) and cos(x). In fact, they have some similar properties. For example, −J1 (x) is a derivative of
J0 (x), and in general the derivative of Jn (x) can be written as a linear combination of Jn−1 (x) and
Jn+1 (x). Furthermore, these functions oscillate, although they are not periodic. See Figure 7.4 for
graphs of Bessel functions.
0.0 2.5 5.0 7.5 10.0 0.0 2.5 5.0 7.5 10.0
1.0 1.0
1.00 1.00
0.5 0.5
0.75 0.75
0.0 0.0
0.50 0.50
-0.5 -0.5
0.25 0.25
-1.0 -1.0
0.00 0.00
-1.5 -1.5
-0.25 -0.25
-2.0 -2.0
0.0 2.5 5.0 7.5 10.0 0.0 2.5 5.0 7.5 10.0
Figure 7.4: Plot of the J0 (x) and J1 (x) in the first graph and Y0 (x) and Y1 (x) in the second graph.
Example 7.3.4: Other equations can sometimes be solved in terms of the Bessel functions. For
example, given a positive constant λ,
xy00 + y0 + λ2 xy = 0,
can be changed to x2 y00 + xy0 + λ2 x2 y = 0. Then changing variables t = λx we obtain via chain rule
the equation in y and t:
t2 y00 + ty0 + t2 y = 0,
which can be recognized as Bessel’s equation of order 0. Therefore the general solution is y(t) =
AJ0 (t) + BY0 (t), or in terms of x:
y = AJ0 (λx) + BY0 (λx).
This equation comes up for example when finding fundamental modes of vibration of a circular
drum, but we digress.
318 CHAPTER 7. POWER SERIES METHODS
7.3.4 Exercises
Exercise 7.3.3: Find a particular (Frobenius-type) solution of x2 y00 + xy0 + (1 + x)y = 0.
Exercise 7.3.8: In the following equations classify the point x = 0 as ordinary, regular singular, or
singular but not regular singular.
a) x2 (1 + x2 )y00 + xy = 0
b) x2 y00 + y0 + y = 0
c) xy00 + x3 y0 + y = 0
d) xy00 + xy0 − e x y = 0
e) x2 y00 + x2 y0 + x2 y = 0
Exercise 7.3.101: In the following equations classify the point x = 0 as ordinary, regular singular,
or singular but not regular singular.
a) y00 + y = 0
b) x3 y00 + (1 + x)y = 0
c) xy00 + x5 y0 + y = 0
d) sin(x)y00 − y = 0
e) cos(x)y00 − sin(x)y = 0
Nonlinear systems
319
320 CHAPTER 8. NONLINEAR SYSTEMS
where f (x, y) and g(x, y) are functions of two variables, and the derivatives are taken with respect to
time t. Solutions are functions x(t) and y(t) such that
The way we will analyze the system is very similar to § 1.6, where we studied a single autonomous
equation. The ideas in two dimensions are the same, but the behavior can be far more complicated.
It may be best to think of the system of equations as the single vector equation
" #0 " #
x f (x, y)
= . (8.1)
y g(x, y)
As in § 3.1 we draw the phase portrait (or phase diagram), where each point (x, y) corresponds to ai
h f (x,y)
specific state of the system. We draw the vector field given at each point (x, y) by the vector g(x,y) .
And as before if we find solutions, we draw the trajectories by plotting all points x(t), y(t) for a
certain range of t.
Example 8.1.1: Consider the second order equation x00 = −x + x2 . Write this equation as a first
order nonlinear system
x0 = y, y0 = −x + x2 .
The phase portrait with some trajectories is drawn in Figure 8.1.
-2 -1 0 1 2
2 2
1 1
0 0
-1 -1
-2 -2
-2 -1 0 1 2
From the phase portrait it should be clear that even this simple system has fairly complicated
behavior. Some trajectories keep oscillating around the origin, and some go off towards infinity. We
will return to this example often, and analyze it completely in this (and the next) section.
Let us concentrate on those points in the phase diagram above where the trajectories seem to
start, end, or go around. We see two such points: (0, 0) and (1, 0). The trajectories seem to go
around the point (0, 0), and they seem to either go in or out of the point (1, 0). These points are
precisely those points where the derivatives of both x and y are zero. Let us define the critical points
as the points (x, y) such that " #
f (x, y)
= ~0.
g(x, y)
In other words, the points where both f (x, y) = 0 and g(x, y) = 0.
h The
f (x,y)
icritical points are where the behavior of the system is in some sense the most complicated.
If g(x,y) is zero, then nearby, the vector can point in any direction whatsoever. Also, the trajectories
are either going towards, away from, or around these points, so if we are looking for long term
behavior of the system, we should look at what happens there.
Critical points are also sometimes called equilibria, since we have so-called equilibrium solutions
at critical points. If (x0 , y0 ) is a critical point, then we have the solutions
x(t) = x0 , y(t) = y0 .
In Example 8.1.1 on the facing page, there are two equilibrium solutions:
x(t) = 0, y(t) = 0, and x(t) = 1, y(t) = 0.
Compare this discussion on equilibria to the discussion in § 1.6. The underlying concept is exactly
the same.
8.1.2 Linearization
In § 3.5 we studied the behavior of a homogeneous linear system of two equations near a critical
point. For a linear system of two variables the only critical point is generally the origin (0, 0). Let
us put the understanding we gained in that section to good use understanding what happens near
critical points of nonlinear systems.
In calculus we learned to estimate a function by taking its derivative and linearizing. We work
similarly with nonlinear systems of ODE. Suppose (x0 , y0 ) is a critical point. First change variables
to (u, v), so that (u, v) = (0, 0) corresponds to (x0 , y0 ). That is,
u = x − x0 , v = y − y0 .
Next we need to find the derivative. In multivariable calculus you may have seen that the several
variables version of the derivative is the Jacobian matrix∗ . The Jacobian matrix of the vector-valued
∗
Named for the German mathematician Carl Gustav Jacob Jacobi (1804–1851).
322 CHAPTER 8. NONLINEAR SYSTEMS
h f (x,y) i
function g(x,y) at (x0 , y0 ) is
∂f ∂f
∂x (x0 , y0 ) (x , y )
∂y 0 0
∂g ∂g .
(x , y )
∂x 0 0
(x , y )
∂y 0 0
This matrix gives the best linear approximation as u and v (and therefore x and y) vary. We define
the linearization of the equation (8.1) as the linear system
" #0 ∂ f
∂x (x0 , y0 ) ∂∂yf (x0 , y0 ) u
" #
u
= ∂g ∂g .
, ,
v ∂x
(x 0 y0 ) ∂y
(x0 y0 ) v
Example 8.1.2: Let us keep with the same equations as Example 8.1.1: x0 = y, y0 = −x + x2 . There
are two critical points, (0, 0) and (1, 0). The Jacobian matrix at any point is
∂f
∂x (x, y) ∂∂yf (x, y)
" #
= 0 1
∂g .
∂x
(x, y) ∂g
∂y
(x, y) −1 + 2x 0
Therefore at (0, 0) the linearization is
" #0 " #" #
u 0 1 u
= ,
v −1 0 v
where u = x and v = y.
At the point (1, 0), we have u = x − 1 and v = y, and the linearization is
" #0 " #" #
u 0 1 u
= .
v 1 0 v
The phase diagrams of the two linearizations at the point (0, 0) and (1, 0) are given in Figure 8.2
on the next page. Note that the variables are now u and v. Compare Figure 8.2 with Figure 8.1 on
page 320, and look especially at the behavior near the critical points.
8.1.3 Exercises
Exercise 8.1.1: Sketch the phase plane vector field for:
a) x0 = x2 , y0 = y2 ,
b) x0 = (x − y)2 , y0 = −x,
c) x0 = ey , y0 = e x .
Exercise 8.1.2: Match systems
1) x0 = x2 , y0 = y2 , 2) x0 = xy, y0 = 1 + y2 , 3) x0 = sin(πy), y0 = x,
to the vector fields below. Justify.
-2 -1 0 1 2 -2 -1 0 1 2 -2 -1 0 1 2
2 2 2 2 2 2
1 1 1 1 1 1
a) 0 0
b) 0 0
c) 0 0
-1 -1 -1 -1 -1 -1
-2 -2 -2 -2 -2 -2
-2 -1 0 1 2 -2 -1 0 1 2 -2 -1 0 1 2
8.1. LINEARIZATION, CRITICAL POINTS, AND EQUILIBRIA 323
-1.0 -0.5 0.0 0.5 1.0 -1.0 -0.5 0.0 0.5 1.0
1.0 1.0 1.0 1.0
Figure 8.2: Phase diagram with some trajectories of linearizations at the critical points (0, 0) (left) and (1, 0)
(right) of x0 = y, y0 = −x + x2 .
Exercise 8.1.3: Find the critical points and linearizations of the following systems.
a) x0 = x2 − y2 , y0 = x2 + y2 − 1,
b) x0 = −y, y0 = 3x + yx2 ,
c) x0 = x2 + y, y0 = y2 + x.
Exercise 8.1.4: For the following systems, verify they have critical point at (0, 0), and find the
linearization at (0, 0).
a) x0 = x + 2y + x2 − y2 , y0 = 2y − x2
b) x0 = −y, y0 = x − y3
c) x0 = ax + by + f (x, y), y0 = cx + dy + g(x, y), where f (0, 0) = 0, g(0, 0) = 0, and all first partial
derivatives of f and g are also zero at (0, 0), that is, ∂∂xf (0, 0) = ∂∂yf (0, 0) = ∂g
∂x
(0, 0) = ∂g
∂y
(0, 0) = 0.
Exercise 8.1.101: Find the critical points and linearizations of the following systems.
a) x0 = sin(πy) + (x − 1)2 , y0 = y2 − y,
b) x0 = x + y + y2 , y0 = x,
c) x0 = (x − 1)2 + y, y0 = x2 + y.
324 CHAPTER 8. NONLINEAR SYSTEMS
1 1 1 1 1 1
a) 0 0
b) 0 0
c) 0 0
-1 -1 -1 -1 -1 -1
-2 -2 -2 -2 -2 -2
-2 -1 0 1 2 -2 -1 0 1 2 -2 -1 0 1 2
Exercise 8.1.103: The idea of critical points and linearization works in higher dimensions as well.
You simply make the Jacobian matrix bigger by adding more functions and more variables. For the
following system of 3 equations find the critical points and their linearizations:
x 0 = x + z2 ,
y0 = z2 − y,
z0 = z + x 2 .
Table 8.1: Behavior of an almost linear system near an isolated critical point.
point is stable if we start close to a critical point and follow a trajectory we will either go towards,
or at least not get away from, this critical point.
A stable critical point (x0 , y0 ) is called asymptotically stable if given any initial condition
sufficiently close to (x0 , y0 ) and any solution x(t), y(t) satisfying that condition, then
That is, the critical point is asymptotically stable if any trajectory for a sufficiently close initial
condition goes towards the critical point (x0 , y0 ).
Example 8.2.1: Consider x0 = −y − x2 , y0 = −x + y2 . See Figure 8.3 on the next page for the phase
diagram. Let us find the critical points. These are the points where −y − x2 = 0 and −x + y2 = 0.
The first equation means y = −x2 , and so y2 = x4 . Plugging into the second equation we obtain
−x + x4 = 0. Factoring we obtain x(1 − x3 ) = 0. Since we are looking only for real solutions we get
either x = 0 or x = 1. Solving for the corresponding y using y = −x2 , we get two critical points, one
being (0, 0) and the other being (1, −1). Clearly the critical points are isolated. Let us compute the
Jacobian matrix: " #
−2x −1
.
−1 2y
0 −1
At the point (0, 0) we get the matrix −1 0 and so the two eigenvalues are 1 and −1. As the
matrix is invertible, the system is almost linear at (0, 0). As the eigenvalues are real and of opposite
signs, we get a saddle point, which is an unstable equilibrium point.
At the point (1, −1) we get the matrix −2
−1
−1 −2 and computing the eigenvalues we get −1, −3.
The matrix is invertible, and so the system is almost linear at (1, −1). As we have real eigenvalues
and both negative, the critical point is a sink, and therefore an asymptotically stable equilibrium
point. That is, if we start with any point (xi , yi ) close to (1, −1) as an initial condition and plot a
trajectory, it will approach (1, −1). In other words,
lim x(t), y(t) = (1, −1).
t→∞
As you can see from the diagram, this behavior is true even for some initial points quite far from
(1, −1), but it is definitely not true for all initial points.
8.2. STABILITY AND CLASSIFICATION OF ISOLATED CRITICAL POINTS 327
-2 -1 0 1 2
2 2
1 1
0 0
-1 -1
-2 -2
-2 -1 0 1 2
Example 8.2.2: Let us look at x0 = y + y2 e x , y0 = x. First let us find the critical points. These are
the points where y + y2 e x = 0 and x = 0. Simplifying we get 0 = y + y2 = y(y + 1). So the critical
points are (0, 0) and (0, −1), and hence are isolated. Let us compute the Jacobian matrix:
y e 1 + 2ye x
" 2 x #
.
1 0
At the point (0, 0) we get the matrix 01 10 and so the two eigenvalues are 1 and −1. As the
matrix is invertible, the system is almost linear at (0, 0). And, as the eigenvalues are real and of
opposite signs, we get a saddle point, which is an unstable equilibrium point. √
At the point (0, −1) we get the matrix 11 −1 whose eigenvalues are 12 ± i 23 . The matrix is
0
invertible, and so the system is almost linear at (0, −1). As we have complex eigenvalues with
positive real part, the critical point is a spiral source, and therefore an unstable equilibrium point.
See Figure 8.4 on the following page for the phase diagram. Notice the two critical points, and
the behavior of the arrows in the vector field around these points.
-2 -1 0 1 2
2 2
1 1
0 0
-1 -1
-2 -2
-2 -1 0 1 2
Jacobian matrix, and the Jacobian matrix in a nonlinear system changes from point to point. Since
this real part is zero at the critical point itself, it can have either sign nearby, meaning the trajectory
could be pulled towards or away from the critical point.
Example 8.2.3: An easy example where such a problematic behavior is exhibited is the system
x0 = y, y0 = −x + y3 . The only critical point is the origin (0, 0). The Jacobian matrix is
" #
0 1
.
−1 3y2
0 1
At (0, 0) the Jacobian matrix is −1 0 , which has eigenvalues ±i. Therefore, the linearization has a
center.
Using the quadratic equation, the eigenvalues of the Jacobian matrix at any point (x, y) are
p
3 2 4 − 9y4
λ= y ±i .
2 2
At any point where y , 0 (so at most points near the origin), the eigenvalues have a positive real
part (y2 can never be negative). This positive real part will pull the trajectory away from the origin.
A sample trajectory for an initial condition near the origin is given in Figure 8.5 on the facing page.
The moral of the example is that further analysis is needed when the linearization has a center.
The analysis will in general be more complicated than in the above example, and is more likely
to involve case-by-case consideration. Such a complication should not be surprising to you. By
now in your mathematical career, you have seen many places where a simple test is inconclusive,
perhaps starting with the second derivative test for maxima or minima, and requires more careful,
and perhaps ad hoc analysis of the situation.
8.2. STABILITY AND CLASSIFICATION OF ISOLATED CRITICAL POINTS 329
-3 -2 -1 0 1 2 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -2 -1 0 1 2 3
Figure 8.5: An unstable critical point (spiral source) at the origin for x0 = y, y0 = −x + y3 , even if the
linearization has a center.
x0 = y, y0 = − f (x).
These types of equations have the advantage that we can solve for their trajectories easily.
The trick is to first think of y as a function of x for a moment. Then use the chain rule
dy 0 dy
x00 = y0 = x =y ,
dx dx
Z
1 2
y + f (x) dx = C.
2
We obtained an implicit equation for the trajectories, with different C giving different trajectories.
The value of C is conserved on any trajectory. This expression is sometimes called the Hamiltonian
dy
or the energy of the system. If you look back to § 1.8, you will notice that y dx + f (x) = 0 is an exact
equation, and we just found a potential function.
330 CHAPTER 8. NONLINEAR SYSTEMS
Example 8.2.4: Let us find the trajectories for the equation x00 + x − x2 = 0, which is the equation
from Example 8.1.1 on page 320. The corresponding first order system is
x0 = y, y0 = −x + x2 .
Trajectories satisfy
1 2 1 2 1 3
y + x − x = C.
2 2 3
We solve for y r
2
y=± −x2 + x3 + 2C.
3
Plotting these graphs we get exactly the trajectories in Figure 8.1 on page 320. In particular
we notice that near the origin the trajectories are closed curves: they keep going around the origin,
never spiraling in or out. Therefore we discovered a way to verify that the critical point at (0, 0) is a
stable center. The critical point at (0, 1) is a saddle as we already noticed. This example is typical
for conservative equations.
Consider an arbitrary conservative equation x00 + f (x) = 0. All critical points occur when y = 0
(the x-axis), that is when x0 = 0. The critical points are those points on the x-axis where f (x) = 0.
The trajectories are given by s Z
y = ± −2 f (x) dx + 2C.
So all trajectories are mirrored across the x-axis. In particular, there can be no spiral sources nor
sinks. The Jacobian matrix is " #
0 1
.
− f 0 (x) 0
The critical point is almost linear if f 0 (x) , 0 at the critical point. Let J denote the Jacobian matrix.
The eigenvalues of J are solutions to
Therefore λ = ± − f 0 (x). In other words, either we get real eigenvalues of opposite signs (if
p
f 0 (x) < 0), or we get purely imaginary eigenvalues (if f 0 (x) > 0). There are only two possibilities
for critical points, either an unstable saddle point, or a stable center. There are never any sinks or
sources.
8.2.5 Exercises
Exercise 8.2.1: For the systems below, find and classify the critical points, also indicate if the
equilibria are stable, asymptotically stable, or unstable.
a) x0 = −x + 3x2 , y0 = −y b) x0 = x2 + y2 − 1, y0 = x c) x0 = ye x , y0 = y − x + y2
8.2. STABILITY AND CLASSIFICATION OF ISOLATED CRITICAL POINTS 331
Exercise 8.2.2: Find the implicit equations of the trajectories of the following conservative systems.
Next find their critical points (if any) and classify them.
a) x00 + x + x3 = 0 b) θ00 + sin θ = 0 c) z00 + (z − 1)(z + 1) = 0 d) x00 + x2 + 1 = 0
Exercise 8.2.3: Find and classify the critical point(s) of x0 = −x2 , y0 = −y2 .
Exercise 8.2.4: Suppose x0 = −xy, y0 = x2 − 1 − y. a) Show there are two spiral sinks at (−1, 0)
and (1, 0). b) For any initial point of the form (0, y0 ), find what is the trajectory. c) Can a trajectory
starting at (x0 , y0 ) where x0 > 0 spiral into the critical point at (−1, 0)? Why or why not?
Exercise 8.2.5: In the example x0 = y, y0 = y3 − x show that for any trajectory, the distance from
the origin is an increasing function. Conclude that the origin behaves like is a spiral source. Hint:
2 2
Consider f (t) = x(t) + y(t) and show it has positive derivative.
Exercise 8.2.6: Suppose f is always positive. Find the trajectories of x00 + f (x0 ) = 0. Are there any
critical points?
Exercise 8.2.7: Suppose that x0 = f (x, y), y0 = g(x, y). Suppose that g(x, y) > 1 for all x and y. Are
there any critical points? What can we say about the trajectories at t goes to infinity?
Exercise 8.2.101: For the systems below, find and classify the critical points.
a) x0 = −x + x2 , y0 = y b) x0 = y − y2 − x, y0 = −x c) x0 = xy, y0 = x + y − 1
Exercise 8.2.102: Find the implicit equations of the trajectories of the following conservative
systems. Next find their critical points (if any) and classify them.
a) x00 + x2 = 4 b) x00 + e x = 0 c) x00 + (x + 1)e x = 0
Exercise 8.2.103: The conservative system x00 + x3 = 0 is not almost linear. Classify its critical
point(s) nonetheless.
Exercise 8.2.104: Derive an analogous classification of critical points for equations in one dimen-
sion, such as x0 = f (x) based on the derivative. A point x0 is critical when f (x0 ) = 0 and almost
linear if in addition f 0 (x0 ) , 0. Figure out if the critical point is stable or unstable depending on
the sign of f 0 (x0 ). Explain. Hint: see § 1.6.
332 CHAPTER 8. NONLINEAR SYSTEMS
8.3.1 Pendulum
The first example we will study is the pendulum equation θ00 + Lg sin θ = 0. Here, θ is the angular
displacement, g is the gravitational constant, and L is the length of the pendulum. In this equation
we disregard friction, so we are talking about an idealized pendulum.
As we mentioned before, this equation is a conservative equation, so
we can use our analysis of conservative equations from the previous section.
L Let us change the equation to a two-dimensional system in variables (θ, ω)
θ by introducing the new variable ω:
" #0 "
θ ω
#
= g .
ω − L sin θ
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-5.0 -2.5 0.0 2.5 5.0
Figure 8.6: Phase plane diagram and some trajectories of the nonlinear pendulum equation.
Suppose we start at θ = 0 (no deflection), and we start with a small angular velocity ω. Then the
trajectory keeps going around the critical point (0, 0) in an approximate circle. This corresponds to
short swings of the pendulum back and forth. When θ stays small, the trajectories really look like
circles and hence are very close to our linearization.
When we give the pendulum a big enough push, it will go across the top and keep spinning
about its axis. This behavior corresponds to the wavy curves that do not cross the horizontal axis in
the phase diagram. Let us suppose we look at the top curves, when the angular velocity ω is large
and positive. Then the pendulum is going around and around its axis. The velocity is going to be
large when the pendulum is near the bottom, and the velocity is the smallest when the pendulum is
close to the top of its loop.
At each critical point, there is an equilibrium solution. The solution θ = 0 is a stable solution.
That is when the pendulum is not moving and is hanging straight down. Clearly this is a stable place
for the pendulum to be, hence this is a stable equilibrium.
The other type of equilibrium solution is at the unstable point, for example θ = π. Here the
pendulum is upside down. Sure you can balance the pendulum this way and it will stay, but this is
an unstable equilibrium. Even the tiniest push will make the pendulum start swinging wildly.
See Figure 8.7 on the following page for a diagram. The first picture is the stable equilibrium
θ = 0. The second picture corresponds to those “almost circles” in the phase diagram around θ = 0
when the angular velocity is small. The next picture is the unstable equilibrium θ = π. The last
picture corresponds to the wavy lines for large angular velocities.
The quantity
1 2 g
ω − cos θ
2 L
is conserved by any solution. This is the energy or the Hamiltonian of the system.
334 CHAPTER 8. NONLINEAR SYSTEMS
for various values of C. Let us look at the initial condition of (θ0 , 0), that is, we take the pendulum
to angle θ0 , and just let it go (initial angular velocity 0). We plug the initial conditions into the above
and solve for C to obtain
2g
C = − cos θ0 .
L
Thus the expression for the trajectory is
r
2g p
ω=± cos θ − cos θ0 .
L
Let us figure out the period. That is, the time it takes for the pendulum to swing back and forth.
We notice that the trajectory about the origin in the phase plane is symmetric about both the θ and
the ω axis. That is, in terms of θ, the time it takes from θ0 to −θ0 is the same as it takes from −θ0
back to θ0 . Furthermore, the time it takes from −θ0 to 0 is the same as to go from 0 to θ0 . Therefore,
let us find how long it takes for the pendulum to go from angle 0 to angle θ0 , which is a quarter of
the full oscillation and then multiply by 4.
We figure out this time by finding dθdt
and integrating from 0 to θ0 . The period is four times this
integral. Let us stay in the region where ω is positive. Since ω = dθ dt
, inverting we get
s
dt L 1
= √ .
dθ 2g cos θ − cos θ0
8.3. APPLICATIONS OF NONLINEAR SYSTEMS 335
We plot T , T linear , and the relative error T −TTlinear in Figure 8.8. The relative error says how far is our
approximation from the real period percentage-wise. Note that T linear is simply a constant, it does
not change with the initial angle θ0 . The actual period T gets larger and larger as θ0 gets larger.
Notice how the relative error is small when θ0 is small. It is still only 15% when θ0 = π2 , that is, a 90
degree angle. The error is 3.8% when starting at π4 , a 45 degree angle. At a 5 degree initial angle,
the error is only 0.048%.
0.00 0.25 0.50 0.75 1.00 1.25 1.50 0.00 0.25 0.50 0.75 1.00 1.25 1.50
8.0 8.0
0.150 0.150
7.5 7.5
0.125 0.125
7.0 7.0
0.100 0.100
0.025 0.025
5.5 5.5
0.000 0.000
5.0 5.0
0.00 0.25 0.50 0.75 1.00 1.25 1.50 0.00 0.25 0.50 0.75 1.00 1.25 1.50
g T −T linear
Figure 8.8: The plot of T and T linear with L = 1 (left), and the plot of the relative error T (right), for θ0
between 0 and π/2.
That is, the period goes to infinity as the initial angle approaches the unstable equilibrium point. So
if we put the pendulum almost upside down it may take a very long time before it gets down. This
is consistent with the limiting behavior, where the exactly upside down pendulum never makes an
oscillation, so we could think of that as infinite period.
336 CHAPTER 8. NONLINEAR SYSTEMS
x0 = (a − by)x,
y0 = (cx − d)y,
where a, b, c, d are some parameters that describe the interaction of the foxes and hares† . In this
model, these are all positive numbers.
Let us analyze the idea behind this model. The model is a slightly more complicated idea based
on the exponential population model. First expand,
x0 = (a − by)x = ax − byx.
The hares are expected to simply grow exponentially in the absence of foxes, that is where the ax
term comes in, the growth in population is proportional to the population itself. We are assuming
the hares will always find enough food and have enough space to reproduce. However, there is
another component −byx, that is, the population also is decreasing proportionally to the number of
foxes. Together we can write the equation as (a − by)x, so it is like exponential growth or decay but
the constant depends on the number of foxes.
The equation for foxes is very similar, expand again
The foxes need food (hares) to reproduce: the more food, the bigger the rate of growth, hence the
cxy term. On the other hand, there are natural deaths in the fox population, and hence the −dy term.
∗
Named for the American mathematician, chemist, and statistician Alfred James Lotka (1880–1949) and the Italian
mathematician and physicist Vito Volterra (1860–1940).
†
This interaction does not end well for the hare.
8.3. APPLICATIONS OF NONLINEAR SYSTEMS 337
Without further delay, let us start with an explicit example. Suppose the equations are
x0 = (0.4 − 0.01y)x, y0 = (0.003x − 0.3)y.
See Figure 8.9 for the phase portrait. In this example it makes sense to also plot x and y as graphs
with respect to time. Therefore the second graph in Figure 8.9 is the graph of x and y on the vertical
axis (the prey x is the thinner line with taller peaks), against time on the horizontal axis. The
particular solution graphed was with initial conditions of 20 foxes and 50 hares.
250 250
75 75
200 200
50 50 150 150
100 100
25 25
50 50
0 0 0 0
0 50 100 150 200 250 300 0 10 20 30 40
Figure 8.9: The phase portrait (left) and graphs of x and y for a sample solution (right).
Let us analyze what we see on the graphs. We work in the general setting rather than putting in
specific numbers. We start with finding the critical points. Set (a − by)x = 0, and (cx − d)y = 0.
The first equation is satisfied if either x = 0 or y = a/b. If x = 0, the second equation implies y = 0.
If y = a/b, the second equation implies x = d/c. There are two equilibria: at (0, 0) when there are no
animals at all, and at (d/c, a/b).
In our specific example x = d/c = 100, and y = a/b = 40. This is the point where there are 100
hares and 40 foxes.
Let us compute the Jacobian matrix:
" #
a − by −bx
.
cy cx − d
0
At the origin (0, 0) we get the matrix a0 −d , so the eigenvalues are a and −d, hence real and of
opposite signs. So the critical point at the origin is a saddle. This makes sense. If you started with
some foxes but no hares, then the foxes would go extinct, that is, you would approach the origin. If
you started with no foxes and a few hares, then the hares would keep multiplying without check,
and so you would go away from the origin.
OK, how about the other critical point at (d/c, a/b). Here the Jacobian matrix becomes
" #
0 − bdc
ac .
b
0
338 CHAPTER 8. NONLINEAR SYSTEMS
√
Computing the eigenvalues we get the equation λ2 + ad = 0. In other words, λ = ±i ad. The
eigenvalues being purely imaginary, we are in the case where we cannot quite decide using only
linearization. We could have a stable center, spiral sink, or a spiral source. That is, the equilibrium
could be asymptotically stable, stable, or unstable. Of course I gave you a picture above that seems
to imply it is a stable center. But never trust a picture only. Perhaps the oscillations are getting
larger and larger, but only very slowly. Of course this would be bad as it would imply something
will go wrong with our population sooner or later. And I only graphed a very specific example with
very specific trajectories.
How can we be sure we are in the stable situation? As we said before, in the case of purely
imaginary eigenvalues, we have to do a bit more work. Previously we found that for conservative
systems, there was a certain quantity that was conserved on the trajectories, and hence the trajectories
had to go in closed loops. We can use a similar technique here. We just have to figure out what is
the conserved quantity. After some trial and error we find the constant
ya xd
C= = ya xd e−cx−by
ecx+by
is conserved. Such a quantity is called the constant of motion. Let us check C really is a constant of
motion. How do we check, you say? Well, a constant is something that does not change with time,
so let us compute the derivative with respect to time:
Our equations give us what x0 and y0 are so let us plug those in:
C 0 = aya−1 (cx − d)yxd e−cx−by + ya dxd−1 (a − by)xe−cx−by + ya xd e−cx−by −c(a − by)x − b(cx − d)y
= ya xd e−cx−by a(cx − d) + d(a − by) + −c(a − by)x − b(cx − d)y
= 0.
a d
So along the trajectories C is constant. In fact, the expression C = eycx+byx
gives us an implicit equation
for the trajectories. In any case, once we have found this constant of motion, it must be true that
a xd
the trajectories are simple curves, that is, the level curves of eycx+by . It turns out, the critical point at
(d/c, a/b) is a maximum for C (left as an exercise). So (d/c, a/b) is a stable equilibrium point, and we
do not have to worry about the foxes and hares going extinct or their populations exploding.
One blemish on this wonderful model is that the number of foxes and hares are discrete quantities
and we are modeling with continuous variables. Our model has no problem with there being 0.1 fox
in the forest for example, while in reality that makes no sense. The approximation is a reasonable
one as long as the number of foxes and hares are large, but it does not make much sense for small
numbers. One must be careful in interpreting any results from such a model.
An interesting consequence (perhaps counterintuitive) of this model is that adding animals to the
forest might lead to extinction, because the variations will get too big, and one of the populations
8.3. APPLICATIONS OF NONLINEAR SYSTEMS 339
will get close to zero. For example, suppose there are 20 foxes and 50 hares as before, but now
we bring in more foxes, bringing their number to 200. If we run the computation, we will find the
number of hares will plummet to just slightly more than 1 hare in the whole forest. In reality that
will most likely mean the hares die out, and then the foxes will die out as well as they will have
nothing to eat.
Showing that a system of equations has a stable solution can be a very difficult problem. When
Isaac Newton put forth his laws of planetary motions, he proved that a single planet orbiting a single
sun is a stable system. But any solar system with more than 1 planet proved very difficult indeed.
In fact, such a system behaves chaotically (see § 8.5), meaning small changes in initial conditions
lead to very different long-term outcomes. From numerical experimentation and measurements, we
know the earth will not fly out into the empty space or crash into the sun, for at least some millions
of years or so. But we do not know what happens beyond that.
8.3.3 Exercises
Exercise 8.3.1: Take the damped nonlinear pendulum equation θ00 + µθ0 + (g/L) sin θ = 0 for some
µ > 0 (that is, there is some friction). a) Suppose µ = 1 and g/L = 1 for simplicity, find and classify
the critical points. b) Do the same for any µ > 0 and any g and L, but such that the damping is
small, in particular, µ2 < 4(g/L). c) Explain what your findings mean, and if it agrees with what you
expect in reality.
Exercise 8.3.2: Suppose the hares do not grow exponentially, but logistically. In particular consider
For the following two values of γ, find and classify all the critical points in the positive quadrant,
that is, for x ≥ 0 and y ≥ 0. Then sketch the phase diagram. Discuss the implication for the long
term behavior of the population. a) γ = 0.001, b) γ = 0.01.
Exercise 8.3.3: a) Suppose x and y are positive variables. Show eyxx+y attains a maximum at (1, 1).
b) Suppose a, b, c, d are positive constants, and also suppose x and y are positive variables. Show
ya x d
ecx+by
attains a maximum at (d/c, a/b).
Exercise 8.3.4: Suppose that for theqpendulum equation we take a trajectory giving the spinning-
around motion, for example ω = 2g
L
cos θ + 2g
L
+ ω20 . This is the trajectory where the lowest
angular velocity is ω20 . Find an integral expression for how long it takes the pendulum to go all the
way around.
Exercise 8.3.5 (challenging): Take the pendulum, suppose the initial position is θ = 0.
a) Find the expression for ω giving the trajectory with initial condition (0, ω0 ). Hint: Figure out
what C should be in terms of ω0 .
b) Find the crucial angular velocity ω1 , such that for any higher initial angular velocity, the
340 CHAPTER 8. NONLINEAR SYSTEMS
pendulum will keep going around its axis, and for any lower initial angular velocity, the pendulum
will simply swing back and forth. Hint: When the pendulum doesn’t go over the top the expression
for ω will be undefined for some θs.
c) What do you think happens if the initial condition is (0, ω1 ), that is, the initial angle is 0, and the
initial angular velocity is exactly ω1 .
Exercise 8.3.101: Take the damped nonlinear pendulum equation θ00 + µθ0 + (g/L) sin θ = 0 for some
µ > 0 (that is, there is friction). Suppose the friction is large, in particular µ2 > 4(g/L). a) Find
and classify the critical points. b) Explain what your findings mean, and if it agrees with what you
expect in reality.
Exercise 8.3.102: Suppose we have the system predator-prey system where the foxes are also killed
at a constant rate h (h foxes killed per unit time): x0 = (a − by)x, y0 = (cx − d)y − h. a) Find the
critical points and the Jacobian matrices of the system. b) Put in the constants a = 0.4, b = 0.01,
c = 0.003, d = 0.3, h = 10. Analyze the critical points. What do you think it says about the forest?
Exercise 8.3.103 (challenging): Suppose the foxes never die. That is, we have the system x0 =
(a − by)x, y0 = cxy. Find the critical points and notice they are not isolated. What will happen to the
population in the forest if it starts at some positive numbers. Hint: Think of the constant of motion.
8.4. LIMIT CYCLES 341
where µ is some positive constant. The Van der Pol oscillator originated with electrical circuits, but
finds applications in diverse fields such as biology, seismology, and other physical sciences.
For simplicity, let us use µ = 1. A phase diagram is given in the left hand plot in Figure 8.10.
Notice how the trajectories seem to very quickly settle on a closed curve. On the right hand plot
we have the plot of a single solution for t = 0 to t = 30 with initial conditions x(0) = 0.1 and
x0 (0) = 0.1. Notice how the solution quickly tends to a periodic solution.
-4 -2 0 2 4 0 5 10 15 20 25 30
4 4
2 2
2 2
1 1
0 0 0 0
-1 -1
-2 -2
-2 -2
-4 -4
-4 -2 0 2 4 0 5 10 15 20 25 30
Figure 8.10: The phase portrait (left) and a graph of a sample solution of the Van der Pol oscillator.
The Van der Pol oscillator is an example of so-called relaxation oscillation. The word relaxation
comes from the sudden jump (the very steep part of the solution). For larger µ the steep part
becomes even more pronounced, for small µ the limit cycle looks more like a circle. In fact setting
µ = 0, we get x00 + x = 0, which is a linear system with a center and all trajectories become circles.
A trajectory in the phase portrait that is a closed curve (a curve that is a loop) is called a closed
trajectory. A limit cycle is a closed trajectory such that at least one other trajectory spirals into it (or
spirals out of it). For example, the closed curve in the phase portrait for the Van der Pol equation is
a limit cycle. If all trajectories that start near the limit cycle spiral into it, the limit cycle is called
asymptotically stable. The limit cycle in the Van der Pol oscillator is asymptotically stable.
∗
Named for the Dutch physicist Balthasar van der Pol (1889–1959).
342 CHAPTER 8. NONLINEAR SYSTEMS
Given a closed trajectory on an autonomous system, any solution that starts on it is periodic.
Such a curve is called a periodic orbit. More precisely, if x(t), y(t) is a solution such that for some
t0 the point x(t0 ), y(t0 ) lies on a periodic orbit, then both x(t) and y(t) are periodic functions (with
the same period). That is, there is some number P such that x(t) = x(t + P) and y(t) = y(t + P).
Consider the system
x0 = f (x, y), y0 = g(x, y), (8.2)
where the functions f and g have continuous derivatives in some region R in the plane.
The main point of the theorem is that if you find one solution that exists for all t large enough
(that is, as t goes to infinity) and stays within a bounded region, then you have found either a
periodic orbit, or a solution that spirals towards a limit cycle or tends to a critical point. That is, in
the long term, the behavior is very close to a periodic function. Note that a constant solution at a
critical point is periodic (with any period). The theorem is more a qualitative statement rather than
something to help us in computations. In practice it is hard to find analytic solutions and so hard to
show rigorously that they exist for all time. But if we think the solution exists we numerically solve
for a large time to approximate the limit cycle. Another caveat is that the theorem only works in
two dimensions. In three dimensions and higher, there is simply too much room.
Let us next look when limit cycles (or periodic orbits) do not exist. We will assume the equation
(8.2) is defined on a simply connected region, that is, a region with no holes we can go around. For
example the entire plane is a simply connected region, and so is the inside of the unit disc. However,
the entire plane minus a point is not a simply connected domain as it has a “hole” at the origin.
Theorem 8.4.2 (Bendixson-Dulac† ). Suppose R is a simply connected region, and the expression‡
∂ f ∂g
+
∂x ∂y
is either always positive or always negative on R (except perhaps a small set such as on isolated
points or curves) then the system (8.2) has no closed trajectory inside R.
The theorem gives us a way of ruling out the existence of a closed trajectory, and hence a way of
ruling out limit cycles. The exception about points or curves means that we can allow the expression
to be zero at a few points, or perhaps on a curve, but not on any larger set.
∗
Ivar Otto Bendixson (1861–1935) was a Swedish mathematician.
†
Henri Dulac (1870–1955) was a French mathematician.
‡
Sometimes the expression in the Bendixson-Dulac Theorem is ∂(ϕ f)
∂x +
∂(ϕg)
∂y for some continuously differentiable
function ϕ. For simplicity let us just consider the case ϕ = 1.
8.4. LIMIT CYCLES 343
Example 8.4.2: Let us look at x0 = y + y2 e x , y0 = x in the entire plane (see Example 8.2.2 on
page 327). The entire plane is simply connected and so we can apply the theorem. We compute
∂f
∂x
+ ∂g
∂y
= y2 e x + 0. The function y2 e x is always positive except on the line y = 0. Therefore, via the
theorem, the system has no closed trajectories.
In some books (or the internet) the theorem is not stated carefully and it concludes there are no
periodic solutions. That is not quite right. The above example has two critical points and hence it
has constant solutions, and constant functions are periodic. The conclusion of the theorem should
be that there exist no trajectories that form closed curves. Another way to state the conclusion of
the theorem would be to say that there exist no nonconstant periodic solutions that stay in R.
Example 8.4.3: Let us look at a somewhat more complicated example. Take the system x0 = −y−x2 ,
y0 = −x + y2 (see Example 8.2.1 on page 326). We compute ∂∂xf + ∂g ∂y
= −2x + 2y = 2(−x + y). This
expression takes on both signs, so if we are talking about the whole plane we cannot simply apply
the theorem. However, we could apply it on the set where −x + y ≥ 0. Via the theorem, there is no
closed trajectory in that set. Similarly, there is no closed trajectory in the set −x + y ≤ 0. We cannot
conclude (yet) that there is no closed trajectory in the entire plane. Perhaps half of it is in the set
where −x + y ≥ 0 and the other half is in the set where −x + y ≤ 0.
The key is to look at the line where −x + y = 0, or x = y. On this line x0 = −y − x2 = −x − x2
and y0 = −x + y2 = −x + x2 . In particular, when x = y then x0 ≤ y0 . That means that the arrows, the
vectors (x0 , y0 ), always point into the set where −x + y ≥ 0. There is no way we can start in the set
where −x + y ≥ 0 and go into the set where −x + y ≤ 0. Once we are in the set where −x + y ≥ 0,
we stay there. So no closed trajectory can have points in both sets.
8.4.1 Exercises
Exercise 8.4.1: Show that the following systems have no closed trajectories.
a) x0 = x3 + y, y0 = y3 + x2 ,
b) x0 = e x−y , y0 = e x+y ,
c) x0 = x + 3y2 − y3 , y0 = y3 + x2 .
Exercise 8.4.2: Formulate a condition for a 2-by-2 linear system ~x 0 = A~x to not be a center using
the Bendixson-Dulac theorem. That is, the theorem says something about certain elements of A.
Exercise 8.4.3: Explain why the Bendixson-Dulac Theorem does not apply for any conservative
system x00 + h(x) = 0.
Exercise 8.4.4: A system such as x0 = x, y0 = y has solutions that exist for all time t, yet there are
no closed trajectories. Explain why the Poincarè-Bendixson Theorem does not apply.
Exercise 8.4.5: Differential equations can also be given in different coordinate systems. Suppose
we have the system r0 = 1 − r2 , θ0 = 1 given in polar coordinates. Find all the closed trajectories
and check if they are limit cycles and if so, if they are asymptotically stable or not.
344 CHAPTER 8. NONLINEAR SYSTEMS
Exercise 8.4.101: Show that the following systems have no closed trajectories.
a) x0 = x + y2 , y0 = y + x2 , b) x0 = −x sin2 (y), y0 = e x , c) x0 = xy, y0 = x + x2 .
Exercise 8.4.102: Suppose an autonomous system in the plane has a solution x = cos(t) + e−t ,
y = sin(t) + e−t . What can you say about the system (in particular about limit cycles and periodic
solutions)?
Exercise 8.4.103: Show that the limit cycle of the Van der Pol oscillator (for µ > 0) must not lie
completely in the set where −1 < x < 1. Compare with Figure 8.10.
Exercise 8.4.104: Suppose we have the system r0 = sin(r), θ0 = 1 given in polar coordinates. Find
all the closed trajectories.
8.5. CHAOS 345
8.5 Chaos
Note: 1 lecture, §6.5 in [EP], §9.8 in [BD]
You have surely heard the story about the flap of a butterfly wing in the Amazon causing
hurricanes in the North Atlantic. In a prior section, we mentioned that a small change in initial
conditions of the planets can lead to very different configuration of the planets in the long term.
These are examples of chaotic systems. Mathematical chaos is not really chaos, there is precise order
behind the scenes. Everything is still deterministic. However a chaotic system is extremely sensitive
to initial conditions. This also means even small errors induced via numerical approximation create
large errors very quickly, so it is almost impossible to numerically approximate for long times. This
is large part of the trouble as chaotic systems cannot be in general solved analytically.
Take the weather for example. As a small change in the initial conditions (the temperature at
every point of the atmosphere for example) produces drastically different predictions in relatively
short time, we cannot accurately predict weather. This is because we do not actually know the
exact initial conditions, we measure temperatures at a few points with some error and then we
somehow estimate what is in between. There is no way we can accurately measure the effects of
every butterfly wing. Then we solve numerically introducing new errors. That is why you should
not trust weather prediction more than a few days out.
The idea of chaotic behavior was first noticed by Edward Lorenz∗ in the 1960s when trying to
model thermally induced air convection (movement). The equations Lorentz was looking at form
the relatively simple looking system:
8
x0 = −10x + 10y, y0 = 28x − y − xz, z0 = − z + xy.
3
A small change in the initial conditions yield a very different solution after a reasonably short time.
A very simple example the reader can experiment with, which displays chaotic
behavior, is a double pendulum. The equations that govern this system are some-
what complicated and their derivation is quite tedious, so we will not bother to
write them down. The idea is to put a pendulum on the end of another pendulum.
If you look at the movement of the bottom mass, the movement will appear chaotic.
This type of system is a basis for a whole number of office novelty desk toys. It
is very simple to build a version. Take a piece of a string, and tie two heavy nuts
at different points of the string; one at the end, and one a bit above. Now give the
bottom nut a little push, as long as the swings are not too big and the string stays
tight, you have a double pendulum system.
Here a, b, c, C, and ω are constants. You will recognize that except for the cx3 term, this equation
looks like a forced mass-spring system. The cx3 term comes up when the spring does not exactly
obey Hooke’s law (which no real-world spring actually does obey exactly). When c is not zero, the
equation does not have a nice closed form solution, so we have to resort to numerical solutions as
is usual for nonlinear systems. Not all choices of constants and initial conditions exhibit chaotic
behavior. Let us study
x00 + 0.05x0 + x3 = 8 cos(t).
The equation is not autonomous, so we cannot draw the vector field in the phase plane. We can still
draw the trajectories.
In Figure 8.11 we plot trajectories for t going from 0 to 15, for two very close initial conditions
(2, 3) and (2, 2.9), and also the solutions in the (x, t) space. The two trajectories are close at first, but
after a while diverge significantly. This sensitivity to initial conditions is precisely what we mean
by the system behaving chaotically.
3 3
5.0 5.0
2 2
2.5 2.5
1 1
0.0 0.0
0 0
-1 -1
-2.5 -2.5
-2 -2
-5.0 -5.0
-3 -3
-2 0 2 0.0 2.5 5.0 7.5 10.0 12.5 15.0
Figure 8.11: On left, two trajectories in phase space for 0 ≤ t ≤ 15, for the Duffing equation one with initial
conditions (2, 3) and the other with (2, 2.9). On right the two solutions in (x, t)-space.
Let us see the long term behavior. In Figure 8.12 on the next page, we plot the behavior of the
system for initial conditions (2, 3), but for much longer period of time. Note that for this period of
time it was necessary to use a ridiculously large number of steps in the numerical algorithm used to
produce the graph, as even small errors quickly propagate∗ . From the graph it is hard to see any
particular pattern in the shape of the solution except that it seems to oscillate, but each oscillation
appears quite unique. The oscillation is expected due to the forcing term.
In general it is very difficult to analyze chaotic systems, or to find the order behind the madness,
but let us try to do something that we did for the standard mass-spring system. One way we
analyzed the system is that we figured out what was the long term behavior (not dependent on initial
conditions). From the figure above it is clear that we will not get a nice description of the long term
∗
In fact for reference, 30,000 steps were used with the Runge-Kutta algorithm, see exercises in § 1.7.
8.5. CHAOS 347
0 20 40 60 80 100
2 2
0 0
-2 -2
0 20 40 60 80 100
Figure 8.12: The solution to the given Duffing equation for t from 0 to 100.
behavior for this chaotic system, but perhaps we can figure out some order to what happens on each
“oscillation” and what do these oscillations have in common.
The concept we explore is that of a Poincarè section∗ . Instead of looking at t in a certain interval,
we look at where the system is at a certain sequence of points in time. Imagine flashing a strobe at a
certain fixed frequency and drawing the points where the solution is during the flashes. The right
strobing frequency depends on the system in question. The correct frequency to use for the forced
Duffing equation (and other similar systems) is the frequency of the forcing term. For the Duffing
equation above, find a solution x(t), y(t) , and look at the points
x(0), y(0) , x(2π), y(2π) , x(4π), y(4π) , x(6π), y(6π) , . . .
As we are really not interested in the transient part of the solution, that is, the part of the solution
that depends on the initial condition we skip some number of steps in the beginning. For example,
we might skip the first 100 such steps and start plotting points at t = 100(2π), that is
x(200π), y(200π) , x(202π), y(202π) , x(204π), y(204π) , x(206π), y(206π) , . . .
The plot of these points is the Poincarè section. After plotting enough points, a curious pattern
emerges in Figure 8.13 on the following page (the left hand picture), a so-called strange attractor.
If we have a sequence of points, then an attractor is a set towards which the points in the
sequence eventually get closer and closer to, that is, they are attracted. The Poincarè section is not
really the attractor itself, but as the points are very close to it, we see its shape. The strange attractor
in the figure is a very complicated set. In fact, it has fractal structure, that is, if you zoom in as far
as you want, you keep seeing the same complicated structure.
The initial condition makes no difference. If we start with a different initial condition, the points
eventually gravitate towards the attractor, and so as long as we throw away the first few points, we
get the same picture. Similarly small errors in the numerical approximations do not matter here.
∗
Named for the French polymath Jules Henri Poincarè (1854–1912).
348 CHAPTER 8. NONLINEAR SYSTEMS
5.0 5.0
0 0
-1 -1
2.5 2.5
-2 -2
-3 -3
0.0 0.0
-4 -4
-2.5 -2.5
-5 -5
Figure 8.13: Strange attractor. The left plot is with no phase shift, the right plot has phase shift π/4.
An amazing thing is that a chaotic system such as the Duffing equation is not random at all.
There is a very complicated order to it, and the strange attractor says something about this order.
We cannot quite say what state the system will be in eventually, but given a fixed strobing frequency
we can narrow it down to the points on the attractor.
If we use a phase shift, for example π/4, and look at the times
we obtain a slightly different looking attractor. The picture is the right hand side of Figure 8.13. It
is as if we had rotated, distorted slightly, and then moved the original. Therefore for each phase
shift you can find the set of points towards which the system periodically keeps coming back to.
You should study the pictures and notice especially the scales—where are these attractors located
in the phase plane. Notice the regions where the strange attractor lives and compare it to the plot of
the trajectories in Figure 8.11 on page 346.
Let us compare the discussion in this section to the discussion in § 2.6 about forced oscillations.
Take the equation
F0
x00 + 2px0 + ω20 x = cos(ωt).
m
This is like the Duffing equation, but with no x3 term. The steady periodic solution is of the form
x = C cos(ωt + γ).
Strobing using the frequency ω we would obtain a single point in the phase space. So the attractor
in this setting is a single point—an expected result as the system is not chaotic. In fact it was the
opposite of chaotic. Any difference induced by the initial conditions dies away very quickly, and we
settle into always the same steady periodic motion.
8.5. CHAOS 349
-15 x
20 -10
-5
y 10 0
5
10
0 15
-10
-20 40
40 30
30 20
20 10
10 20
10
-15 0
-10
-5
0 -10 y
5
10
x 15 -20
The solutions tend to an attractor in space, the so-called Lorenz attractor. In this case no
strobing is necessary. Again we cannot quite see the attractor itself, but if we try to follow a solution
for long enough, as in the figure, we will get a pretty good picture of what the attractor looks like.
The path is not just a repeating figure-eight. The trajectory will spin some seemingly random
number of times on the left, then spin a number of times on the right, and so on. As this system
arose in weather prediction, one can perhaps imagine a few days of warm weather and then a few
350 CHAPTER 8. NONLINEAR SYSTEMS
days of cold weather, where it is not easy to predict when the weather will change, just as it is not
really easy to predict far in advance when the solution will jump onto the other side. See Figure 8.15
for a plot of the x component of the solution drawn above.
10 10
0 0
-10 -10
8.5.3 Exercises
Exercise 8.5.1: For the non-chaotic equation x00 + 2px0 + ω20 x = Fm0 cos(ωt), suppose we strobe
with frequency ω as we mentioned above. Use the known steady periodic solution to find precisely
the point which is the attractor for the Poincarè section.
Exercise 8.5.2 (project): A simple fractal attractor can be drawn via the following chaos game.
Draw three points of a triangle (just the vertices) and number them, say p1 , p2 and p3 . Start with
some random point p (does not have to be one of the three points above) and draw it. Roll a die, and
use it to pick of the p1 , p2 , or p3 randomly (for example 1 and 4 mean p1 , 2 and 5 mean p2 , and 3
and 6 mean p3 ). Suppose we picked p2 , then let pnew be the point exactly halfway between p and p2 .
Draw this point and let p now refer to this new point pnew . Rinse, repeat. Try to be precise and draw
as many iterations as possible. Your points should be attracted to the so-called Sierpinski triangle.
A computer was used to run the game for 10,000 iterations to obtain the picture in Figure 8.16 on
the next page.
Exercise 8.5.3 (project): Construct the double pendulum described in the text with a string and two
nuts (or heavy beads). Play around with the position of the middle nut, and perhaps use different
weight nuts. Describe what you find.
Exercise 8.5.4 (computer project): Use a computer software (such as Matlab, Octave, or perhaps
even a spreadsheet), plot the solution of the given forced Duffing equation with Euler’s method.
Plotting the solution for t from 0 to 100 with several different (small) step sizes. Discuss.
8.5. CHAOS 351
0.75 0.75
0.50 0.50
0.25 0.25
0.00 0.00
Figure 8.16: 10,000 iterations of the chaos game producing the Sierpinski triangle.
Exercise 8.5.101: Find critical points of the Lorenz system and the associated linearizations.
352 CHAPTER 8. NONLINEAR SYSTEMS
Further Reading
[BM] Paul W. Berg and James L. McGregor, Elementary Partial Differential Equations, Holden-
Day, San Francisco, CA, 1966.
[BD] William E. Boyce and Richard C. DiPrima, Elementary Differential Equations and Boundary
Value Problems, 9th edition, John Wiley & Sons Inc., New York, NY, 2008.
[EP] C.H. Edwards and D.E. Penney, Differential Equations and Boundary Value Problems:
Computing and Modeling, 4th edition, Prentice Hall, 2008.
[F] Stanley J. Farlow, An Introduction to Differential Equations and Their Applications, McGraw-
Hill, Inc., Princeton, NJ, 1994. (Published also by Dover Publications, 2006.)
[I] E.L. Ince, Ordinary Differential Equations, Dover Publications, Inc., New York, NY, 1956.
[T] William F. Trench, Elementary Differential Equations with Boundary Value Problems. Books
and Monographs. Book 9. 2013. http://digitalcommons.trinity.edu/mono/9
353
354 FURTHER READING
Solutions to Selected Exercises
0.2.101: Compute x0 = −2e−2t and x00 = 4e−2t . Then (4e−2t ) + 4(−2e−2t ) + 4(e−2t ) = 0.
0.2.102: Yes.
0.2.103: y = xr is a solution for r = 0 and r = 2.
0.2.104: C1 = 100, C2 = −90
0.2.105: ϕ = −9e8s
0.3.101: a) PDE, equation, second order, linear, nonhomogeneous, constant coefficient.
b) ODE, equation, first order, linear, nonhomogeneous, not constant coefficient, not autonomous.
c) ODE, equation, seventh order, linear, homogeneous, constant coefficient, autonomous.
d) ODE, equation, second order, linear, nonhomogeneous, constant coefficient, autonomous.
e) ODE, system, second order, nonlinear.
f) PDE, equation, second order, nonlinear.
0.3.102: equation: a(x)y = b(x), solution: y = b(x)
a(x)
.
x2
1.1.101: y = ex + 2
+9
1.1.102: x = (3t − 2)1/3
1.1.103: x = sin−1 t + 1
1.1.104: 170
1/(1−n)
1.1.105: If n , 1, then y = (1 − n)x + 1 . If n = 1, then y = e x .
1.1.106: The equation is r0 = −C for some constant C. The snowball will be completely melted in
25 minutes from time t = 0.
1.1.107: y = Ax3 + Bx2 + Cx + D, so 4 constants.
1.2.101:
355
356 SOLUTIONS TO SELECTED EXERCISES
1.2.102: Yes a solution exists. y0 = f (x, y) where f (x, y) = xy. The function f (x, y) is continuous
and ∂∂yf = x, which is also continuous near (0, 0). So a solution exists and is unique. (In fact y = 0 is
the solution).
1.2.103: No, the equation is not defined at (x, y) = (1, 0).
1.2.104: a) y0 = cos y, b) y0 = y cos(x), c) y0 = sin x. Justification left to reader.
1.2.105: Picard does not apply as f is not continuous at y = 0. The equation does not have a
continuously solution. If it did notice that y0 (0) = 1, by first derivative test, y(x) > 0 for small
positive x, but then for those x we would have y0 (x) = 0, so clearly the derivative cannot be
continuous.
1.3.101: y = Ce x
2
x = et + 1
3
1.3.102:
1.3.103: x3 + x = t + 2
1.3.104: y = 1−ln
1
x
1.3.105: sin(y) = − cos(x) + C
1.3.106: The range is approximately 7.45 to 12.15 minutes.
t
1.3.107: a) x = 1000e
et +24
. b) 102 rabbits after one month, 861 after 5 months, 999 after 10 months,
1000 after 15 months.
1.4.101: y = Ce−x + 1/3
3
1.4.102: y = 2ecos(2x)+1 + 1
1.4.103: 250 grams
P(5) = 1000e2×5−0.05×5 = 1000e8.75 ≈ 6.31 × 106
2
1.4.104:
1.4.105: Ah0 = I − kh, where k is a constant with units m2 s.
1.5.101: y= 2
3x−2
3−x2
1.5.102: y= 2x
1/3
1.5.103: y = 7e3x + 3x + 1
y = x2 − ln(C − x)
p
1.5.104:
1.6.101:
a) 0, 1, 2 are critical points.
b) x = 0 is unstable (semistable), x = 1 is stable, and x = 2 is unstable.
c) 1
1.6.102: a) There are no critical points. b) ∞
√
kM+ (kM)2 +4Ak
1.6.103: a) dt = kx(M − x) + A b)
dx
2k
1.6.104: a) α is a stable critical point, β is an unstable one. b) α, c) α, d) ∞ or DNE.
1.7.101: Approximately: 1.0000, 1.2397, 1.3829
SOLUTIONS TO SELECTED EXERCISES 357
1.7.102:
a) 0, 8, 12
b) x(4) = 16, so errors are: 16, 8, 4.
c) Factors are 0.5, 0.5, 0.5.
1.7.103: a) 0, 0, 0 b) x = 0 is a solution so errors are: 0, 0, 0.
1.7.104: a) Improved Euler: y(1) ≈ 3.3897 for h = 1/4, y(1) ≈ 3.4237 for h = 1/8, b) Standard
Euler: y(1) ≈ 2.8828 for h = 1/4, y(1) ≈ 3.1316 for h = 1/8, c) y = 2e x − x − 1, so y(2) is
approximately 3.4366. d) Approximate errors for improved Euler: 0.046852 for h = 1/4, and
0.012881 for h = 1/8. For standard Euler: 0.55375 for h = 1/4, and 0.30499 for h = 1/8. Factor
is approximately 0.27 for improved Euler, and 0.55 for standard Euler.
1.8.101: a) e xy +sin(x) = C, b) x2 + xy−2y2 = C, c) e x +ey = C, d) x3 +3xy+y3 = C.
1.8.102: a) Integrating factor is y, the equation becomes dx + 3y2 dx = 0. b) Integrating factor
is e x , the equation becomes e x dx − e−y dx = 0. c) Integrating factor is y2 , the equation becomes
cos(x) + y dx + x dy = 0. d) Integrating factor is x, the equation becomes (2xy + y2 ) dx + (x2 +
2xy) dx = 0.
1.8.103: a) The equation is − f (x) dx + 1
g(y)
dy, and this is exact because M = − f (x), N = 1
g(y)
, so
2
My = 0 = N x . b) −x dx + dy = 0, leads to potential function F(x, y) =
1
y
+ ln|y|, solving
− x2
F(x, y) = C leads to the same solution as the example.
2.1.101: Yes. To justify try to find a constant A such that sin(x) = Ae x for all x.
2.1.102: No. e x+2 = e2 e x .
2.1.103: y = 5
2.1.104: y = C1 ln(x) + C2
2.1.105: y00 − 3y0 + 2y = 0
√ √
2.2.101: y = C1 e(−2+ 2)x + C2 e(−2− 2)x
2.2.102: y = C1 e3x + C2 xe3x
√ √ √
y = e−x/4 cos ( 7/4)x − 7e−x/4 sin ( 7/4)x
2.2.103:
2.2.104: y= 2(a−b) −3x/2
5
e + 3a+2b
5
ex
2.2.105: z(t) = 2e cos(t)
−t
aβ−b αx b−aα βx
2.2.106: y= β−α
e + β−α
e
2.2.107: y00 − y − 6y = 0
0
2.3.101: y = C1 e x + C2 x3 + C3 x2 + C4 x + C5
2.3.102: a) r3 −3r2 +4r −12 = 0, b) y000 −3y00 +4y0 −12y = 0, c) y = C1 e3x +C2 sin(2x)+C3 cos(2x)
2.3.103: y = 0
2.3.104: No. e1 e x − e x+1 = 0.
2.3.105: Yes. (Hint: First note that sin(x) is bounded. Then note that x and x sin(x) cannot be
multiples of each other.)
358 SOLUTIONS TO SELECTED EXERCISES
√
2.6.101: ω = 4 √2 ≈ 0.984 C(ω) = 316
31 √ ≈
7
2.016
q
(ω20 −ω2 )F0
2.6.102: x sp = 2 cos(ωt) + 2ωpF0
2 sin(ωt) + A
k
, where p = c
2m
and ω0 = k
m
.
m(2ωp)2 +m(ω20 −ω2 ) m(2ωp)2 +m(ω20 −ω2 )
2.6.103: a) ω = 2, b) 25
3.1.101: y1 = C1 e3x , y2 = y(x) = C2 e x + C1 3x
2
e , y3 = y(x) = C3 e x + C1 3x
2
e
3.1.102: x = 53 e2t − 32 e−t , y = 35 e2t + 43 e−t
3.1.103: x10 = x2 , x20 = x3 , x30 = x1 + t
3.1.104: y03 + y1 + y2 = t, y04 + y1 − y2 = t2 , y01 = y3 , y02 = y4
3.1.105: x1 = x2 = at. Explanation of the intuition is left to reader.
3.2.101: −15
3.2.102: −2
~x = −5
15
3.2.103:
1/a 0 0
a) 0/a 10/b
h1 i
3.2.104: b) 0 1/b 0
0 0 1/c
3.3.101: Yes.
− e1 − e1 = ~0
h i h t i h −t i
3.3.102: No. 2 cosh(t)
1
x 0 3 −1 x h et i
3.3.103: y = t 0 y + 0
2
C2 et +C1
a) ~x 0 = 00 2t ~ ~ =
3.3.104: 2t x b) x t2 C2 e
SOLUTIONS TO SELECTED EXERCISES 359
3.4.101:
1 0 3
a) Eigenvalues: 4, 0, −1 Eigenvectors: 0 , 1 , 5
1 0 −2
1 0 3
b) ~x = C1 0 e + C2 1 + C3 5 e
4t −t
1 0 −2
3.4.102: √ √ h i h −2 i
a) Eigenvalues: 2
,
1+ 3i 1− 3i
2
, Eigenvectors: −2
√
1− 3i, 1+ √3i
" √ # " √ #
3t
−2 cos 2 −2 sin 23t
b) ~x = C1 et/2 √ √ √ + C2 et/2 √ √ √
cos 2
3t
+ 3 sin 3t
2 sin 2
3t
− 3 cos3t
2
3.4.103: ~x = C1 11 et + C2 −1
1 −t
e
h cos(t) i h sin(t) i
3.4.104: ~x = C1 − sin(t) + C2 cos(t)
√
3.5.101: a) Two eigenvalues: ± 2 so the behavior is a saddle. b) Two eigenvalues: 1 and 2, so
the behavior is a source. c) Two eigenvalues: ±2i, so the behavior is a center (ellipses). d) Two
eigenvalues: −1 and −2, so the behavior is a sink. e) Two eigenvalues: 5 and −3, so the behavior
is a saddle.
3.5.102: Spiral source.
3.5.103:
-10 -5 0 5 10
10 10
5 5
0 0
-5 -5
-10 -10
-10 -5 0 5 10
The solution will not move anywhere if y = 0. When y is positive, then the solution moves (with
constant speed) in the positive x direction. When y is negative, then the solution moves (with
constant speed) in the negative x direction. It is not one of the behaviors we have seen.
Note that the matrix has a double eigenvalue 0 and the general solution is x = C1 t + C2 and y = C1 ,
which agrees with the above description.
1 √ √ 0 √ √ 0
3.6.101: ~x = −1 a1 cos( 3 t)+b1 sin( 3 t) + 1 a2 cos( 2 t)+b2 sin( 2 t) + 0 a3 cos(t)+
1 −2 1
−1
b3 sin(t) + 12/2 cos(2t)
/3
m 0 0
−k k 0
1 √ √
~x = k −2k k ~x. Solution: ~x = −2 a1 cos( 3k/m t) + b1 sin( 3k/m t) +
00
3.6.102: 0 m 0
0 0 m 0 k −k 1
1 √ √ 1
a2 cos( /m t) + b2 sin( /m t) + 1 a3 t + b3 .
k k
0
−1 1
√
3.6.103: x2 = (2/5) cos( 1/6 t) − (2/5) cos(t)
1 1 0
3.7.101: a) 3, 0, 0 b) No defects. c) ~x = C1 1 e3t + C2 0 + C3 1
1 −1 −1
360 SOLUTIONS TO SELECTED EXERCISES
3.7.102:
a) 1, 1, 2
b) Eigenvalue
1 has a defect
of 1
0 1 0 3
c) ~x = C1 1 e + C2 0 + t 1 et + C3
t 3 e2t
−1 0 −1 −2
3.7.103:
a) 2, 2, 2
b) Eigenvalue
2 has a defect
of 2
0 0 0 1 0 t2 0
c) ~x = C1 3 e + C2 −1 + t 3 e + C3 0 + t −1 +
2t 2t
2
3 e2t
1 0 1 0 0 1
3.7.104: A = 0 5
5 5
" 3t −t #
e +e e−t −e3t
3.8.101: e = e−t −e3t
tA 2 2
e3t +e−t
2 2
3t 2t t 3et 3t
2e −4e +3e 2 − 3e2 −e3t +4e2t −3et
etA = 2et −2e2t
3.8.102: et 2e2t −2et
3et 3e3t
2e3t −5e2t +3et 2 − 2 −e +5e2t −3et
3t
3.9.101: The general solution is (particular solutions should agree with one of these):
x(t) = 51 C1 (e9t + e4t ) + 54 C2 (e9t − e4t ) − 18t+5
54
y(t) = 15 C1 (e9t − e4t ) + 51 C2 (4e5t + e4t ) + 6t + 7
216
3.9.102: The general solution is (particular solutions should agree with one of these):
x(t) = 12 C1 (et + e−t ) + 12 C2 (et − e−t ) + tet y(t) = 12 C1 (et − e−t ) + 21 C2 (et + e−t ) + tet
3.9.103: ~x = 11 25 et − t − 1 + −1 1 −1 e−t
2
1 1 √ √
3.9.104: ~x = 9 140 + 1201√6 e 6t + 140 1
+ 1201√6 e− 6t − 60t − cos(t)
70
1 −9
+ −1 80 sin(2t) + 30 cos(2t) + 40 − 30
1 9t cos(t)
q
4.1.101: ω = π 152
4.1.102: λk = 4k2 π2 for k = 1, 2, 3, . . . xk = cos(2kπt) + B sin(2kπt) (for any B)
4.1.103: x(t) = − sin(t)
4.1.104: General solution is x = Ce−λt . Since x(0) = 0 then C = 0, and so x(t) = 0. Therefore, the
solution is always identically zero. One condition is always enough to guarantee a unique solution
for a first order equation.
√ √ √ √ √3 √ √3
−3 3
4.1.105: 33 e 2 λ − 33 cos 32 λ + sin 32 λ = 0
4.2.101: sin(t)
∞
P (π−n) sin(πn+π2 )+(π+n) sin(πn−π2 )
4.2.102: πn2 −π3
sin(nt)
n=1
SOLUTIONS TO SELECTED EXERCISES 361
1
4.2.103: 2
− 12 cos(2t)
∞
π4 (−1)n (8π2 n2 −48)
+
P
4.2.104: 5 n4
cos(nt)
n=1
∞
16(−1)n
8
+ nπ 8 16
cos π2 t + 4
cos πt − 16 3π
+ ···
P
4.3.101: a) 6 π2 n 2
cos 2
t b) 6
− π2 π2 9π2
cos 2
t
n=1
∞
(−1)n+1 2λ nπ 2λ
sin λπ t − λπ sin 2π
+ 2λ 3π
P
4.3.102: a) nπ
sin λ
t b) π λ
t 3π
sin λ
t − ···
n=1
∞
π
f 0 (t) =
P
4.3.103: n2 +1
cos(nπt)
n=1
∞
4.3.104: a) F(t) = t
+C + 1
P
2 n4
sin(nt) b) no.
n=1
∞
(−1)n+1
b) f is continuous at t = π/2 so the Fourier series converges to
P
4.3.105: a) n
sin(nt)
n=1
∞
(−1)n+1
f (π/2) = π/4. Obtain π/4 = = 1 − 1/3 + 1/5 − 1/7 + · · · .
P
2n−1
c) Using the first 4 terms get
n=1
76/105
≈ 0.72 (quite a bad approximation, you would have to take about 50 terms to start to get to
within 0.01 of π/4).
∞ ∞
2(−1)n+1
4.4.101: a) 1/2 + −4 nπ
sin nπ
P P
π2 n2
cos 3
t b) πn 3
t
n=1 n=1
n odd
∞
P −4n
4.4.102: a) cos(2t) b) πn2 −4π
sin(nt)
n=1
n odd
4.4.103: a) f (t) b) 0
∞
P −1
4.4.104: n2 (1+n2 )
sin(nt)
n=1
∞
t
+ 1
P
4.4.105: π 2n (π−n2 )
sin(nt)
n=1
4.5.101: x= √ 1
2−4π2
sin(2πt) + √2−100π
0.1
2
cos(10πt)
∞
e−n
x=
P
4.5.102: 3−2n
cos(2nt)
n=1
∞
x= 1
+ √−4
P
4.5.103: √
2 3 n2 π2 ( 3−n2 π2 )
cos(nπt)
n=1
n odd
∞
x= 1 2
+ −4
P
4.5.104: √
2 3
− π3
t sin(πt) n2 π4 (1−n2 )
cos(nπt)
n=3
n odd
4.7.102: y(x, t) = 1
5π
sin(πx) sin(5πt) + 1
100π
sin(2πx) sin(10πt)
∞
2(−1)n+1
√
4.7.103: y(x, t) =
P
n
sin(nx) cos(n 2 t)
n=1
4.7.104: y(x, t) = sin(2x) + t sin(x)
4.8.101: y(x, t) = sin(2π(x−3t))+sin(2π(3t+x))
2
+ cos(3π(x−3t))−cos(3π(3t+x))
18π
x − x2 − 0.04 if 0.2 ≤ x ≤ 0.8
4.8.102: a) y(x, 0.1) =
if x ≤ 0.2
0.6x
0.6 − 0.6x
if x ≥ 0.8
b) y(x, /2) = −x + x
1 2
c) y(x, 1) = x − x 2
1
6.1.103: (s+1)2
1
6.1.104: s2 +2s+2
f (t) = (t − 1) u(t − 1) − u(t − 2) + u(t − 2)
6.2.101:
e−t 3et
6.2.102: x(t) = (2et−1 − t2 − 1)u(t − 1) − 2
+ 2
6.2.103: H(s) = 1
s+1
6.3.101: 1
2
(cos t + sin t − e−t )
6.3.102: 5t − 5 sin t
1
6.3.103: 2
(sin t − t cos t)
Rt
f (τ) 1 − cos(t − τ) dτ
6.3.104: 0
6.4.101: x(t) = t
6.4.102: x(t) = e−at
6.4.103: x(t) = (cos ∗ sin)(t) = 12 t sin(t)
6.4.104: δ(t) − sin(t)
6.4.105: 3δ(t − 1) + 2t
7.1.101: Yes. Radius of convergence is 10.
7.1.102: Yes. Radius of convergence is e.
∞
1
= − 1−(2−x)
1 1
= (−1)n+1 (x − 2)n , which converges for 1 < x < 3.
P
7.1.103: 1−x so 1−x
n=0
∞
1
xn
P
7.1.104: (n−7)!
n=7
7.1.105: f (x) − g(x) is a polynomial. Hint: Use Taylor series.
7.2.101: a2 = 0, a3 = 0, a4 = 0, recurrence relation (for k ≥ 5): ak = −2a k−5
k(k−1)
, so:
y(x) = a0 + a1 x − 10 x − 15 x + 450 x + 825 x − 47250 x − 99000 x + · · ·
a0 5 a1 6 a0 10 a1 11 a0 15 a1 16
k−3 +1
7.2.102: a) a2 = 21 , and for k ≥ 1 we have ak = ak(k−1) , so
a0 +1 3 a0 +2 6
y(x) = a0 + a1 x + 2 x + 6 x + 12 x + 40 x + 30 x + a142+2 x7 + 112
1 2 a1 +1 4 3 5
x + a072+3 x9 +
5 8 a1 +3 10
90
x + ···
b) y(x) = 12 x2 + 16 x3 + 12
1 4
x + 403 x5 + 151 x6 + 211 x7 + 1125 8
x + 24 x + 30
1 9
x + ···
1 10
7.2.103: Applying the method of this section directly we obtain ak = 0 for all k and so y(x) = 0 is
the only solution we find.
7.3.101: a) ordinary, b) singular but not regular singular, c) regular singular, d) regular singular,
e) ordinary.
√ √
1+ 5 1− 5
7.3.102: y = Ax 2 + Bx 2
∞
(−1)−1 k
y = x3/2 (Note that for convenience we did not pick a0 = 1)
P
7.3.103: k!(k+2)!
x
k=0
364 SOLUTIONS TO SELECTED EXERCISES
7.3.104: y = Ax + Bx ln(x)
8.1.101: a) Critical points (0, 0) and (0, 1). At (0, 0) using u = x, v = y the linearization is
u0 = −2u − (1/π)v, v0 = −v. At (0, 1) using u = x, v = y − 1 the linearization is u0 = −2u + (1/π)v,
v0 = v.
b) Critical point (0, 0). Using u = x, v = y the linearization is u0 = u + v, v0 = u.
c) Critical point (1/2, −1/4). Using u = x − 1/2, v = y + 1/4 the linearization is u0 = −u + v, v0 = u + v.
8.1.102: 1) is c), 2) is a), 3) is b)
8.1.103: Critical points are (0, 0, 0), and (−1, 1, −1). The linearization at the origin using variables
u = x, v = y, w = z is u0 = u, v0 = −v, z0 = w. The linearization at the point (−1, 1, −1) using
variables u = x + 1, v = y − 1, w = z + 1 is u0 = u − 2w, v0 = −v − 2w, w0 = w − 2u.
8.1.104: u0 = f (u, v, w), v0 = g(u, v, w), w0 = 1.
8.2.101: a) (0, 0): saddle (unstable), (1, 0): source (unstable), b) (0, 0): spiral sink (asymptot-
ically stable), (0, 1): saddle (unstable), c) (1, 0): saddle (unstable), (0, 1): saddle (unstable)
8.2.102: a) 12 y2 + 13 x3 − 4x = C, critical points (−2, 0): an unstable saddle, and (2, 0): a stable
center. b) 12 y2 + e x = C, no critical points. c) 12 y2 + xe x = C, critical point at (−1, 0) is a stable center.
8.2.103: Critical point at (0, 0). Trajectories are y = ± 2C + (1/2)x4 , for C > 0, these give closed
p
opposite signs and we get a saddle (In the application however we are only looking at the positive
0 − b(bh+ad)
quadrant so this critical point is not relevant). At ( bh+ad
ac
, ba ) we get Jacobian matrix ac
ac
bh+ad
−d
.
h 0 a−11/6
b i
b) For the specific numbers given, the second critical point is ( 550
3
, 40) the matrix is 3/25 1/4 ,
√
which has eigenvalues 5±i40327 . Therefore there is a spiral source. This means the solution will spiral
outwards. The solution will eventually hit one of the axis x = 0 or y = 0 so something will die out
in the forest.
8.3.103: The critical points are on the line x = 0. In the positive quadrant the y0 is always positive
and so the fox population always grows. The constant of motion is C = ya e−cx−by , for any C this
curve must hit the y axis (why?), so the trajectory will simply approach a point on the y axis
somewhere and the number of hares will go to zero.
8.4.101: Use Bendixson-Dulac Theorem. a) f x + gy = 1 + 1 > 0, so no closed trajectories. b)
f x + gy = − sin2 (y) + 0 < 0 for all x, y except the lines given by y = kπ (where we get zero), so no
closed trajectories. c) f x + gy = y + 0 > 0 for all x, y except the line given by y = 0 (where we get
zero), so no closed trajectories.
SOLUTIONS TO SELECTED EXERCISES 365
8.4.102: Using Poincarè-Bendixson Theorem, the system has a limit cycle, which is the unit circle
centered at the origin as x = cos(t) + e−t , y = sin(t) + e−t gets closer and closer to the unit circle.
Thus we also have that x = cos(t), y = sin(t) is the periodic solution.
8.4.103: f (x, y) = y, g(x, y) = µ(1 − x2 )y − x. So f x + gy = µ(1 − x2 ). The Bendixson-Dulac
Theorem says there is no closed trajectory lying entirely in the set x2 < 1.
8.4.104: The closed trajectories are those where sin(r) = 0, therefore, all the circles with radius a
multiple of π are closed trajectories.
√ √ √ √
8.5.101: Critical points: (0, 0, 0), (3 8, 3 8, 27), (−3 8, −3 8, 27). Linearization at (0, 0, 0)
√ u √= x, v = y, w = z is √
using u0 = −10u +√10v, v0 = 28u − v, w0 = −(8/3)w. Linearization √ at
(3 8, 3√ 8, 27) √using u = x − 3 8, v = y − 3 8, w√= z − 27
√ is u = −10u + 10v, v √= u − v − 3 √
0 0
8w,
w0 = 3 8u + 3 8v − (8/3)w. Linearization at (−3
√ 8, −3 8,√27) using
√ u = x + 3 8, v = y + 3 8,
w = z − 27 is u = −10u + 10v, v = u − v + 3 8w, w = −3 8u − 3 8v − ( /3)w.
0 0 0 8
366 SOLUTIONS TO SELECTED EXERCISES
Index
367
368 INDEX
d’Alembert solution to the wave equation, 225 even function, 179, 194
damped, 83 even periodic extension, 194
damped motion, 79 exact equation, 54
damped nonlinear pendulum equation, 339 existence and uniqueness, 25, 64, 74
defect, 143 exponential growth model, 9
defective eigenvalue, 143 exponential of a matrix, 147
deficient matrix, 143 exponential order, 270
delta function, 288 extend periodically, 175
dependent variable, 7
determinant, 110 first order differential equation, 7
diagonal matrix, 134 first order linear equation, 32
matrix exponential of, 148 first order linear system of ODEs, 117
diagonalization, 149 first order method, 49
differential equation, 7 first shifting property, 272
Dirac delta function, 288 forced motion, 79
direction field, 105 systems, 139
Dirichlet boundary conditions, 197, 247 Fourier series, 177
Dirichlet problem, 232 fourth order method, 50
displacement vector, 134 Fredholm alternative
distance, 20 simple case, 172
divergent power series, 296 Sturm-Liouville problems, 251
dot product, 109, 176 free motion, 79
Duffing equation, 345 free variable, 114
dynamic damping, 141 Frobenius method, 313
Frobenius-type solution, 313
eigenfunction, 168, 248 fundamental frequency, 182
eigenfunction decomposition, 247, 252 fundamental matrix, 118
eigenvalue, 121, 248 fundamental matrix solution, 118, 148
eigenvalue of a boundary value problem, 168
eigenvector, 121 general solution, 10
eigenvector decomposition, 156, 163 generalized eigenvectors, 143, 145
ellipses (vector field), 130 generalized function, 288
elliptic PDE, 207 Genius software, 6
endpoint problem, 167 geometric multiplicity, 142
envelope curves, 85 geometric series, 243, 300
equilibrium, 321 Gibbs phenomenon, 182
equilibrium solution, 43, 321
Euler’s equation, 66 half period, 185
Euler’s formula, 70 Hamiltonian, 329
Euler’s method, 48 harmonic conjugate, 62
Euler-Bernoulli equation, 291 harmonic function, 62, 231
INDEX 369