3.1 Solving Small Number of Equation
3.1 Solving Small Number of Equation
System of linear
equations is
written as
Cramer’s Rule
2 1 Graphical Method
Two Types
of Methods
a b
x2 = − 11 x1 + 1 x2 = (slope) x1 + intercept
a12 a12
a b
x2 = − 21 x1 + 2
a22 a22
1 7
x2 = − x1 +
2 2
2 7
x2 = x1 +
3 3
Prepared by Norhayati Rosli
Graphical Method
Plot the two equations on Cartesian coordinate using Geogebra.
Go to link https://www.geogebra.org/graphing?lang=en
If 𝐿1 and 𝐿2 intersect at exactly one point, there is a unique solution. The lines cross at
only one point.
If 𝐿1 and 𝐿2 are parallel and coincident, there is an infinitely many solutions.
If 𝐿1 and 𝐿2 are almost parallel, the system is ill-conditioned. The point of intersection
is difficult to detect visually due to the slopes are closed.
If 𝐿1 and 𝐿2 are parallel and distinct, there is no solution.
Determine the nature of the solution for the following system of linear equations
x1 − 3 x2 = 3
3 x1 − 9 x2 = 5
Solution
No solution
x1 − 3 x2 = 3
3 x1 − x2 = 9
Solution
Unique solution
Solution
ill-conditioned
x1 − 3 x2 = 3
2 x1 − 6 x2 = 6
Solution
Many solutions
Cramer’s rule states that each unknown in a system of linear equations may be expressed as a fraction
of two determinants. The denominator, 𝐷 is a determinant of 𝑨 matrix. The numerator, 𝐷𝑛 is obtained
by replacing the column of the coefficients of the unknown by the vector 𝒃.
Dn
Cramer’s rule formula: xn =
D
1 1 a11 = a11
a11 a12
2 2 = a11a22 − a12 a21
a21 a22
a11 a12 a13
a22 a23 a21 a23 a21 a22
3 3 a21 a22 a23 = a11 − a12 + a13
a32 a33 a31 a33 a31 a32
a31 a32 a33
= a11 (a22 a33 − a23a32 ) − a12 (a21a33 − a23a31 ) + a13 (a21a32 − a22 a31 )
x1 + 3x2 − x3 = −8
2 x1 − x2 + 3x3 = 13
3x1 + 2 x2 − x3 = −4
a) Transform the above system into a matrix form of 𝐀𝐱 = 𝐛.
b) Compute 𝑥1 , 𝑥2 and 𝑥3 by using Cramer’s rule.
Solution
a) 1 3 −1 x1 −8
2 −1 3 x = 13
2
3 2 −1 x3 −4
1 3 −1
−1 3 2 3 2 −1
D = A = 2 −1 3 = (1) −3 + (−1) = 21
2 −1 3 −1 3 2
3 2 −1
Find the determinants of 𝐷1 , 𝐷2 and 𝐷3 by replacing the first, second and third column in 𝐀 with 𝐛.
−8 3 −1
−1 3 13 3 13 −1
D1 = 13 −1 3 = (−8) −3 + (−1) = 21
2 −1 −4 −1 −4 2
−4 2 −1
1 −8 −1
13 3 2 3 2 13
D2 = 2 13 3 = (1) − (−8) + (−1) 3 = −42
−4 −1 3 −1 −4 −4
3 −4 −1
1 3 −8
−1 13 2 13 2 −1
D3 = 2 −1 13 = (1) −3 + (−8) = 63
2 −4 3 −4 3 2
3 2 −4
21 −42 63
x1 = = 1, x2 = = −2, x3 = =3
21 21 21
Therefore, 𝑥1 = 1, 𝑥2 = −2, 𝑥3 = 3.
Prepared by Norhayati Rosli
Summary
✓ Norhayati Rosli, Nadirah Mohd Nasir, Mohd Zuki Salleh, Rozieana Khairuddin,
Nurfatihah Mohamad Hanafi, Noraziah Adzhar. Numerical Methods, Second
Edition, UMP, 2017.
✓ Chapra, C. S. & Canale, R. P. Numerical Methods for Engineers, Sixth Edition,
McGraw–Hill, 2010.
26