Professional Documents
Culture Documents
MA 411 - 1411 Notes
MA 411 - 1411 Notes
Department of Mathematics
LECTURE NOTES
August 7, 2020
1
(x − x1 )(x − x2 )(x − x3 ) · · · (x − xn )
f (x) = y0
(x0 − x1 )(x0 − x2 )(x0 − x3 ) · · · (x0 − xn )
(x − x0 )(x − x2 )(x − x3 ) · · · (x − xn )
+ y1
(x1 − x0 )(x1 − x2 )(x1 − x3 ) · · · (x1 − xn )
(x − x0 )(x − x1 )(x − x3 ) · · · (x − xn )
+ y2 (1)
(x2 − x0 )(x2 − x1 )(x2 − x3 ) · · · (x2 − xn )
..........................................................................
..........................................................................
(x − x0 )(x − x1 )(x − x2 ) · · · (x − xn−1 )
+ yn
(xn − x0 )(xn − x1 )(xn − x2 ) · · · (xn − xn−1 )
This is called the Lagrange’s interpolation formula for unequal intervals.
Example 1
Using Lagrange’s interpolation formula, find the values of y when x = 10, from
the following table:
x 5 6 9 11
y 12 13 14 16
Solution
Here the interval of differencing is not the same as for Newton’s Forward
and Backward Interpolation and so we have;
x0 = 5, x1 = 6, x2 = 9, x3 = 11
y0 = 12, y1 = 13, y2 = 14, y3 = 16
2
Example 2
Using Lagrange’s formula, find the form of the function f (x) given that ;
x 0 2 3 6
f (x) 659 705 729 804
Solution
Take x0 = 0, x1 = 2, x2 = 3, x3 = 6
y0 = 659, y1 = 705, y2 = 729, y3 = 804
Practice Exercise
1. Given the following values:
x 0 2 3 6
f (x) -4 2 14 158
2. State the Lagrange’s formula for interpolation. Use this formula to make
y as the function of x, when x = 5, if the following values of x and y are
given:
x 1 2 -4
y 3 -5 4
3
NEWTON’S DIVIDED DIFFERENCE FORMULA
Let f (x0 ), f (x1 ), f (x3 ), · · · , f (xn ) be the values of the function f (x)
corresponding to the argument x0 , x1 , x2 , · · · , xn . The first divided difference
f (x1 ) − f (x0 )
for the arguments x0 , x1 is defined as and is denoted by f (x0 , x1 )
x1 − x0
f (x1 ) − f (x0 )
or ∆f (x0 ) or [x0 , x1 ]. Thus f (x0 , x1 ) = ∆f (x0 ) =
x1 x1 x1 − x0
f (x2 ) − f (x1 )
Similarly, f (x1 , x2 ) = ∆f (x1 ) =
x2 x2 − x1
f (x3 ) − f (x2 )
f (x2 , x3 ) = ∆f (x2 ) = etc.
x3 x3 − x2
The second divided difference for the arguments x0 , x1 , x2 is defined as
f (x1 , x2 ) − f (x0 , x1 )
f (x0 , x1 , x2 ) = ∆2 f (x0 ) = .
x1 ,x2 ,x3 x2 − x0
The third divided difference for the arguments x0 , x1 , x2 , x3 is defined as
f (x1 , x2 , x3 ) − f (x0 , x1 , x2 )
f (x0 , x1 , x2 , x3 ) = ∆3 f (x0 ) =
x1 ,x2 ,x3 x3 − x0
and so on.
EXAMPLE 1
Using Newton’s divided difference formula, evaluate f (8) and f (15), given by
x 4 5 7 10 11 13
f (x) 48 100 294 900 1210 2028
Solution
4
Newton’s divided difference formula is ;
f (x) = f (4) + (x − 4)∆f (4) + (x − 4)(x − 5)∆2 f (4) + (x − 4)(x − 5)(x − 7) ∆3 f (4) + ...
5 5,7 5,7,10
Practice Exercise
1. Use Newton’s Divided Difference Formula to find f (x) given the following
data;
x 0 1 2 4 5 6
f (x) 1 14 15 5 6 19
2. Use Newton’s Divided Difference formula to find f (7) given the following
; f (3) = 24, f (5) = 120, f (8) = 504, f (9) = 720, and f (12) = 1716
x 0 2 3 4 7 9
g(x) 4 26 58 112 466 922
4. Use Newton’s Divided Difference formula to find y when x = 3.5 from the
table below;
x 1 3 5
y 1.5708 1.5719 1.5738
5
Numerical Differentiation
(i) Forward Differences Newton’s forward interpolation formula is
2 2 6x − 6 3 12x2 − 36x + 22 4
h2 f 00 (a + xh) = ∆ f (a) + ∆ f (a) + ∆ f (a) + · · ·
2 6 24
Differentiating again w.r.t, x
6 3 24x − 36 4
h3 f 000 (a + xh) = ∆ + ∆ + ···
6 24
Putting x = 0 and simplifying we obtain
1 1 1
hf 0 (a) = ∆f (a) − ∆2 f (a) + ∆3 f (a) − ∆4 f (a) + · · ·
2 3 4
11 4
h2 f 00 (a) = ∆2 f (a) − ∆3 f (a) + ∆ f (a) − · · ·
12
3
h3 f 000 (a) = ∆3 f (a) − f (a) + · · ·
2
Similarly we can find the formula for high order derivatives.
6
Figure 1: Differencing table
Differentiating again w.r.t, x , we get
2 2 6x − 6 3 12x2 − 36x + 22 4
h2 f 00 (a − xh) = ∇ f (a) − ∇ f (a) + ∇ f (a) + · · ·
2 6 24
putting x = 0 and simplifying we get;
1 1 1
hf 0 (a) = ∇f (a) + ∇2 f (a) + ∇3 f (a) + ∇f (a) + · · ·
2 3 4
11 4
h2 f 00 (a) = ∇2 f (a) + ∇ f (a) + · · ·
12
Example 1
Find the first, second and third derivatives of the function tabulated below,
at the point x = 1.5.
Solution
1 1
=⇒ (0.5)f 0 (1.5) = 3.625 − (3) + (0.750) = 3.625 − 1.500 + 0.250 = 2.375
2 3
Thus, f 0 (1.5) = 2 × 2.375 = 4.750
7
Figure 2: forward difference table
Example 2
A slider in a machine moves along a fixed straight rod. Its distance xcm
along the rod is given below for various of the time t sec. Find the velocity and
acceleration of the slider when t = 0.3sec
Solution
8
Differentiating again w.r.t, x we obtain
2 2 6t − 6 3 12t2 − 36t + 22 4
hf 00 (a + th) = ∆ f (a) + ∆ f (a) + ∆ f (a)
2 6 24
Substituting the values , we get
1 1 1
(0.1)f 0 (0.3) = 0.77 + (−0.46) − (0.01) + (0.01)
2 6 12
=⇒ f 0 (0.3) = 10[0.77 − 0.23 − 0.0017 + 0.0008] = 10 × 0.5391 = 5.34
Practice Questions
(i) A rod is rotating in a plane about one of its end. If the following table
gives the angle θ in radians through which the rod has turned for different
values of time t second. Find its angular velocity and angular acceleration
when t = 0.7seconds. You can either use the forward or Backward inter-
polation for numerical differentiation
dy
(ii) From the following data below evaluate dx at x = 0.0
x 0.0 0.05 0.10 0.15 0.20 0.25
y 0.000000 0.10017 0.20134 0.30452 0.41075 0.52110
dy d2 y
(iii) From the following table below, calculate and at x = 1.35
dx dx2
x 1.1 1.2 1.3 1.4 1.5 1.6
y -1.62628 0.15584 2.45256 5.39168 9.12500 13.83072
9
Figure 3:
Numerical Integration
Rb
The process of computing the value of a definite integral a y dx from a set
of numerical values of the integrand y is called Numerical Integration. As in nu-
merical differentiation, the function y = f (x) is represented by an interpolating
polynomial of certain degree [nth degree polynomial if there are (n+1) entries]
which is integrated within the desired limits to get an approximate value of the
definite integral. Now we derive a general formula for numerical integration by
using Newton’s forward interpolation formula. See figure 3.
Rb
(i) Newton-Cote’s Quadrature Formula Let I = a y dx where y takes
the values y0 , y1 , y2 , · · · , yn for x = x0 , x1 , · · · , xn . Let the interval of
integration (a, b) be divided into n equal sub-interval, each of width
b−a
h= so that
n
x0 = a, x1 = x0 + h, x2 = x0 + 2h, · · · , xn = x0 + nh = b.
Z x0 +nh
Thus I = f (x) dx. Since any x is given by x0 + rh and dx = hdr.
x0
Therefore
Z n
I=h f (x0 + rh) dr
0
Z nh
r(r − 1) 2 r(r − 1)(r − 2) 3 i
=h y0 + r∆y0 + ∆ y0 + ∆ yo + · · · dr
0 2! 3!
2 3 2 4 in
h r 1 r
r 1 r
= h ry0 + ∆y0 + − ∆2 + − r 3 + r 2 ∆3 y 0 + · · ·
2 2 3 2 6 4 0
h n n(2n − 3) 2 n(n − 2)2 3 i
= nh y0 + ∆y0 + ∆ y0 + ∆ y0 + · · ·
2 12 24
(3)
10
This is a general quadrature formula and is known as Newton’s-Cote’s
quadrature formula. A number of important deductions that is Trape-
zoidal rule, Simpson’s one third and three- eight rules, Weddle’s rules
can be immediately deduced by putting n = 1, 2, 3 and 6 respectively in
formula (3).
(ii) Trapezoidal Rule (n = 1) Putting n = 3 in the formula (3) and taking
the curve through (x0 , y0 ) and (x1 , y1 ) as a polynomial of degree one so
that differences of order higher than one vanish, we get
Z x0 +h 1 hh i h
f (x) dx = h y0 + ∆y0 = 2y0 + (y1 − y0 ) = (y0 + y1 )
x0 2 2 2
Z x0 +nh
hh i
f (x)dx = (y0 +yn )+4(y1 +y3 +· · ·+yn−1 )+2(y2 +y4 +· · ·+yn−2 )
x0 3
11
Which is known as Simpson’s one -third rule. While using this formula,
the given interval of integration must be even number of sub- intervals,
since we find the area over two sub-intervals at a time.
(iv) Simpson’s three-eighth rule (n = 3)
Putting n = 3 in formula (3) and taking the curves through (x0 , y0 ), (x1 , y1 ), (x2 , y2 )
and x3 , y3 as a polynomial of degree three so that differences of order
higher than three vanishes, we get
Z x0 +3h 3 3 1
f (x) dx = 3h y0 ∆y0 + ∆2 y0 + ∆3 y0
x0 2 4 8
3h h i
= 8y0 + 12(y1 − y0 ) + 6(y2 − 2y1 + y0 ) + (y3 − 3y2 + 3y1 − y0 )
8
3h h i
= y0 + 3y1 + 3y2 + y3
8
Similarly,
Z x0 +6h
3h h i
f (x) dx = y3 + 3y4 + 3y5 + y6
x0 +3h 8
................
................
Z x0 +nh
3h h i
f (x) dx = yn−3 + 3yn−2 + 3yn−1 + yn
x0 +(n−3)h 8
Adding the above integrals, we get
Z x0 +nh
3h h i
f (x) dx = (y0 + yn ) + 3(y1 + y2 + y4 + y5 + · · · + yn−2 + yn−1 ) + 2(y3 + y6 + · · · + yn−3 )
x0 8
which is known as Simpson’s three-eight rule. While using this formula,
the given interval of integration must be divided into sub-intervals whose
number n is a multiple of 3.
(v) Weddle’s Rule (n = 6) Try to derive the formula from equation (3) and
you have to end with
Z x0 +nh
3h h
f (x) dx = y0 + 5y1 + y2 + 6y3 + y4 + 5y5 + 2y6 + 5y7 + y8 + 6y9 + y10 + 5y11 + 2y12 + · · ·
x0 8
which is known as Weddle’s rule. Here n must be a multiple of 6.
Z 1
Example 1 Use trapezoidal rule to evaluate x3 dx considering five sub-
0
intervals.
Solution
Dividing the interval (0, 1) into five equal parts, each of width
1−0
h= = 0.2, the value of f (x) = x3 are given below
5
12
By trapezoidal rule, we have
Z 1
hh i
x3 dx = (y0 + y5 ) + 2(y1 + y2 + y3 + y4 )
0 2
0.2 h i
= (0 + 1.000) + 2(0.008 + 0.064 + 0.216 + 0.512)
2
= 0.1 × 2.6
= 0.26
Example 2
Z 1
dx
Evaluate using
0 1 + x2
1 1 3 1
(i) Simpson’s rule taking h = (ii) Simpson’s rule taking h =
3 4 8 6
1
(ii) Weddle’s rule taking h =
6
Solution
1 1 2 3
(i) The value of f (x) = at x = 0, , , , 1 are given below;
1 + x2 4 4 4
1 1 3
x 0 1
4 2 4
f (x) 1 0.9412 0.8000 0.6400 0.5000
1
By Simpson’s rule,
3
Z 1
dx hh i
2
= (y0 + y4 ) + 4(y1 + y3 ) + 2y2
0 1+x 3
1h i
= 1 + 0.5000 + 4(0.9412 + 0.6400) + 2(.8000)
12
= 0.7854
Also Z 1 i1
dx π
2
= tan−1 x = tan−1 1 =
0 1+x 0 4
π
Thus = 0.7854 =⇒ π = 3.1416
4
3h
By Simpson’s ,
8
Z 1
dx 3h h i
= (y0 + y 6 ) + 3(y1 + y 2 + y 4 + yy 5
) + 22y3
0 1 + x2 8
1h i
= (1 + 0.5000) + 3(0.9730 + 0.9000 + 0.6923 + 0.5902) + 2(0.8000)
16
= 0.7854
13
Also Z 1 i1
dx π
2
= tan−1 x = tan−1 1 =
0 1+x 0 4
π
Thus = 0.7854 =⇒ π = 3.1416
4
(iii) By Weddle’s rule,
Z 1
dx 3h h i
2
= y0 + 5y1 + y2 + 6y3 + y4 + 5y5 + y6
0 1+x 10
1h i
= 1 + 5(0.9730) + 0.9000 + 6(0.8000) + 0.6923 + 5(0.5902) + 0.5000
20
= 0.7854
Also Z 1 i1
dx −1 π
= tan x = tan−1 1 =
0 1 + x2 0 4
π
Thus = 0.7854 =⇒ π = 3.1416
4
Practice Questions
(i) The speed, v meters per second, of a car, i seconds after it starts, is shown
in the table below:
t 0 12 24 36 48 60 72 84 96 108 120
v 0 3.60 10.08 18.90 21.60 18.54 10.26 5.40 4.50 5.40 9.00
Using Simpson’s rule, find the distance travelled by the car in 2 minutes.
Z 8
dx
(ii) Use trapezoidal rule to evaluate using four sub-intervals
4 x
(iii) Apply (i) trapezoidal rule (ii) Simpson’s 31 rule, to find an approximate
Z 3
value of x4 dx by taking six equal sub-intervals. Compare it with the
−3
exact value.
(iv) Use Simpson’s rule , taking five ordinates, to find an approximate value
Z 2 r
1
of x− dx to two decimals places.
1 x
Z π2
1
(v) Calculate the value of sin x dx by Simpson’s rule rule, using 11
0 3
ordinates
14
DIFFERENCE EQUATIONS
An equation of the form a0 E r +a1 E r−1 +a2 E r−2 +· · ·+ar−1 E +ar yn = f (n)
here a0 , a2 , cdots, ar−1 , ar are constants, is called a linear difference equation
of order r, with constants coefficients. In symbolic form, it is written as
φ(E) = 0 (5)
1
(iii) Particular Integral P.I = f (n) is a particular solution of (4), not
φ(E)
containing any arbitrary constant.
(iv) The complete solution of (4) is given by yn = C.F + P.I
Note If f (n) = 0 complete solution is yn = C.F
(ii) If two roots m1 and m2 are real and each equal to m then,
(iv) If two roots m1 and m2 are conjugate complex numbers, say p α + iβ then
C.F = rn (c1 cos nθ + c2 sin nθ) + c3 (m3 )n + · · · where r = α2 + β 2 and
β
θ = tan−1 .
α
15
Example 1
Solve the following difference equations
(i) (∆2 − 3∆ + 2)yx = 0 (ii) Un+3 − 3Un+2 + 4Un = 0
(iii) ∆3 yn − 5∆yn + 4yn
Solution
(i) Putting ∆ = E − 1, the given equation becomes
E = −1, 2, 2
Thus complete solution is Un = c1 (−1)n + (c2 + c3 .n).2n
16
Example 2
Solve the following difference equations:
√
1+ 3
(i) yn+2 − yn+1 + yn = 0 given that y0 = 1 and y1 = .
2
(ii) yn+1 − 2yn cos α + yn−1 = 0
Solution
(i) Since yn+2 = E 2 yn , yn+1 = Eyn , the given equation becomes
and
β √ π
θ = tan−1 = tan−1 3 =
α 3
Therefore
nπ nπ
yn = c1 cos + c2 sin
3 3
and putting n = 0, y0 = c1 but y0 = 1(given) and again putting n = 1, we
obtain
π π
y1 = c1 cos + c2 sin
3 3
or √ √
1+ 3 1 3
= + c2
2 2 2
Thus c2 = 1. Hence the particular solution is yn = cos nπ nπ
3 + sin 3 .
(ii) The given equation is yn+1 − 2yn cos α + yn−1 = 0. Since it involves yn−1 ,
we operate both sides with E. Thus
or
(E 2 − 2E cos α + 1)yn = 0
A.E is E 2 − 2E cos α + 1 = 0 and solving yields. Therefore
√
2 cos α ± 4 cos2 α − 4 p
E= = cos α± − sin2 α = cos α±i sin α(= a±ib)
2
Thus the complete solution is yn = c1 cos nθ + c2 sin nθ
17
Rules for finding the particular integral
Let φ(E)yn = f (n), be the given difference equation, then
1
P.I = f (n).
φ(E)
1 n 1 n
(i) Case I. If f (n) = an , then P.I = a = a , provided φ 6= 0(i.e
φ(E) φ(a)
replace E by a ). If φ(a) = 0, then (E-a) must be a factor of φ(E) and we
operate as follows
1
an = nan−1
E−a
1 n(n − 1)an−2
2
an =
(E − a) 2!
1 n n(n − 1)(n − 2)an−3
a =
(E − a)3 3!
and so on.
(ii) Case II. If f (n) = np , then
1 1
P.I = np = np
φ(E) φ(1 + ∆)
Second Method
Example 1
Solve the following difference equations;
(i) Un+2 − 7Un+1 + 10Un = 12e3n + 4n (ii) Yn+2 − 4Yn = 2n
(iii) Yn+2 − 3Yn+1 − 4Yn + 6 = 0
Solution
18
Thus the complementary Function (C.F) is C.F = c1 .2n + c2 .5n and so the
particular integral is given as
1
P.I = (12e3n + 4n )
E 2 − 7E + 10
1 1
= 12. 2 (e3 )n + 2 (4)n
E − 7E + 10 E − 7E + 10
1 1
= 12. 3 2 3
(e3 )n + 2 4n
(e ) − 7(e ) + 10 (4 ) − 7(4) + 10
12e3n 4n
= 6 + −
e − 7e3 + 10 2
12e3n 4n
= 6 −
e − 7e3 + 10 2
Therefore the complete solution is
12e3n 4n
Un = c1 .2n + c2 .5n + −
e6 − 7e3 + 10 2
(ii) (E 2 − 4)Yn = 2n . Thus A.E is E 2 − 4 = 0 =⇒ E = −2, 2. Therefore
C.F = c1 (−2)n + c2 2n . Thus
1
P.I = 2n
E2 − 4
1 1
= 2n
E−2 E+2
1 1 n
= . 2
E−2 2+2
1 1
= 2n
4E−2
= n2n−1
Practice Exercise
Find the complete solution for following differencing equation
(i) (E 2 − 5E + 6)Yx = x + 2x (ii) Un+2 − 4Un = 9n2 (iii) (∆2 + ∆ + 1)y = x2
(iv) Un+2 − 16Un = cos n2 (v) Un+2 − 7Un+1 + 12Un = cos n
(vi) un+2 − 2un+1 + un = n .2n (vii)yn+1 − 3yn = n, given that y0 = 1
2
19
Numerical Solution of Ordinary Differential
Equations
An ordinary differential equation of n th order is of the form
dy d2 y dn y
F x, y , 2 , · · · , n = 0
dx dx dx
. The general solution of this equation contains n arbitrary constants or pa-
rameters. Thus the general solution is of the form f (x, y, c1 , c2 , · · · , cn ) = 0.
If particular values are given to the constants c1 , c2 , · · · , cn , then the resulting
solution is called a particular solution. To get a particular solution we must be
given n conditions(e.g the values of y or its derivatives for some specific value of
x) to determine the n constants. If all the n conditions are specified at the same
initial point x0 then the problem is called an initial value problem. When the
conditions are specified at two or more values of x, then the problem is called a
boundary value problem.
Many ordinary differential equations can be solved by analytical methods
discussed earlier giving closed form solutions. i.e expressing y in terms of x.
However, a majority of differential equations appearing in physical problems
cannot be solved analytically. Thus it becomes imperative to discuss their so-
lutions by numerical methods.
In this chapter , we shall discuss some of the methods for obtaining numerical
dy
solution of first order and first degree ordinary differential equation = f (x, y)
dx
subject of the condition y(x0 ) = y0 .
The integrand in (7) is now a function of x alone and can be evaluated in gen-
eral. In the integrand f (x, y) in the R.H.S of (7) we replace y by itsRfirst
x
approximation y (1) . Thus , we get a second approximation y (2) = y0 + x0 f (x, y (1) )dx.
20
Similarly a third approximation is
Z x
y (3) = y0 + f (x, y (2) )dx
x0
Example 1
Obtain Picard’s second approximate solution of the initial value problem
dy x2
= 2 , y(0) = 0
dx y +1
Solution
x2
Here x0 = 0, y0 = 0, f (x, y) = . Thus
y2
+1
Z x
y = y0 + f (x, y)dx
x0
becomes x
x2
Z
y= dx
0 y2 + 1
putting y = 0 in the integrand in the equation above, we get the first approxi-
mation
Z x
x3
y (1) = x2 dx =
0 3
x3
putting y = y (1) = in the integrand we get the second approximation
3
Z x
x2
y (2) = x6
0 9 +1
Z x33
dt x3
= , where t =
0 t2 + 1 3
Z x33
= (1 + t2 )−1 dt
0
Z x3
3
= (1 − t2 + t4 − · · · )dt
0
3
t3 t5 i x3
= t − + − ···
3 5 0
x3 x9 x15
= − + − ···
3 81 1215
Note: Picard’s method can be used with ease only when it does not pose
any difficulty in performing the necessary integration in the course of obtaining
various approximation.
21
Example 2
dy
Given the differential equation dx = x − y with the condition that y = 1 when
x = 0. Use Picard’s method to obtain y for x = 0.2 correct to five places of
decimal. Check your answer by comparing the result with the exact particular
solution.
Solution
becomes Z x
y =1+ (x − y) dx
0
putting y = y0 = 1 in the integrand, first approximation
Z x
x2
y (1) = 1 + (x − 1) dx = 1 − x +
0 2
x2
putting y = y (1) = 1 − x + in the integrand, second approximation
2
Z x
x2 x3
y (2) =1+ x−1+x− dx = 1 − x + x2 −
0 2 6
When x = 0.2, y = 0.83746 upto five decimal places of decimal. This value
is exactly the same as the value obtained by Picard’s method
22
Practice Exercise
(i) Employ Picard’s method to obtain correct to four places of decimal the
dy
solution of the equation = x2 + y 2 for x = 0.1 given that y = 0 when
dx
x = 0.
(ii) Find the value of y for x = 0.1 by Picard’s method given that
dy y−x
= , y(0) = 1.
dx y+x
dy
(iii) Find an approximate value of y when x = 0.1, if = x − y 2 and y = 1
dx
at x = 0, using Picard’s method.
dy
(iv) Solve numerically = 2x − y, y(0) = 0.9 at x = 0.4 by Picard’s method
dx
with three iterations and compare the result with the exact value.
(x − x0 )2 00 (x − x0 )3 y 000 (0)
y(x) = y0 + (x − x0 )y 0 (0) + y (0) + + ··· (9)
2! 3!
Where dashes denote differentiation w.r.t. x Differentiating (1) successively
w.r.t. x we get
∂f ∂f dy ∂f ∂f ∂ ∂
y 00 = + = +f = +f f
∂x ∂y dx ∂x ∂y ∂x ∂y
d d2 y ∂ ∂ ∂f ∂f
y 000 = = + f + f
dx dx2 ∂x ∂y ∂x ∂y
∂2f ∂f ∂f ∂2f ∂2f ∂f ∂f 2
2∂ f
= + + f + f + f + f
∂x2 ∂x ∂y ∂x∂y ∂y∂x ∂y ∂y ∂y 2
and so on
putting x = x0 and y = y0 in the expressions for y 0 , y 00 , y 000 , · · · and substi-
tuting them in equation(9), we get a power series for y(x) in powers of (x − x0 ).
23
Example 1
y iv (0) = 2y 000 (0) + 3e0 = 2 × 21 + 3 = 43 The Taylor series for y(x) near
x = 0 is given by
x2 00 x3 x4
y(x) = y0 + xy 0 (0) + y (0) + y 000 (0) + y iv (0) + · · ·
2! 3! 4!
9x2 21x3 45x4
= 0 + 3x + + + + ···
2 3×2 4×3×2
9 7 15
= 3x + x2 + x3 + x4 + · · ·
2 2 8
Putting x = 0.2 in the above series, we have
9 7 15
y(0.2) ≈ 3(0.2) + (0.2)2 + (0.2)3 + (0.2)4
2 2 8
≈ 0.8110
dy dy
R
Now dx = 2y + 3ex or dx − 2y = 3ex in a linear differential equation I.F =
−2dx −2x
e =e and the solution is
Z
−2x
y.e = 3ex + e−2x dx = −3e−x + c
Practice Questions
dy
(i) Using Taylor series method, compute the solution of = x + y, y(0) = 1
dx
at the point x = 0.2 correct to three decimal places.
(ii) find by Taylor series method the value of y at x = 0.1 and x = 0.2 to five
dy
places of decimals from = x2 y − 1, y(0) = 1
dx
(iii) Solve y 0 = y 2 + x, y(0) = 1 using Taylor series method and compute y(0.1)
and y(0.2)
24
Euler’s Method
or
y = y0 + f (x0 , y0 )(x − x0 ) (11)
h dy i
∴ = f (x, y)
dx
This gives the y− coordinate of any point on the tangent since the curve is
approximately by the tangent in the interval (x0 , x1 ) the value of y on the curve
corresponding to x = x1 is given by the above value of y in (11) approximately.
∴ putting x = x1 = x0 + h in (11) we have y1 = y0 + hf (x0 , y0 ). Thus Q1
is (x1 , y1 ). Similarly approximating the curve in the next interval (x1 , x2 ) by a
dy
line through Q1 (x1 , y1 ) whose slope is = f (x1 , y1 ) we get
dx
y2 = y1 + hf (x1 , y1 )
y3 = y2 + hf (x2 , y2 )
y4 = y3 + hf (x3 , y3 )
In general,
yn+1 = yn + hf (xn , yn )
This is called Euler’s algorithm.
Note 2. The practical value of the Euler’s method is limited, but since it is
helpful for understanding the basic idea of the method in this section.
25
In fact, we approximate the solution y by the straight line (xn , yn ) with slope
(xn , yn ) interval xn , xx + 12 h and then we continue alone the straight line with
slope f (xn+1 , yn+1 ) until x reaches xn+1 . (in the figure,n=0)...... The modified
method is a predictor-corrector method, because in each step we first predict a
value by (1) and then correct it by (2).
dy
Example 1. Using Euler’s method, solve for y at x = 0.1 from dx = x+y+xy
y(0) = 1 taking step size h = 0.025
dy
Sol.The given differential equations is dx = x + y + xy, y(0) = 1.
Hence
f (x, y = x + y + xy)
The initial condition is xo = 0, yo = 1. Also h = 0.025
Euler’s algorithm is
yn+1 = yn + hf (xn , yn ) (12)
From (12), for n = 0, we have y1 = y0 + 0.025f (x0 , y0 )
26
dy
Example. Given that dx = x + y 2 and y = 1 at x = 0. find an approximate
value of y at x = 0.5by modified Euler’s method.
1
y2 = y1 + × 0.1 f (x1 , y1 ) + f (x2 , y2∗ )
2
= 1.1155 + 0.05 f (0.1, 1.1155) + f (0.2, 1.2499)
= 1.1155 + 0.05 0.1 + (1.1155)2 + 0.2 + (1.2499)2 = 1.2708
1
y3 = y2 × 0.1 f (x2 , y2 ) + f (x3 , y32 )
2
= 1.2708 + 0.05 0.2 + (1.2708)2 + 0.3 + (1.4522)2 = 1.4819
1
y4 = y3 + × 0.1 f (x3 , y3 ) + f (x4 , y4 )
2
= 1.4819 + 0.05 f (0.3, 1.4819) + f (0.4, 1.7315)
= 1.4819 + 0.05 0.3 + (1.4819)2 + 0.4 + (1.7315)2 = 1.7766
1
y5 = y4 + × 0.1 f (x4 , y4 ) + f (x5 , y5∗ )
2
= 1.7766 + 0.05 f (0.4, 1.7766) + f (0.5, 2.1322)
= 1.7766 + 0.05 0.4 + (1.7766)2 + 0.5 + (2.1322)2 = 2.2067
When x = 0.5 = x5 , y = y5
∴ y = 2.2067 when x = 0.5
27
Practice Questions
RUNGE’S METHOD
To evaluate the integral onR.H.S. we shall use simpson’s one third rule. We
divide the interval x0 , x0 + h in to two equal parts, each of width h2 and find
dy
the value of integrand f (x, y) dx at the point x0 , x0 h2 and x0 + h. Let us first
find the values of y these points. At x = x0 , y = y0 .
Let the tangent at A meet the verticals at M and N in Q and R respectively.
Now
dy
f (x0 , y0 ) = = slope of tangent at A
dx A
= tan θ1 , where θ1 = ∠P AQ and AP ||x − axis
28
h
When x = x0 + 2
y = ym = M Q = M P + P Q
h
= y0 + AP tan θ1 = y0 + f (x0 , y0 )
2
Also
yR = N R = N S + SR
= y0 + AS tan θ1 = y0 + hf (x0 , y0 )
h
Thus the value of f (x, y) at x0 , x0 + 2 and x0 + h are respectively
f0 = f (x0 , y0 )
h h
fm = f x0 + , y0 + f0
2 2
f1 = f (x0 + h, y0 + hfk )
where
fk = f (x0 + h, y0 + hf0 )
∴ From (15), we get
h
y1 = y0 + [f0 + 4fm + f1 ] by Simpson0 s one third rule
2
3
h
= y0 + [f0 + 4fm + f1 ]
6
The formula gives sufficiently accurate value of y1 = y(x0 + h).
Hence to solve (14) by Runge’s method compute,
f0 = f (x0 , y0 )
h h
fm = f x0 + , y0 + f0
2 2
fk = f (x0 + h, y0 + hf0 )
f1 = f (x0 + h, y0 + hfk )
29
Take h = 0.2
√
sol. Here f (x, y) = x + y,h = 0.2
We first compute y(0.6) and then y(0.4)
For y(0.6), we have x0 = 0.4, y0 = 0.41
√ √
f0 = f (x0 , y0 ) = f (0.4, 0.41) = o.4 + 0.41 = 0.81 = 0.9
h h
fm = x0 + , y0 + f0
2 2 √
√
= f (0.4 + 0.1, 0.41 + 0.1 × 0.9) = f (0.5, 0.5) = 0.5 + 0.5 = 1 = 1
fk = f (x0 + h, y0 + hf0 )
= f (0.4 + 0.2, 0.41 + 0.2 ∗ 0.9) = f (0.6, 0.59)
√ √
= 0.6 + 0.59 = 1.19 = 1.0908
f1 = f (x0 + h, y0 + hfk )
= f (0.4 + 0.2, 0.41 + 0.2 × 1.0908) = f (0.6, 0.62816)
√ √
= 0.6 + 0.62816 = 1.22816 = 1.1082
∴
h
y(x0 + h) = y0 + (f0 + 4fm + f1 )
6
0.2
y(0.6) = 0.4 + (0.9 + 4 × 1 + 1.1082) = 0.6102
6
∴
h
y(x0 + h) = y0 + (f0 + 4fm + f1 )
6
0.2
y(0.8) = 0.6102 + (1.1 + 4 × 1.1917 + 1.2905) = 0.8487
0.6
PRACTICE QUESTION
1. Apply Runge’s method to find an approximate value of y when x = 0.2,
dy
given that dx = x + y and y = 1 when x = 0.
30
2. Use Runge’s method to solve numerically the differential equation y 0 =
x − y,y(1) = 0.4 for x = 1.6.
3. Apply Runge’s method to find an approximate value of y when x = 0.1
dy
given that dx = 3x + y 2 , y(0)=1
RUNGE-KUTTA METHODS
1 1
k3 = hf x0 + h, y0 + k2 = 0.1f (1.05, 1.5 + 0.1933)
2 2
= 0.1 (1.05)2 + (1.6933)2 = 0.3969
∴
1
y1 = y(x0 + h) = y0 + (k1 + k2 + k3 + k4 )
6
31
1
y(1.1) = 1.5 + (0.325 + 0.7732 + 0.7938 + 0.4808) = 1.8954
6
1 1
k2 = hf x1 + h, y1 + k1 = 0.1(1.1 + 0.05, 1.8954 + 0.2401)
2 2
= 0.1 (1.15)2 + (2.1355)2 = 0.5882
1 1
k3 = hf x1 + h, y1 + k2 = 0.1f (1.15, 1.8954 + 0.2941)
2 2
= 0.1 (1.15)2 + (2.1895)2 = 0.6116
∴
1
y2 = y(x1 + h) = y1 + (k1 + 2k2 + 2k3 + k4 )
6
1
y(1.2) = 1.8954 + (0.4802 + 1.1764 + 1.2232 + 0.7725) = 2.5041
6
PRACTICE QUESTIONS
32
dy
and then from 16,we compute y10 = dx
x0 ,y0
= f (x0 , y0 )
y10 = f (x1 , y1 ),y20 = f (x2 , y2 ),y30 = f (x3 , y3 )
For equi-spaced arguments x0 ,x0 + h,x0 + 2h,......., by newton’s forward inter-
polation formula, we know that
Replacing u by y, we have
r(r − 1) 2 0 r(−1)(r − 2)
y 0 = y00 + r∆y00 + ∆ y0 + = ∆3 y00 + ....... (18)
2! 3!
Integrating 18 w.r.t.x over the interval 0 to x0 + 4h, we have
x0 +4h x0 +4h
r(r − 1) 2 0 r(r − 1)(r − 2) 3 0
Z Z
y 0 dx =
0
y0 +r∆y00 + ∆ y0 + ∆ y0 +...]dx
x0 x0 2! 3!
(19)
x=x0 +4h
Now L.H.S = y x=x0 = y4 − y0
In the R.H.S. since x = x0 + rh ∴ dx = hdr
When x = x0 + 4h, r = 4
∴ from 19,we
R 4have
y4 − y0 = h 0 y00 + r∆y00 + r(r−1) 2 0 r(r−1)(r−2) 3 0
2! ∆ y0 + 3! ∆ y0 + .... dr
Considering differences only upto the third order
Z 4 ZZ 44 Z 4
1 1
y4 = y0 + h y00 rdr + ∆2 y00
dr + ∆y00 (r2 − 1)dr + ∆3 y00 (r3 − 3r2 + 2r)dr
0 0 2 0 6 0
1 64 1
= y0 + h y0 × 4 + ∆y00 × 8 + ∆2 y00
0
− 8 + ∆3 y00 (64 + 16)
2 3 6
20 8
= y0 + h 4y0 + 8(E − 1)y00 + ∆2 y00 + ∆3 y00
0
3 3
20 8
= y0 + h 4y0 + 8(E − 1)y00 + (E − 1)2 y00 + (E − 1)3 y00
0
3 3
Using the operator relation ∆ = E − 1
20 8
= y0 + h 4y00 + 8(E − 1)y00 + (E 2 − 2E + 1)y00 + (E 3 − 3E 3 + 3E − 1)y00
3 3
20 8
= y0 + h 4y0 + 8(y10 − y00 ) + (y20 − 2y10 + y00 ) + (y30 − 3y20 + 3y10 − y00 )
3 3
20 8 0 40 20 8
+ 8 y10 + − 8 y20 + y30
= y0 + h 4 − 8 + − y0 + 8 −
3 3 3 3 3
8 0 4 0 8 0
= y0 + h y1 − y2 + y3
3 3 3
4h
(2y10 − y20 + 2y30 )
y4 + h = y0 + (20)
3
The formula is known as Milne’s predictor formula.
To get Milne’s corrector formula, we integrate (13) w.r.t.x over the interval x0
to x0 + 2h. Thus
x0 +2h x0 +2h
r(r − 1) 2 0 r(r − 1)(r − 2) 3 0
Z Z
y 0 dx =
0
y0 +r∆y00 +
∆ y0 + ∆ y0 +..... dx
x0 x0 2! 3!
(21)
33
Now x=x0 +2h
L.H.S = y x=x = y2 − y0
0
2 2
1 2 0 2 2 1 3 0 4 3
Z Z Z Z
y2 = y0 + h y00 ∆y00 (r − 3r2 + 2r)dr
dr + rdr + ∆ y0 (r − r)dr + ∆ y0
0 0 2 0 6 0
0 0 1 2 0 8 1 3 0
= y0 + h y0 ∗ 2 + ∆y0 ∗ 2 + ∆ y0 − 2 + ∆ y0 (4 − 8 + 4)
2 3 6
1 2 0 1
= y0 + h 2y0 + 2∆y0 + ∆ y0 = y0 + h 2y0 + 2(E − 1)y00 + (E − 1)2 y00
0 0
0
3 3
0 0 1 2 2 0
= y0 + h 2y0 + 2(E − 1)y0 + (E − 2E + 1) y0
2
1 0
= y0 + h 2y0 + 2(y1 − y0 ) + (y2 − 2y10 + y00 )
0
0 0 0
3
1 0 2 1
= y0 + h 2 − 2 + y0 + 2 − y10 + y20
3 3 3
1 0 4 0 1 0
= y0 + h y0 + y1 + y2
3 3 3
h
y2 = y0 + (y00 + 4y10 + y[0 2]) (22)
3
This formula is known as Milne’s corrector formula.
Expressing the results in general from and replacing y 0 by f (x, y), we have
yn+1 ,p = yn−3 + 4h3 (2fn−2 − fn−1 + 2f n) -Milne’s predictor formula
yn+1 ,c = yn−1 + h3 (fn−1 + 4fn + fn+1 ) -Milne’s corrector formula
34
∴
y40 = f (x4 , y4 ) = (1.4)2 (1 + 2.5738) = 7.0046 = f4
we have
0.1
y4,c = 1.548 + (3.6691 + 20.1380 + 7.0046) = 2.5750
3
Hence
y(1.4) = 2.5750
y 0 (0) = 1, y”(0) = 2 × 0 + 2 × 1 × 1 = 2
y”0 (0) = 2 + 2(1 × 2 + 12 ) = 8
x2 x3 4x3
y(x) = y0 + xy 0 (0) y”(0) + y”0 (0) + ..... = 1 + x + x2 + ...
2! 3! 3
∴
4(−.1)3
y(−.1) = 1 − .1 + (.1)2 + − .... = 0.9087
3
4(1)3
y(.1) = 1 + .1 + (.1)2 + − ..... = 1.1113
3
4(.2)3
y(.2) = 1 + .2 + (.2)2 + − .... = 1.2506
3
Now
4h
y3,p = y−1 + (2f0 − f1 + 2f2 )
3
,
35
we have
4 ∗ 0.1
y3,p = 0.9087 + (2 − 1.2449 + 3.2080) = 1.4371
3
Since x3 = .3,y3 = 1.4371
h
y3,c = y1 + (f1 + 4f2 + f3 ),
3
we have
0.1
y3,c = 1.1113 + (1.2449 + 6.4160 + 2.1552) = 1.3485
3
Hence
y(0.3) = 1.4385
PRACTICE QUESTIONS
1. Using Milne’s predictor corrector method to obtain the solution of the
dy
equation = x − y 2 at x = 0.8, given that y(0) = 0.0000,y(0.2) =
dx
0.0200,y(0.4) = 0.0795,y(0.6) = 0.1762.
2. Using Milne’s method, obtain the solution of the equation
1
y0 = ,y(0) = 2 at x = 0.8,given that y(0.2) = 2.0933,(0.4) =
x+y
2.1755,(0.6) = 2.2493.
dy
3. Solve by Milne’s predictor-corrector method, the differential equation dx =
2
y − x with the following starting value:
y(0) = 1,y(.2) = 1.12186,y(.4) = 1.4682,y(.6) = 1.7379 and find the value
of y when x = .8
36
where the coefficient matrix A = [aij ] is then m ∗ n matrix and x and b
are the column matrices (vectors) given by:
a11 a12 · · · a1n
a21 a22 · · · a2n
A= .
. .. ..
. . ··· .
am1 am2 · · · amn
,
x1
x2
x= .
..
xn
and
b1
b2
b= .
..
bm
A solution of the system is a set of numbers x1 , x2 , ...., xn which satisfy all
the m equations, and a solution vector of (1)is a column matrix whose com-
ponents constitute a solution of system. The method of solving such a system
using methods like Cramer’s rule is impracticable for large system. Hence, we
use other methods like Gauss elimination.
To eliminate x1 from equation (2), (3) and (4), we subtract suitable multiples of
equation (1) and we get the following system of equations:
To eliminate x2 from equations (6) and (7), subtract suitable multiples of equa-
tion (5) and get the following system of equations:
−1
(6) − (5) → − x3 − 4x4 = −11 ...(8)
9
−1
(7) − (5) → − 3x3 + x4 = 6 ...(9)
9
37
To eliminate x2 from equation (9), subtract 3x(8) and get the following
equation:
13x4 = 39 ...(10)
From equation (10),x4 = 39/13 = 3; using this value of x4 ,(9) gives x3 = −1;
using these values of x4 and x3 ,(7) gives x2 = 1; using all these values (1) gives
x1 = 2. Hence the solution to the system is x1 =,x2 = 1,x3 = −1,4 = 3
Note: The above method can be simplified using the matrix notation. The given
system of equations can be written as
Ax = b
Hence
2 1 2 1 x1 6
0
−9 0 9 x2 = 18
0 0 −1 −4 x3 −11
0 0 0 13 x4 39
Back substitution gives
x1 = 2, x2 = 1, x3 = −1, x4 = 3
In the example, we had a11 6= 0. Otherwise we would not have been able to
eliminate x1 by using the equations in the given order. Hence if a11 6= 0 in
the system of equations we ha to reorder the equation (and perhaps even the
unknowns in each equation) in a suitable fashion; similarly, in the further steps.
Such a situation can be seen in the following Example.
Example Using Gauss elimination solve
y + 3z = 9
2x + 2y − z = 8
−x + 5z = 8
2x + 2y − z = 8 ...(1)
y + 3z = 9 ...(2)
−x + 5z = 8 ...(3)
38
Elimination of x from last two equations
2x + 2y − z = 8
y + 3z = 9
1 9
(3) + (1) → y + z = 12 ...(4)
2 2
Elimination of y from last equation
2x + 2y − z = 8
y + 3z = 9
3
(4) − (2) → z=3 ...(5)
2
Hence
z = 2, y = 9 − 6 = 3, x = 2
.
Hence
x 2
y = 3
z 2
In each step in the Gauss elimination method, the coefficient of the first
unknown in the first equation is called pivotal coefficient. By the above Ex-
ample, the Gauss elimination method fails if any one of the pivotal coefficient
becomes zero. In such a situation, we rewrite the equations in a different order
to avoid zero pivotal coefficient. Changing the order of equations is called piv-
oting
39
and hence from (1a)
1 0.005
x1 = (1.406 − 1.402 × 0.9993) = = 12.5
0.0004 0.0004
Example Solve the following system (i) without pivoting (ii) with pivoting
2 0.3003 × 2 0.1002 × 2
(2) − (2) → 3.000 − y = 2.0000 −
.0002 0.0002 0.0002
i.e.,
1498.5y = 499
.
Now by back substitution, the solution of the system is given by y = 0.3330 and
x = 0.5005;
40
which simplifies to
0.3000y = 0.1000
x1 + 2x2 + 3x3 = 14
2x1 + 3x2 + 4x3 = 20
3x1 + 4x2 + x3 = 14
R2 → R3 + (−2)R1 m21 = −2
R3 → R3 + (−3)R1 m31 = −3
1 2 3
0 −1 −2
0 −2 −8
1 2 3
0 −1 −2
0 0 −4
R3 → R3 + (−2)R2 m32 = −3
We take
1 2 3
U = 0 −1 −2
0 0 −4
as the upper triangular matrix
Using the multiplier m21 = −2, m31 = −3, m32 = −2, we get the lower triangu-
lar matrix as follows:
1 0 0 1 0 0
L = −m21 1 0 = 2 1 0
−m31 −m32 1 3 2 1
41
(solutionof thesystem)
The given system of equation can be written as
1 0 0 1 2 3 x1 14
2 1 0 0 −1 −2 x2 = 20 ...(1)
3 2 1 0 0 −4 x3 14
The above can be written as
1 0 0 y1 14
2 1 0 y2 = 20 ...(2)
3 2 1 y3 14
where
1 2 3 x1 y1
0 −1 −2 x2 = y2 ...(3)
0 0 −4 x3 y3
Solving the system in (2) by forward substitution, we get
y1 14
y2 = −8
y3 −12
With these values of y1 , y2 , y3 , Eq.(3) can now be solved by back substitution
and we obtain
x1 1
x2 = 2
x3 3
Example Solve the equations
2x + 3y + z = 9
x + 2y + 3z = 6
3x + y + 2z = 8
by LU decomposition.
(LU decomposition of the coefficient matrix A)
Proceeding as in the above example,
2 3 1 1 0 0
U = 0 21 52 and L = 21 1 0
3
0 0 18 2 −7 1
(solutionof thesystem)
The given system of the equations can be written as
1 0 0 2 3 1 x 9
1/2 1 0 0 1/2 5/2 y = 6 ...(iv)
3/2 −7 1 0 0 18 z 8
or,as
1 0 0 y1 9
1/2 1 0 y2 = 6 ...(v)
3/2 −7 1 y3 8
42
where
2 3 1 x
0 1/2 5/2 y = y1 y2 y3 ...(vi)
0 0 18 z
With these values of y1 , y2 , y3 , eq.(vi) can now be solved by the back substitution
process and we obtain
35 29 5
x= , y= , z=
18 18 18
. Gauss Jordan Method
The method is based on the idea of reducing the given system of equations
Ax = b,to diagonal system of equations Ix = d, where I is the identity ma-
trix, using elementary row operations. We know that the solutions of both the
systems are identical. This reduced system gives the solution vector x. This
reduction is equivalent to finding the solution as x = A−1 b
is written as
a11 a12 a13 x1 b1
a21 a22 a23 x2 = b2 − − − −(∗ )
a31 a32 a33 x3 b3
To obtain the system as given in (∗∗ ), first we augment the matrices given is (∗ )
as,
a11 a12 a13 b1
a21 a22 a23 b2
a31 a32 a33 b3
and after some elementary operations, it is written as,
1 0 0 d1
0 1 0 d2 − − − (∗∗∗ ),
0 0 1 d3
this helps us to write the given system as given in (∗∗ ). Then it is easy to get
the solution of the system as x1 = d1 , x2 = d2 and x3 = d3 .
43
matrix as zeros, using the elementary row transformations. From the second
step onwards, we make the elements below and above the pivots as zeros using
the elementary row transformations. Lastly, we divide each row by its pivot so
that the final matrix is of the form (∗∗∗ ). Partial pivoting can also be used in the
solution. We may also make the pivots as 1 before performing the elimination.
x1 + x2 + x3 = 1
4x1 + 3x2 − x2 = 6
3x1 + 5x2 + 3x3 = 4
Hence,
1 0 0 x1 1
0 1 0 x2 = 1
2
0 0 1 x3 − 12
Therefore, the solution of the system is,
1 1
x1 = 1, x2 = , x3 = −
2 2
.
Note: The Gauss-Jordan method looks very elegant as the solution is obtained
directly. However, it is computationally more expensive than Gauss elimination.
For large n, the total number of divisions and multiplications for Gauss-Jordan
method is almost 1.5 times the total number of divisions and multiplications
required for Gauss elimination. Hence, we do not normally use this method for
44
the solution of the system of equations.
Assignment
45
5. Solve the system, using Gauss elimination method:
5x1 + x2 + x3 + x4 = 4
x1 + 7x2 + x3 + x4 = 12
x1 + x2 + 6x3 + x4 = −5
x1 + x2 + x3 + 4x4 = −6
x + 4y − z = −5
x + y − 6z = −12
3x + y − z = 4
AX = I (23)
46
In this method, we place an identity matrix, whose order is same as that of
A, adjacent to A which we call augmented matrix. Then the inverse of A is
computed in two stages. In the first stage, A is converted into an upper trian-
gular form, using Gaussian elimination method.
We write the augmented system first and then apply low transformations:
2 1 1 1 0 0
3 2 3 0 1 0 ...(1)
1 4 90 0 1
In first column of matrix (1), 4 is the largest element, and hence is the pivotal
element. In order to bring 4 in the first row we interchange the first and second
rows and obtain the augmented matrix in the form
4 3 −1 0 1 0
1 1 1 1 0 0 ...(2)
3 5 3 0 0 1
1 24 − 12 0 14 0
1 1 1 1 0 0 by R1 → 1 R1
4
3 5 3 0 0 1
1 42 − 41 0 1
4 0
0 1 5 1 −1 0
4 4 4
11 15 0 −3 1
0 4 4 4
by R2 → R2 − R1
by R3 → R3 − 3R1
1 34 − 41 1
0 0
4
0 1 15 0 − 3 4
11 11 11
0 0 10 11
1 −1
4 0
1 34 − 14 0 1
4 0
0 1 15 0 − 3 4
11 11 11
10 2 1
0 0 11 1 − 11 − 11
47
This is equivalent to the following three matrices
1 34 − 14 0 1 34 − 41 14 3
− 14
1 0
4 4
0 1 15 0 ; 0 1 15 − 3 ; 0 1 15
11 10 11 11 111
0 0 10 11
1 0 0 10 11
− 2
11 0 0 10
11
−
11
Thus we have
7 1
− 25
x11 x12 x13 5 5
A−1 = x21 x22 x23 = − 32 0 1
2
11
x31 x32 x33 10 − 15 1
− 10
byR2 → R2 − 4R1
byR3 → R3 − 3R1
1 1 1 1 0 7
0 1 5 4 −1 0
0 2 0 −3 0 1
byR2 → −R2
1 0 −4 −3 1 0
0 1 5 4 −1 0
0 0 −10 −11 2 1
by R1 → R1 − R2
by R3 → R3 − 2R2
1 0 −4 −3 1 0
0 1 5 4 −1 0
0 0 1 11/10 −1/5 −1/10
1
byR3 → − R3
10
1 0 0 7/5 1/5 −2/5
0 1 0 −3/5 0 1/2
0 0 1 11/10 −1/5 −1/10
byR1 → R1 + 4R3
byR2 → R2 − 5R1
48
Thus we have
7 1
− 25
5 5
− 3 0 1
2 2
11
10 − 15 1
− 10
49
This gives the y values by forward substitution, which means, substitute the
value of y1 given by the first equation in the second and solve y2 , then use these
values of y1 and y2 in the third and solve y3 .
Then the system of equations
u11 u12 u13 x1 y1
U x = y; that is 0 u22 u23 x2 = y2
0 0 u33 x3 y3
gives the required values of x1 , x2 and x3 as the solution of the original system
of linear equations by backward substitution.
a11 a12 a13
T o compose a matrix A = a21 a22 a23 , in the f orm
a31 a32 a33
a11 a12 a13 1 0 0 u11 u12 u13
a21 a22 a23 = l21 1 0 0 u22 u23 , we proceed as f ollows.
a31 a32 a33 l31 l32 1 0 0 u33
1 0 0 u11 u12 u13
On multiplying l21 1 0 and 0 u22 u23 , we get,
l31 l32 1 0 0 u33
u11 u12 u13
l21 u11 l21 u12 + u22 l21 u13 + u23
l31 u11 l31 u12 + l32 u22 l31 u13 + l32 u23 + u33
Equating it with the corresponding terms of A, we get,
2x + 3y + z = 9
x + 2y + 3z = 6
3x + y + 2z = 8.
Solution :
50
in the form of LU , we equate the corresponding terms of A and LU as
already illustrated, and obtain
51
Assignment
1. Using Gauss-Jordan method, find the inverse of the following matrices:
1 1 3 1 1 2
(i) A = 1 3 −3 (ii) B = 1 2 4
−2 −4 −4 2 4 7
2. Using Gaussian elimination method, find the inverse of the following ma-
trices:
0 1 2 2 0 1
(i) A = 1 2 3 (ii) B = 3 2 5
3 1 1 1 −1 0
52