Cramer’s Rule
Sections 5.5, 4.6 from
Fundamental methods of Mathematical Economics, McGraw Hill 2005, 4th Edition.
By A. C. Chiang & Kevin Wainwright are covered.
Non-homogenous systems of linear equations:
An arbitrary system of m linear equations in n unknowns of form
a 11 x 1 +a12 x 2 +…+ a1 n x n=d 1
a 21 x1 + a22 x 2+ …+a2 n x n=d 2
a m 1 x 1+ am2 x2 +…+ amn x n =d m
Where x1,x2,...xn are unknowns and a’s and d’s denote constants, is known as non-homogeneous
system provided d ’ s not all zero (at least one of them is non-zero).
This system can be expressed as AX=b
where
a11 a12 … a1 n x1 d1
a
⋮
[
A= 21
a22 … a2 n
⋮ ⋮ ⋮
a m 1 am 2 … a mn
, X=
] [] [] x2
⋮
xn
, b=
d2
⋮
dm
A is called matrix of coefficients.
Cramer’s Rule for a 2 x 2 system of linear equations
a11 a12 x d
Given ( )( ) ( )
a21 a22 y
= 1
d2
We can write it in matrix form as AX = d, where A is a 2 x 2 matrix .Then
set up matrix A1 obtained by replacing the first column of A by the column vector d.
det ( A 1 )
Then x=
det ( A )
Matrix A2 is obtained by replacing the second column of A by the column vector d.
det ( A 2)
And y = ¿ .
det ( A )
(This method can be extended to any system of linear equations if A is a square matrix).
Example: Solve the following system of equations by Cramer’s Rule
x +2 y =−3
2 x− y=4
Solution: This can be expressed in matrix form as:
[ 12 −12 ][ xy ]=[−34 ] or AX = d
Now det(A) = -1 -4 = -5. Since det(A)≠ 0 Cramer’s rule can be applied.
A1= −3 2 and det ( A 1 )=3−8=−5
[
4 −1 ]
1 −3
A2=
2 4 [ ]
∧det ( A 2 )=4+ 6=10
det ( A 1 ) −5 det ( A 2 ) 10
By Cramer’s Rule; x= = =1; y = = =−2
det ( A ) −5 det ( A ) −5
Cramer’s rule: If AX=b is a system of n linear equations in n unknowns such that det(A)≠0,
then the system has a unique solution. This solution is
|A 1| | A2| | An|
x 1= , x 2= ,… , x n=
| A| | A| | A|
Where Aj is the matrix obtained by replacing the entries in the jth column of A by the entries in
the matrix
d1
d
[]
b= 2
⋮
dn
Example 1: Use Cramer’s rule to solve
4 x1 +5 x 2=2
11 x 1+ x 2 +2 x3 =3
x 1+ 5 x 2 +2 x3 =1
Solution:
4 5 0 2
[ ] []
A= 11 1 2 , d= 3
1 5 2 1
2 5 0 4 2 0 4 5 2
[ ] [ ] [
A1= 3 1 2 , A2= 11 3 2 , A3 = 11 1 3
1 5 2 1 1 2 1 5 1 ]
| A|=−132 ,|A 1|=−36 ,| A 2|=−24 ,|A 3|=12
Therefore
|A 1| −36 3
x 1= = =
| A| −132 11
|A 2| −24 2
x 2= = =
| A| −132 11
| A3| 12 −1
x 3= = =
| A| −132 11
Example 2: Use Cramer’s rule to solve
x 1−4 x2 + x 3=6
4 x1 −x2 +2 x 3=−1
2 x1 +2 x 2−3 x3 =−20
Solution:
1 −4 1 6
[
A= 4 −1 2 , d= −1
2 2 −3 −20 ] [ ]
6 −4 1 1 6 1 1 −4 6
[
A1= −1 −1 2 , A2= 4 −1
−20 2 −3 ] [
2 , A3= 4 −1 −1
2 −20 −3 2 2 −20 ] [ ]
| A|=−55 ,| A1|=144 ,| A2|=61 ,| A 3|=−230
Therefore
|A 1| −144 | A2| −61 | A3| −230 46
x 1= = , x 2= = , x 3= = =
| A| 55 | A| 55 | A| −55 11
Example 3: Use Cramer’s rule to solve following homogeneous system
x 1+ 2 x 3=0
−3 x 1+ 4 x 2+ 6 x3 =0
−x 1−2 x2 +3 x 3=0
Solution:
1 0 2 0
[
A= −3 4 6 , d= 0
−1 −2 3 0 ] []
0 0 2 1 0 2 1 0 0
[ ] [ ] [
A1= 0 4 6 , A2= −3 0 6 , A 3= −3 4 0
0 −2 3 −1 0 3 −1 −2 0 ]
| A|=44 ,|A 1|=0 ,| A 2|=0 ,| A 3|=0
Therefore
|A 1| 0 | A 2| 0 |A 3| 0
x 1= = =0 , x 2= = =0 , x 3= = =0
| A| 44 | A| 44 | A| 44
Thus for a homogeneous system if | A|≠ 0, then only trivial solution exists and we can find it by
Cramer’s rule.
Remark: Cramer’s rule is applicable if A is square matrix and | A|≠ 0.
Example: Solve the following system:
8x + 10z = 7y + 15
2x + 3y + 8z = 7
5y + 9 = 4x + 2z
Rearrange the system:
8x - 7y + 10z = 15
2x + 3y + 8z = 7
-4x + 5y - 2z = - 9
1. Create the matrices:
A =
Det(A) = 48 . Since det ( A ) ≠ 0 Cramer’s rule can be applied.
A1
=
Det ( A 1)=336
A2=¿
Det ( A 2)=144
A3
=
det ( A3 )=−96
det ( A 1 ) 336
x= = =7 ;
det ( A ) 48
det ( A 2 ) 144
y= = =3 ;
det ( A ) 48
det ( A 3 ) −96
z= = =−2
det ( A ) 48