Ordinary Differential Equations
1
Introduction to Ordinary
Differential Equations (ODE)
Recall basic definitions of ODE,
order
linearity
initial conditions
solution
Classify ODE based on( order, linearity, conditions)
Classify the solution methods
2
Derivatives
Derivatives
Ordinary Derivatives Partial Derivatives
dy u
dx y
u is a function of
y is a function of one more than one
independent variable independent variable
3
Differential Equations
Differential
Equations
Ordinary Differential Equations Partial Differential Equations
u u
2 2 2
d y
2
6 xy 1 2 0
dx y x
2
involve one or more
involve one or more partial derivatives of
Ordinary derivatives of unknown functions
unknown functions
4
Ordinary Differential Equations
Ordinary Differential Equations (ODE) involve one or
more ordinary derivatives of unknown functions with
respect to one independent variable
Examples :
dy
y ex y(x): unknown function
dx
d2y dy
2
5 2 y cos( x)
dx dx
x: independent variable
5
Order of a differential equation
The order of an ordinary differential equations is the order
of the highest order derivative
Examples :
dy
y ex First order ODE
dx
d2y dy
2
5 2 y cos( x) Second order ODE
dx dx
3
d y
2
dy
2
2 y 4 1 Second order ODE
dx dx
6
Solution of a differential equation
A solution to a differential equation is a function that
satisfies the equation.
Example :
Solution x(t ) e t
dx(t )
x(t ) 0 Proof :
dt dx(t ) t
e
dt
dx(t )
x(t ) e t e t 0
dt
7
Linear ODE
An ODE is linear if the unknown function and its derivatives
appear to power one. No product of the unknown function
and/or its derivatives
an ( x) y n ( x) an 1 ( x) y n 1 ( x) a1 ( x) y ' ( x) a0 ( x) y ( x) g ( x)
Examples :
dy Linear ODE
y ex
dx
d2y dy
2
5 2 x 2
y cos( x) Linear ODE
dx dx
3
d 2 y dy
2 y 1 Non-linear ODE
dx dx
8
Boundary-Value and Initial value Problems
Initial-Value Problems Boundary-Value Problems
The auxiliary conditions are The auxiliary conditions are not at
at one point of the one point of the independent
independent variable variable
More difficult to solve than initial
value problem
y ' '2 y ' y e2 x y' '2 y' y e 2 x
y (0) 1, y ' (0) 2.5 y(0) 1, y(2) 1.5
same different
9
Classification of ODE
ODE can be classified in different ways
Order
First order ODE
Second order ODE
Nth order ODE
Linearity
Linear ODE
Nonlinear ODE
Auxiliary conditions
Initial value problems
Boundary value problems
10
Solutions
Analytical Solutions to ODE are available for linear
ODE and special classes of nonlinear differential
equations.
Numerical method are used to obtain a graph or a
table of the unknown function
We focus on solving First Order Linear ODE and
Second Order Linear ODE and Euler Equation
11
First Order Linear Differential Equations
Def: A first order differential equation is
said to be linear if it can be written
y p( x) y g ( x)
12
First Order Linear Differential Equations
How to solve first-order linear ODE ?
y p( x) y g ( x) (1)
Sol:
Multiplying both sides by (x ) , called an integrating factor,
gives dy
( x) ( x) p( x) y ( x) g ( x) (2)
dx
assuming ( x) p( x) ' ( x), (3) we get
dy
( x) ' ( x) y ( x) g ( x) (4)
dx
13
First Order Linear Differential Equations
By product rule, (4) becomes
( ( x) y ( x))' ( x) g ( x) (5)
( x) y ( x) ( x) g ( x)dx c1
y ( x)
( x) g ( x)dx c 1
(6)
( x)
Now, we need to solve (x ) from (3)
' ( x)
( x) p ( x) ' ( x) p ( x)
( x)
14
First Order Linear Differential Equations
' ( x)
p( x) (ln ( x))' p( x)
( x)
ln ( x) p( x)dx c2
( x) e p ( x ) dx c2
c3e p ( x ) dx
(7)
to get rid of one constant, we can use
( x) e p ( x ) dx (8)
The solution t o a linear first order differenti al equation is then
y ( x)
( x) g ( x)dx c
(9)
e
p ( x ) dx
15
Summary of the Solution Process
Put the differential equation in the form (1)
Find the integrating factor, (x ) using (8)
Multiply both sides of (1) by (x ) and write the left
side of (1) as ( ( x) y ( x))'
Integrate both sides
Solve for the solution y (x)
16
Example 1
y y e 2x
Sol:
y ( x) e
p ( x ) dx e p ( x ) dx g ( x)dx c
( 1) dx ( 1) dx 2 x
e e e dx c
e x e x e 2 x dx c
ex ex c
ce x e 2 x
17
Example 2
1
xy ' 2 y x x ; With Initial Condition: y (1)
2
2
2
Sol: y ' y x 1
x
y ( x) e
p ( x ) dx e p ( x ) dx g ( x)dx c
2 2
dx x dx
2
e x
e ( x 1) dx c x x 2
( x 1)dx c
2 1 4 1 3 1 2 1
x x x c x x cx 2
4 3 4 3
Apply the initial condition to get c,
1 1 1 7
cc .
2 4 3 12 18
Second Order Linear Differential Equations
Homogeneous Second Order Linear Differential
Equations
o real roots, complex roots and repeated roots
Non-homogeneous Second Order Linear Differential
Equations
o Undetermined Coefficients Method
Euler Equations
19
Second Order Linear Differential Equations
The general equation can be expressed in the form
ay ' 'by 'cy g ( x)
where a, b and c are constant coefficients
Let the dependent variable y be replaced by the sum of the
two new variables: y = u + v
Therefore
au' 'bu'cu av' 'bv'cv g ( x)
If v is a particular solution of the original differential equation
au' 'bu'cu 0
purpose
The general solution of the linear differential equation will be the
sum of a “complementary function” and a “particular solution”.
20
The Complementary Function (solution of the
homogeneous equation)
ay' 'by'cy 0
Let the solution assumed to be: y e rx
dy d2y
re rx 2
r 2 rx
e
dx dx
erx (ar 2 br c) 0
characteristic equation
Real, distinct roots
Double roots
Complex roots
21
Real, Distinct Roots to Characteristic Equation
• Let the roots of the characteristic equation be real, distinct
and of values r1 and r2. Therefore, the solutions of the
characteristic equation are:
y e r1x y e r2 x
• The general solution will be
y c1e r1x c2e r2 x
• Example
y ' '5 y '6 y 0 r 2 5r 6 0
r1 2
y c1e 2 x c2e3 x
r2 3
22
Equal Roots to Characteristic Equation
• Let the roots of the characteristic equation equal and of value r1
= r2 = r. Therefore, the solution of the characteristic equation is:
y e rx
Let y Ve y' e rxV 'rVerx and y' ' e rxV ' '2re rxV 'r 2Verx
rx
where V is a
function of x
ay' 'by'cy 0
ar 2 br c 0 2ar b 0
V ' ' ( x) 0 V cx d
y berx (cx d )erx c1erx c2 xerx
23
Complex Roots to Characteristic Equation
Let the roots of the characteristic equation be complex in the
form r1,2 =λ±µi. Therefore, the solution of the characteristic
equation is:
y1 e( i ) x ex (cos( x) i sin( x)),
y2 e( i ) x ex (cos( x) i sin( x)).
1 1
x
u ( x) ( y1 y2 ) e cos( x), v( x) ( y1 y2 ) e x sin( x)
2 2i
It is easy to see that u and v are two solutions to the differential
equation. Therefore, the geneal solution to the d.e. is:
y ( x) c1e λx cos( x) c2e λx sin( x).
24
Examples
(I) Solve y ' '6 y '9 y 0 (II) Solve y ' '4 y '5 y 0
Characteristic Equation Characteristic Equation
r 2 6r 9 0 r 2 4r 5 0
r1 r2 3 r1, 2 2 i
y (c1 c2 x)e 3 x
y e2 x (c1 cos x c2 sin x)
25
Non-homogeneous Differential Equations (Method of
Undetermined Coefficients)
ay ' 'by 'cy g ( x)
When g(x) is constant, say k, a particular solution of equation is
y k /c
When g(x) is a polynomial of the form a0 a1 x a2 x ... an x where
2 n
all the coefficients are constants. The form of a particular solution is
y 0 1 x 2 x 2 ... n x n
26
Example
Solve
y' '4 y'4 y 4 x 8x 3 Complementary Function
y ' '4 y '4 y 0
y' q 2rx 3sx 2
y p qx rx 2 sx 3
y ' ' 2r 6 sx
r 2 4r 4 0
Characteristic Equation
(2r 6sx) 4(q 2rx 3sx 2 ) 4( p qx rx 2 sx 3 ) 4 x 8x3
Equating Coefficients of Equal Powers of x
r2
2r 4q 4 p 0
yc (c1 c2 x)e 2 x
6s 8r 4q 4
4r 12s 0
4s 8
y yc y p
y p 7 10 x 6 x 2 2 x3 (c1 c2 x)e 2 x 7 10 x 6 x 2 2 x 3
27
Non-homogeneous Differential Equations
(Method of Undetermined Coefficients)
• When g(x) is of the form Te r x , where T and r are constants. The
form of a particular solution is
y Ae
rx
T
A
ar 2 br c
• W h e n g ( x ) i s o f t h e f o r m C s i n n x + D c o s n x , wh e r e C a n d D a r e
constants, the form of a particular solution is
y E sin nx F cos nx
(c n 2 a)C nbD
E
(c n 2 a ) 2 n 2 b 2
(c n 2 a)C nbD
F
(c n 2 a ) 2 n 2 b 2
28
Example
Solve Complementary Function
3 y ' '6 y ' 18
3 y ' '6 y ' 0
y' C
y Cx
y' ' 0 3r 2 6r 0
Characteristic Equation
3(0) 6(C) 18
r1 0, r2 2
C 3 yc c1 c2 e 2 x
y yc y p
y p 3 x 3x c1 c2e 2 x
29
Example
Solve Complementary Function
3 y' '10 y'8 y 7e4 x
3 y ' '10 y '8 y 0
y' (1 4 x)Ce4 x
y Cxe4 x
y' ' (16 x 8)Ce 4 x 3r 2 10r 8 (3r 2)(r 4) 0
Characteristic Equation
24C 10C 7
r1 2 / 3, r2 4
1 yc Ae2 x / 3 Be 4 x
C
2
y yc y p
1 4 x
1 4 x
y p xe xe Ae2 x / 3 Be 4 x
2 2
30
Example
Solve Complementary Function
y ' ' y '6 y 52 cos 2 x
y ' ' y '6 y 0
y ' 2(C sin 2 x D cos 2 x)
y C cos 2 x D sin 2 x
y ' ' 4(C cos 2 x D sin 2 x)
r 2 r 6 (r 2)(r 3) 0
Characteristic Equation
10C 2D 52
r1 2, r2 3
2C 10D 0
yc Ae2 x Be 3 x
C 5
D 1
y yc y p
y p 5 cos 2 x sin 2 x Ae2 x Be 3 x 5 cos 2 x sin 2 x
31
Euler Equations
Def: Euler equations
ax y' 'bxy'cy 0
2
Assuming x>0 and all solutions are of the
form y(x) = xr
Plug into the differential equation to get the
characteristic equation
ar (r 1) b(r ) c 0.
32
Solving Euler Equations: (Case I)
• The characteristic equation has two different real
solutions r1 and r2.
• In this case the functions y = xr1 and y = xr2 are both
solutions to the original equation. The general solution
is: y( x) c x r1 c x r2
1 2
Example:
2 x 2 y ' '3xy'15 y 0, the characteri stic equation is :
5
2r(r-1 ) 3r-15 0 r1 , r2 3.
2
5
y(x) c1 x c2 x 3.
2
33
Solving Euler Equations: (Case II)
• The characteristic equation has two equal roots r1 = r2=r.
• In this case the functions y = xr and y = xr lnx are both
solutions to the original equation. The general solution is:
y( x) x r (c1 c2 ln x)
Example:
x 2 y' '7 xy'16 y 0, the characteri stic equation is :
r(r-1 ) 7r 16 0 r 4.
y(x) c1 x 4 c2 x 4 ln x.
34
Solving Euler Equations: (Case III)
• The characteristic equation has two complex roots r1,2 = λ±µi.
x i e( i )ln x x cos( ln x) ix sin( ln x)
So, in the case of complex roots, the general solution will be:
y( x) x λ (c1 cos( μ ln x) c2 sin( μ ln x))
Example:
x 2 y ' '3 xy'4 y 0, the characteri stic equation is :
r(r-1 ) 3r 4 0 r1, 2 1 3i.
y(x) c1 x 1 cos( 3 ln x) c2 x 1 sin( 3 ln x).
35