185week1 1
185week1 1
185week1 1
Introduction. A differential equation is a relationship between an unknown function and its derivatives.
In science and engineering, differential equations are used to model physical quantities which change over
time. The prototypical example is Newton’s law, which is a second order differential equation
d2 x
F = ma = m .
dt2
This equation models the position x(t) of a moving object, as a function of time. Newton’s law allows us to
predict the future motion of any object, if we know all of the forces acting on it.
For example, a falling object near the surface of the Earth experiences a constant downward force, so its
height y(t) above the ground satisfies an equation of the form
d2 y
m = my ′′ (t) = −mg.
dt2
For concreteness, let’s take the particular value g = 10. Then the equation becomes
y ′′ (t) = −10.
We can solve this equation by integrating both sides twice. Integrating once gives
y ′ (t) = −10t + c1 ,
where c1 is a constant of integration, and integrating a second time gives
y(t) = −5t2 + c1 t + c2 ,
where c2 is a second constant of integration.
Notice that we do not obtain a single solution. Instead, the solution we have found depends on two unknown
constants c1 and c2 , whose values can be chosen arbitrarily. This is a general phenomenon - differential
equations usually have many different solutions.
In our example, the ambiguity of our solution has an important physical meaning: the trajectory of a moving
object depends on its initial position and velocity. For example, if we set t = 0, we find that
y ′ (0) = −0 + c1 = c1
and
y(0) = −0 + 0 + c2 = c2 .
So, the constants of integration c1 and c2 precisely reflect the initial values of y(t) and y ′ (t).
In general, to single out a particular solution of a differential equation we must select some initial conditions.
A differential equation together with a prescribed set of initial conditions is called an initial value problem.
For example, to find the motion of a ball which is dropped from rest at a height of 10 meters, we would need
to solve the initial value problem
y ′′ = −10, y(0) = 10, y ′ (0) = 0.
Our computations above show that the solution of this initial value problem is
y(t) = 10 − 5t2 .
Differential equations are classified by their order, which is the highest order derivative of the unknown
function y(t) that appears in the equation. Generally speaking, solving for this highest order derivative
yields an equation of the form
y (n) (t) = F t, y, y ′ (t), . . . , y (n−1) (t) .
To determine a particular solution of an nth order differential equation of this form, we must specify a total
of n initial conditions,
y(t0 ), y ′ (t0 ), . . . , y (n−1) (t0 ),
at an initial time t0 .
1
2
We will also encounter differential equations where the variable in the unknown function does not represent
time, but instead represents some other quantity.
For example, consider a cable suspended between two points,
The shape of the cable can be modeled as the graph of a function y = y(x). To find this unknown function, it
is necessary to solve the following second order equation (which can be derived from mechanical principles):
p
y ′′ (x) = a 1 + y ′ (x)2 .
Here a is a constant (determined by the total length of the cable and the locations of its endpoints).
We may not see how to solve an equation like this, but if someone tells us that they have a solution, it is
easy to check whether or not they are correct! For example, in the case a = 1, one solution is
ex + e−x
y(x) = = cosh(x).
2
To verify this is a solution, we just need to calculate its derivatives:
ex − e−x
y ′ (x) = = sinh(x)
2
ex + e−x
y ′′ (x) = = cosh(x)
2
We can then substitute the derivatives into our equation, and verify that the two sides are equal:
p q
1 + y ′ (x)2 = 1 + cosh2 (x) = sinh(x) = y ′′ (x)
We will also encounter differential equations in which the unknown function is a function of more than
one variable. These are called partial differential equations, because they involve partial derivatives of the
unknown function.
For example, in 184 we encountered the following partial differential equation:
2 2
⃗ 2ϕ = ∂ ϕ + ∂ ϕ = 0
∇
∂x2 ∂y 2
In this case the unknown function ϕ was a function of two variables:
ϕ = ϕ(x, y).
By contrast, differential equations in which the unknown function has only one dependent variable are called
ordinary differential equations.
3
Slope Fields. The simplest differential equations are first order equations,
y ′ (x) = f (x, y(x)).
To write an equation like this, we will usually use the notation
dy
= f (x, y),
dx
in which the dependence of y on x is suppressed.
Most first order equations can’t be solved explicitly. However, it is always possible to visualize the solutions
by drawing careful pictures (either by hand, or with the help of a computer).
To plot the solutions of an equation, we must first understand what the equation means geometrically. Recall
that the first derivative y ′ (x) represents the slope of the graph of y(x). So, if y = y1 (x) is one particular
solution of the equation
dy
= f (x, y),
dx
we can conclude that
The slope of the graph of y1 (x) at the point (x, y1 (x)) is f (x, y1 (x)).
To see what this looks like, the first step is to draw a line segment of slope f (x, y) at a large number of
points (x, y). The diagram which results from this process is called a slope field.
For example, here is a slope field represnting the equation
dy
= y 2 − x,
dx
drawn with the help of a computer:
y
For each of those values it drew a line segment of slope f (x, y). For example, at the point (1, 1) we have
f (1, 1) = 12 − 1 = 0,
so the computer drew a horizontal line segment at that point.
Once we have drawn the slope field corresponding to our differential equation, we can begin to visualize the
solutions. To do this we must draw the integral curves for our slope field. By definition, these are curves
which are everywhere tangent to the slope field.
dy
For example, here are the graphs of a few different integral curves for the equation dx = y − x2 :
Notice that at each point where a integral curve passes through one of the line segments we have drawn, the
curve and the line segment are tangent to one another. If we were to pick any point along any of the integral
curves and evaluate the slope function at the point, the result would be the slope of the integral curve.
In particular, the graph of any solution to our equation will be (a piece of) an integral curve, because the
slope of its graph at any point (x, y) will be the slope prescibed by the slope function - that is exactly what
is meant by the equation
dy
= f (x, y).
dx
So, the curves we have drawn above are actually graphs of several solutions of our equation.
To draw pictures like this by hand, it is important to be more clever than a computer (otherwise your picture
will look terrible). One method is to draw what are called isoclines. These are curves where the slope has
a particular constant value C:
f (x, y) = C.
In other words, the isoclines are level curves of the slope function.
For example, suppose we wanted to visualize the slope field corresponding to the equation
dy x
=− .
dx y
5
C= 0
C = 1/3 C = -1/3
C=1 C = -1
C=3 C = -3
To get the slope field, we draw a series of line segments with slope C, on each of these lines:
C= 0
C = 1/3 C = -1/3
C=1 C = -1
C=3 C = -3
From the picture, we can see that the integral curves are circles:
6
C= 0
C = 1/3 C = -1/3
C=1 C = -1
C=3 C = -3
where R is the radius of the circle. Indeed, we can verify algebraically that y1 is a solution of the equation:
d hp 2 i −2x x x
y1′ (x) = R − x2 = √ = −√ =−
dx 2
2 R −x 2 2
R −x 2 y1 (x)
We can check that y2 (x) is also a solution (for any value of R).
One thing to observe from this example is that it is not always possible to extend our solutions to all values
of x. The solutions we have graphed only exist on an interval [−R, R], and cannot be extended any further,
because the develop vertical tangent lines at x = ±R.
In a mathematically rigorous treatment of differential equations, we would prove the following theorem:
Existence of Solutions to First Order Differential Equations. Let f (x, y) be a function which is
continuous in the vicinity of a point (x0 , y0 ). Then the initial value problem
dy
= f (x, y) , y(x0 ) = y0
dx
has a solution y = y(x), which can be defined on a small interval (x0 −ϵ, x0 +ϵ), but which cannot necessarily
be extended beyond this interval.
Autonomous Equations. Often one needs to model the behavior of a physical systems whose governing
laws are fixed and not dependent on time. This leads to differential equations of the following special form:
dy
= f (y).
dt
Equations of this form, where the right hand side depends only on y and not on t, are said to be autonomous.1
As a first example of an autonomous equation, suppose we take a hot piece of metal and submerge it in a
large pool of water. Over time the metal will cool down, and its temperature will approach the temperature
of the water.2 This can be modeled using Newton’s law of cooling, which states that the rate of change of
the temperature of the metal is proportional to the temperature difference between the metal and the water.
More explicitly, if we write
T (t) = temperature of the metal at time t,
then Newton’s law of cooling can be expressed as follows:
dT
= −k(T − Twater ).
dt
Notice that the right hand side of this equation does not depend on t - the equation is autonomous.
The constant k which appears in Newton’s law must be determined empirically - it will depend on the
particular type of metal we use. For the purposes of illustration, let’s choose our units of measurement so
that k = Twater = 1 - then the equation simplifies to
dT
= 1 − T.
dt
To visualize the solutions of this equation, we must make a slope field. This can be done using the simple
observation that the isoclines
1 − T = constant
are horizontal lines:
T
When we see this picture, one thing should immediately pop out: the horizontal slopes along the isocline
T = 1. In this case, the isocline is actually a integral curve, corresponding to the constant solution
T = 1.
It’s easy to verify that this in fact a solution:
dT
= 0 = 1 − 1 = 1 − T.
dt
1The word autonomous comes from ancient Greek, and means “independent” or “subject to one’s own laws”.
2Obviously, the water will also be heated by the metal, but if we assume that the volume of water is sufficiently large then
we can neglect this effect.
8
Physically, this makes sense - if the metal is already the same temperature as the water when we drop it in,
then its temperature won’t change.
A second thing is that the slopes above the line T = 1 are all negative, whereas the slopes below the line
T = 1 are all positive. This makes physical sense: if the initial temperature of the metal is greater than the
temperature of the water, then water will cool the metal off, and its temperature will decrease. If the initial
temperature of the metal is less than the temperature of the water, then the water will heat the metal up,
and its temperature will increase.
If we plot several solutions with different initial values at t = 0, here is what we see:
T
As we can see, the solutions all approach the value T = 1 as t → ∞. We will soon be able to see this directly,
by explicitly solving the equation.
We can see another interesting feature of this equation by plotting solutions which start at the same value
of T , but at different times t:
T
The solutions are exactly the same, except they are shifted in time. This is a reflection of the fact that the
equation is autonomous - the solutions obey the same rules, no matter what time they start, so their time
evolution must be the same.
All three of the observations we have made above can be applied to arbitrary autonomous equations. In
general, the following principles can be applied to any autonomous equation:
9
1. If f (y0 ) = 0, then the constant function y(t) = y0 is a solution of the autonomous equation dy dt = f (y).
Solutions like this are referred to as equilibrium solutions, and the values y0 are referred to as
equilibrium values.
2. If f (y0 ) > 0, then any solution of the equation dy dt = f (y) will increase as t → ∞, eventually
approaching an equilibrium value (or diverging to infinity).
3. If f (y0 ) < 0, then any solution of the equation dy dt = f (y) will decrease as t → ∞, eventually
approaching an equilibrium value (or diverging to negative infinity).
4. If y(t) is any solution of the equation dydt = f (y), then y(t − t0 ) is also a solution, for any value t0 .
We will not attempt to fully justify these principles. Instead, we will illustrate all of them in the context of
a single autonomous equation,
dc
= (c − 1)(c − 2).
dt
For values of c that are between 1 and 2, it is negative (because it is the product of a positive term and a
negative term). At c = 1 and c = 2, it is zero. For all other values, it is positive. To visualize this, we can
make a sign plot:
f (c)
+ − +
| |
1 2 c
Notice that we drew a negative slope for values of c between 1 and 2, and a positive slope for all other values.
10
If 1 < c < 2, the solutions decrease until they approach the equilibrium value c = 1:
c
If c < 1, the solutions increase until they approach the equilibrium value c = 1. If c > 2, they increase to
infinity:
c
t
11
Separable Equations. A first order equation is said to be separable if it can be written in the form
dy
= f (x)g(y),
dx
where f and g are arbitrary functions.
Note that autonomous equations are a special case (f (x) = 1). In fact, we can borrow an idea from that
context and notice that separable equations often have equilibrium solution, which are solutions of the form
y = y0 = constant,
where
g(y0 ) = 0.
The first thing we should always do with a separable equation is find all solutions of this form.
Once we’ve found the equilibrium solutions, we attempt to find all solutions y = y(x) which satisfy g(y) ̸= 0.
To do this, we just divide both sides of the equation by g(y):
1 dy
= f (x)
g(y) dx
This operation is valid precisely because g(y) ̸= 0.
3
We can then do something cute and multiply both sides of the equation by dx:
1
dy = f (x)dx
g(y)
We can then integrate both sides of the equation: 4
Z Z
1
dy = f (x)dx + C
g(y)
Evaluating the integrals leads to an equation of the form
G(y) = F (x) + C,
which we can hope to solve, obtaining a formula for y as a function of x.
For example, consider the equation
dy x
=−
dx y
from the “slope fields” section of this week’s notes. To solve this equation we first separate the variables,
ydy = −xdx,
and then we integrate both sides,
y2 x2
=− +C
2 2
and solve for y,
p p √
y = ± 2C − x2 = ± R2 − x2 , R = 2C.
The solution takes the exact form we predicted, based on the slope field picture!
3We might find this notation a bit unclear. To understand it, we have to keep in mind that y is a function of x, so the left
hand side should really be
1
y ′ (x)dx
g(y(x))
When we integrate this, we immediately apply the “substitution” technique, with y = y(x) and dy = y ′ (x)dx. This gives
Z Z
1 1
y ′ (x)dx = dy.
g(y(x)) g(y)
4Technically, we need to include a constant of integration on both sides. But we can always subtract the constant on the
left hand side and absorb it into the constant on the right hand side.
12
We can use this same technique to solve the autonomous equations we studeied in the previous section. For
example, consider the equation
dT
= 1 − T,
dt
where T (t) represents the temperature of a iece of metal which has been submerged in a water bath.
To solve this equation, we first look for its equilibrium solutions:
1 − T = 0 =⇒ T = 1.
Next, we find the non-equilibrium solutions, by assuming that T ̸= 1 and separating the variables:
dT
= −dt
T −1
Integrating both sides, we obtain
ln |T − 1| = −t + C1 .
Here we have to be careful to include the absolute value sign, to avoid missing some solutions!
Solving for T , we find that
|T − 1| = e−t+C1 .
T = 1 ± e−t+C1
The form of the solution reflects the fact that the equation is autonomous: its solutions can be translated
in time.
At this point it is helpful to introduce a new constant C2 and write
T = 1 + C2 e−t
Something nice happens when we do this, which is that although C2 = ±eC1 had to be a nonzero number,
we can recover our equilibrium solution by setting C2 = 0! So, the most general solution of the equation is
T = 1 + Ce−t ,
where C is a completely arbitrary constant (either zero or nonzero).
Observe that all solutions approach the equilibrium value T = 1 in the limit as t → ∞:
lim T = lim 1 + Ce−t = 1 + 0 = 1.
t→∞ t→∞
This confirms our geometric intuition: T = 1 is a stable equilibrium point.
Finally, let’s solve the initial value problem which we considered in the second example:
dc
= (c − 1)(c − 2) , c(0) = 0.
dt
Here we have two equilibrium solutions, c = 1 and c = 2. Neither of these is consistent with our initial
condition c(0) = 0, so we can ignore them here.
Since c ̸= 1 and c ̸= 2, we can proceed:
dc
= dt.
(c − 1)(c − 2)
To integrate both sides of this equation, we need a special trick: partial fractions. We write
1 A B
= +
(c − 1)(c − 2) c−1 c−2
and try to determine the appropriate values of A and B. One method of doing this is to clear the denominators
on both sides:
1 = A(c − 2) + B(c − 1)
and then simplify:
1 = (A + B)c + (−2A − B).
In order for this equation to be valid for all values of c (which is what we’re after), we must have
A + B = 0 , −2A − B = 1
It’s not terribly difficult to solve this system of equations and obtain values for A and B.
13
However, there is a quicker method of obtaining the values of A and B, since we know that we will be able
to solve for them! It’s called the Heaviside cover-up method, and it goes like this. We take the equation
1 = A(c − 2) + B(c − 1)
and we substitute values of c which cause one or the other term on the right hand side to disappear (if we do
this on paper, we can “cover up” that term with the fingers, hence the name of the method). For example,
if we substitute c = 1, we obtain:
1 = A(1 − 2) + B(1 − 1) = −A
so we must have A = −1. Similarly if we substitute c = 2, we obtain the value of B:
1 = A(2 − 2) + B(2 − 1) = B.
− ln(1 − c) + ln(2 − c) = t + K
2−c
= 2et
1−c
2 − c = (2 − 2c)et
2 − 2et = c − 2cet
2 − 2et 2e−t − 2
c= t
= −t
1 − 2e e −2
If we take the limit as t → ∞, we see that the solution approaches the equilibrium value c = 1, as predicted:
2e−t − 2 −2
lim c = lim = = 1.
t→∞ t→∞ e−t − 2 −2
14
First Order Linear Equations. A first order linear equation is an equation of the form
dy
= p(x)y + q(x)
dx
where p = p(x) and q = q(x) are arbitrary functions of x.
We have already encountered one equation of this form - Newton’s law of cooling:
dT
= −k(T − T0 ) = −kT + kT0 .
dt
In this case the coefficients p = −k and q = kT0 were constants - this made the equation separable.
In the general case we need a completely different method. This method has four steps: