Part IA — Differential Equations
Based on lectures by M. G. Worster
Notes taken by Dexter Chua
Michaelmas 2014
These notes are not endorsed by the lecturers, and I have modified them (often
significantly) after lectures. They are nowhere near accurate representations of what
was actually lectured, and in particular, all errors are almost surely mine.
Basic calculus
Informal treatment of differentiation as a limit, the chain rule, Leibnitz’s rule, Taylor
series, informal treatment of
O
and
o
notation and l’Hˆopital’s rule; integration as an
area, fundamental theorem of calculus, integration by substitution and parts. [3]
Informal treatment of partial derivatives, geometrical interpretation, statement (only)
of symmetry of mixed partial derivatives, chain rule, implicit differentiation. Informal
treatment of differentials, including exact differentials. Differentiation of an integral
with resp ect to a parameter. [2]
First-order linear differential equations
Equations with constant coefficients: exp onential growth, comparison with discrete
equations, series solution; modelling examples including radioactive decay.
Equations with non-constant coefficients: solution by integrating factor. [2]
Nonlinear first-order equations
Separable equations. Exact equations. Sketching solution trajectories. Equilibrium
solutions, stability by perturbation; examples, including logistic equation and chemical
kinetics. Discrete equations: equilibrium solutions, stability; examples including the
logistic map. [4]
Higher-order linear differential equations
Complementary function and particular integral, linear independence, Wronskian (for
second-order equations), Abel’s theorem. Equations with constant coefficients and
examples including radioactive sequences, comparison in simple cases with difference
equations, reduction of order, resonance, transients, damping. Homogeneous equations.
Response to step and impulse function inputs; introduction to the notions of the Heav-
iside step-function and the Dirac delta-function. Series solutions including statement
only of the need for the logarithmic solution. [8]
Multivariate functions: applications
Directional derivatives and the gradient vector. Statement of Taylor series for functions
on
R
n
. Local extrema of real functions, classification using the Hessian matrix. Coupled
first order systems: equivalence to single higher order equations; solution by matrix
metho ds. Non-degenerate phase portraits local to equilibrium points; stability.
Simple examples of first- and second-order partial differential equations, solution of
the wave equation in the form f (x + ct) + g(x − ct). [5]
Contents
0 Introduction
1 Differentiation
1.1 Differentiation
1.2 Small o and big O notations
1.3 Methods of differentiation
1.4 Taylor’s theorem
1.5 L’Hopital’s rule
2 Integration
2.1 Integration
2.2 Methods of integration
3 Partial differentiation
3.1 Partial differentiation
3.2 Chain rule
3.3 Implicit differentiation
3.4 Differentiation of an integral wrt parameter in the integrand
4 First-order differential equations
4.1 The exponential function
4.2 Homogeneous linear ordinary differential equations
4.3 Forced (inhomogeneous) equations
4.3.1 Constant forcing
4.3.2 Eigenfunction forcing
4.4 Non-constant coefficients
4.5 Non-linear equations
4.5.1 Separable equations
4.5.2 Exact equations
4.6 Solution curves (trajectories)
4.7 Fixed (equilibrium) points and stability
4.7.1 Perturbation analysis
4.7.2 Autonomous systems
4.7.3 Logistic Equation
4.8 Discrete equations (Difference equations)
5 Second-order differential equations
5.1 Constant coefficients
5.1.1 Complementary functions
5.1.2 Second complementary function
5.1.3 Phase space
5.2 Particular integrals
5.2.1 Guessing
5.2.2 Resonance
5.2.3 Variation of parameters
5.3 Linear equidimensional equations
5.4 Difference equations
5.5 Transients and damping
5.6 Impulses and point forces
5.6.1 Dirac delta function
5.7 Heaviside step function
6 Series solutions
7 Directional derivative
7.1 Gradient vector
7.2 Stationary points
7.3 Taylor series for multi-variable functions
7.4 Classification of stationary points
7.5 Contours of f (x, y)
8 Systems of differential equations
8.1 Linear equations
8.2 Nonlinear dynamical systems
9 Partial differential equations (PDEs)
9.1 First-order wave equation
9.2 Second-order wave equation
9.3 The diffusion equation
0 Introduction
In this course, it is assumed that students already know how to do calculus.
While we will define all of calculus from scratch, it is there mostly to introduce
the big and small
o
notation which will be used extensively in this and future
courses (as well as for the sake of completeness). It is impossible for a person
who hasn’t seen calculus before to learn calculus from those few pages.
Calculus is often used to model physical systems. For example, if we know
that the force
F
=
m¨x
on a particle at any time
t
is given by
t
2
−
1, then we
can write this as
m¨x = t
2
− 1.
We can easily integrate this twice with respect to
t
, and find the position
x
as a
function of time.
However, often the rules governing a physical system are not like this. Instead,
the force on the particle is more likely to depend on the position of the particle,
instead of what time it is. Hence the actual equation of motion might be
m¨x = x
2
− 1.
This is an example of a differential equation. We are given an equation that
a function
x
obeys, often involving derivatives of
x
, and we have to find all
functions that satisfy this equation (of course, the first equation is also a
differential equation, but a rather boring one).
A closely related notion is difference equations. These are discrete analogues
of differential equations. A famous example is the Fibonacci sequence, which
states that
F
n+2
− F
n+1
− F
n
= 0.
This specifies a relationship between terms in a sequence (
F
n
), and we want to
find an explicit solution to this equation.
In this course, we will develop numerous techniques to solve different differ-
ential equations and difference equations. Often, this involves guessing of some
sort.
1 Differentiation
We will first quickly go through basic notions of differentiation and integration.
You should already be familiar with these from A levels or equivalent.
1.1 Differentiation
Definition (Derivative of function). The derivative of a function
f
(
x
) with
respect to x, interpreted as the rate of change of f(x) with x, is
df
dx
= lim
h→0
f(x + h) − f(x)
h
.
A function
f
(
x
) is differentiable at
x
if the limit exists (i.e. the left-hand and
right-hand limits are equal).
Example.
f
(
x
) =
|x|
is not differentiable at
x
= 0 as
lim
h→0
+
|h|−|0|
h
= 1 and
lim
h→0
−
|h|−|0|
h
= −1.
Notation. We write
df
dx
=
f
0
(
x
) =
d
dx
f
(
x
). Also,
d
dx
d
dx
f(x)
=
d
2
dx
2
f
(
x
) =
f
00
(x).
Note that the notation
f
0
represents the derivative with respect to the
argument. For example, f
0
(2x) =
df
d(2x)
1.2 Small o and big O notations
Definition (O and o notations).
(i)
“
f
(
x
) =
o
(
g
(
x
)) as
x → x
0
” if
lim
x→x
0
f(x)
g(x)
= 0. Intuitively,
f
(
x
) is much
smaller than g(x).
(ii)
“
f
(
x
) =
O
(
g
(
x
)) as
x → x
0
” if
f(x)
g(x)
is bounded as
x → x
0
. Intuitively,
f(x) is about as big as g(x).
Note that for f(x) = O(g(x)) to be true, lim
x→x
0
f(x)
g(x)
need not exist.
Usually,
x
0
is either 0 or infinity. Clearly, we have
f
(
x
) =
o
(
g
(
x
)) implies
f(x) = O(g(x)).
Note that this is an abuse of notation. We are not really saying that
f
(
x
)
is “equal” to
o
(
g
(
x
)), since
o
(
g
(
x
)) itself is not a function. Instead,
o
(
g
(
x
))
represents a class of functions (namely functions that satisfy the property above),
and we are saying that
f
is in this class. Technically, a better notation might
be
f
(
x
)
∈ o
(
g
(
x
)), but in practice, writing
f
(
x
) =
o
(
g
(
x
)) is more common and
more convenient.
Example.
– x = o(
√
x) as x → 0 and
√
x = o(x) as x → ∞.
– sin 2x = O(x) as x → 0 as sin θ ≈ θ for small θ.
– sin 2x = O(1) as x → ∞ even though the limit does not exist.
This notation will frequently be used in calculus. For example, if we want to
ignore all terms second order in
x
in an expression, we can write out the first
order terms and then append +
O
(
x
2
). In particular, we can use it to characterize
derivatives in a different way.
Proposition.
f(x
0
+ h) = f(x
0
) + f
0
(x
0
)h + o(h)
Proof. We have
f
0
(x
0
) =
f(x
0
+ h) − f(x
0
)
h
+
o(h)
h
by the definition of the derivative and the small
o
notation. The result follows.
1.3 Methods of differentiation
Theorem (Chain rule). Given f(x) = F (g(x)), then
df
dx
=
dF
dg
dg
dx
.
Proof. Assuming that
dg
dx
exists and is therefore finite, we have
df
dx
= lim
h→0
F (g(x + h)) − F (g(x))
h
= lim
h→0
F [g(x) + hg
0
(x) + o(h)] − F (g(x))
h
= lim
h→0
F (g(x)) + (hg
0
(x) + o(h))F
0
(g(x)) + o(hg
0
(x) + o(h)) − F (g(x))
h
= lim
h→0
g
0
(x)F
0
(g(x)) +
o(h)
h
= g
0
(x)F
0
(g(x))
=
dF
dg
dg
dx
Theorem (Product Rule). Give f(x) = u(x)v(x). Then
f
0
(x) = u
0
(x)v(x) + u(x)v
0
(x).
Theorem (Leibniz’s Rule). Given f = uv, then
f
(n)
(x) =
n
X
r=0
n
r
u
(r)
v
(n−r)
,
where f
(n)
is the n-th derivative of f.
1.4 Taylor’s theorem
Theorem (Taylor’s Theorem). For n-times differentiable f, we have
f(x + h) = f(x) + hf
0
(x) +
h
2
2!
f
00
(x) + ··· +
h
n
n!
f
(n)
(x) + E
n
,
where E
n
= o(h
n
) as h → 0. If f
(n+1)
exists, then E
n
= O(h
n+1
).
Note that this only gives a local approximation around
x
. This does not
necessarily tell anything about values of f far from x (but sometimes does).
An alternative form of the sum above is:
f(x) = f(x
0
) + (x − x
0
)f
0
(x
0
) + ··· +
(x − x
0
)
n
n!
f
(n)
(x
0
) + E
n
.
When the limit as
n → ∞
is taken, the Taylor series of
f
(
x
) about the point
x = x
0
is obtained.
1.5 L’Hopital’s rule
Theorem (L’Hopital’s Rule). Let
f
(
x
) and
g
(
x
) be differentiable at
x
0
, and
lim
x→x
0
f(x) = lim
x→x
0
g(x) = 0. Then
lim
x→x
0
f(x)
g(x)
= lim
x→x
0
f
0
(x)
g
0
(x)
.
Proof.
From the Taylor’s Theorem, we have
f
(
x
) =
f
(
x
0
) + (
x − x
0
)
f
0
(
x
0
) +
o(x − x
0
), and similarly for g(x). Thus
lim
x→x
0
f(x)
g(x)
= lim
x→x
0
f(x
0
) + (x − x
0
)f
0
(x
0
) + o(x − x
0
)
g(x
0
) + (x − x
0
)g
0
(x
0
) + o(x − x
0
)
= lim
x→x
0
f
0
(x
0
) +
o(x−x
0
)
x−x
0
g
0
(x
0
) +
o(x−x
0
)
x−x
0
= lim
x→x
0
f
0
(x)
g
0
(x)
2 Integration
2.1 Integration
Definition (Integral). An integral is the limit of a sum, e.g.
Z
b
a
f(x) dx = lim
∆x→0
N
X
n=0
f(x
n
)∆x.
For example, we can take ∆
x
=
b−a
N
and
x
n
=
a
+
n
∆
x
. Note that an integral
need not be defined with this particular ∆
x
and
x
n
. The term “integral” simply
refers to any limit of a sum (The usual integrals we use are a special kind known
as Riemann integral, which we will study formally in Analysis I). Pictorially, we
have
x
y
a x
1
x
2
x
3
···
x
n
x
n+1
···
···
b
The area under the graph from
x
n
to
x
n+1
is
f
(
x
n
)∆
x
+
O
(∆
x
2
). Provided
that f is differentiable, the total area under the graph from a to b is
lim
N→∞
N−1
X
n=0
(f(x
n
)∆x)+N·O(∆x
2
) = lim
N→∞
N−1
X
n=0
(f(x
n
)∆x)+O(∆x) =
Z
b
a
f(x) dx
Theorem (Fundamental Theorem of Calculus). Let
F
(
x
) =
R
x
a
f
(
t
) d
t
. Then
F
0
(x) = f(x).
Proof.
d
dx
F (x) = lim
h→0
1
h
"
Z
x+h
a
f(t) dt −
Z
x
a
f(t) dt
#
= lim
h→0
1
h
Z
x+h
x
f(t) dt
= lim
h→0
1
h
[f(x)h + O(h
2
)]
= f(x)
Similarly, we have
d
dx
Z
b
x
f(t) dt = −f (x)
and
d
dx
Z
g(x)
a
f(t) dt = f (g(x))g
0
(x).
Notation. We write
R
f
(
x
) d
x
=
R
x
f
(
t
) d
t
, where the unspecified lower limit
gives rise to the constant of integration.
2.2 Methods of integration
Integration is substantially harder than differentiation. Given an expression,
the product rule and chain rule combined with a few standard derivatives can
usually differentiate it with ease. However, many seemingly-innocent expressions
can turn out to be surprisingly difficult, if not impossible, to integrate. Hence
we have to come up with a lot of tricks to do integrals.
Example (Integration by substitution). Consider
R
1−2x
√
x−x
2
d
x
. Write
u
=
x−x
2
and du = (1 − 2x) dx. Then the integral becomes
Z
du
√
u
= 2
√
u + C = 2
p
x − x
2
+ C.
Trigonometric substitution can be performed with reference to the following
table: if the function in the 2nd column is found in the integrand, perform
the substitution in the 3rd column and simplify using the identity in the first
column:
Useful identity Part of integrand Substitution
cos
2
θ + sin
2
θ = 1
√
1 − x
2
x = sin θ
1 + tan
2
θ = sec
2
θ 1 + x
2
x = tan θ
cosh
2
u − sinh
2
u = 1
√
x
2
− 1 x = cosh u
cosh
2
u − sinh
2
u = 1
√
1 + x
2
x = sinh u
1 − tanh
2
u = sech
2
u 1 −x
2
x = tanh u
Example. Consider
R
√
2x − x
2
d
x
=
R
p
1 − (x − 1)
2
d
x
. Let
x −
1 =
sin θ
and thus dx = cos θ dθ. The expression becomes
Z
cos
2
θ dθ =
Z
cos 2θ + 1
2
dθ
=
1
4
sin 2θ +
1
2
θ + C
=
1
2
sin
−1
(x − 1) +
1
2
(x − 1)
p
2x − x
2
+ C.
Theorem (Integration by parts).
Z
uv
0
dx = uv −
Z
vu
0
dx.
Proof.
From the product rule, we have (
uv
)
0
=
uv
0
+
u
0
v
. Integrating the whole
expression and rearranging gives the formula above.
Example. Consider
R
∞
0
xe
−x
d
x
. Let
u
=
x
ad
v
0
=
e
−x
. Then
u
0
= 1 and
v = −e
−x
. We have
Z
∞
0
xe
−x
dx = [−xe
−x
]
∞
0
+
Z
∞
0
e
−x
dx
= 0 + [−e
−x
]
∞
0
= 1
Example (Integration by Parts). Consider
R
log x
d
x
. Let
u
=
log x
and
v
0
= 1.
Then u
0
=
1
x
and v = x. So we have
Z
log x dx = x log x −
Z
dx
= x log x − x + C
3 Partial differentiation
3.1 Partial differentiation
So far, we have only considered functions of one variable. If we have a function
of multiple variables, say
f
(
x, y
), we can either differentiate it with respect to
x
or with respect to y.
Definition (Partial derivative). Given a function of several variables
f
(
x, y
),
the partial derivative of
f
with respect to
x
is the rate of change of
f
as
x
varies,
keeping y constant. It is given by
∂f
∂x
y
= lim
δx→0
f(x + δx, y) − f(x, y)
δx
Example. Consider
f
(
x, y
) =
x
2
+
y
3
+
e
xy
2
. Computing the partial derivative
is equivalent to computing the regular derivative with the other variables treated
as constants. e.g.
∂f
∂x
y
= 2x + y
2
e
xy
2
.
Second and mixed partial derivatives can also be computed:
∂
2
f
∂x
2
= 2 + y
4
e
xy
2
∂
2
f
∂y∂x
=
∂
∂y
∂f
∂x
= 2ye
xy
2
+ 2xy
3
e
xy
2
It is often cumbersome to write out the variables that are kept constant. If
all other variables are being held constant, we simply don’t write them out, and
just say
∂f
∂x
.
Another convenient notation is
Notation.
f
x
=
∂f
∂x
, f
xy
=
∂
2
f
∂y∂x
.
It is important to know how the order works in the second case. The left
hand side should be interpreted as (
f
x
)
y
. So we first differentiate with respect
to x, and then y. However, in most cases, this is not important, since we have
Theorem. If f has continuous second partial derivatives, then f
xy
= f
yx
.
We will not prove this statement and just assume it to be true (since this is
an applied course).
3.2 Chain rule
Consider an arbitrary displacement in any direction (
x, y
)
→
(
x
+
δx, y
+
δy
).
We have
δf = f(x + δx, y + δy) − f(x, y)
= f(x + δx, y + δy) − f(x + δx, y) + f(x + δx, y) − f(x, y)
= f
y
(x + δx, y)δy + o(δy) + f
x
(x, y)δx + o(δx)
= (f
y
(x, y) + o(1))δy + o(δy) + f
x
(x, y)δx + o(δx)
δf =
∂f
∂x
δx +
∂f
∂y
δy + o(δx, δy)
Take the limit as δx, δy → 0, we have
Theorem (Chain rule for partial derivatives).
df =
∂f
∂x
dx +
∂f
∂y
dy.
Given this form, we can integrate the differentials to obtain the integral form:
Z
df =
Z
∂f
∂x
dx +
Z
∂f
∂y
dy,
or divide by another small quantity. e.g. to find the slope along the path
(x(t), y(t)), we can divide by dt to obtain
df
dt
=
∂f
∂x
dx
dt
+
∂f
∂y
dy
dt
.
If we pick the parameter t to be the arclength s, we have
df
ds
=
∂f
∂x
dx
ds
+
∂f
∂y
dy
ds
=
dx
ds
,
dy
ds
·
∂f
∂x
,
∂f
∂y
= ˆs · ∇f,
which is known as the directional derivative (cf. Chapter 7).
Alternatively, the path may also be given by
y
=
y
(
x
). So
f
=
f
(
x, y
(
x
)).
Then the slope along the path is
df
dx
=
∂f
∂x
y
+
∂f
∂y
dy
dx
.
The chain rule can also be used for the change of independent variables, e.g.
change to polar coordinates x = x(r, θ), y = y(r, θ). Then
∂f
∂θ
r
=
∂f
∂x
y
∂x
∂θ
r
+
∂f
∂y
x
∂y
∂θ
r
.
3.3 Implicit differentiation
Consider the contour surface of a function
F
(
x, y, z
) given by
F
(
x, y, z
) = const.
This implicitly defines
z
=
z
(
x, y
). e.g. If
F
(
x, y, z
) =
xy
2
+
yz
2
+
z
5
x
= 5,
then we can have
x
=
5−yz
2
y
2
+z
5
. Even though
z
(
x, y
) cannot be found explicitly
(involves solving quintic equation), the derivatives of
z
(
x, y
) can still be found
by differentiating F (x, y, z) = const w.r.t. x holding y constant. e.g.
∂
∂x
(xy
2
+ yz
2
+ z
5
x) =
∂
∂x
5
y
2
+ 2yz
∂z
∂x
+ z
5
+ 5z
4
x
∂z
∂x
= 0
∂z
∂x
= −
y
2
+ z
5
2yz + 5z
4
x
In general, we can derive the following formula:
Theorem (Multi-variable implicit differentiation). Given an equation
F (x, y, z) = c
for some constant c, we have
∂z
∂x
y
= −
(∂F )/(∂x)
(∂F )/(∂z)
Proof.
dF =
∂F
∂x
dx +
∂F
∂y
dy +
∂F
∂z
dz
∂F
∂x
y
=
∂F
∂x
∂x
∂x
y
+
∂F
∂y
∂y
∂x
y
+
∂F
∂z
∂z
∂x
y
= 0
∂F
∂x
+
∂F
∂z
∂z
∂x
y
= 0
∂z
∂x
y
= −
(∂F )/(∂x)
(∂F )/(∂z)
3.4
Differentiation of an integral wrt parameter in the
integrand
Consider a family of functions
f
(
x, c
). Define
I
(
b, c
) =
R
b
0
f
(
x, c
)d
x
. Then by
the fundamental theorem of calculus, we have
∂I
∂b
=
f
(
b, c
). On the other hand,
we have
∂I
∂c
= lim
δc→0
1
δc
"
Z
b
0
f(x, c + δc)dx −
Z
b
0
f(x, c) dx
#
= lim
δc→0
Z
b
0
f(x, c + δc) − f(x, c)
δc
dx
=
Z
b
0
lim
δc→0
f(x, c + δc) − f(x, c)
δc
dx
=
Z
b
0
∂f
∂c
dx
In general, if I(b(x), c(x)) =
R
b(x)
0
f(y, c(x))dy, then by the chain rule, we have
dI
dx
=
∂I
∂b
db
dx
+
∂I
∂c
dc
dx
= f(b, c)b
0
(x) + c
0
(x)
Z
b
0
∂f
∂c
dy.
So we obtain
Theorem (Differentiation under the integral sign).
d
dx
Z
b(x)
0
f(y, c(x)) dy = f(b, c)b
0
(x) + c
0
(x)
Z
b
0
∂f
∂c
dy
This is sometimes a useful technique that allows us to perform certain
otherwise difficult integrals, as you will see in the example sheets. However, here
we will only have time for a boring example.
Example. Let I =
R
1
0
e
−λx
2
dx. Then
dI
dλ
=
Z
1
0
−x
2
e
−λx
2
dx.
If I =
R
λ
0
e
−λx
2
dx. Then
dI
dλ
= e
−λ
3
+
Z
λ
0
−x
2
e
−λx
2
dx.
4 First-order differential equations
A differential equation is an equation that involves derivatives, such as
x
2
dy
dx
+
2
y
= 0. Unlike regular equations where the solution is a number, the solution to
a differential equation is a function that satisfies the equation. In this chapter,
we will look at first-order differential equations, where only first derivatives are
involved.
4.1 The exponential function
Often, the solutions to differential equations involve the exponential function.
Consider a function f(x) = a
x
, where a > 0 is constant.
x
y
O
1
The derivative of this function is given by
df
dx
= lim
h→0
a
x+h
− a
x
h
= a
x
lim
h→0
a
h
− 1
h
= λa
x
= λf(x)
where
λ
=
lim
h→0
a
h
− 1
h
=
f
0
(0) = const. So the derivative of an exponential
function is a multiple of the original function. In particular,
Definition (Exponential function).
exp
(
x
) =
e
x
is the unique function
f
satisfying f
0
(x) = f(x) and f(0) = 1.
We write the inverse function as ln x or log x.
Then if y = a
x
= e
x ln a
, then y
0
= e
x ln a
ln a = a
x
ln a. So λ = ln a.
Using this property, we find that the value of e is given by
e = lim
k→∞
1 +
1
k
k
≈ 2.718281828 ··· .
The importance of the exponential function lies in it being an eigenfunction of
the differential operator.
Definition (Eigenfunction). An eigenfunction under the differential operator
is a function whose functional form is unchanged by the operator. Only its
magnitude is changed. i.e.
df
dx
= λf
Example. e
mx
is an eigenfunction since
d
dx
e
mx
= me
mx
.
4.2 Homogeneous linear ordinary differential equations
Before we start, we will first define the terms used in the title. These are useful
criteria for categorizing differential equations.
Definition (Linear differential equation). A differential equation is linear if the
dependent variable (y, y
0
, y
00
etc.) appears only linearly.
Definition (Homogeneous differential equation). A differential equation is
homogeneous if y = 0 is a solution.
Definition (Differential equation with constant coefficients). A differential
equation has constant coefficients if the independent variable
x
does not appear
explicitly.
Definition (First-order differential equation). A differential equation is first-
order if only first derivatives are involved.
Theorem. Any linear, homogeneous, ordinary differential equation with constant
coefficients has solutions of the form e
mx
.
This theorem is evident when we consider an example.
Example. Given 5
dy
dx
− 3y = 0. Try y = e
mx
. Then
dy
dx
= me
mx
5me
mx
− 3e
mx
= 0
Since this must hold for all values of
x
, there exists some value
x
for which
e
mx
6
= 0 and we can divide by
e
mx
(note in this case this justification is not
necessary, because
e
mx
is never equal to 0. However, we should justify as above
if we are dividing, say,
x
m
). Thus 5
m −
3 = 0 and
m
= 3
/
5. So
y
=
e
3x/5
is a
solution.
Because the equation is linear and homogeneous, any multiple of a solution
is also a solution. Therefore y = Ae
3x/5
is a solution for any value of A.
But is this the most general form of the solution? One can show that an
n
th
-order linear differential equation has
n
and only
n
independent solutions. So
y = Ae
3x/5
is indeed the most general solution.
We can determine A by applying a given boundary condition.
Discrete equations
Suppose that we are given the equation 5
y
0
−
3
y
= 0 with boundary condition
y
=
y
0
at
x
= 0. This gives a unique function
y
. We can approximate this by
considering discrete steps of length
h
between
x
n
and
x
n+1
. (Using the simple
Euler numerical scheme,) we can approximate the equation by
5
y
n+1
− y
n
h
− 3y
n
≈ 0.
Rearranging the terms, we have
y
n+1
≈
(1 +
3
5
h
)
y
n
. Applying the relation
successively, we have
y
n
=
1 +
3
5
h
y
n−1
=
1 +
3
5
h
1 +
3
5
h
y
n−2
=
1 +
3
5
h
n
y
0
For each given value of x, choose h = x/n, so
y
n
= y
0
1 +
3
5
(x/n)
n
.
Taking the limit as n → ∞, we have
y(x) = lim
n→∞
y
0
1 +
3x/5
n
n
= y
0
e
3x/5
,
in agreement with the solution of the differential equation.
x
y
solution of diff. eq.
1
discrete approximation
O
x
0
x
1
x
2
x
3
Series solution
We can also try to find a solution in the form of a Taylor Series
y
=
∞
P
n=0
a
n
x
n
.
We have y
0
=
P
a
n
nx
n−1
. Substituting these into our equation
5y
0
− 3y = 0
5(xy
0
) − 3x(y) = 0
X
a
n
(5n − 3x)x
n
= 0
Consider the coefficient of
x
n
: 5
na
n
−
3
a
n−1
= 0. Since this holds for all values
of
n
, when
n
= 0, we get 0
a
0
= 0. This tells that
a
0
is arbitrary. If
n >
0, then
a
n
=
3
5n
a
n−1
=
3
2
5
2
1
n(n − 1)
a
n−2
= ··· =
3
5
n
1
n!
a
0
.
Therefore we have
y = a
0
∞
X
n=0
3x
5
n
1
n!
h
= a
0
e
3x/5
i
.
4.3 Forced (inhomogeneous) equations
Recall that a homogeneous equation is an equation like 5
y
0
−
3
y
= 0, with no
x
or constant terms floating around. A forced, or inhomogeneous, equation is
one that is not homogeneous. For example, 5
y
0
−
3
y
= 10 or 5
y
0
−
3
y
=
x
2
are
forced equations. We call the “extra” terms 10 and x
2
the forcing terms.
4.3.1 Constant forcing
Example. Consider 5
y
0
−
3
y
= 10. We can spot that there is a equilibrium
(constant) solution y = y
p
= −
10
3
with y
0
p
= 0.
The particular solution
y
p
is a solution of the ODE. Now suppose the general
solution is
y
=
y
p
+
y
c
. We see that 5
y
0
c
−
3
y
c
= 0. So
y
c
satisfies the homogeneous
equation we already solved, and
y = −
10
3
+ Ae
3x/5
.
Note that any boundary conditions to determine
A
must be applied to the full
solution y and not the complementary function y
c
.
This is the general method of solving forced equations. We first find one
particular solution to the problem, often via educated guesses. Then we solve
the homogeneous equation to get a general complementary solution. Then the
general solution to the full equation is the sum of the particular solution and
the general complementary solution.
4.3.2 Eigenfunction forcing
This is the case when the forcing term is an eigenfunction of the differential
operator.
Example. In a radioactive rock, isotope A decays into isotope B at a rate
proportional to the number
a
of remaining nuclei A, and B also decays at a rate
proportional to the number b of remaining nuclei B. Determine b(t).
We have
da
dt
= −k
a
a
db
dt
= k
a
a − k
b
b.
Solving the first equation, we obtain a = a
0
e
−k
a
t
. Then we have
db
dt
+ k
b
b = k
a
a
0
e
−k
a
t
.
We usually put the variables involving
b
on the left hand side and the others on
the right. The right-hand term k
a
a
0
e
−k
a
t
is the forcing term.
Note that the forcing term is an eigenfunction of the differential operator
on the LHS. So that suggests that we can try a particular integral
b
p
=
Ce
−k
a
t
.
Substituting it in, we obtain
−k
a
C + k
b
C = k
a
a
0
C =
k
a
k
b
− k
a
a
0
.
Then write
b
=
b
p
+
b
c
. We get
b
0
c
+
k
b
b
c
= 0 and
b
c
=
De
−k
b
t
. All together, we
have the general solution
b =
k
a
k
b
− k
a
a
0
e
−k
a
t
+ De
−k
b
t
.
Assume the following boundary condition:
b
= 0 when
t
= 0, in which case we
can find
b =
k
a
k
b
− k
a
a
0
e
−k
a
t
− e
−k
b
t
.
x
y
O
a
b
The isotope ratio is
b
a
=
k
a
k
b
− k
a
h
1 − e
(k
a
−k
b
)t
i
.
So given the current ratio
b/a
, with laboratory determined rates
k
a
and
k
b
, we
can determine the value of t, i.e. the age of the rock.
4.4 Non-constant coefficients
Consider the general form of equation
a(x)y
0
+ b(x)y = c(x).
Divide by a(x) to get the standard form
y
0
+ p(x)y = f(x).
We solve this by multiplying an integrating factor
µ
(
x
) to obtain (
µ
)
y
0
+ (
µp
)
y
=
µf.
We want to choose a
µ
such that the left hand side is equal to (
µy
)
0
. By the
product rule, we want µp = µ
0
, i.e.
p =
1
µ
dµ
dx
Z
p dx =
Z
1
µ
dµ
dx
dx
=
Z
1
µ
du
= ln µ(+C)
µ = exp
Z
p dx
Then by construction, we have (µy)
0
= µf and thus
y =
R
µf dx
µ
, where µ = exp
Z
p dx
Example. Consider
xy
0
+ (1
−x
)
y
= 1. To obtain it in standard form, we have
y
0
+
1−x
x
y =
1
x
. We have µ = exp
R
(
1
x
− 1) dx
= e
ln x−x
= xe
−x
. Then
y =
R
xe
−x
1
x
dx
xe
−x
=
−e
−x
+ C
xe
−x
=
−1
x
+
C
x
e
x
Suppose that we have a boundary condition
y
is finite at
x
= 0. Since we have
y
=
Ce
x
−1
x
, we have to ensure that
Ce
x
−
1
→
0 as
x →
0. Thus
C
= 1, and by
L’Hopital’s rule, y → 1 as x → 0.
4.5 Non-linear equations
In general, a first-order equation has the form
Q(x, y)
dy
dx
+ P (x, y) = 0.
(this is not exactly the most general form, since theoretically we can have powers
of
y
0
or even other complicated functions of
y
0
, but we will not consider that
case here).
4.5.1 Separable equations
Definition (Separable equation). A first-order differential equation is separable
if it can be manipulated into the following form:
q(y) dy = p(x) dx.
in which case the solution can be found by integration
Z
q(y) dy =
Z
p(x) dx.
This is the easy kind.
Example.
(x
2
y − 3y)
dy
dx
− 2xy
2
= 4x
dy
dx
=
4x + 2xy
2
x
2
y − 3y
=
2x(2 + y
2
)
y(x
2
− 3)
y
2 + y
2
dy =
2x
x
2
− 3
dx
Z
y
2 + y
2
dy =
Z
2x
x
2
− 3
dx
1
2
ln(2 + y
2
) = ln(x
2
− 3) + C
ln
p
2 + y
2
= ln A(x
2
− 3)
p
y
2
+ 2 = A(x
2
− 3)
4.5.2 Exact equations
Definition (Exact equation).
Q
(
x, y
)
dy
dx
+
P
(
x, y
) = 0 is an exact equation iff
the differential form
Q
(
x, y
) d
y
+
P
(
x, y
) d
x
is exact, i.e. there exists a function
f(x, y) for which
df = Q(x, y) dy + P (x, y) dx
If
P
(
x, y
) d
x
+
Q
(
x, y
) d
y
is an exact differential of
f
, then d
f
=
P
(
x, y
) d
x
+
Q
(
x, y
) d
y
. But by the chain rule, d
f
=
∂f
∂x
d
x
+
∂f
∂y
d
y
and this equality holds
for any displacements dx, dy. So
∂f
∂x
= P,
∂f
∂y
= Q.
From this we have
∂
2
f
∂y∂x
=
∂P
∂y
,
∂
2
f
∂x∂y
=
∂Q
∂x
.
We know that the two mixed 2nd derivatives are equal. So
∂P
∂y
=
∂Q
∂x
.
The converse is not necessarily true. Even if this equation holds, the differential
need not be exact. However, it is true if the domain is simply-connected.
Definition (Simply-connected domain). A domain
D
is simply-connected if it
is connected and any closed curve in
D
can be shrunk to a point in
D
without
leaving D.
Example. A disc in 2D is simply-connected. A disc with a “hole” in the middle
is not simply-connected because a loop around the hole cannot be shrunk into a
point. Similarly, a sphere in 3D is simply-connected but a torus is not.
Theorem. If
∂P
∂y
=
∂Q
∂x
through a simply-connected domain
D
, then
P
d
x
+
Q
d
y
is an exact differential of a single-valued function in D.
If the equation is exact, then the solution is simply
f
= constant, and we
can find f by integrating
∂f
∂x
= P and
∂f
∂y
= Q.
Example.
6y(y − x)
dy
dx
+ (2x − 3y
2
) = 0.
We have
P = 2x − 3y
2
, Q = 6y(y − x).
Then
∂P
∂y
=
∂Q
∂x
= −6y. So the differential form is exact. We now have
∂f
∂x
= 2x − 3y
2
,
∂f
∂y
= 6y
2
− 6xy.
Integrating the first equation, we have
f = x
2
− 3xy
2
+ h(y).
Note that since it was a partial derivative w.r.t.
x
holding
y
constant, the
“constant” term can be any function of
y
. Differentiating the derived
f
w.r.t
y
,
we have
∂f
∂y
= −6xy + h
0
(y).
Thus h
0
(y) = 6y
2
and h(y) = 2y
3
+ C, and
f = x
2
− 3xy
2
+ 2y
3
+ C.
Since the original equation was d
f
= 0, we have
f
= constant. Thus the final
solution is
x
2
− 3xy
2
+ 2y
3
= C.
4.6 Solution curves (trajectories)
Example. Consider the first-order equation
dy
dt
= t(1 − y
2
).
We can solve it to obtain
dy
1 − y
2
= t dt
1
2
ln
1 + y
1 − y
=
1
2
t
2
+ C
1 + y
1 − y
= Ae
t
2
y =
A − e
−t
2
A + e
−t
2
We can plot the solution for different values of
A
and obtain the following graph:
t
y
−1
1
But can we understand the nature of the family of solutions without solving
the equation? Can we sketch the graph without solving it?
We can spot that
y
=
±
1 are two constant solutions and we can plot them
first. We also note (and mark on our graph) that y
0
= 0 at t = 0 for any y.
Then notice that for t > 0, y
0
> 0 if −1 < y < 1. Otherwise, y
0
< 0.
Now we can find isoclines, which are curves along which
dy
dt
(i.e.
f
) is constant:
t
(1
− y
2
) =
D
for some constant
D
. Then
y
2
= 1
− D/t
. After marking a few
isoclines, can sketch the approximate form of our solution:
t
y
−1
1
In general, we sketch the graph of a differential equation
dy
dt
= f(t, y)
by locating constant solutions (and determining stability: see below) and iso-
clines.
4.7 Fixed (equilibrium) points and stability
Definition (Equilibrium/fixed point). An equilibrium point or a fixed point of
a differential equation is a constant solution
y
=
c
. This corresponds to
dy
dt
= 0
for all t.
These are usually the easiest solutions to find, since we are usually given an
expression for
dy
dt
and we can simply equate it to zero.
Definition (Stability of fixed point). An equilibrium is stable if whenever
y
is deviated slightly from the constant solution
y
=
c
,
y → c
as
t → ∞
. An
equilibrium is unstable if the deviation grows as t → ∞.
The objective of this section is to study how to find equilibrium points and
their stability.
Example. Referring to the differential equation above (
˙y
=
t
(1
− y
2
)), we see
that the solutions converge towards
y
= 1, and this is a stable fixed point. They
diverge from y = −1, and this is an unstable fixed point.
4.7.1 Perturbation analysis
Perturbation analysis is used to determine stability. Suppose
y
=
a
is a fixed
point of
dy
dt
=
f
(
y, t
), so
f
(
a, t
) = 0. Write
y
=
a
+
ε
(
t
), where
ε
(
t
) is a small
perturbation from
y
=
a
. We will later assume that
ε
is arbitrarily small. Putting
this into the differential equation, we have
dε
dt
=
dy
dt
= f(a + ε, t)
= f(a, t) + ε
∂f
∂y
(a, t) + O(ε
2
)
= ε
∂f
∂y
(a, t) + O(ε
2
)
Note that this is a Taylor expansion valid when
ε
1. Thus
O
(
ε
2
) can be
neglected and
dε
dt
∼
=
ε
∂f
∂y
.
We can use this to study how the perturbation grows with time.
This approximation is called a linearization of the differential equation.
Example. Using the example ˙y = t(1 − y
2
) above, we have
∂f
∂y
= −2yt =
(
−2t at y = 1
2t at y = −1
.
At
y
= 1,
˙ε
=
−
2
tε
and
ε
=
ε
0
e
−t
2
. Since
ε →
0 as
t → ∞
,
y →
1. So
y
= 1 is a
stable fixed point.
On the other hand, if we consider
y
=
−
1, then
˙ε
= 2
tε
and
ε
=
ε
0
e
t
2
. Since
ε → ∞ as t → ∞, y = −1 is unstable.
Technically
ε → ∞
is not a correct statement, since the approximation used
is only valid for small
ε
. But we can be sure that the perturbation grows (even
if not → ∞) as t increases.
4.7.2 Autonomous systems
Often, the mechanics of a system does not change with time. So
˙y
is only a
function of y itself. We call this an autonomous system.
Definition (Autonomous system). An autonomous system is a system in the
form ˙y = f(y), where the derivative is only (explicitly) dependent on y.
Near a fixed point
y
=
a
, where
f
(
a
) = 0, write
y
=
a
+
ε
(
t
). Then
˙ε
=
ε
df
dy
(
a
) =
kε
for some constant
k
. Then
ε
=
ε
0
e
kt
. The stability of the
system then depends solely on sign of k.
Example. Consider a chemical reaction NaOH + HCl
→
H
2
O + NaCl. We
have
NaOH + HCl → H
2
O + NaCl
Number of molecules a b c c
Initial number of molecules a
0
b
0
0 0
If the reaction is in dilute solution, then the reaction rate is proportional to
ab
.
Thus
dc
dt
= λab
= λ(a
0
− c)(b
0
− c)
= f(c)
We can plot
dc
dt
as a function of c, and wlog a
0
< b
0
.
c
˙c
a
0
b
0
We can also plot a phase portrait, which is a plot of the dependent variable only,
where arrows show the evolution with time,
c
a
0
b
0
We can see that the fixed point c = a
0
is stable while c = b
0
is unstable.
We can also solve the equation explicitly to obtain
c =
a
0