Mat 241 Lectures-1 (1) - 1
Mat 241 Lectures-1 (1) - 1
AKEJU A.O
University of Ibadan
Department of Mathematics
1
Course Outline
1. Introduction
Reference Materials
Introduction
their derivatives which involve coefficients that are functions of the indepen-
dent variables.
Definition:ORDER
The degree of a differential equation is the highest power present in the equa-
tion
Definition:LINEAR DIFFERENTIAL EQUATIONS
2
3
Definition: SOLUTION
Solution are often accompanied by interval and these intervals can impart some
important information about the solution
The solution of ODE are classified into (1)General Solution and (2)Particular
Solution
Definition:INITIAL CONDITION(S)
This is a condition or set of conditions on the solution that allow us to de-
termine the particular solution and which solution that we are after.Initial
Condition are values of the solution and its derivative at specific points.The
number of I.C required for the solution of a certain differential equation will
•
dy
= cosx
dx
order 1, linear equation, (y is dependent variable, x is independent vari-
able)
4
•
d2 y
2
+ k2y = 0
dx
order 2, linear equation, (y is dependent variable, x is independent vari-
able)
•
d3 x dx
+ x − 4xy = 0
dy 3 dy
order 3, linear equation, (x is dependent variable, y is independent vari-
able)
•
d2 w 3 dw
( ) − xy +w =0
dx2 dx
order 2, degree 3, non linear equation,(w is dependent variable, x is
independent variable)
∂ 2v ∂ 2v
+ =0
∂x2 ∂y 2
PDE order 2, V is dependent, x and y are independent variable
Generally, the equation
is called an n th-order ODE. Equation (1.1) can be solved explicitly for y (n) in
Illustration
Solution:
Let y denote the population at time t years and y0 the population at time
t = 0. Then
dy dy dy
∝ y =⇒ = ky =⇒ = kdt.
dt dt y
where k is constant.
Integrating both sides,we have
ln y = kt + ln c
y = cekt
At time
t = 0, y = y0 =⇒ y0 = ce0 =⇒ y0 = c =⇒ y = y0 ekt .
when y = 3y0 ,
3 = ekt
so
350 = e50kt = (e50k )t = 2t
350 = 2t =⇒ t = 79years.
Exercises
State the type, linearity, order ,independent and dependent variables of the
following equations:
1.
d2 x
2
+ k2x = 0
dt
2.
(x2 + y 2 )dx + 2xydy = 0
3.
d3 w 2 dw
( 3
) − 2( )4 + yw = 0
dx dx
4.
∂ 2w 2
2∂ w
= a
∂t2 ∂x2
5.
x(y 00 )3 + (y 0 )4 − y = 0
Chapter 2
Derivative of ODE
tion, the reverse process can be carried out by obtaining an ODE from a given
function through the process of eliminating some constants that appear in such
functions.
Examples:
Form a DE by eliminating the constant(s) in the following equations:
1. y = Ax
Solution:
dy dy y
y0 = = A =⇒ = y0 =
dx dx x
2. y = Ax + B
Solution:
y 0 = A, y 00 = 0
but
B 00 xy 0 − y + B
y0 = y − ,y =
x x2
7
8
3. y = Ax2 + Bx + c
Solution:
y 0 = 2Ax + B
y 00 = 2A
4. y = A cos ax + B sin ax
Solution:
y 0 = −Aa sin ax + Ba cos ax
5. y = x + A
x
= x + Ax−1
Solution
y 0 = 1 − Ax−2
but
A
x
= y − x =⇒ A = x(y − x)
y 0 = 1 − x y−x
x2
= x−y+x
x
= 2x−y
x
Exercise
Form a differential equation from these functions
• y = Ax2 + Bx
• y = −Asinx + Bcosx
• y = c1 e3x + c2 e2x + c3 ex
9
• Separation of Variable
• Homogeneous type
• Exact type
• Bernoulli equation
dy
= f (x)g(y)
dx
10
11
then the equation is a separable equation where f (x) and g(y) are given func-
•
dy
= 2xy 2
dx
•
dy
y −1 (x + 1)−1
dx
•
dy
(3y 2 + ey ) = cosx
dx
•
dy
(x + 1) = 2y
dx
Examples
(1)
dy 1+y
=
dx 2+x
Solution
1 dy 1
=
1 + y dx 2+x
Hence,we have
ln(1 + y) = lnA(2 + x)
Then we get
y(x) = A(2 + x) − 1
(2)
dy
= 2xy 2
dx
Solution
This equation can be written in the separable form as
y −2 dy = 2xdx
Hence,we have
−1
= x2 + C
y
If we simplify ,we get
1
y(x) = −
x2 + C
where C is an arbitrary constant of integration
13
degree n in x and y if and only if the function f(x,y) defined for all (x, y) ∈ R2
has the behaviour defined as follow;
Examples
dy y x4
= 2y 3 e x −
dx x + 3y
y x4
f (x, y) = 2y 3 e x −
x + 3y
is such that
ty t4 x4
f (tx, ty) = 2t3 y 3 e tx −
tx + 3ty
y x4
= t3 [2y 3 e x − ]
x + 3y
= t3 f (x, y)
dy
= x3 y 2 − 3x5
dx
f (x, y) = x3 y 2 − 3x5
14
is such that
= t5 [x3 y 2 − 3x5 ]
= t5 f (x, y)
this is obtained,we can then use the separation of variable technique to solve
the problem.
Examples Solve the following differential equations
(1)
dy x2 + y 2
=
dx xy
Let
y
y = vx =⇒ v =
x
So that
dy dv
=v+x
dx dx
But
dy x2 + v 2 x2 1 + v2
= =
dx x2 v v
This means that
dv 1 + v2
v+x =
dx v
If we simplify this above equation ,we have
dv 1
x =
dx v
15
This gives
v2
= ln x + c =⇒ v 2 = ln x2 + 2c
2
After further simplification,we have
y 2 = x2 (ln x + 2c)
So that
√
y = x ln x2 + A
(2)
dy x + 3y
=
dx 2x
Let
y
y = vx =⇒ v =
x
So that
dy dv
=v+x
dx dx
But
dy x + 3xv 1 + 3v
= =
dx 2x 2
This means that
dv 1 + 3v
v+x =
dx 2
16
dv 1+v
x =
dx 2
This gives
2 ln(1 + v) = ln x + c where c = ln A
y
(1 + v)2 = Ax =⇒ (1 + )2 = Ax =⇒ (x + y)2 = Ax3
x
So that
√
y= Ax3 − x
dy
1. x2 + y 2 dx = xy
dy
2. (x2 + xy) dx = xy − y 2
dy
3. (x − y) dx =x+y
The equation we shall concern ourselves with here are either of the form:
y 0 = F (x, y) (3.1)
or
M (x, y)dx + N (x, y)dy = 0 (3.2)
17
Example
may be written as
dy sin(x + y)
y0 = =−
dx x + 3y
.
Definition 3.3.1. Let F be a function of 2 variables such that F has 1st partial
derivatives in the domain D. Then, the total differential equations of F ;
∂F (x, y) ∂F (x, y)
dF (x, y) = dx + dy ∀x, y ∈ D (3.3)
∂x ∂y
Example:
Let F (x, y) = xy 2 + 2x3 y
so that
∂F (x, y) ∂F (x, y)
dx = y 2 + 6x2 y, dy = 2xy + 2x3
∂x ∂y
Hence,
dF (x, y) = y 2 + 6x2 y + 2xy + 2x3
From (3.3),
dF (x, y) = M (x, y)dx + N (x, y)dy
∂F ∂F
But M = ∂x
and N = ∂y
, then
∂ 2F
!
∂M ∂ ∂F
= =
∂y ∂y ∂x ∂y∂x
∂ 2F
!
∂N ∂ ∂F
= =
∂x ∂x ∂y ∂x∂y
Consider
y 2 dx + 2xydy = 0
where
so that
∂M ∂N
= 2y, = 2y
∂y ∂x
Since
∂M ∂N
= = 2y
∂y ∂x
Then the given DE is an exact DE ∀ (x, y) ∈ D.
Exercise:
1. x2 dx + 2xydy = 0
2. ydx + 2xdy = 0
19
theorem (2.1) and its exact in (x, y) ∈ D, then the solution of the differential
equation (2.2) is given as
F (x, y) = c (3.6)
tion.
Solution:
and
∂M ∂N
= 4x, = 4x
∂y ∂x
Hence, the DE is exact.
∂F Z
= 3x2 + 4xy =⇒ F = 3x2 + 4xydx
∂x
So,
∂F
= 2x2 + Φ0 (y)
∂y
20
But
∂F
= N (x, y) = 2x2 + 2y
∂y
Therefore
∂F
2x2 + 2y = 2x2 + Φ0 (y) =
∂y
and
Φ0 (y) = 2y, =⇒ Φ(y) = y 2 + c
F = x3 + 2x2 y + y 2 + c
Solution:
and
∂M ∂N
= −2x sin y + 3x2 , = 3x2 − 2x sin y
∂y ∂x
Hence the differential equation is exact
∂F Z
= 2x cos y + 3x2 y, =⇒ F = 2x cos y + 3x2 ydx
∂x
So
F = x2 cos y + +x3 y + φ(y)
21
∂F
= −x2 sin y + x3 + φ0 (y)
∂y
But
∂F
= N (x, y) = x3 − x2 sin y
∂y
Therefore
x3 − x2 sin y = −x2 sin y + x3 + φ0 (y)
and
φ0 (y) = 0, =⇒ φ(y) = 0
Hence
F = x2 cos y + x3 y
Solution
∂F Z
= 3x2 y − 6x, =⇒ F = 3x2 y − 6xdx
∂x
So
F = x3 y − 3x2 + φ(y)
22
∂F
= x3 + φ0 (y)
∂y
But
∂F
= N (x, y) = x3 + 2y
∂y
Therefore
x3 + 2y = x3 + φ0 (y)
and
φ0 (y) = 2y, =⇒ φ(y) = y 2
Hence
F (x, y) = x3 y − 3x2 + y 2
Exercise
(1) Determine which of the following differential equations are exact and
Solve those that are exact
(2.) Determine the value of constant A which the equations below are exact
23
(b.) ( x12 + 1
y2
)dx + ( Ax+1
y3
)dy = 0
y 1
2
dx + (y − )dy = 0
x x
which is exact (observe)
Generally, if
M (x, y)dx + N (x, y)dy = 0
is always
R
pdx
e
24
Example 1
Solve the D.E
dy
+ 3y = e2x
dx
Solution
Compare this with (3.7), then, we observe that P = 3, Q = e2x then
R
3dx
I.F = e = e3x
dy
e3x + e3x 3y = e5x
dx
Observe that the LHS is the differential coefficient of ye3x i.e
d dy
(ye3x ) = e3x + e3x 3y
dx dx
Hence
d
(ye3x ) = e5x
dx
Integrating both sides, we have
3x
Z
e5x
ye = e5x dx = +C
5
Divide both sides by e3x ,we have
e2x
y= + Ce−3x
5
25
Example 2
Solution
Compare with (3.7), P = −1, Q = x, then
R
−1dx
I.F = e = e−x
dy
e−x − e−x y = xe−x
dx
Observe that the LHS is the differential coefficient of ye−x i.e
d dy
(ye−x ) = e−x − e−x y
dx dx
Hence
d
(ye−x ) = xe−x
dx
Integrating both sides,we have
Z
ye−x = xe−x dx = −e−x (x + 1) + C
Example3 Solve
dy
+ ycotx = cosx
dx
26
Solution
dy
sinx + ycotxsinx = sinx
dy
2
ysinx= cosxsinxdx= sin2 x + c
R
y= sinx
2
+ ccosecx
Exercise
Solve the following D.E
dy
(1) (x + 1) dx + y = (x + 1)2
dy
(2) (1 − x2 ) dx − xy = 1
dy
(3) x dx − 5y = x7
27
This is a non linear special type of D.E which can be reduced to a linear
dy
+ p(x)y = q(x)y n (3.8)
dx
dy
+ p(x)y = q(x)y n
dx
dy
y −n + p(x)y 1−n = q(x) (3.9)
dx
Let
Z = y 1−n (3.10)
Then
dz dy
= (1 − n)y −n (3.11)
dx dx
Substitute (3.10) and (3.11) in (3.9), we have
1 dz
+ p(x)z = q(x)
1 − n dx
28
. Observe that (3.12) is of the form (3.7) which is a linear D.E in variable x
and z
Example 1
Solve the D.E
dy y
+ = xy 2
dx x
Solution:
Divide through by y 2 ,
dy 1 1−2
y −2 + y =x
dx x
Let
z = y 1−2 ..............(3.13)
Then
dz dy
= −y −2 ..........(3.14)
dx dx
Substitute (3.13) and (3.14) into the given differential equation,we have
dz 1
− z = −x
dx x
29
The given equation has reduce to linear differential equation that be solve
Multiply both sides of the last equation by this integrating factor,we have
1 dz 1
+ 2 z = −1
x dx x
Note that the left hand side of the above equation satisfy the differential coef-
ficient
d z
(+ ) = −1
dx x
Integrating both sides,we have
z Z
= − dx = −x + c
x
Then
z = −x2 + cx
Therefore
y = (−x2 + cx)− 1
Example 2
Solve the D.E
dy
x2 y − x3 = y 4 cos x
dx
Solution:
This equation can be re-arrange as
dy 1 −y 4 cosx
− y=
dx x x3
30
dy 1 cosx
y −4 − y −3 = 3 ....... +
dx x x
Let
z = y 1−4 = y −3 .......... ∗
dz dy
= −3y −4 .......... ∗∗
dx dx
−3 we have
dz 3
+ z = −3x−3 cosx
dx x
This is a linear differential equation with variable z and x
Where
R 3
dx
I.F = e x = x3
dz
x3 + 3x2 z = 3cosx
dx
d
Observe that the RHS of above equation is the derivative of dx
(x3 z)
So that
d 3
(x z) = 3 cos x
dx
Integrate both sides, we have
Z
x3 z = 3cosxdx
31
3 sin x + c
z=
x3
and
x3 x3
y3 = R =
[ 3cosxdx] + c 3sinx + c
Therefore,
x3 1
y=( )3
3sinx + c
Exercise
is called a second oder O.D.E involving 2nd order derivative of the unknown
function y(x) as the highest order. We consider this type of equation under 2
cases
Case 1
0 00
G(x, y , y ) = 0 (4.2)
dy
Suppose y is the solution of (4.2), then we can set v = dx
such that V becomes
32
33
0
G(x, v, v ) = 0 (4.3)
d2 y dy dy
x 2
= 2([ ]2 − )
dx dx dx
This is of the form (4.2) with missing variable y i.e the dependent variable
Solution:
dy
Let v = dx
then the equation becomes
dv
x = 2(v 2 − v)
dx
Seperating variable,we have
dv dx
= 2
v2 − v x
1 1 dx
( − )dv = 2
v−1 v x
Integrating both sides,we have
Simplify,we have
v−1
= cx2
v
34
But
dy
v=
dx
then
−1 dy 1
1− = cx2 =⇒ =
v dx 1 − c1 x 2
By integration
1 1 + ax
y= ln( ) + c2 if C1 ≥ 0
2a 1 − ax
And
1
y = tan−1 bx + c if C1 ≤ 0
b
Case 2
G(y, y 0 , y 00 ) = 0 (4.4)
Let
dy d2 y dv dv dy dv
v= , 2
= = . =v
dx dx dx dy dx dy
Then we ca write 4.4 as
dy
G(y, v, v )=0 (4.5)
dx
(4.5) is a first order D.E for dependent variable v. If (4.5) is solvable then,
d2 y dy dy
2
= ( )2 + 2 (4.6)
dx dx dx
35
Solution:
dy d2 y dv
Since x is missing , then v = dx
, and dx2
= v dy , so (4.6) becomes
dv
yv = v 2 + 2v (4.7)
dy
This is can be reduce to
dv
y =v+2
dy
Seperate the variable,we have
dv dy
=
v+2 y
Solving, we have
v + 2 = cy and v = c1 y − 2
i.e
dy
= c1 y − 2
dx
Seperate the variables ,we have
dy
= dx
c1 y − 2
1
ln(c1 y − 2) = x + c2
c1
so that
C1 y − 2 = ec1 x+c = Aec1 x
36
Where C = c1 c2 .So
C1 y = Aec1 x + 2
Therefore,
A c1 x 2
y= e +
c1 c1
Exercise
2
d y dy 2
(1) y dx2 + ( dx ) = 0
d y 2 dy 2
(2) 2x dx2 = ( dx ) − 1
d2 y dy
a0 (x) 2
+ a1 (x) + a2 (x)y = f (x) (4.8)
dx dx
d2 y dy
a0 2
+ a1 + a2 y = 0 (4.9)
dx dx
dy
a1 + a2 y = 0
dx
dy a2
+ y=0
dx a1
a2
Let a1
= k ,then we have
dy
= −ky
dx
Seperate the variable and intergrate both sides,we have
If − k = m then y = Aemx
If y is a solution of (4.9),then
dy d2 y
= Amemx , = Am2 emx
dx dx2
so
Aemx (a0 m2 + a1 m + a2 ) = 0
Hence
a0 m2 + a1 m + a2 = 0 (4.10)
38
d2 y dy
− 3 + 2y = 0
dx2 dx
m2 − 3m + 2 = 0
(m − 1)(m − 2), m1 = 1, m2 = 2
Since the roots of the auxilliary equation are distinct,then the general solution
is
y(x) = A1 em1 x + A2 em2 x = A1 ex + A2 e2x
Example 2
Given the differential equation
d2 y dy
2
= −4 + 5 = 0
dx dx
39
m2 + 4m − 5 = 0
m1 = 1, m2 = 5
y(x) = A1 ex + A2 e−5x
m2 − 6m + 9 = 0
m1 = 3, m2 = 3
= (A1 + A2 )e3x
= Ae3x
But we know that every second order differential equation must have two ar-
botrary constants,so there must be anotherterm containing a second constant.
40
(A + Bx)e3x
y(x) = (A + Bx)e3x
m1 = α + iβ, m2 = α − iβ
so that we have
y(x) = A1 e(α+iβ)x + Ae(α−iβ)x
since
therefore
y(x) = eαx [A1 cos βx + A2 cos βx + iA1 sin βx − iA2 sin βx]
41
where A1 +A2 = A and i(A1 −A2 ) = B where A and B are arbitrary constants
Example
y 00 − 2y 0 + 10y = 0
Solution
The auxilliary equation associated with above differential equation is given by
m2 − 2m + 10 = 0
m1 = 1 + 3i, m2 = 1 − 3i
Exercise
Solve the following differential equations
(1) y 00 − 5y 0 + 6 = 0
(2) y 00 − 8y 0 + 16y = 0
(3) y 00 + cy = 0 if c>0
Example
Solve the Initial Value Problem
d2 y dy
2
− 6 + 25y = 0, y(0) = −3, y 0 (0) = −1
dx dx
Solution
The auxilliary equation of the above D.E is
m2 − 6m + 25 = 0
i.e α = 3 ,and β = 4
The general solution therefore is
−3 = A2
−1 = (3A2 + 4A1 )
−1 = (4A1 − 9)
A1 = 2
d2 y dy
a0 (x) 2
+ a1 (x) + a2 (x)y = f (x) (4.11)
dx dx
where yc (x) is called the complimentary equation and yp (x) is called the par-
ticular integral
We shall solve this type of differential equation with the following techniques
namely
(a) Pn (x)
(b) Pn (x)eax
This require that we solve the homogeneous part first to get the complimen-
tary function and then the part with f (x) 6= 0 to get the paticular integral
Example Solve the differential equation
y 00 − 5y 0 + 6y = x2
45
m2 − 5m+ = 0
m = 2, m=3
To find the particular integral,we assume the general form of the RHS of the
yp (x) = Cx2 + Dx + E
Next,we find the first and the second derivative of the particular intgral and
the substitute them into the given problem to find the unknown constants
so
2C − 5(2Cx + D) + 6(Cx2 + Dx + E) = X 2
1
6C = 1, =⇒ C=
6
5
6D − 10C = 0, =⇒ D=
18
19
2C − 5D + 6E = 0, =⇒ E=
108
So the particular integral for the given D.E is given by
1 5 19
yp (x) = x2 + x +
6 18 108
1 5 19
y(x) = A1 e2x + A2 e3x + x2 + x +
6 18 108
where A1 and A2 are arbitrary constant that can be determined if the initial
y 00 + y 0 = xe2x
Solution
The auxilliary equation of the homogeneous part is
m2 + 1 = 0
If we solve,we get
m1 = i, m2 = −i
But f (x) is of the form Pn (x)eax where Pn (x) is a polynomial of degree one,so
the particular integral is
Differentiate the P.I twice and substitute into the given D.E,we have
and
y 00 = e2x (4a + 4bx + 4b)
simplify we have,
so
(5a + 4b + +5bx) = x
5a + 4b = 0, 5b = 1
−4 1
a= , b=
25 5
−4 1
yp (x) = e2x ( + x)
25 5
48
−4 1
A1 sin x + A2 cos x + e2x ( + x)
25 5
y 00 + ay 0 + by = f (x) (4.12)
f (x)y2 (x)
C10 (x) = − )
y1 (x)y20 (x)− y2 (x)y10 (x
f (x)y1 (x)
C20 (x) = − )
y1 (x)y20 (x)− y2 (x)y10 (x
provided the denominator is not zero, where
is the Wronskian
Example
Solve the differential equation
y 00 + y = tan x
Solution
If we follow the previous discussion,we see that the general solution of this
equation is given as
yc (x) = A1 cos x + A2 sin x
where
y1 (x) = cos x and y2 (x) = sin x
so
tan x sin x
C10 (x) = − = cos x − sec x
cos x cos x + sin x sin x
Integrate both sides we have
Z
C1 = cos x − sec xdx = sin x − ln| sec x + tan x|
Also,
tan x cos x
C20 (x) = − = − sin x
cos x cos x + sin x sin x
Integrate both sides we have
Z
C2 = − sin xdx = cos x
50
y(x) = A1 cos x + A2 sin x + (sin x − ln| sec x + tan x|) cos x + cos x sin x
Example 1
Solve the D.E
y 000 + 14y 00 + y 0 − 6y = 0
Solution
m3 + 14m2 + m − 6 = 0
m1 = 1, m2 = −2, m3 = −3
51
52
Example 2
Solve the D.E
Solution
The auxilliary equation of this D.E is
W (y1 , y2 ....yn ) = |y1 , y2 ....yn y10 , y20 ....yn0 ....y1n−1 , y2n−1 ....ynn−1 | |= 0 (5.3)
yp0 (x) = c1 (x)y10 (x)+c01 (x)y1 (x)+c2 (x)y20 (x)+c02 (x)y2 (x)+....+cn (x)yn0 (x)+c0n (x)yn (x)
= (c1 (x)y10 (x)+c2 (x)y20 (x)+...+cn (x)yn0 (x))+(c01 (x)y1 (x)+c02 (x)y2 (x)+....+c0n (x)yn (x))
If we set
(c01 (x)y1 (x) + c02 (x)y2 (x) + .... + c0n (x)yn (x)) = 0
Then
yp0 (x) = c1 (x)y10 (x) + c2 (x)y20 (x) + ... + cn (x)yn0 (x)
yp00 (x) = c1 (x)y100 (x)+c01 (x)y10 (x)+c2 (x)y200 (x)+c02 (x)y20 (x)+....+cn (x)yn00 (x)+c0n (x)yn0 (x)
= (c1 (x)y100 (x)+c2 (x)y200 (x)+....+cn (x)yn00 (x))+(c01 (x)y10 (x)+c02 (x)y20 (x)+....+c0n (x)yn0 (x))
54
If we set
(c01 (x)y10 (x) + c02 (x)y20 (x) + .... + c0n (x)yn0 (x)) = 0
then we have
c01 (x)y1k (x) + c02 (x)y2k (x) + .... + c0n (x)ynk (x) = 0, k = 0, 1, 2...(n − 1)
then we have
ypk (x) = c1 (x)y1k (x) + c2 (x)y2k (x) + .... + cn (x)ynk (x), k = 0, 1, 2...(n − 1)
and
ypn−1 (x) = c1 (x)y1n−1 (x) + c2 (x)y2n−1 (x) + .... + cn (x)ynn−1 (x)
so that
ypn (x) = (c1 (x)y1n (x)+c2 (x)y2n (x)+....+cn (x)ynn (x))+(c01 (x)y1n−1 (x)+c02 (x)y2n−1 (x)+....+c0n (x)ynn−1 (x))
c01 (x)y1 (x) + c02 (x)y2 (x) + .... + c0n (x)yn (x) = 0
c01 (x)y10 (x) + c02 (x)y20 (x) + .... + c0n (x)yn0 (x) = 0
c01 (x)y1n−1 (x) + c02 (x)y2n−1 (x) + .... + c0n (x)ynn−1 (x) = 0
55
The determinant of this system is called WRONSKIAN which is non zero since
Example
d3 y dy
+ 3 − 2y = 3e−x
dx3 dx
Solution
The homogeneuos part has an auxilliary equation given as
m3 + 3m − 2 = 0
m1 = −1, m2 = −1, m3 = 2
where
By Crammer’s rule,
xex e2x
0
w1 (x)=
0 (1 − x)e−x 2e2x
= 9x − 3
−x
(x − 2)e−x 4e2x
3e
e−x 0 e2x
w2 (x)=
−e−x 0 2e2x = −9
e−x e−x 4e2x
e−x xe−x
0
−x
w3 (x)=
−e (1 − x)e−x 0
= 3ex
e−x (x − 2)e−x 3ex
C10 = w1
w
= 9x−3
9
= 9x
9
− 3
9
=x− 1
3
−9
C20 = w2
w
= 9
=1
3e−3x e−3x
C30 = w3
w
= 9
= 3
x2 x −1 −3x
C1 = 2
− 3
, C2 = −x , C3 = 9
e
So,
y(x) = C1 (x)y1 (x) + C2 (x)y1 (2) + C3 (x)y1 (3)
x2
= 2
− x
3
e−x -x(xe−x ) - 1 −3x
9
e e2x
2
= x2 e−x − x
3
+ 1
9
e−x
Therefore,
57
y(x) = yc + yp
x2 −x
A1 e−x + A2 xe−x + A3 e2x − 2
e − x
3
+ 1
9
e−x
Chapter 6
Numerical Solution
Error/Types of Error
(1.) Gross Error or Blunder: This is the error committed whwn a wrong
answer is written for a correct one. e.g. Writing 0.5971 instead of 0.5791.
(2.) Truncation Error This is the error committed when an infinite process
1 x x2
(1 + x) 2 = 1 + − + .......
2 8
(3.) Round-Off Errors: This is the error committed when certain arith-
metic calculation obtain as fraction is required to be expressed as deci-
58
59
Relative Error =
Actual Error E X − X∗ X∗
= = =1−
T rue V alue X X X
we say that x has been rounded off to a d-decimal places written as x(d) i.e.
|E| = x − x(d) ≤ 1
× 10−d
2
0.0028571 ≤ 1
2
× 10−d ≤ 1
2
× 1
100
≤ 1
200
≤ 0.005
If x = 0.333333 x(3) = 0.333
Errors Propagation
Let X and Y be the real values and let X ∗ and Y ∗ be their respective approx-
(1.) Addition
X ∗ + Y ∗ = (X − εX ) + (Y − εY )
= X − εX + Y − εY
(2.) Subtraction
X ∗ − Y ∗ = (XεX ) − (Y − εY )
=X − εX − Y + εY
=(X − Y ) − (εX − εY ) = (X − Y ) + (εY − εX )
⇒ (εX − εY ) = (X − Y ) − (X ∗ − Y ∗ )
(3.) Multiplication
X ∗ × Y ∗ = (X − εX )(Y − εY ) = XY − XY − Y εX + εX εY
Neglecting εX εY , then
X ∗ × Y ∗ = XY − Xεy − Y εX
XY − X ∗ Y ∗ = XεY + Y εX
Therefore, the relative error in the product equals the sum of the relative
error in the number we are multiplying.
(4.) Division
X∗ X−εX
Y∗
= Y −εY
X X∗ X X − εX X(Y − εY ) − Y (X − εX )
− ∗ = − =
Y Y Y Y − εY Y (Y − εY )
XY − XεY − XY + Y εX Y εX − XεY
=
Y (Y − εY ) Y (Y − εY )
Relative Error
Y X −X Y
P P
1
= ×
Y (Y − Y )
P
x/y
61
1 X X Y
= × (Y −X ) ×
Y2−Y Y
P
x Y X
Y2
P P !
1 X XY Y
= 2 P · −
Y −Y Y X X
Y2
P !
1 X
X
= 2 P · −Y
Y −Y Y X Y
P P
1 X Y
= 2 P · −
Y −Y Y X Y
Y2
P P !
1 X XY Y
= P ·Y2 −
Y 2 (1 − Y
) X X
Y
P P
1 X Y
= P · −
(1 − Y
) X Y
Y
P
Y
= Plim →0
y
→0 Y
P P
X Y
= −
X Y
Therefore, the relative error in the division equals the difference of the relative
error of the respective number we are dividing.
Interpolation
62
f1 − f0
P1 (x1 ) = f0 + (x1 − x0 )
x1 − x0
P1 (x1 ) = f0 + f1 − f0 = f1
Exercise:
2. Quadratic interpolation:
This is interpolation of second order polynomial with a curve through
given by
where
f (x1 , x2 ) − f (x0 , x1 ) f2 − f1
f (x0 , x1 , x2 ) = , f (x1 , x2 ) =
x2 − x0 x2 − x1
Exercise:
(2) Compute the quadratic interpolation for f (0.9) from f (0.5) = 0.479, f (1.0) =
0.841, f (2.0) = 0.909
(3) Compute the quadratic interpolation for Γ(1.01) and Γ(1.03) from
Γ(1.00) = 1.000, Γ(1.02) = 0.989, Γ(1.04) = 0.978
(4) Obtain the polynomial for ln8.0 = 2.0794, ln9.0 = 2.1972, ln9.5 =
2.2573
64
3. Lagrange Interpolation
where
Exercise:
x0 = 0, x1 = 2, x2 = 3, x3 = 5
f0 = 1, f1 = 3, f2 = 2, f3 = 5
65
3 3 15 2 62
Answer: 10
x − 6
x + 15
x +1
(2) Let f (x) = lnx. Estimate the value of ln(0.6) from the table
x 0,4 0.5 0.7 0.8
f(x) -0.9165 -0.6931 -0.3567 -0.2231
Answer = −0.5100