CALCULUS:Ordinary Differential Equations,its history
Notation and Definitions,Solution methods,Order
Degree,Linearity,Homogeneity
Initial Value/Boundary value problems
Newton’s law of cooling, Heat balance equation (maths)
2. Slide number 2
Ordinary Differential
Equations
Where do ODEs arise?
Notation and Definitions
Solution methods for 1st order
ODEs
3. Slide number 3
Where do ODE’s arise
All branches of Engineering
Economics
Biology and Medicine
Chemistry, Physics etc
Anytime you wish to find out how
something changes with time (and
sometimes space)
4. Slide number 4
Example – Newton’s Law of
Cooling
This is a model of how the
temperature of an object changes as
it loses heat to the surrounding
atmosphere:
Temperature of the object: ObjT Room Temperature: RoomT
Newton’s laws states: “The rate of change in the temperature of an
object is proportional to the difference in temperature between the object
and the room temperature”
)( RoomObj
Obj
TT
dt
dT
Form
ODE
t
RoominitRoomObj eTTTT
)(
Solve
ODE
Where is the initial temperature of the object.initT
5. Slide number 5
Example – Swinging of a
pendulum
q
mg
l
Newton’s 2nd law for a rotating object:
q
q
sin2
2
2
mgl
dt
d
ml
0sin2
2
2
q
q
dt
d
This equation is very difficult to solve.
rearrange and divide
through by ml 2
l
g
2
where
Moment of inertia x angular acceleration = Net external torque
6. Slide number 6
Notation and Definitions
Order
Degree
Linearity
Homogeneity
Initial Value/Boundary value
problems
7. Slide number 7
Order
The order of a differential
equation is just the order of
highest derivative used.
02
2
dt
dy
dt
yd.
2nd order
3
3
dt
xd
x
dt
dx
3rd order
8. Slide number 8
Degree of an ODE
The degree of the highest
derivative of y in the equation is
called the degree of the ODE.
9. Slide number 9
Types of equations first order
and first degree
Variable separable equations
Homogeneous equations
Exact equations
Linear equations
11. Slide number 11
Linearity
The important issue is how the
unknown y appears in the equation.
A linear equation involves the
dependent variable (y) and its
derivatives by themselves. There
must be no "unusual" nonlinear
functions of y or its derivatives.
A linear equation must have constant
coefficients, or coefficients which
depend on the independent variable
(t). If y or its derivatives appear in the
coefficient the equation is non-linear.
12. Slide number 12
Linearity - Examples
0 y
dt
dy
is linear
02
x
dt
dx
is non-linear
02
t
dt
dy
is linear
02
t
dt
dy
y is non-linear
13. Slide number 13
Linearity – Summary
y2
dt
dy
dt
dy
y
dt
dy
t
2
dt
dy
yt)sin32( yy )32( 2
Linear Non-linear
2
y )sin(yor
14. Slide number 14
Linearity – Special Property
If a linear homogeneous ODE has solutions:
)(tfy )(tgy and
then:
)()( tgbtfay
where a and b are constants,
is also a solution.
15. Slide number 15
Linearity – Special Property
Example:
02
2
y
dt
yd
0sinsinsin
)(sin
2
2
ttt
dt
td
0coscoscos
)(cos
2
2
ttt
dt
td
0cossincossin
cossin
)cos(sin
2
2
tttt
tt
dt
ttd
ty sin ty coshas solutions and
Check
tty cossin Therefore is also a solution:
Check
16. Slide number 16
Life is mostly linear!!!
Most ODEs that arise in engineering are linear with
constant coefficients.
In many cases they are approximate versions of more
complex nonlinear models but they are sufficiently
accurate for most purposes. Often they work OK for small
amplitude disturbances but for large amplitude behaviour
nonlinearities start to have some effect.
For linear systems the qualitative behaviour is
independent of amplitude.
The coefficients in the ODE correspond to system
parameters and are usually constant.
Sometimes nonlinearities are important and there have
been some important failures because nonlinearities
were not understood e.g. the collapse of the Tacoma
Narrows bridge.
17. Slide number 17
Approximately Linear –
Swinging pendulum example
The accurate non-linear equation for a
swinging pendulum is:
0sin2
2
2
q
q
dt
d
But for small angles of swing this can be
approximated by the linear ODE:
02
2
2
q
q
dt
d
18. Slide number 18
Homogeniety
Put all the terms of the equation
which involve the dependent variable
on the LHS.
Homogeneous: If there is nothing
left on the RHS the equation is
homogeneous (unforced or free)
Nonhomogeneous: If there are
terms involving t (or constants) - but
not y - left on the RHS the equation
is nonhomogeneous (forced)
19. Slide number 19
Initial Value/Boundary value
problems
Problems that involve time are represented
by an ODE together with initial values.
Problems that involve space (just one
dimension) are also governed by an ODE
but what is happening at the ends of the
region of interest has to be specified as well
by boundary conditions.
20. Slide number 20
Example
1st order
Linear
Nonhomogeneous
Initial value problem
g
dt
dv
0)0( vv
w
dx
Md
2
2
0)(
0)0(
and
lM
M
2nd order
Linear
Nonhomogeneous
Boundary value
problem
21. Slide number 21
Example
2nd order
Nonlinear
Homogeneous
Initial value problem
2nd order
Linear
Homogeneous
Initial value problem
0sin2
2
2
q
q
dt
d
0)0(,0 0
dt
d
θ)θ(
q
02
2
2
q
q
dt
d
0)0(,0 0
dt
d
θ)θ(
q
22. Slide number 22
Solution Methods - Direct
Integration
This method works for equations
where the RHS does not depend on
the unknown:
The general form is:
)(tf
dt
dy
)(2
2
tf
dt
yd
)(tf
dt
yd
n
n
23. Slide number 23
Direct Integration
y is called the unknown or
dependent variable;
t is called the independent variable;
“solving” means finding a formula for
y as a function of t;
Mostly we use t for time as the
independent variable but in some
cases we use x for distance.
24. Slide number 24
Direct Integration – Example
Find the velocity of a car that is
accelerating from rest at 3 ms-2:
3 a
dt
dv
ctv 3
tv
ccv
3
00300)0(
If the car was initially at rest we
have the condition:
25. Slide number 25
Bending of a beam - Example
Beam theory gives the governing equation:
w
dx
Md
2
2
with boundary conditions:
0)(and0)0( lMM (pinned ends)
A beam under uniform load
26. Slide number 26
Bending of a beam - Solution
w
dx
Md
2
2
Step 1:
Integrate
BAxwxM 2
2
1
Awx
dx
dM
Step 2:
Integrate again to
obtain the general
solution:
27. Slide number 27
Bending of a beam - Solution
Step 3:
Use the boundary conditions to obtain the
particular solution.
BAxwxM 2
2
1
Step 4:
Substitute back the values for A and B
000
2
1
0 2
BBAw
BlAlw 2
2
1
0
)(
2
1
xlwxM wlxwxM
2
1
2
1 2
0)0( M
0)( lM
wlA
2
1
28. Slide number 28
Solution Methods - Separation
The separation method applies only to
1st order ODEs. It can be used if the
RHS can be factored into a function of t
multiplied by a function of y:
)()( yhtg
dt
dy
29. Slide number 29
Separation – General Idea
First Separate:
dttg
yh
dy
)(
)(
Then integrate LHS with
respect to y, RHS with respect
to t.
Cdttg
yh
dy
)(
)(
30. Slide number 30
Separation - Example
)sin(ty
dt
dy
Separate:
dttdy
y
)sin(
1
Now integrate:
)cos(
)cos(
)cos()ln(
)sin(
1
t
ct
Aey
ey
cty
dttdy
y
31. Slide number 31
Cooling of a cup of coffee
Amount of heat in a cup of coffee:
cTVQ
heat volume specific heat
density temperature
Heat balance equation (words):
Rate of change of heat = heat lost to surrounding air
32. Slide number 32
Cooling of a cup of coffee
Heat lost to the surrounding air is
proportional to temperature difference
between the object and the air
The proportionality constant involves
the surface area multiplied by a heat
tranfer coefficient
Newton’s law of cooling:
Heat balance equation (maths) :
)( RoomTThA
dt
dQ
33. Slide number 33
Cooling of a cup of coffee
)( RoomTThA
dt
dQ
)( RoomTThA
dt
dT
cV
)( RoomTT
dt
dT
cV
hA
whererearrange
cTVQ
Substitute in
Now we solve the equation together with
the initial condition:
InitialTT )0(
34. Slide number 34
Cooling of a cup of coffee -
Solution
)( RoomTT
dt
dT
Step 1:
Separate
dt
TT
dT
Room
)(
ctTT Room )ln( Step 2:
Integrate
ct
Room eTT
t
Room AeTT
c
eA
where
Make explicit in unknown T
35. Slide number 35
Cooling of a cup of coffee -
Solution
Step 3:
Use Initial
Condition
Step 4:
Substitute
back to
obtain final
answer
t
Room AeTT
InitialTT )0(
0
AeTT RoomInitial
)( RoomInitial TTA
t
RoomInitialRoom eTTTT
)(
36. Slide number 36
Solution Methods - Integrating
Factor
The integrating factor method is used for
nonhomogeneous linear 1st order equations
The basic ideas are:
Collect all the terms involving y and
on the left hand side of the equation. dt
dy
Combine them together as the derivative of
a single function of y and t.
Solve by direct integration.
The cunning trick is that step 2 cannot
usually be done unless you first multiply the
whole equation by an integrating factor.
37. Slide number 37
Integrating Factor – Example
1 y
dt
dy
2)0( y
There are several ways to solve this problem
but we will use it to demonstrate the
integrating factor method. To understand the
integrating factor method you must be very
familiar with the formula for the derivative of
a product:
38. Slide number 38
Integrating Factor – Example
Product Rule:
y
dt
df
dt
dy
f
dt
yfd
).(
The basic idea is that if we multiply the
ODE by the correct function (an integrating
factor) we can make the LHS of the ODE
look like the RHS of the product rule.
39. Slide number 39
Integrating Factor – Example
We will look ahead, use the answer and
show how it is derived later. For our ODE the
integrating factor is t
e
Thus the ODE becomes:
ttt
eye
dt
dy
e
Now the LHS of this equation looks like the
RHS of the Product Rule with:
t
ef
40. Slide number 40
Integrating Factor – Example
We can rewrite the equation as:
t
t
t
ey
dt
ed
dt
dy
e
)(
or
t
t
e
dt
yed
)(
Now we can use direct integration
Ceye tt
Do not forget C, the constant of integration!
41. Slide number 41
Integrating Factor – Example
Rearrange to make this explicit in y
t
Cey
1
Now use the initial condition to calculate C
1
21
212)0( 0
C
C
Cey
Substitute back to obtain the final solution
t
ey
1
42. Slide number 42
How do we calculate the
integrating factor?
Let us now pretend we do not know what
the integrating factor should be
Call it Φ and use it to multiply the ODE
from the previous example
y
dt
dy
To make the LHS of this equation look
like the RHS of the Product Rule we
must choose
dt
d
43. Slide number 43
How do we calculate the
integrating factor?
Then the ODE becomes
y
dt
d
dt
dy
Now using the product rule in reverse the
LHS can be written as a single term (a
very clever trick)
dt
yd )(
44. Slide number 44
How do we calculate the
integrating factor?
Now we can integrate once we know Φ
We can separate to find Φ
t
ct
Ae
ect
dt
d
dt
d
ln
The convention is to put A = 1. It appears
in every term of the ODE, and therefore
can be divided out. This gives the
integrating factor:
t
e
45. Slide number 45
Finding the integrating
factor in general
Given the general form of a
nonhomogeneous 1st order
equation:
)()( tfytg
dt
dy
0)0( yy
How do we use the integrating
factor method to find a y?
46. Slide number 46
Finding the integrating
factor in general
Step 1: Multiply by Φ:
)()( tfytg
dt
dy
Step 2: Compare with the RHS of the
Product Rule and set up equation for Φ:
)(tg
dt
d
Step 3: Use separation to solve for Φ:
dttg
e
dttg
dttg
d
)(
)(ln
)(
47. Slide number 47
Finding the integrating
factor in general
Step 4: Combine terms on the LHS:
)(
][
tf
dt
yd
Step 5: Integrate:
Cfdty
Step 6: Divide by to make explicit in y :
C
fdty
1
Step 7: Use the initial conditions to
evaluate C :
48. Slide number 48
Finding the integrating
factor in general
Notes:
After you have been through the process a
few times then skip some of the steps. For
example you can remember the formula for
the integrating factor, you do not have to re-
derive it every time.
dttg
e
)(
In principle this process can be used to
solve any linear nonhomogeneous 1st order
ODE but some of the details may be tricky
or impossible. Both the integrals
and
may be impossible to evaluate.
dttg )( dttf )(
49. Slide number 49
Solving an example using the
integrating factor method
tty
dt
dy
0)0( y
)()( tfytg
dt
dy
Step 1: Put the ODE into the general form:
The ODE is already in that form!
Step 2: Find the integrating factor:
2
2
1
)(
t
tdt
e
ettg
50. Slide number 50
Solving an example using the
integrating factor method
Step 5: Integrate and make explicit in y:
Step 3: Multiply by the integrating factor:
2
2
12
2
12
2
1
ttt
tetye
dt
dy
e
Step 4: Use the reverse Product Rule:
2
2
1
2
2
1
][ t
t
te
dt
yed
2
2
1
2
2
12
2
12
2
1
1
t
ttt
Cey
CeCdtteye
51. Slide number 51
Solving an example using the
integrating factor method
Step 7: Substitute back into the original
equation:
Step 6: Use the initial conditions to find the
exact solution:
1
01
010)0( 0
C
C
Cey
2
2
1
1
t
ey
52. Slide number 52
Exponential substitution
The exponential trial or guessing method can
be used for solving linear constant coefficient
homogeneous differential equations.
t
Cey
The basic trial for the solution of the ODE is:
53. Slide number 53
Characteristic Equations
gives the differentialst
Cey
tnn
t
t
t
Cey
Cey
Cey
Cey
)(
3)3(
2
An algebraic characteristic equation comes
from substituting in for y and its derivatives
and cancelling out t
Ce
54. Slide number 54
Exponential Trial - Example
05 yy
05 tt
AeAe
Try t
Aey
Cancelling out gives the characteristic
equation
t
Ae
505
Substituting this back into givest
Aey
t
Aey 5
55. Slide number 55
Solving Guide
General Form Description Solving
Method
)(tf
dt
yd
n
n
)()(),( yhtgytf
dt
dy
)()( tfytg
dt
dy
Direct
Integration
Separation
Integrating
Factor Method
1st order only
1st order
nonhomogeneous
linear equation
1st or higher order
RHS does not
depend on the
unknown y
56. Slide number 56
Solving Guide
General Form Description Solving
Method
Exponential trial.
See Module 2
Problems like
this can be
solved for some
types of f.
Covered in
Modules 3
and 5
001
1
1
1
ya
dt
dy
a
dt
yd
a
dt
yd
n
n
nn
n
)(01
1
1
1
tfya
dt
dy
a
dt
yd
a
dt
yd
n
n
nn
n
2nd order or higher
homogeneous
linear equation
constant
coefficients
2nd order or higher
nonhomogeneous
linear equation
constant
coefficients
57. Slide number 57
Solving Guide
General Form Description Solving
Method
Can only solve a
few ‘special’
problems
Not Covered in
MM2
Generally can’t
be solved
analytically
(see Module 4
for numerical
methods)
2nd order or higher
nonhomogeneous
linear equation
variable
coefficients
2nd order
Function f
contains t, y and
y’ terms all
mixed up
)()()(
)(
01
1
1
1
tfytg
dt
dy
tg
dt
yd
tg
dt
yd
n
n
nn
n
dt
dy
ytf
dt
yd
,,2
2