Cramer’s Rule
Advanced Engineering Mathematics
MATH115
Systems of Linear
Equation
A system of m linear equations in n variables, or unknowns, has the
general form
The numbers 𝑏𝑚, … , 𝑏2, 𝑏1 are called the constants of the system. If
all the constants are zero, the system is said to be homogeneous;
otherwise, it is nonhomogeneous.
Systems of Linear
Equation
We can express this linear system in matrix form
𝑎11 𝑎12 𝑎1𝑛
⋯ 𝑥1 𝑏1
𝑎21 𝑎22 𝑎2𝑛
⋮ = ⋮
⋮ ⋱ ⋮
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 𝑥𝑛 𝑏𝑛
𝐴𝑥 =𝐵
Where: A is the matrix composed of the coefficient (coefficient matrix)
𝑥 column vector representing the system variables
B is the column vector of the system constants
Cramer’s Rule
Cramer's rule is an explicit formula for the solution of a system of
linear equations with as many equations as unknowns, valid
whenever the system has a unique solution.
It expresses the solution in terms of the determinants of the (square)
coefficient matrix and of matrices obtained from it by replacing one
column by the column vector of right-hand-sides of the equations.
Cramer’s Rule
For example, we consider the system of linear equation below:
𝑎1𝑥1 + 𝑎2𝑥2 + 𝑎3𝑥3 + 𝑎4𝑥4 = 𝑚1
𝑏1𝑥1 + 𝑏2𝑥2 + 𝑏3𝑥3 + 𝑏4𝑥4 = 𝑚2
𝑐1 𝑥1 + 𝑐2𝑥2 + 𝑐3𝑥3 + 𝑐4 𝑥4 = 𝑚3
𝑑1 𝑥1 + 𝑑2𝑥2 + 𝑑3𝑥3 + 𝑑4 𝑥4 = 𝑚4
Where: 𝑥1, 𝑥2, 𝑥3, 𝑥4 are the variables.
𝑎𝑖 , 𝑏𝑖 , 𝑐𝑖 , 𝑑𝑖 are the numerical coefficients of the variables.
𝑚𝑖 are the constants of the system.
𝑖 = 1,2,3,4
Cramer’s Rule
To solve the given system of linear equation, we follow these steps:
𝑥1 𝑥2 𝑥3 𝑥4
1. Create a fraction with the
coefficient matrix in the 𝑎1 𝑎2 𝑎3 𝑎4
numerator and denominator. 𝑏1 𝑏2 𝑏3 𝑏4
For the given system, 𝑐1 𝑐2 𝑐3 𝑐4
𝑑1 𝑑2 𝑑3 𝑑4
𝑎1 𝑎2 𝑎3 𝑎4
𝑏1 𝑏2 𝑏3 𝑏4
𝑐1 𝑐2 𝑐3 𝑐4
𝑑1 𝑑2 𝑑3 𝑑4
𝑥1 𝑥2 𝑥3 𝑥4
Cramer’s Rule
2. To solve for a certain variable, we eliminate coefficient column of
that variable in the numerator matrix and 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡 𝑥2 𝑥3 𝑥4
replace it with the constant column.
𝑚1 𝑎2 𝑎3 𝑎4
For example, we want to solve for the 𝑚2 𝑏2 𝑏3 𝑏4
value of 𝑥1. We will eliminate the 𝑚3 𝑐2 𝑐3 𝑐4
coefficient column of 𝑥1 in the numerator 𝑥 = 𝑚4 𝑑2 𝑑3 𝑑4
and replace it with the constant column.
1 𝑎1 𝑎2 𝑎3 𝑎4
𝑏1 𝑏2 𝑏3 𝑏4
𝑐1 𝑐2 𝑐3 𝑐4
𝑑1 𝑑2 𝑑3 𝑑4
Cramer’s Rule
For example, if we want to solve for the value of 𝑥3, we eliminate the
coefficient column of 𝑥3 in the numerator and replace it with the
constant column. 𝑥1 𝑥2 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡 𝑥4
𝑎1 𝑎2 𝑚1 𝑎4
𝑏1 𝑏2 𝑚2 𝑏4
𝑐1 𝑐2 𝑚3 𝑐4
𝑑1 𝑑2 𝑚4 𝑑4
𝑥3 = 𝑎3 𝑎4
𝑎1 𝑎2
𝑏1 𝑏2 𝑏3 𝑏4
𝑐1 𝑐2 𝑐3 𝑐4
𝑑1 𝑑2 𝑑3 𝑑4
Cramer’s Rule
3. Solve for the determinant of the numerator and denominator.
𝑚1 𝑎2 𝑎3 𝑎4 𝑎1 𝑎2 𝑚1 𝑎4
𝑚2 𝑏2 𝑏3 𝑏4 𝑏1 𝑏2 𝑚2 𝑏4
𝑚3 𝑐2 𝑐3 𝑐4 𝑐1 𝑐2 𝑚3 𝑐4
𝑚4 𝑑2 𝑑3 𝑑4 𝑑1 𝑑2 𝑚4 𝑑4
𝑥1 = 𝑥3 =
𝑎1 𝑎2 𝑎3 𝑎4 𝑎1 𝑎2 𝑎3 𝑎4
𝑏1 𝑏2 𝑏3 𝑏4 𝑏1 𝑏2 𝑏3 𝑏4
𝑐1 𝑐2 𝑐3 𝑐4 𝑐1 𝑐2 𝑐3 𝑐4
𝑑1 𝑑2 𝑑3 𝑑4 𝑑1 𝑑2 𝑑3 𝑑4
Example
Solve for 𝑥1, 𝑥2, 𝑥3 and 𝑥4 in the system of linear equation below:
Solution
𝑐𝑜𝑛𝑠 𝑐𝑜𝑛𝑠
𝑡𝑎𝑛𝑡 𝑥2 𝑥3 𝑥4 𝑥1 𝑡𝑎𝑛𝑡 𝑥3 𝑥4
3 1 1 0 2 3 1 0
4 1 1 1 3 4 1 1
3 2 2 3 1 3 2 3
16 5 −2 1 −42 4 16 −2 1 −84
𝑥1 = = =1 𝑥2 = = =2
2 1 1 0 −42 2 1 1 0 −42
3 1 1 1 3 1 1 1
1 2 2 3 1 2 2 3
4 5 −2 1 4 5 −2 1
𝑥1 𝑥2 𝑥3 𝑥4 𝑥1 𝑥2 𝑥3 𝑥4
Solution
𝑐𝑜𝑛𝑠 𝑐𝑜𝑛𝑠
𝑥1 𝑥2 𝑡𝑎𝑛𝑡 𝑥4 𝑥1 𝑥2 𝑥3 𝑡𝑎𝑛𝑡
2 1 3 0 2 1 1 3
3 1 4 1 3 1 1 4
1 2 3 3 1 2 2 3
4 5 16 1 42 4 5 −2 16 0
𝑥3 = = 𝑥
= −1 4 = = =0
2 1 1 0 −42 2 1 1 0 −42
3 1 1 1 3 1 1 1
1 2 2 3 1 2 2 3
4 5 −2 1 4 5 −2 1
𝑥1 𝑥2 𝑥3 𝑥4 𝑥1 𝑥2 𝑥3 𝑥4
Example
Solve the linear system below using Cramer’s Rule
𝑥 + 3𝑦 − 2𝑧 = −7
4𝑥 + 𝑦 + 3𝑧 = 5
2𝑥 − 5𝑦 + 7𝑧 = 19
Solution
𝑥 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡 𝑧 𝑥 𝑦 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡
𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡 𝑦 𝑧
−7 3 −2 1 −7 −2 1 3 −7
5 1 3 4 5 3 4 1 5
7 =0 2 19 7 0 2 −5 19 = 0
𝑥 = 19 −5 𝑦=
1 3 −2
=
0
𝑧=
1 3 −2 0
1 3 −2 0
4 1 3 4 1 3 4 1 3
2 −5 7 2 −5 7 2 −5 7
𝑥 𝑦 𝑧 𝑥 𝑦 𝑧
𝑥 𝑦 𝑧
If the each variable results to an undefined (0/0) value,
therefore, the system has no solution.
Example
Find solution to the linear system below:
𝑥1 − 𝑥2 + 𝑥3 − 𝑥4 = 2
𝑥1 + 𝑥2 + 𝑥3 − 3𝑥4 = 2
𝑥1 + 2𝑥2 − 𝑥3 + 2𝑥4 = 4
2𝑥1 − 𝑥2 + 𝑥3 − 2𝑥4 = 3
Solution
Solving for 𝑥1
2 −1 1 −1
2 1 −3 2 −1 −1 2 −1 −1 2 −1 −1
2 1 1 −3 = 4 2 2 − 4 2 2 + −1 2 1 −3 − 2 1 −3
4 2 −1 2
3 −1 −2 3 −1 −2 3 −1 −2 4 2 2
2 −1 1 −1 3 −1 1 −2
2 1 1 −3 2 −1 1 −1
4 2 −1 2 2 1 1 −3 = 40 − −8 − 0 − 32 = 16
3 −1 1 −2 16 4 2 −1 2
𝑥1 = = =2 3 −1 1 −2
1 −1 1 −1 8
1 1 1 −3
1 2 −1 2 1 −1 1 −1
1 1 −3 1 −1 −1 1 −1 −1 1 −1 −1
2 −1 1 −2 1 1 1 −3 =
1 2 2 − 1 2 2 + −1 1 1 −3 − 1 1 −3
1 2 −1 2
2 −1 −2 2 −1 −2 2 −1 −2 1 2 2
2 −1 1 −2
2 −1 1 −1
2 1 1 −3 = 19 − −3 − 2 − 12 = 8
4 2 −1 2
3 −1 1 −2
Solution
Solving for 𝑥2
1 2 1 −1 1 2 −3 1 2 −1 1 2 −1 1 2 −1
1 2 1 −3 = 1 4 2 − 1 4 2 + −1 1 2 −3 − 1 2 −3
1 4 −1 2
2 3 −2 2 3 −2 2 3 −2 1 4 2
1 2 1 −1 2 3 1 −2
1 2 1 −3 1 2 1 −1
1 4 −1 2 1 2 1 −3 = 13 − 3 − (−2) − 4 = 8
2 3 1 −2 8 1 4 −1 2
𝑥2 = = =1 2 3 1 −2
1 −1 1 −1 8
1 1 1 −3
1 2 −1 2
2 −1 1 −2
Solution
Solving for 𝑥3
1 −1 2 −1
1 2 −3 1 2 −3 1 1 −3 1 1 2
1 1 2 −3 =
2 4 2 − (−1) 1 4 2 + 2 1 2 2 − (−1) 1 2 4
1 2 4 2
−1 3 −2 2 3 −2 2 −1 −2 2 −1 3
1 −1 2 −1 2 −1 3 −2
1 1 2 −3 1 −1 2 −1
1 2 4 2 1 1 2 −3
16 = −40 + 13 + 2 19 + 5 = 16
2 −1 3 −2 1 2 4 2
𝑥3 = = =2 2 −1 3 −2
1 −1 1 −1 8
1 1 1 −3
1 2 −1 2
2 −1 1 −2
Solution
Solving for 𝑥4
1 −1 1 2
1 1 2 1 −1 2 1 −1 2 1 −1 2
1 1 1 2 = 1 2 4 − 1 2 4 + −1 1 1 2 − 1 1 2
1 2 −1 4
2 −1 3 2 −1 3 2 −1 3 1 2 4
1 −1 1 2 2 −1 1 3
1 1 1 2 1 −1 1 2
1 2 −1 4 1 1 1 2 = 5 − −5 − −2 − 4 = 8
2 −1 1 3 8 1 2 −1 4
𝑥4 = = =1 2 −1 1 3
1 −1 1 −1 8
1 1 1 −3
1 2 −1 2
2 −1 1 −2
Answer:
𝑥1 = 2, 𝑥2 = 1, 𝑥3 = 2, 𝑥4 = 1
END