An ordinary differential equation (ODE) is an equation involving an

ODEs
An ordinary differential equation (ODE) is an equation
involving an unknown function y (t) and its derivatives: y 0 (t),
y 00 (t), etc. (and its variable, t).
• physics: v (t) = velocity of object subject to drag force −kv 2 .
2
Newton says: m dv
dt = −kv
• biology: c(t) = concentration of DDT in a fish, accumulated at
rate K , eliminated at rate −kc(t): c 0 (t) = K − kc(t)
• chemistry: ψ(x) = wavefunction of particle in a (1D) box at
2
2
~ d ψ
energy E solves Schrödinger’s equation: − 2m
= Eψ
dx 2
Some terminology:
• ordinary : means the unknown function depends on only one
variable (otherwise you have a PDE)
• an ODE is first order if only y and y 0 are involved (not y 00 , etc),
second order if only y , y 0 , y 00 are involved, etc. . . .
1/1
ODEs
A function satisfying an ODE is called a solution of it.
Given an ODE, our objective is usually either:
1. find all solutions of it (typically there are infinitely many)
Example: find the general solution of dy
dt = y :
t
y (t) = Ce
(how can we be sure these are all the solutions?)
Example: find the general solution of
y (x) = A sin(x) + B cos(x)
d 2y
dx 2
= −y :
2. find the solution satisfying some extra conditions, such as:
• initial conditions (eg: initial position & velocity for Newton )
• boundary conditions (eg: conditions on wavefunctions at box walls)
Example: solve the initial value problem dy
dt = y , y (0) = 3:
y (t) = Ce t , 3 = y (0) = C
=⇒ y (t) = 3e t
2/1
ODEs
Sad fact: we can not solve most ODEs explicitly! So we must
solve them numerically (approximately, by computer).
But there are a special few we can, such as:
First order, separable ODEs:
dy
dt
= F (y )G (t).
Solve by separating variables, then integrating (antidifferentiating):
Z
Z
dy
1
1
= F (y )G (t) →
dy = G (t)dt →
dy = G (t)dt
dt
F (y )
F (y )
Ex: find the general solution, then solve the initial value problem:
1.
dy
dx
=
ey
,
x2
y (1) = 0
2. (drag force)
2
m dv
dt = −kv ,
3. (DDT concentration)
v (0) = v0
c 0 (t) = K − kc,
c(0) = 0
3/1
ODEs
1.
dy
dx
y
= ex 2 , y (1)
R = 0:
R
gen. solution: e −y dy = x −2 dx =⇒ −e −y = −x −1 + C
=⇒ e −y = x1 − C =⇒ y = − ln( x1 − C )
initial value.: 0 = y (1) = − ln(1 − C ) =⇒ C = 0
=⇒ y (x) = − ln(1/x) =⇒ y (x) = ln(x) .
2. (drag force) m dv
= −kv 2 , v (0) = v0 :
R k dt
R dv
k
t + C =⇒ v =
= − m dt =⇒ − v1 = − m
v2
v0 = v (0) = − C1
=⇒ C = − v10 =⇒
v (t) =
1
k
t−C
m
v0
kv
1+ m0 t
.
3. (DDT
c 0 (t) = K − kc, c(0) = 0:
R dc in fish)
R
dt =⇒ − k1 ln(K − kc) = t + C
K −kc =
c(0) = 0 =⇒ C = − k1 ln(K )
=⇒ K −kc = e −kC e −kt = Ke −kt =⇒ c(t) =
K
k (1
− e −kt )
4/1