0% found this document useful (0 votes)
118 views

Mat 241 Lectures-1 (1) - 1

This document outlines the course content for Ordinary Differential Equations. It includes: 1. Introduction to differential equations including definitions of order, degree, linear/non-linear equations, and initial value problems. 2. Techniques for deriving differential equations from given functions by eliminating constants. 3. Techniques for solving first order linear and non-linear differential equations including separation of variables, homogeneous equations, and exact/non-exact equations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views

Mat 241 Lectures-1 (1) - 1

This document outlines the course content for Ordinary Differential Equations. It includes: 1. Introduction to differential equations including definitions of order, degree, linear/non-linear equations, and initial value problems. 2. Techniques for deriving differential equations from given functions by eliminating constants. 3. Techniques for solving first order linear and non-linear differential equations including separation of variables, homogeneous equations, and exact/non-exact equations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

ORDINARY DIFFERENTIAL EQUATIONS

AKEJU A.O
University of Ibadan
Department of Mathematics
1

Course Outline

1. Introduction

2. Derivation of Differential Equations

3. Techniques for Solving Order 1 Linear and Non-Linear

4. Techniques for Solving Order 2 Linear and Non-Linear

5. Techniques for Solving nth Order Linear Equations

6. Finite Difference/Difference Equations

7. Numerical Differentiation/Integration: Interpolations, Errors.

Reference Materials

1. Ordinary Differential Equations and Applications by E.O. Ayoola

2. Schaum’s Outline Series of Differential Equations by Frank Ayres JR

3. Elementary Differential Equations by Earl D. Rainville

4. Numerical Analysis by Ian Jacques and Collin Judd

5. Engineering Mathematics by K. A. Stroud


Chapter 1

Introduction

An ODE is an equation that involves the unknown dependent function and

their derivatives which involve coefficients that are functions of the indepen-
dent variables.
Definition:ORDER

The order of a differential equation is the highest derivative present in the


differential equation
Definition : DEGREE

The degree of a differential equation is the highest power present in the equa-
tion
Definition:LINEAR DIFFERENTIAL EQUATIONS

A D.E is called linear if there is no product of the dependent variable (func-


tion) and it derivative,and neither the function or its derivative occurs to any
power other than the first power

Definition:NON LINEAR DIFFERENTIAL EQUATIONS


If the differential equation is not linear,it is called non linear differential equa-
tion

2
3

Definition: SOLUTION

A solution to a differential equation on the interval a ≤ x ≤ b is any func-


tion y(x) which satisfies the differential equation in question on the interval
a≤x≤b

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

depend on the order of the D.E


Definition:INITIAL VALUE PROBLEM
An initial value problem (IVP) is a differential equation along with an appro-

priate number of initial conditions


Examples are:


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)

When an equation involves one or more derivatives with respect to a par-


ticular variable, that variable is called an independent variable.

∂ 2v ∂ 2v
+ =0
∂x2 ∂y 2
PDE order 2, V is dependent, x and y are independent variable
Generally, the equation

F (x, y, y 0 , y 00 , . . . , y (n) ) = 0 (1.1)


5

is called an n th-order ODE. Equation (1.1) can be solved explicitly for y (n) in

terms of the other n + 1 variables x, y, y0, y 00 , . . . , to obtain

y (n) = f (x, y, y 0 , y 00 , . . . , y (n−1) ) (1.2)

ODE arises from geometric, physical, biological problems (e.t.c.)

Illustration

If the population of a country doubles in 50 years, in how many years will it


become triple under the assumption that the rate of increase is proportional
to the number of inhabitants?

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 .

At time t = 50 years, y = 2y0 , 2y0 = y0 e50 k , 2 = e50k


6

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

Just as a function can be obtained as a solution of any given differential equa-

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

y 000 = 0 [free or arbitrary constants]

4. y = A cos ax + B sin ax
Solution:
y 0 = −Aa sin ax + Ba cos ax

y 00 = −Aa2 cos ax − Ba2 sin ax = −a2 (A cos ax + B sin ax) = −a2 y


y 00 + a2 y = 0

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

Note: A function with 1 arbitrary constant gives a 1st order equation. A

function with 2 arbitrary constants gives a 2nd order equation. A function


with n arbitrary constant gives a n-th order equation.
Chapter 3

Technique for Solving Order 1


Linear and Non Linear ODE

We shall classify this into five categories as follows;

• Separation of Variable

• Homogeneous type

• Exact type

• Non exact type

• Bernoulli equation

3.1 Separation of Variable

If a first order ODE of the form

dy
= f (x)g(y)
dx

can be written in the form


dy
= f (x)dx
g(y)

10
11

then the equation is a separable equation where f (x) and g(y) are given func-

tions of the independent variable and the dependent variable respectively.


Examples


dy
= 2xy 2
dx


dy
y −1 (x + 1)−1
dx


dy
(3y 2 + ey ) = cosx
dx


dy
(x + 1) = 2y
dx

Examples

Solve the following differential equations

(1)
dy 1+y
=
dx 2+x
Solution

This equation can be written in the separable form as

1 dy 1
=
1 + y dx 2+x

Integrating both sides ,we have


Z
dy Z
dx
=
1+y 2+x
12

Hence,we have

ln(1 + y) = ln(2 + x) + C = ln(2 + x) + lnA

If we simplify ,we have

ln(1 + y) = lnA(2 + x)

Then we get

y(x) = A(2 + x) − 1

where A is an arbitrary constant

(2)
dy
= 2xy 2
dx
Solution
This equation can be written in the separable form as

y −2 dy = 2xdx

Integrating both sides,we have


Z Z
−2
y 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

3.2 Homogeneous Type


dy
A differential equation of the form dx
= f (x, y) is said to be homogeneous of

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;

f (tx, ty) = tn f (x, y) ∀t

Examples

(1) The differential equation

dy y x4
= 2y 3 e x −
dx x + 3y

is a homogeneous equation of order 3 since the function

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)

(2) The differential equation

dy
= x3 y 2 − 3x5
dx

is a homogeneous equation of order 5 since the function

f (x, y) = x3 y 2 − 3x5
14

is such that

f (tx, ty) = t3 x3 t2 y 2 − 3t5 x5

= t5 [x3 y 2 − 3x5 ]

= t5 f (x, y)

The solution of the homogeneous type required a change of variable y = vx


that reduces the equation to the variable separable type of equation.Once this

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

Integrating both sides of the equation ,we have


Z Z
dx
vdv =
x

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

If we simplify the above equation,we have

dv 1+v
x =
dx 2

Integrating both sides of the equation ,we have


Z
2 Z
dx
dv =
1+v x

This gives

2 ln(1 + v) = ln x + c where c = ln A

After further simplification,we have

y
(1 + v)2 = Ax =⇒ (1 + )2 = Ax =⇒ (x + y)2 = Ax3
x

So that

y= Ax3 − x

Exercise Solve the following differential equations:

dy
1. x2 + y 2 dx = xy
dy
2. (x2 + xy) dx = xy − y 2
dy
3. (x − y) dx =x+y

3.3 The Exact Type

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

(sin(x + y))dx + (x + 2y)dy = 0

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

then we can write


∂F ∂F
= M (x, y), = N (x, y) (3.4)
∂x ∂y
Theorem 3.3.1. Consider equation (3.2), where M and N have 1st partial
derivatives in (x, y) ∈ D. Then, the DE (3.2) is exact in D iff
∂M ∂N
= ∀ (x, y) ∈ D (3.5)
∂y ∂x
18

∂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

Equation (3.6) confirms (3.5)

Consider
y 2 dx + 2xydy = 0

where

M (x, y) = y 2 , N (x, y) = 2xy

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:

Verify whether the following differential equations are exact or not:

1. x2 dx + 2xydy = 0

2. ydx + 2xdy = 0
19

Theorem 3.3.2. Suppose (2.2) satisfies the differentiability requirement of

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)

where F is a function satisfying (2.4) and c is any arbitrary constant or func-

tion.

Example 1: Solve the DE

(3x2 + 4xy)dx + (2x2 + 2y)dy = 0

Solution:

M (x, y) = 3x2 + 4xy, N (x, y) = 2x2 + 2y

and
∂M ∂N
= 4x, = 4x
∂y ∂x
Hence, the DE is exact.

∂F Z
= 3x2 + 4xy =⇒ F = 3x2 + 4xydx
∂x
So,

F = x3 + 2x2 y + Φ(y), (Φ is a f unction of y)

In other to know the value of Φ , we find

∂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

c at this level is optional.

Example 2: Solve the DE

(2x cos y + 3x2 y)dx + (x3 − x2 sin y)dy

Solution:

M (x, y) = 2x cos y + 3x2 y, N (x, y) = x3 − x2 sin y

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

In other to evaluate the value of Φ ,we find

∂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

Example 3: Solve the D.E

3x(xy − 2)dx + (x3 + 2y)dy = 0

Solution

M (x, y) = 3x2 y − 6x, N (x, y) = x3 + 2y


∂M ∂N
= 3x2 , = 3x2
∂y ∂x
Hence the differential equation is exact

∂F Z
= 3x2 y − 6x, =⇒ F = 3x2 y − 6xdx
∂x

So
F = x3 y − 3x2 + φ(y)
22

In other to evaluate the value of Φ ,we find

∂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

The general solution F (x, y) = C , ⇒ x3 y − 3x2 + y 2 = C

Exercise

(1) Determine which of the following differential equations are exact and
Solve those that are exact

(a.) (3x2 y + 2)dx − (x3 − y)dy = 0

(b.) (θ2 + 1) cos rdr + 2θ sin rdθ = 0

(c.) (2y sin x cos x + y 2 sin x)dx + (sin2 x − 2y cos x)dy = 0

(d.) ydx + (x2 y − x)dy = 0


y
(e.) x2
dx + (y − x1 )dy

(2.) Determine the value of constant A which the equations below are exact
23

(a.) (x2 + 3xy)dx + (Ax2 + 4y)dy = 0

(b.) ( x12 + 1
y2
)dx + ( Ax+1
y3
)dy = 0

3.4 Non-Exact Equation To Exact Equation

Observe that the D.E


ydx + (x2 y − x)dy = 0

is not exact i.e


∂M ∂N
6=
∂y ∂x
However, if we multiply the equation by 1/x2 for instance, then we have

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 not exact, it is possible to make it exact by multiplying the equation with


a specific function that will make the equation exact.This function is called
Integrating factor.

Consider a Linear Differential equation of order 1 of the form


dy
+ Py = Q (3.7)
dx
where P and Q are functions of x or constant
Equation(3.7) is not exact, but it can be solved using Integrating factor which

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

Multiply the given D.E by I.F, we have

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

Solve the D.E


y0 − y = x

Solution
Compare with (3.7), P = −1, Q = x, then

R
−1dx
I.F = e = e−x

Multiply the given D.E by I.F ,we have

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

Using Integration by part


Divide both sides by e−x ,we have

y = −(x + 1) + Cex = Cex − x − 1

Example3 Solve
dy
+ ycotx = cosx
dx
26

Solution

Comparing with (3.7), p = cotx , Q = cosx,


R
cotxdx
I.F = e
R cosx
dx
I.F = e sinx

= eln sinx = sinx

Multiply the given D.E by I.F ,we have

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

3.5 Bernoulli Equation

This is a non linear special type of D.E which can be reduced to a linear

equation via logical transformation.


The equation of the form

dy
+ p(x)y = q(x)y n (3.8)
dx

is called Bernoulli equation where n ∈ N


If n = 0 or n = 1, then(3.8) reduced to a linear equation which can be solved

using our previous method(s). It is therefore assume that n 6= 0, 1 for (3.8)


to retain its identity as Bernoulli D.E.The solution of this type of D.E require

the following transformation,

dy
+ p(x)y = q(x)y n
dx

Divide (3.8) by y n i.e

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

Multiple through by 1 − n,we have


dz
+ (1 − n)p(x)z = (1 − n)q(x)
dx
This can be written in the form
dz
+ Φ(x)z = Q(x) (3.12)
dx
where

(1 − n)p(x) = Φ(x) and (1 − n)q(x) = Q(x)

. 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

using integrating factor i.e


R −1 −1 1
I.F = e x
dx
= elnx = x−1 =
x

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

Divide through by y 4 , we have

dy 1 cosx
y −4 − y −3 = 3 ....... +
dx x x
Let
z = y 1−4 = y −3 .......... ∗

So that the derivative

dz dy
= −3y −4 .......... ∗∗
dx dx

Substitute ∗ and ∗∗ in equation +, and divide both sides of the equation by

−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

Multiple the linear equation by the integrating factor ,we have

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

Solve the D.E


dy
2y −3 = y 4 e3x
dx
Chapter 4

Techniques for Solving Second


order Linear and Non Linear
O.D.E

4.1 Homogeneous Non Linear With Missing


Dependent/Independent Variable

An equation of the form


0 00
F (x, y, y , y ) = 0 (4.1)

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

The case when dependent variable 0 y 0 is missing is of the form

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

a solution of the first order equation

0
G(x, v, v ) = 0 (4.3)

If (4.3) is solvable, then the solution of (4.2) can be obtained by integrating


dy
v= dx

Example: Solve the diferential equation

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

Appling partial fraction,we have,

1 1 dx
( − )dv = 2
v−1 v x
Integrating both sides,we have

ln(v − 1) − lnv = 2lnx + lnc

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

The case when independent variable is missing i.e

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,

(3.7) has a solution by solving


dy
= v(y)
dx
Example: Solve the D.E

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

lnv + 2 = lny + lnc1 = lnc1 y

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

Integrate both sides,we have

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

Solve the differential equations

2
d y dy 2
(1) y dx2 + ( dx ) = 0

d y 2 dy 2
(2) 2x dx2 = ( dx ) − 1

4.2 Second order Homogeneous Linear Differ-


ential Equation

Generally,second order linear Ordinary Differential Equation is of the form

d2 y dy
a0 (x) 2
+ a1 (x) + a2 (x)y = f (x) (4.8)
dx dx

where a0 , a1 ,a2 are either constant or functions of x and f is a functions of (x)

If a0 , a1 and a2 are constant and f = 0, then (4.8) becomes Homogeneous


Second Order Linear Differential Equation with constant coefficients i.e

d2 y dy
a0 2
+ a1 + a2 y = 0 (4.9)
dx dx

If y1 (x) and y2 (x) are the solutions of (4.9),so also is

y(x) = y1 (x) + y2 (x) a solution


37

Procedure for solution of (4.9)

If a0 = 0 in (4.9),we have the 1st order ordinary differential equation provided


a0 and a0 are not equal to zero,so

dy
a1 + a2 y = 0
dx

Divide through by a1 ,we have

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

lny = −kx + c, y = e−kx+c = Ae−kx

If − k = m then y = Aemx

If y is a solution of (4.9),then

dy d2 y
= Amemx , = Am2 emx
dx dx2

Substitute these into equation(4.9),we have

a0 Am2 emx + a1 Amemx + a2 Aemx = 0

so
Aemx (a0 m2 + a1 m + a2 ) = 0

Hence
a0 m2 + a1 m + a2 = 0 (4.10)
38

Equation (4.10) is called the Auxilliary or Characteristics Equation of the

differential equation (4.9)


The solution of (4.10) can be classify into three i.e

(a) Real and distinct solutions (roots)

(b) Real and equal solution (roots)

(c) Complex solution (roots)

Real and Distinct roots


Example 1
Consider the differential equation

d2 y dy
− 3 + 2y = 0
dx2 dx

The auxilliary equation is

m2 − 3m + 2 = 0

Solve this,we have

(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

with auxilliary equation

m2 + 4m − 5 = 0

solve this ,we have

m1 = 1, m2 = 5

So the general solution is given by

y(x) = A1 ex + A2 e−5x

Real and Equal (Repeated) roots


Example
Consider tge differential equation
d2 y dy
− 6 + 9y = 0
dx2 dx
The auxilliary equation is given as,

m2 − 6m + 9 = 0

solve this ,we have

m1 = 3, m2 = 3

so the general solution is expected to be

y(x) = A1 e3x + A2 e3x

= (A1 + A2 )e3x

= Ae3x

(Since the addition of two constant is another constant)

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

Thus,we must have two linearly independent solutions as

y(x) = Ae3x + Bxe3x

(A + Bx)e3x

Generally,the general solution of a differential equation whose auxilliary roots


are real and repeated is

y(x) = (A + Bx)e3x

Complex Conjugate roots


If the roots of the auxilliary equation are complex conjugate roots such that

m1 = α + iβ, m2 = α − iβ

then the solution of (4.9) are

y1 (x) = A1 e(α+iβ)x , y2 (x) = A2 e(α−iβ)x

so that we have
y(x) = A1 e(α+iβ)x + Ae(α−iβ)x

= A1 eαx eiβ)x + A2 eαx e−iβ)x

eαx (A1 eiβ)x + A2 e−iβ)x )

eαx (A1 (cos β + i sin βx) + A2 (cos β + i sin βx)

since

eiθ = cos θ + i sin θ, e−iθ = cos θ − i sin θ

therefore

y(x) = eαx [A1 cos βx + A2 cos βx + iA1 sin βx − iA2 sin βx]
41

= eαx [A cos βx + B sin βx]

where A1 +A2 = A and i(A1 −A2 ) = B where A and B are arbitrary constants
Example

Find the general solution of the differential equation

y 00 − 2y 0 + 10y = 0

Solution
The auxilliary equation associated with above differential equation is given by

m2 − 2m + 10 = 0

Solve this ,we have the auxilliary roots as

m1 = 1 + 3i, m2 = 1 − 3i

This means that α = 1 and β = 3


Therefore ,the general solution of the differential equation is given by

y(x) = ex [A cos 3x + B sin 3x]

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

Initial Value Problem (IVP)


42

The initial value problem is a difeferntial equation with initial condition(s).This

initial condition(s) helps us to find the particular solution of the differential


equation after obtaining the general solution.We shall illustrate this with the
example

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

Solve this ,we have


m1 = 3 + 4i, m1 = 3 − 4i

i.e α = 3 ,and β = 4
The general solution therefore is

y(x) = e3x (A1 sin 4x + A2 cos 4x)

We can find A1 and A2 by using the initial condition

−3 = e0 (A1 sin 0 + A2 cos 0)

−3 = A2

y 0 (x) = e3x [(3A1 − 4A2 ) sin 4x + (3A2 + 4A1 ) cos 4x)

−1 = e0 [(3A1 − 4A2 ) sin 0 + (3A2 + 4A1 ) cos 0)


43

−1 = (3A2 + 4A1 )

−1 = (4A1 − 9)

A1 = 2

Therefore ,the particular solution of the differential equation is

y(x) = e3x (2 sin 4x − 3 cos 4x)

4.3 Second Order Non Homogeneous Differn-


tial Equation

Consider the differential equation of the form

d2 y dy
a0 (x) 2
+ a1 (x) + a2 (x)y = f (x) (4.11)
dx dx

If f (x) is zero,the equation is homogeneous as previously stated,but if f (x)


is not zero,then the equation is Non-Homogenous.The solution of this non

homogeneous equation is the addition of the solution of the homogeneous part


and the non homogeneous part i.e

y(x) = yc (x) + yp (x)

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

• Method of Undertermined Coefficient

• Method of Variation of Parameter or Constant


44

• The Operator D method

We shall examine these methods one after the other as follows

Method of Undertermined Coefficient


We shall consider when the function f (x) is of the form

(a) Pn (x)

(b) Pn (x)eax

(c) Pn (x) sin βx

(d) Pn (x) cos βx

(e) Pn (x) sinh x

(f) Pn (x) cosh x

We summarize these and the corresponding particular integral on the table


below
f (x) yp (x)
Pn (x) a0 + a1 x + a2 x2 ....an xn
Pn (x)eax (a0 + a1 x + a2 x2 ....an xn )eax
Pn (x) sin βx (a0 + a1 x + a2 x2 ....an xn )eax sin bx + (c0 + c1 x + c2 x2 ....cn xn )eax cos bx
Pn (x) cos βx (a0 + a1 x + a2 x2 ....an xn )eax sin bx + (c0 + c1 x + c2 x2 ....cn xn )eax cos bx

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

This has auxilliary equation

m2 − 5m+ = 0

Solve this to get

m = 2, m=3

Therefore the complimentary function is

y(x) = A1 e2x + A2 e3x

To find the particular integral,we assume the general form of the RHS of the

given problemwhich is a polynomial of order 2. so the that,

yp (x) = Cx2 + Dx + E

where C,D and D are unknown constant to be determine

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

yp0 = 2Cx + D, yp00 = 2C

Substitute these into the given D.E, we have

2C − 5(2Cx + D) + 6(Cx2 + Dx + E) = X 2

6Cx2 + (6D − 10C)x + (2C − 5D + 6E) = x2


46

Equating corresponding coefficients,we have

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

And the general soution is

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

conditions are given.


Example
Solve the D.E

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

So the complimentary function is

yc (x) = A1 sin x + A2 cos x


47

But f (x) is of the form Pn (x)eax where Pn (x) is a polynomial of degree one,so
the particular integral is

yp (x) = e2x (a + bx)

Differentiate the P.I twice and substitute into the given D.E,we have

y 0 = e2x (2a + 2bx + b)

and
y 00 = e2x (4a + 4bx + 4b)

substitute these we have,

e2x (4a + 4bx + 4b) + e2x (a + bx) = xe2x

simplify we have,

e2x (4a + 4bx + 4b + a + bx) = xe2x

so
(5a + 4b + +5bx) = x

Equating corresponding coefficients ,we have

5a + 4b = 0, 5b = 1

Solve these simultaneously ,we have

−4 1
a= , b=
25 5

This implies that the particular integral is

−4 1
yp (x) = e2x ( + x)
25 5
48

Therefore the general solution of the D.E is given as

−4 1
A1 sin x + A2 cos x + e2x ( + x)
25 5

Method of Variation of Parmeters


If f (x) is not in any of the form described under the method of undetermined
coefficient,then we require another method which is method of variation of

parameter,which is more general Consider

y 00 + ay 0 + by = f (x) (4.12)

If we have two linearly independent solutions y1 and y2 of the homogeneous


equation
y 00 + ay 0 + by = 0

so that a general solution is given by

yc (x) = C1 (x)y1 (x) + C2 y2

with C1 and C2 satisfying the differential

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

y1 (x)y20 (x) − y2 (x)y10 (x) = |W (y1 , y2 )|


49

is the Wronskian

Therefore the general solution will be

y(x) = yc (x) + yp (x)

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

This implies that

yp (x) = (sin x − ln| sec x + tan x|) cos x + cos x sin x

Therefore the general solution of the D.E is

y(x) = A1 cos x + A2 sin x + (sin x − ln| sec x + tan x|) cos x + cos x sin x

4.4 Operator D Method


Chapter 5

Higher Order Homogeneous and


Non Homogeneous Differential
Equation

5.1 Homogeneous Type

The process of solving this type of differential equation is similar to other


homogeneous equation

Example 1
Solve the D.E
y 000 + 14y 00 + y 0 − 6y = 0

Solution

The auxilliary equation of this D.E is

m3 + 14m2 + m − 6 = 0

If we solve this ,we have

m1 = 1, m2 = −2, m3 = −3

51
52

Therefore the general solution is

y(x) = c1 ex + c2 e−2x + c3 e−3x

Example 2
Solve the D.E

y iv + 16y 000 + 96y 00 + 256y 0 + 256y = 0

Solution
The auxilliary equation of this D.E is

m4 + 16m3 + 96m2 + 256m + 256 = 0

If we solve this ,we have

m1 = −4, m2 = −4, m3 = −4, m4 = −4

Therefore the general solution is

y(x) = c1 e−4x + c2 xe−4x + c3 x2 e−4x + c4 x3 e−4x

5.2 Non Homogeneous Type

Consider the nth order non homogeneous equation

y n + a1 (x)y n−1 + a2 (x)y n−2 + .... + an (x)y = f (x) (5.1)

and it associated homogeneous equation

y n + a1 (x)y n−1 + a2 (x)y n−2 + .... + an (x)y = 0 (5.2)


53

If y1 , y2 ....yn are linearly independent solutions of (5.2),then the solutiony(x)


of (5.2) is expressed as

y(x) = c1 y1 (x) + c2 y2 (x) + .... + cn yn (x)

where c1 , c2 ,.....cn are constant


If y1 , y2 ....yn are independent solutions of (5.2),then the Wronskian

W (y1 , y2 ....yn ) = |y1 , y2 ....yn y10 , y20 ....yn0 ....y1n−1 , y2n−1 ....ynn−1 | |= 0 (5.3)

Using the method of Variation of Parameter,we find a solution (Partivular


Integral) of the form

yp (x) = c1 (x)y1 (x) + c2 (x)y2 (x) + .... + cn (x)yn (x)

Differentiating ,we have

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)

Differentiating one more time ,we have

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

yp00 (x) = c1 (x)y100 (x) + c2 (x)y200 (x) + .... + cn (x)yn00 (x)

If we continue this way,we set

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))

This represent the nth derivative of yp (x)

With all these,we have suceeded in forming a system of n equations in 4n4


unknowns i.e

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

the funcyions y1 , y2 , ....yn are linearly independent

Example

Solve the differential equation

d3 y dy
+ 3 − 2y = 3e−x
dx3 dx
Solution
The homogeneuos part has an auxilliary equation given as

m3 + 3m − 2 = 0

Solve this,we have the roots

m1 = −1, m2 = −1, m3 = 2

and this will have a complimentary function given as

yc (x) = A1 e−x + A2 xe−x + A3 e2x

where

y1 = e−x , y2 = xe−x , y3 = e2x

so the wronskian is given by

e−x xe−x e2x





w(x)=

−e−x (1 − x)e−x 2e2x
=0
e−x (x − 2)e−x 4e2x




1 0 1
w(0)=

−1 1 2 = 9
1 −2 1


56

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

6.1 Error and Interpolation

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

is replaced by a finite process.e.g. The expansion of

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-

mal, leading to approximation e.g. 1/3 = 0.333,. . . , 3. . .

Let E = Error, X = true value , and X ∗ = approximated value.


then, Absolute Error = |X − X ∗ |

58
59

Relative Error =
Actual Error E X − X∗ X∗
= = =1−
T rue V alue X X X

If X is a real number which in general has an infinite decimal representation,

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

If x = 0.1428571, x(2) = 0.14



|E| = x − x(2) = |0.1428571 − 0.14| = 0.0028571

0.0028571 ≤ 1
2
× 10−d ≤ 1
2
× 1
100
≤ 1
200
≤ 0.005
If x = 0.333333 x(3) = 0.333

|E| = |0.333333 − 0.333| = 0.000333


0.000333 ≤ 1
2
× 10−3 = 1
2
× 1
1000
= 1
2000
= 0.0005

Hence, x − x(d)

≤ 1
2
× 10−d

Errors Propagation
Let X and Y be the real values and let X ∗ and Y ∗ be their respective approx-

imation with εX and εY as their respective error. then,


X∗ = X − ε and Y∗ =Y −Y
εX = X − X ∗ and εY = Y − Y ∗

(1.) Addition
X ∗ + Y ∗ = (X − εX ) + (Y − εY )
= X − εX + Y − εY

=(X + Y ) − (εX + εY ) (εX + εY ) = (X + Y ) − (X ∗ + Y ∗ )


The sum is the addition of the errors
60

(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 ∗ )

The error is the difference of the error

(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

But Relation Error =

Actual Error XY − X ∗ Y ∗ XεY Y εY εY εX


= = + = +
T rue V alue XY XY XY 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

Given n+1 data with (xi , fi ), i = 0, 1, ..., n, we seek a polynomial Pn (x)


which takes fi at every xi i.e Pn (xi ) = fi

Pn (x0 ) = f0 , Pn (x1 ) = f1 , ..., Pn (xn ) = fn

The polynomial Pn (x) is called INTERPOLATING POLYNOMIAL and fi are


0
certain mathematical functions Pn (xi ) is an estimate of fi at respective xis
The process of obtaining the Pn (xi ), the estimate of fi (xi ) is called INTERPO-
LATION,If x of interest lies within xi and it iss called EXTRAPOLATION, if

x of interest does not lies within xi


Special Cases:

1. Linear interpolation: This is interpolation by means of straight line

through two points (x0 , f0 ) & (x1 , f1 ) given by


P1 (x) = f0 + (x − x0 )f (x0 , x1 )
f1 −f0
where f (x0 , x1 ) = x1 −x0

Note: (1) P1 (x0 ) = f0

f1 − f0
P1 (x1 ) = f0 + (x1 − x0 )
x1 − x0

P1 (x1 ) = f0 + f1 − f0 = f1

Exercise:

(1) Estimate the population of Nigeria in 1999 given that


Year 1990 2006
Population(million) 120 150
63

Answer is 136.875 million

(2) Find ln 9.2 from ln 9.0=2.1972, ln 9.5=2.2513

2. Quadratic interpolation:
This is interpolation of second order polynomial with a curve through

(x0 , f0 ), (x1 , f1 ), (x2 , f2 )

given by

P2 (x) = f0 + (x − x0 )f (x0 , x1 ) + (x − x0 )(x − x1 )f (x0 , x1 , x2 )

where
f (x1 , x2 ) − f (x0 , x1 ) f2 − f1
f (x0 , x1 , x2 ) = , f (x1 , x2 ) =
x2 − x0 x2 − x1

Exercise:

(1) verify that P2 (X0 ) = f0 and P2 (X1 ) = f1

(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

This invplves the interpolation of polynomial with order n > 2


Given a table of n-values [(x0 , f0 ), ..., (xn , fn )] of a function f (xj ) evalu-
ated at x = xj , j = 1, 2, ..., n, we require to evaluate the value of f (x)

when x is not tabulated. The process is to approximate f (x) by a func-


tion which passes through each of the tabulated point. This is carried
out by the Lagrange interpolation formula.
n
X lk (x)
f (x) = Ln (x) = f (xk )
k=0 lk (xk )

where

lk (x) (x − x0 )(x − x1 )...(x − xj−1 )(x − xj+1 )...(x − xn )


= lj (x) = , j = 0, 1, ..., n
lk (xk ) (xj − x0 )(xj − x1 )...(xj − xj−1 )...(xj − xn )

l0 (x) l1 (x) l2 (x) l3 (x)


L3 (x) = f0 + f1 + f2 + f3
l0 (x0 ) l1 (x1 ) l2 (x2 ) l3 (x3 )
(x − x1 )(x − x2 )(x − x3 ) (x − x0 )(x − x2 )(x − x3 ) (x − x0 )(x − x1 )(x
= f (x0 )+ f (x1 )+
(x0 − x1 )(x0 − x2 )(x0 − x3 ) (x1 − x0 )(x1 − x2 )(x1 − x3 ) (x2 − x0 )(x2 − x1 )(x

Exercise:

(1) Find the lagrange interpolation polynomial for the data


x 0 2 3 5
f(x) 1 3 2 5

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

(3) Find ln9.2 using the table below


x 9.0 9.5 10.0 11.0
ln x 2.69722 2.25129 2.30259 2.39790
Answer = 2.21920

You might also like