Professional Documents
Culture Documents
3 Ordinary Differential Equations: X+ + X DX Dy
3 Ordinary Differential Equations: X+ + X DX Dy
INTRODUCTION
A differential equation (d.e.) is an equation involving an unknown
function and its derivative.
Example 1
In the d.e.
dy
= 7 x 2 +4 x + 3
dx
y f (x ) is the unknown function.
dy
is the derivative of the unknown function.
dx
ODE 1
The d.e. is ordinary (i.e. an o.d.e.) if the unknown function
depends on only one independent variable.
dy
(a) = 2x2 - 4
dx
dx x+1
(b) =
dt t
dy dy
(c) ey + 2( ) 3 = 1
dx dx
d2y dy
(d) ( 2 ) 3 + 3( ) 6 + y 2 = 5 x
dx dx
Example 3
Refer to the d.e. in Example 2, find the order and degree of the d.e.
dy
(a) = 2x2 - 4 Order 1, degree 1
dx
dx x+1 Order 1, degree 1
(b) =
dt t
dy dy
(c) e y + 2( ) 3 = 1 Order 1, degree 3
dx dx
d2y 3 dy Order 2 , degree 3
(d) ( 2 ) + 3( ) 6 + y 2 = 5 x
dx dx
Ordinary Differential Equations Page 4
ODE 2
LINEAR DIFFERENTIAL EQUATIONS
Example 5
Form a d.e. of the problem given that velocity V of a body is
proportional to its displacement X.
dX
VX V kX & V
dt
dX
Therefore kX 0
dt
Example 6
Form a d.e. of the problem that a resistor R and a capacitor C is
connected in series with an a.c. source V of 50 sin (2 f t).
Q dQ
VC ,VR IR & I
C dt
50 sin 2ft 0
Q dQ
Therefore R
C dt
Ordinary Differential Equations Page 6
ODE 3
Solution of a Differential Equation
A solution of a d.e. which involves the independent variable x and
dependent variable y is the finding of the equation f(x, y) = 0 which
satisfies the d.e.
Example 7
Determine whether the equation
(a) y=2e-x + xe-x and
(b) y=3e-x - 4 xe-x
d2y dy
are solutions of the d.e. 2
2 y= 0 .
dx dx
(a)
y 2e -x + xe-x
y' 2
d -x
dx
dx
e x e -x e -x x e -x xe-x
d d
dx
y"
d
d
d
e -x x e -x e -x x xe-x
dx dx dx
d2y dy
L.H .S . 2 2 y
dx dx
2e xe 2 e -x xe -x xe -x 0
-x -x
R.H .S .
d2y dy
y=2e + xe is a solution of 2 2 y
-x -x
dx dx
Ordinary Differential Equations Page 8
ODE 4
(b)
y 3e -x 4 xe-x
y' 3
d -x
d
d
e 4 x e -x e -x x 7e -x 4 xe-x
dx dx dx
d
d
y" 7 e -x 4 x e -x e -x x 11e -x 4 xe-x
d
dx dx dx
d2y dy
L.H .S . 2
2 y
dx dx
3e 4 xe 2 7e -x 4 xe -x 11e -x 4 xe -x 0
-x -x
R.H .S .
d2y dy
y=3e-x 4 xe-x is a solution of 2 y
dx 2 dx
Ordinary Differential Equations Page 9
Example 8
dy
Given the d.e. = 10 x
dx
y = 5x2 + C is a general solution while
y = 5x2 + 3 is a particular solution.
ODE 5
Initial Conditions and Boundary Conditions
These two conditions determine the value(s) of the constant(s) in
the general solution and form the particular solution.
Example 9
Determine the values of the constants C1 and C2 in
y = C1sin x + C2cos x
with the following conditions.
(a) The initial conditions y(0) = 1, y’(0) = 2.
(b) The boundary conditions y(0) = 1 and y’( ) = 2.
ODE 6
Example 11
Find the particular solution of the d.e.
dy
= sin 2 x
dx
which satisfies the condition that y = 2 when x = 0.
dy = sin 2 xdx
y sin 2 xd 2 x cos 2 x c cos 2 x c
dx 1 1
d 2 x 2 2
Direct Integration
As integration is the reverse process of differentiation, a d.e. may
be solved by direct integration.
Example 10
Find the general solution of the d.e.
dy 4x2
dy = 4 xdx y 2 c 2 x c
2
(a) = 4x
dx
d2y
= e- 2 x dy = e
-2 x
(b) 2 dxdx
dx
e-2 x e-2 x
c1 dx c1 x c2
2 4
Ordinary Differential Equations Page 14
ODE 7
FIRST ORDER ORDINARY DIFFERENTIAL EQUATION
dy dy f ( x)
= f ( x) g ( y ) or =
dx dx g ( y)
and the general solution is
1
g ( y) dy = f ( x) dx or g ( y) dy = f ( x) dx
Ordinary Differential Equations Page 15
Example 12
ODE 8
Example 13
Find the general solution of
dy sin 5 x
(a) =
dx y
Example 13
Find the general solution of
dy
(b) = y e- 5 x
dx
1
y dy = e
-5 x
dx
e-5 x
ln y c
5
e- 5 x
c
ye 5
ODE 9
Example 13
Find the general solution of
(c) dx - e- 5 x dy = 0
dx e - 5 x dy
dy e
5x
dx
e5 x
y c
5
Example 13
Find the general solution of
(d) x y' = y
dy
x =y
dx
1 1
y dy x dx
ln y ln x c
y e ln x c
ODE 10
Example 14
Solve the d.e. in Example 13(b) and (d) given
(a) in Example 13(b) y(0) = e.
-50
e
c
y 0 e 5
e
e- 5 x 6
1 6
c 1 c y e 5
5 5
(b) in Example 13(d) y’(4) = 1.
de ln x c de ln x c d ln x c e ln x c
y'
dx d ln x c dx x
e ln 4 c
y ' 4 1 c 0 y e ln x x
4
Ordinary Differential Equations Page 21
Example 15
What are P and Q referred to the standard form?
Px - 3x 2 , Qx 5 x
dy
(a) - 3x 2 y - 5 x = 0
dx
P t 3t , Q t
dx 5 2
(b) t 2 + 3t 3 x + 2t = 5 x 2
dt t t
Ordinary Differential Equations Page 22
ODE 11
Integrating Factor
μ(x) = e
P(x)dx
μ( x) y = μ( x) Q ( x) dx
Example 16
Find the general solution of the following linear d.e.
dy
(a) = 5y
dx
P x 5, Q x 0
x e
5 dx
e 5 x
e 5 x y e 5 x 0 dx C
y Ce 5 x
ODE 12
Example 16
Find the general solution of the following linear d.e.
dy
(b) x + 2 y = 2x given y 6 when x 6
dx
y 6 6 C 62 6
2
Px , Qx 2
2
x 3
2 C 72
x dx
x e e 2 ln x x 2 2
y x 72 x 2
x y x 2 dx
2 2
3
2 3
x2 y x C
3
2
y x Cx 2
3
Ordinary Differential Equations Page 25
Example 16
Find the general solution of the following linear d.e.
dy
(c) + y tan x = sin x
dx
P x tan x, Q x sin x
x e
tan xdx
e sec x
ln sec x
ODE 13
Example 16
Find the general solution of the following linear d.e.
dy
(d) x -3 y = x4e x given y 2 when x 1
dx
P x , Q x x 3e x
3 y 1 1 e 1 C 13 2
3
x C 2 e
3
x e x e 3ln x x 3
dx
y e x e 2 x3
x 3 y x 3 x 3e x dx
x 3 y e x C
y x 3e x Cx 3
t e
k m dt
e kt m
e kt m v e kt m 0 dt C
v Ce kt m
Ordinary Differential Equations Page 28
ODE 14
Example 17
v Ce kt m Ce 0.7 t 2.4 Ce 0.292t
Given the initial condition, v = 30 when t = 0.
v0 Ce 0.2920 30
C 30
then
vt 30e 0.292t
Check:
velocity of a body when t = 0
v 0 30e 0.292 0 30 m s
velocity of a body after 10s
v 10 30e 0.292 10 1.618m / s
Example 18
A charged capacitor C is discharged through a resistor R. Set up
a differential equation for discharging the capacitor. A capacitor of
0.5F is first charged to a potential of 70 V and is then discharged
through a resistor of 20k ohms. Find the potential across the
capacitor after 10 ms. Q dQ
R 0
C dt
dQ Q
0
dt RC
P t RC , Qt 0
1
RC 1 dt
t e e t RC
e t RC Q e t RC 0 dt K
Q Ke t RC
Ordinary Differential Equations Page 30
ODE 15
Example 18
Ke t RC Ke t 2010 0.510
3 6
Vc t 2 10 6 Ke 100t
C 0.5 10 6
Given the initial condition, Vc = 0 when t = 0.
Vc 0 2 10 6 Ke 1000 70
K 3.5 10 5
then
Vc t 2 10 6 3.5 10 5 e 100t 70e 100t
Check:
p.d. across the capacitor at t = 0
Vc 0 70e 100 0 70V
p.d. across the capacitor after 10 ms
Vc 0.01 70e 100 0.01 25.75V
Terminology
A second order linear d.e. has the general form
d2y dy
b2 ( x) 2 +b1 ( x) +b0 ( x) y = f ( x) .
dx dx
ODE 16
If bi (x) are constants, where i = 0, 1, 2, the d.e. is said to
be with constant coefficients.
d2y dy
+ p + q y = f ( x)
dx 2 dx
Example 19
Which of the following are constant coefficient d.e.? Which
are homogeneous?
Constant coeff. Homogeneous
d2y dy
(a) 2
-3 = 5y Yes Yes
dx dx
d2y dy
(b) + 5 x - 4y = 0 No Yes
dx 2 dx
d2y dy
(c) 2
-3 = 6x Yes No
dx dx
ODE 17
General Solution
In order to solve the d.e.
d2y dy
2
+p + qy = f ( x)
dx dx
it is necessary to first solve the homogeneous d.e.
d2y dy
2
+p + qy = 0
dx dx
ODE 18
Example 20
Show that y A sin 2 x B cos 2 x is a complementary function of
d2y
4 y=0.
dx 2
y ' 2 A cos 2 x 2 B sin 2 x, y" 4 A sin 2 x 4 B cos 2 x
Example 21
Given the d.e. d2y dy
2
+ 7 + 12 y = 0.
dx dx
L.H .S . 16e 4 x 7 4e 4 x 12 e 4 x 0 R.H .S .
e - 4 x is a solution of d.e. y" 7y' 12y 0
Ordinary Differential Equations Page 38
ODE 19
Example 21
Given the d.e. d2y dy
2
+ 7 + 12 y = 0.
dx dx
L.H .S .
9C1e 3 x 16C2 e 4 x 7 3C1e 3 x 4C2 e 4 x 12 C1e 3 x C2 e 4 x
0 R.H .S .
The d.e.
d2y dy
2
+p + qy = 0
dx dx
d2 d
D 2 denotes 2
and D denotes .
dx dx
D 2 y + pDy + qy = 0
( D 2 + pD + q ) y = 0
ODE 20
Solution of Homogenous Second Order Linear D.E with
Constant Coefficients
Complementary Function
The general solution of the d.e.
d2y dy
2
+p + qy = 0
dx dx
is y C11(x) C22(x)
Since e
kx
0 , therefore we have
k 2 pk q 0
ODE 21
Example 22
Write down the auxiliary equation of the d.e. and find the roots of
the auxiliary equation.
d2y dy
(a) 2
-7 + 12 y = 0
dx dx
by comparing the general sol. of d.e. y" py ' q 0
p 7 & q 12
Example 22
Write down the auxiliary equation of the d.e. and find the roots of
the auxiliary equation.
d2y dy
(b) 2
+8 + 16 y = 0
dx dx
by comparing the general sol. of d.e. y" py ' q 0
p 8 & q 16
ODE 22
Example 22
Write down the auxiliary equation of the d.e. and find the roots of
the auxiliary equation.
d2y dy
(c) 2
+2 + 2y = 0
dx dx
by comparing the general sol. of d.e. y" py ' q 0
p 2&q 2
k 2 2k 8 0
k 2k 4 0
k 2 or 4
y = C1 e 2 x + C2 e 4 x
Ordinary Differential Equations Page 46
ODE 23
Nature of Roots of the Auxiliary Equation
(1) Roots are real and distinct
If the roots of the auxiliary equation are k1 and k 2 , then the general
solution of the d.e. is
y = C1 e k1x + C2 e k2 x
Example 23
d2y dy
Solve the d.e. (b) 2 2
+ - 6y = 0
dx dx
2k 2 k 6 0
2k 3k 2 0
k 2 or 3 2
y = C1 e 2 x + C2 e3 x 2
Ordinary Differential Equations Page 47
Example 24
d2y dy
Solve the d.e. (a) 2
+8 + 16 y = 0
dx dx
k 2 8k 16 0
k 4k 4 0
k 4 (repeated)
y = C1 C2 x e 4 x
Ordinary Differential Equations Page 48
ODE 24
(2) Roots are equal
If the repeated roots of the auxiliary equation are k ,then the
general solution of the d.e. is
y = C1 e kx + C2 xekx
or y = (C1 + C2 x) e kx
Example 24
d2y dy
Solve the d.e. (b) 2
- 14 + 49 y = 0
dx dx
k 2 14k 49 0
k 7 k 7 0
k 7 (repeated)
y = C1 C2 x e 7 x
Ordinary Differential Equations Page 49
Example 25 (a) D 2 y + 2 Dy + 2 y = 0
Solve the d.e. (b) D 2 y + 25 y = 0
(c) D 2 y + 6 Dy +13 y = 0
given when x=0 , y=2 and y' =1.
ODE 25
3. Roots are complex
Example 25
Solve the d.e. (a) D 2 y + 2 Dy + 2 y = 0
k 2 2k 2 0
2 22 412 2 4
k
21 2
1 j k1 1 & k 2 1
y = A e 1+j x + B e 1 j x
k 2 25 0
k 25 5 j k1 0 & k 2 5
y = A e 5 j x + B e 5 j x
or y = C1 cos 5 x + C2 sin 5 x
ODE 26
3. Roots are complex
Example 25
Solve the d.e. (c) D 2 y + 6 Dy +13 y = 0
given when x=0 , y=2 and y' =1.
k 6k 13 0
2
d2y dy
+ p + qy = f(x)
dx 2 dx
ODE 27
Inhomogenous term f(x) Trial solution
constant constant
axr+…+bx+c C1xr+…+Crx+Cr+1
cos kx C1cos kx + C2sin kx
sin kx C1cos kx + C2sin kx
ekx C1ekx
cosh kx C1cosh kx + C2sinh kx
sinh kx C1cosh kx + C2sinh kx
Example 26
d 2 y dy
Find the particular integral of 2
- -6 y = e2 x
dx dx
2x dy d2y
Let y ( x) = C1 e ; then 2C1e 2 x , and 2 4C1e 2 x
dx dx
4C1e 2 x 2C1e 2 x 6C1e 2 x e 2 x
4C1e 2 x e 2 x
Hence C1 1
4
1
Therefore y pi e 2 x
4
1 2x
The general solution is y Ae Be e
3x 2 x
ODE 28
Systems of Differential Equations
The method of D-operator is employed to obtain the
complementary and particular solutions of systems of
linear ordinary differential equations.
d
where D
dt
11 D 12 D
D 11 D 22 D 12 D 21 D
21 D 22 D
Example 27
Solve dx -3 x -6 y = 0, 3x dy 3 y= 0
dt dt
d
Solution:
Using D-operator, D
dt
( D 3) x -6 y = 0 Eq.(1)
3x ( D 3) y 0 Eq.(2)
D 3 6
D 0
3 D3
( D 3)( D 3) 18 0
D2 9 0
D 3 j
Ordinary Differential Equations Page 58
ODE 29
The complementary solutions of x and y have the same
form and are given by
xcf A1 cos 3t B1 sin 3t , ycf A2 cos 3t B2 sin 3t
( D 3) xcf 6 ycf 0
[(3 A1 sin 3t 3B1 cos 3t ) (3 A1 cos 3t 3B1 sin 3t )
6( A2 cos 3t B2 sin 3t )] 0
ycf
1
A1 B1 cos 3t 1 A1 B1 sin 3t
2 2
Ordinary Differential Equations Page 60
ODE 30
Numerical Solution of ODE
Many first order differential equations cannot be solved by
exactly by writing the solution as a linear combination of
elementary functions. Yield approximate solutions are
often used to handle this shortcoming. However, the
approximate solution do not give the solution interims of
elementary functions.
dy 2
+ y2 = ex
dx
E.g. The differential equation above cannot be solved by
writing the solution as a linear combination of elementary
function.
Euler’s Method
Given the initial-value problem
y ' f ( x, y ), y ( x0 ) = y0
C y(x + h)
0
A D
y(x0 + h)
y0 y1
x
0 x0 x1= x0 + h
ODE 31
Example 28
Use Euler’s method to approximate value of y (0.4) for
the initial-value problem
y ' 2 x y, y ( 0) 1
Solution:
With x0 0, y0 1 and h 0.4
Example 28
Use Euler’s method to approximate value of y (0.4) for
the initial-value problem on the interval 0 x 0.4 by
using four equal intervals.
y ' 2 x y , y ( 0) 1
Solution: 0.4 0
h 0.1
4
With x0 0, y0 1 and h 0.1
xn yn yn + 0.1 *(2xn +yn) = yn+1
0 1.0 1.0+0.1*[2(0)+1.0]=1.1
0.1 1.1 1.1+0.1*[2(0.1)+1.1]=1.23
ODE 32
Runge - Kutta Method
Given the initial-value problem
y ' f ( x, y ), y ( x0 ) = y0
for a fixed, constant value of h , y xn h can be
approximated by
1
yn 1 yn h(m1 2m2 2m3 m4 ) m3 (x0+ h, y0 + hm2)
6 y m1
where
(x0+ h, y0 + hm1)
m1 f ( xn , yn )
(x0, y0)
(x0+ h, y0 + hm3)
1 1
m2 f ( xn h, yn h m1 ) m2
2 2 m4
1 1
m3 f ( xn h, yn h m2 )
2 2 0 x0 x0 + h
x
x0 + 0.5h
m4 f ( xn h, yn h m3 )
Ordinary Differential Equations Page 65
Example 29
Use Runge - Kutta method to estimate y (0.4) if
y ' 2 x y , y ( 0) 1
Solution:
f ( x, y ) 2 x y, x0 0, y0 1 and h 0.4
m1 [2(0) 1] 1.0
0.4 0 .4
m2 [2(0 ) (1 1.0)] 1.6
2 2
0 .4 0.4
m3 [2(0 ) (1 1.6)] 1.72
2 2
m4 [2(0 0.4) (1 0.4 1.72] 2.488
1
y (0.4) 1 (0.4)[1.0 2(1.6) 2(1.72) 2.488] 1.675
6
Ordinary Differential Equations Page 66
ODE 33