0% found this document useful (0 votes)
232 views66 pages

Chapter 3. ODE

This document provides an introduction to ordinary differential equations (ODEs) including terminology, types of ODEs, methods of solving ODEs, and examples. Key points include: - An ODE relates an unknown function and its derivative. It is "ordinary" if the function depends on one independent variable. - The order of an ODE is the order of the highest derivative, and the degree is the highest power of the highest derivative. - Linear ODEs involve the dependent variable and derivative only to the first degree. - Solutions are equations that satisfy the ODE given any initial/boundary conditions. - Methods of solving include separation of variables, direct integration, and

Uploaded by

Joke Chan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
232 views66 pages

Chapter 3. ODE

This document provides an introduction to ordinary differential equations (ODEs) including terminology, types of ODEs, methods of solving ODEs, and examples. Key points include: - An ODE relates an unknown function and its derivative. It is "ordinary" if the function depends on one independent variable. - The order of an ODE is the order of the highest derivative, and the degree is the highest power of the highest derivative. - Linear ODEs involve the dependent variable and derivative only to the first degree. - Solutions are equations that satisfy the ODE given any initial/boundary conditions. - Methods of solving include separation of variables, direct integration, and

Uploaded by

Joke Chan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

3 ORDINARY DIFFERENTIAL EQUATIONS

REFERENCE: CROFT & DAVISON CHAPTER 20 BLOCKS 1 - 3

INTRODUCTION AND TERMINOLOGY

INTRODUCTION
A differential equation (d.e.) is an equation involving an unknown
function and its derivative.

Ordinary Differential Equations Page 1


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

Ordinary Differential Equations Page 2


The d.e. is ordinary (i.e. an o.d.e.) if the unknown function
depends on only one independent variable.

Example 2 The followings are o.d.e.

dy
(a) = 2x2 - 4
dx
dx x+1
(b) =
dt t
y dy dy 3
(c) e + 2( ) = 1
dx dx
d2y 3 dy 6
(d) ( 2 ) + 3( ) + y 2 = 5 x
dx dx

Ordinary Differential Equations Page 3


Order and Degree
The order of a d.e. is the order of the highest derivative of the d.e.
The degree of a d.e. is the highest power of the highest derivative.

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
(b) = Order = 1, degree = 1
dt t
y dy dy 3
(c) e + 2( ) = 1 Order = 1, degree = 3
dx dx
d2y 3 dy 6 Order = 2 , degree = 3
(d) ( 2 ) + 3( ) + y 2 = 5 x
dx dx
Ordinary Differential Equations Page 4
LINEAR DIFFERENTIAL EQUATIONS

A d.e. is said to be linear if the dependent variable and its


derivative are of degree one and there are no product involving the
dependent variable and the derivative.

Example 4 Determine whether the following d.e. are linear.


dy 2dy
(a) + 2 xy = 0 (b) y + 3 xy - 2 = 0
dx dx
Yes No
d2y dy dy 2
(c) 2
+ 3x - 2 = 0 (d) ( ) + 2 xy = 0
dx dx dx
Yes No
Ordinary Differential Equations Page 5
Example 5
Form a d.e. of the problem given that velocity V of a body is
proportional to its displacement X.
dX
VαX ⇒ 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 (2πft ) = 0
Q dQ
Therefore + R
C dt
Ordinary Differential Equations Page 6
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

Ordinary Differential Equations Page 7


(a)

y = 2e -x + xe-x
d -x
( )
y' = 2 e + x e + e
dx
d -x
dx
( )
-x d

dx
(x ) = −e-x − xe-x

y" =
d
( ) d -x
− e − x e + e
-x
( )
-x d 
(x ) = xe-x
dx  dx dx 

d2y dy
L.H .S . = 2 + 2 + y
dx dx
( )
= 2e -x + xe -x + 2 − e -x − xe -x + xe -x = 0
= R.H .S .
2
d y dy
∴ y=2e + xe is a solution of 2 + 2 + y
-x -x

dx dx
Ordinary Differential Equations Page 8
(b)
y = 3e -x − 4 xe-x
d -x
( )
 d -x
y ' = 3 e − 4 x e + e -x d
( ) 
(x ) = −7e-x + 4 xe-x
dx  dx dx 
d -x
( )
 d -x
y" = −7 e + 4 x e + e ( )
-x d 
(x ) = 11e-x − 4 xe-x
dx  dx dx 
d2y dy
L.H .S . = 2 + 2 + y
dx dx
( )
= 3e -x − 4 xe -x + 2 − 7e -x + 4 xe -x + 11e -x − 4 xe -x = 0
= R.H .S .
2
d y dy
∴ y=3e − 4 xe is a solution of
-x -x
2
+2 + y
dx dx
Ordinary Differential Equations Page 9
A general solution of a d.e. is a set of all possible solutions of the
d.e.
A particular solution of a d.e. is any one solution of the d.e that
fulfills the specific boundary conditions.

Example 8
dy
Given the d.e. = 10 x
2
dx
y = 5x + C is a general solution while
y = 5x2 + 3 is a particular solution.

Ordinary Differential Equations Page 10


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.

Ordinary Differential Equations Page 11


Given y = C1sin x + C2cos x
y' = C1cos x - C2sin x
(a) The initial conditions y(0) = 1, y’(0) = 2.
y(0) = C1sin (0) + C2cos (0) = 1
∴ C2 = 1
y‘(0) = C1cos (0) - C2sin (0) = 2
∴ C1 = 2
(b) The boundary conditions y(0) = 1 and y’(π) = 2.
∴ C2 = 1 from answer of (a)
y‘(π) = C1cos (π) - C2sin (π) = 2
∴ C1 = -2

Ordinary Differential Equations Page 12


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

y (0 ) = cos 2(0 ) + c = 2 ⇒ c =
1 3
2 2
1 3
∴ Particular sol. of the d .e. = cos 2 x +
2 2
Ordinary Differential Equations Page 13
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
∫ ∫ ⇒ = + = +c
2
(a) = 4x dy = 4 xdx y c 2 x
dx 2
d2y
∫ ∫ ∫ dxdx
-2 x -2 x
(b) 2
=e dy = e
dx
 e-2 x  e -2 x
= ∫  + c1 dx = + c1 x + c2
 −2  4
Ordinary Differential Equations Page 14
FIRST ORDER ORDINARY DIFFERENTIAL EQUATION

Method of Separation of Variables


Definition
A d.e. is called variables separable if it may be written in the form

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

Determine whether the following d.e. are variable separable.


dy Yes
(a) = ( x 2 + 2)( y - 3)
dx
dy
(b) = x2 y + 2 y - 6 No
dx
dy 2 x3 - 5
(c) = Yes
dx 3y + 4
dy
(d) = 2 x y - 3x + 2 y - 3
2 2
Yes
dx
(
= (2 y − 3) x 2 + 1)
Ordinary Differential Equations Page 16
Example 13
Find the general solution of
dy sin 5 x
(a) =
dx y

∫ ydy = ∫ sin 5 xdx


y 2 − cos 5 x
= +c
2 5
− 2 cos 5 x
y= + 2c
5

Ordinary Differential Equations Page 17


Example 13
Find the general solution of

dy -5 x
(b) =ye
dx
1
∫ y ∫ dx
-5 x
dy = e

e-5 x
ln y = +c
−5
e- 5 x
+c
y=e −5

Ordinary Differential Equations Page 18


Example 13
Find the general solution of

(c) dx - e - 5 x dy = 0
dx = e -5 x
dy

∫ = ∫ dx
5x
dy e
e5 x
y= +c
5

Ordinary Differential Equations Page 19


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
ln x + c
y=e

Ordinary Differential Equations Page 20


Example 14
Solve the d.e. in Example 13(b) and (d) given
(a) in Example 13(b) y(0) = e.
e- 5 (0 )
+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
First Order Linear ODE

The standard form of a first order linear d.e. may be written in


dy
+ P( x) y =Q( x)
dx

Example 15
What are P and Q referred to the standard form?

P(x ) = - 3x 2 , Q(x ) = 5 x
dy
(a) - 3x 2 y - 5 x = 0
dx
2 dx
P (t ) = 3t − 2 , Q (t ) = −
5 2
(b) t + 3t 3 x + 2t = 5 x
dt t t
Ordinary Differential Equations Page 22
Integrating Factor

The linear d.e. in standard form


dy
+ P( x) y =Q( x)
dx
has an integrating factor

μ(x) = e ∫ P(x)dx

The general solution of the linear d.e. is

μ( x) y = ∫ μ( x) Q( x) dx

Ordinary Differential Equations Page 23


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

Ordinary Differential Equations Page 24


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 (6 ) = 6
2 −2
P(x ) = , Q(x ) = 2
2
x 3
2 ∴ C = 72
µ (x ) = e ∫
dx
x
= e 2 ln x = x 2 2
y = x + 72 x − 2
x 2 y = ∫ x 2 (2 )dx 3
2 3
x y = x +C
2

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
ln sec x
= sec x
(sec x ) y = ∫ sec x sin xdx
(sec x ) y = ∫ tan xdx
(sec x ) y = ln sec x + C
y = cos x(ln sec x + C )

Ordinary Differential Equations Page 26


Example 16
Find the general solution of the following linear d.e.
dy
(d) x -3 y = x 4 e x given y = 2 when x = 1
dx

P(x ) = − , Q(x ) = x e
3 3 x y (1) = (1)3 (1)
e + C (1)3
=2
x ∴C = 2 − e
( )
3
∫ − x dx
µ (x ) = e = e −3ln x = x −3 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

Ordinary Differential Equations Page 27


First Order O.D.E. Applications
Example 17
The resistance force on a body is directly proportional to the
velocity of the body. Set up a differential equation and find the
velocity of a body of mass 2.4 kg after 10 s given its initial velocity
30 ms-1 and constant of proportionality 0.7 kgs-1 .
dv
m = − kv
dt
dv k
+ v=0
dt m
P(t ) = k m , Q(t ) = 0

µ (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
Example 17
v = Ce − kt m = Ce −0.7 t 2.4 = Ce −0.292t
Given the initial condition, v = 30 when t = 0.
v(0 ) = Ce −0.292 (0 ) = 30
C = 30

then
v(t ) = 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

Ordinary Differential Equations Page 29


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.5µF 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 ) , Q(t ) = 0
−1

∫ ( RC )
−1

µ (t ) = e
dt
= e t RC
e t RC Q = ∫ e t RC (0 )dt = K
Q = Ke −t RC
Ordinary Differential Equations Page 30
Example 18
−t RC
Ke (
− t 20×103 ×0.5×10 −6 )
Vc (t ) =
Ke
= = 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 −100 (0 ) = 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

Ordinary Differential Equations Page 31


SECOND ORDER ORDINARY DIFFERENTIAL EQUATIONS
Reference: Croft & Davison Chapter 20 Blocks 5 – 6

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
If f ( x) = 0 the d.e. is homogeneous.
If f ( x) ≠ 0 the d.e. is inhomogeneous.

Ordinary Differential Equations Page 32


If bi (x) are constants, where i = 0, 1, 2, the d.e. is said to
be with constant coefficients.

A Second Order Linear D.E with Constant Coefficients has


the form
2
d y dy
2
+p + q y = f ( x)
dx dx

where p, q are constants

Ordinary Differential Equations Page 33


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) 2
+ 5x - 4y = 0 No Yes
dx dx
2
d y dy
(c) 2
-3 = 6x Yes No
dx dx

Ordinary Differential Equations Page 34


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

The solution the homogeneous d.e. is called the complementary


function, ycf and it contains two arbitrary constants.

Ordinary Differential Equations Page 35


Any solution satisfied the inhomogenous d.e. is called particular
integral, ypi.

The general solution of the inhomogenous d.e. is the sum of the


complementary function and the particular integral.
y = ycf + ypi

Ordinary Differential Equations Page 36


Example 20
Show that y = A sin 2 x + B cos 2 x is a complementary function of

d2y
2
+ 4 y=0.
dx
y ' = 2 A cos 2 x − 2 B sin 2 x, y" = −4 A sin 2 x − 4 B cos 2 x

L.H .S . = −4 A sin 2 x − 4 B cos 2 x + 4( A sin 2 x + B cos 2 x )


= 0 = R.H .S .
∴ y = A sin 2 x + B cos 2 x is a complementary function of d.e. y" +4y = 0
Note:
If φ1(x) and φ2(x) are two linear dependent solutions of the
homogeneous d.e. then the linear combination C1φ1(x) + C2 φ2(x)
is also a general solution of the d.e.
Ordinary Differential Equations Page 37
Example 21
Given the d.e. d2y dy
2
+ 7 + 12 y = 0.
dx dx

Show that (a) e -3 x is a solution


let y = e - 3 x , then y ' = −3e - 3 x & y" = 9e - 3 x
( ) ( )
L.H .S . = 9e −3 x + 7 − 3e −3 x + 12 e −3 x = 0 = R.H .S .
∴ e - 3 x is a solution of d.e. y" +7y' +12y = 0
(b) e -4 x is a solution
let y = e - 4 x , then y ' = −4e - 4 x & y" = 16e - 4 x

( ) ( )
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
Example 21
Given the d.e. d2y dy
2
+ 7 + 12 y = 0.
dx dx

Show that (c) C1e - 3 x + C2 e - 4 x is a complementary solution


let y = C1e - 3 x + C2 e - 4 x , then
y ' = −3C1e - 3 x − 4C2 e - 4 x & y" = 9C1e - 3 x + 16C2 e - 4 x

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 .

∴ C1e - 3 x + C2 e - 4 x is a complementary solution of d.e. y" +7y' +12y = 0

Ordinary Differential Equations Page 39


The d.e.
d2y dy
2
+p + qy = 0
dx dx

can be written by using the D operator, where

2 d2 d
D denotes 2 and D denotes .
dx dx

Rewrite the equation in the form

D 2 y + pDy + qy = 0
( D 2 + pD + q) y = 0

Ordinary Differential Equations Page 40


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 = C1φ1(x) + C2φ2(x)

where 1φ (x) = e kx
φ
and 2 (x) =
1
e k x
are solutions of the differential
2

equation provided that φ1 ( x) and φ2 ( x) are linearly independent.

Ordinary Differential Equations Page 41


Let y = e kx be the general solution of the d.e., then
2
dy d y
= ke and
kx
2
= k 2 kx
e
dx dx

Hence the d.e. becomes


e kx (k 2 + pk + q ) = 0

Since e ≠ 0 , therefore we have


kx

k 2 + pk + q = 0
- an auxiliary equation of the d.e. and is quadratic in k.

Ordinary Differential Equations Page 42


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

auxiliary equation of d.e. : k 2 + pk + q = 0


k 2 − 7 k + 12 = 0
(k − 3)(k − 4) = 0
k = 3 or 4
Ordinary Differential Equations Page 43
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

auxiliary equation of d.e. : k 2 + pk + q = 0


k 2 + 8k + 16 = 0
(k + 4)(k + 4) = 0
k = −4 (repeated )
Ordinary Differential Equations Page 44
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
auxiliary equation of d.e. : k 2 + pk + q = 0
k 2 + 2k + 2 = 0
−2± (2) − 4(1)(2) − 2 ±
2
−4
k= = = −1 ± j
2(1) 2
Ordinary Differential Equations Page 45
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. (a) 2
-2 - 8y = 0
dx dx

k 2 − 2k − 8 = 0
(k + 2)(k − 4) = 0
k = −2 or 4

∴ y = C1 e −2 x + C2 e 4 x
Ordinary Differential Equations Page 46
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 − 3)(k + 2) = 0
k = −2 or 3 2

∴ y = C1 e −2 x + C2 e3 x 2
Ordinary Differential Equations Page 47
(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 xe kx
or y = (C1 + C2 x) e kx

Example 24
d2y dy
Solve the d.e. (a) 2
+8 + 16 y = 0
dx dx

k 2 + 8k + 16 = 0
(k + 4)(k + 4) = 0
k = −4 (repeated)

∴ y = (C1 + C2 x ) e −4 x
Ordinary Differential Equations Page 48
(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 xe kx
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
3. Roots are complex
If the roots of the auxiliary equation are k1 + k 2 j and k1 − k 2 j
The solution is y = A e(k1+k 2 j)x + B e(k1-k2 j)x
However, it is usually written as
y = e k1 x (C1 cos k 2 x + C2 sin k 2 x)
where A, B, C1 and C2 are constants to be determined by
boundary conditions.

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.

Ordinary Differential Equations Page 50


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± (2) − 4(1)(2) − 2 ±
2
−4
k= =
2(1) 2
= −1 ± j ⇒ k1 = −1 & k 2 = 1

∴ y = A e(−1+j ) x + B e (−1− j ) x

or y = e − x (C1 cos x + C2 sin x)

Ordinary Differential Equations Page 51


3. Roots are complex
Example 25
Solve the d.e. (b) D 2 y + 25 y = 0

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

Ordinary Differential Equations Page 52


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 2 + 6k + 13 = 0
−6± (6)2 − 4(1)(13) − 6 ± − 16
k= = = −3 ± 2 j ⇒ k1 = −3 & k 2 = 2
2(1) 2
∴ y = A e(−3+ 2 j ) x + B e (−3− 2 j ) x or y = e −3 x (C1 cos 2 x + C2 sin 2 x)
y ' = (− 3 + 2 j )A e (−3+ 2 j ) x + (− 3 − 2 j )B e (−3− 2 j ) x
y (0 ) = A e (−3+ 2 j )(0 ) + B e (−3− 2 j )(0 ) ⇒ A + B = 2 − (i )
y ' (0 ) = (− 3 + 2 j )A e (−3+ 2 j )(0 ) + (− 3 − 2 j )B e (−3− 2 j )(0 )
= (− 3 + 2 j )A + (− 3 − 2 j )B = 1 − (ii )
sub (i ) into (ii ), (− 3 + 2 j )(2 − B ) + (− 3 − 2 j )B = 1
⇒ B = 1 − 7 4 j and A = 1 + 7 4 j
Ordinary Differential Equations Page 53
Particular Integral of inhomogenous ODE with constant
coefficients

For a inhomogeneous second order ODE,

d2y dy
2
+p + qy = f(x)
dx dx

Particular integral is any function that when substituted into the


left-hand side and simplified, results in the function on the right.

Ordinary Differential Equations Page 54


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

Ordinary Differential Equations Page 55


Example 26
d 2 y dy 2x
Find the particular integral of 2
- - 6 y = e
dx dx
dy d2y
= 2C1e , and 2 = 4C1e 2 x
2x
Let y ( x) = C1 e ; then 2x

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 3x
+ Be −2 x
− e
4

Ordinary Differential Equations Page 56


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.

φ11 (D )x + φ12 (D ) y = 0 Eq.(1)


φ21 (D )x + φ22 (D ) y = 0 Eq.(2)

d (⋅)
where D(⋅) =
dt
φ11 (D ) φ12 (D )
φ (D ) = φ11 (D )φ22 (D ) − φ12 (D )φ21 (D ) =
φ21 (D ) φ22 (D )

Ordinary Differential Equations Page 57


Example 27
Solve dx -3 x -6 y = 0, 3 x + dy + 3 y= 0
dt dt

d (⋅)
Solution:
Using D-operator, D(⋅) =
dt
( D − 3) x -6 y = 0 Eq.(1)
3 x + ( D + 3) y = 0 Eq.( 2)
D −3 −6
φ (D ) = =0
3 D+3
( D − 3)( D + 3) + 18 = 0
D2 + 9 = 0
D = ±3 j
Ordinary Differential Equations Page 58
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

Using D-operator, substitute into Eq.(1) ,

( 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

(−3 A1 + 3B1 − 6 A2 ) cos 3t + (−3 A1 − 3B1 − 6 B2 ) sin 3t = 0 Eq.(3)

Ordinary Differential Equations Page 59


cos3t and sin3t are linear independent. As Eq.(3) implies
the coefficients of cos3t and sin3t are both zero.
− 3 A1 + 3B1 − 6 A2 = 0
− 3 A1 − 3B1 − 6 B2 = 0
Therefore,
1
A2 = − ( A1 − B1 )
2
1
B2 = − ( A1 + B1 )
2
The complementary solutions are
xcf = A1 cos 3t + B1 sin 3t

ycf = − ( A1 − B1 ) cos 3t − ( A1 + B1 )sin 3t


1 1
2 2
Ordinary Differential Equations Page 60
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 x2
+y =e
dx
E.g. The differential equation above cannot be solved by
writing the solution as a linear combination of elementary
function.

Ordinary Differential Equations Page 61


Euler’s Method
Given the initial-value problem
y ' = f ( x, y ), y ( x0 ) = y0

Defined on the interval x0 ≤ x ≤ x0 + h , then at x1 = x0 +h


the approximate value of y ( x0 + h) , denoted by y1 , is
given by y
y1 = y0 + hf ( x0 , y0 ) B error

C y(x + h)
0
A D

y(x0 + h)
y0 y1

x
0 x0 x1= x0 + h

Ordinary Differential Equations Page 62


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
y1 = 1.0 + 0.4 * [2(0) + 1.0] = 1.4
−x
Applying the integrating factor e
y = 3e x − 2 x − 2
x = 0.4, y = 1.6755

The percentage of error is 16.4%

Ordinary Differential Equations Page 63


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

0.2 1.23 1.23+0.1*[2(0.2)+1.23]=1.39


0.3 1.39 1.39+0.1*[2(0.3)+1.39]=1.59
0.4 1.59 (The percentage of error is 5.1%)

Ordinary Differential Equations Page 64


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

You might also like