 Jet Set Go! All about Aeroplanes Jet Set Go! All about Aeroplanes

# Cramer’s Rule

In linear algebra, Cramer’s rule is a specific formula used for solving a system of linear equations containing as many equations as unknowns, efficient whenever the system of equations has a unique solution. This rule is named after Gabriel Cramer (1704–1752), who published the rule for an arbitrary number of unknowns in 1750. This is the most commonly used formula for getting the solution for the given system of equations formed through matrices. The solution obtained using Cramer’s rule will be in terms of the determinants of the coefficient matrix and matrices obtained from it by replacing one column with the column vector of the right-hand sides of the equations.

## Cramer’s Rule Definition

Cramer’s rule is one of the important methods applied to solve a system of equations. In this method, the values of the variables in the system are to be calculated using the determinants of matrices. Thus, Cramer’s rule is also known as the determinant method.

## Cramer’s Rule Formula

Consider a system of linear equations with n variables x₁, x₂, x₃, …, xₙ written in the matrix form AX = B.

Here,

A = Coefficient matrix (must be a square matrix)

X = Column matrix with variables

B = Column matrix with the constants (which are on the right side of the equations)

Now, we have to find the determinants as:

D = |A|, Dx1, Dx2, Dx3,…, Dxn

Here, Dxi for i = 1, 2, 3,…, n is the same determinant as D such that the column is replaced with B.

Thus,

x1 = Dx1/D; x2 = Dx2/D; x3 = Dx3/D; ….; xn = Dxn/D {where D is not equal to 0}

Also, try: Cramer’s Rule Calculator

Let’s have a look at the formulas of Cramer’s rule for 2×2 and 3×3 matrices.

## Cramer’s Rule 2×2

Cramer’s rule for the 2×2 matrix is applied to solve the system of equations in two variables.

Let us consider two linear equations in two variables.

a1x + b1y = c1

a2x + b2y = c2

Let us write these two equations in the form of AX = B.

$$\begin{array}{l}\begin{bmatrix} a_1 & b_1\\ a_2 & b_2 \end{bmatrix}\begin{bmatrix} x\\ y \end{bmatrix}=\begin{bmatrix} c_1\\ c_2 \end{bmatrix}\end{array}$$

Here,

$$\begin{array}{l}Coefficient\ matrix =A=\begin{bmatrix} a_1 & b_1\\ a_2 & b_2 \end{bmatrix}\end{array}$$
$$\begin{array}{l}Variable\ matrix = X=\begin{bmatrix} x\\ y \end{bmatrix}\end{array}$$
$$\begin{array}{l}Constant\ matrix = B=\begin{bmatrix} c_1\\ c_2 \end{bmatrix}\end{array}$$
$$\begin{array}{l}D=|A|=\begin{vmatrix} a_1 & b_1\\ a_2 & b_2 \end{vmatrix}=a_1b_2-a_2b_1\end{array}$$

And

$$\begin{array}{l}D_x=\begin{vmatrix} c_1 & b_1\\ c_2 & b_2 \end{vmatrix}=c_1b_2-c_2b_1\end{array}$$
$$\begin{array}{l}D_y=\begin{vmatrix} a_1 & c_1\\ a_2 & c_2 \end{vmatrix}=a_1c_2-a_2c_1\end{array}$$

Therefore,

x = Dx/D

y = Dy/D

Learn: Determinant of a Matrix

### Cramer’s Rule Example – 2×2

Question:

Solve the following system of equations using Cramer’s rule:

2x – y = 5

x + y = 4

Solution:

Given,

2x – y = 5

x + y = 4

Let us write these equations in the form AX = B.

$$\begin{array}{l}\begin{bmatrix} 2 & -1\\ 1& 1 \end{bmatrix}\begin{bmatrix} x\\ y \end{bmatrix}=\begin{bmatrix} 5\\ 4 \end{bmatrix}\end{array}$$

Here,

$$\begin{array}{l}A=\begin{bmatrix} 2 & -1\\ 1& 1 \end{bmatrix}\end{array}$$
$$\begin{array}{l}X=\begin{bmatrix} x\\ y \end{bmatrix}\end{array}$$
$$\begin{array}{l}B=\begin{bmatrix} 5\\ 4 \end{bmatrix}\end{array}$$

Now,

D = |A|

$$\begin{array}{l}=\begin{vmatrix} 2 & -1\\ 1& 1 \end{vmatrix}\end{array}$$

= 2(1) – (-1)1

= 2 + 1

= 3 ≠ 0

So, the given system of equations has a unique solution.

$$\begin{array}{l}D_x=\begin{vmatrix} 5 & -1\\ 4& 1 \end{vmatrix}\end{array}$$

= 5(1) – (-1)(4)

= 5 + 4

= 9

$$\begin{array}{l}D_y=\begin{vmatrix} 2 & 5\\ 1& 4 \end{vmatrix}\end{array}$$

= 2(4) – 5(1)

= 8 – 5

= 3

Therefore,

x = Dx/D = 9/3 = 3

y = Dy/D = 3/3 = 1

## Cramer’s Rule 3×3

To find the Cramer’s rule formula for a 3×3 matrix, we need to consider the system of 3 equations with three variables.

Consider:

a1x + b1y + c1z = d1

a2x + b2y + c2z = d2

a3x + b3y + c3z = d3

Let us write these equations in the form AX = B.

$$\begin{array}{l}\begin{bmatrix} a_1 & b_1 & c_1\\ a_2& b_2 &c_2 \\ a_3& b_3 & c_3 \end{bmatrix}\begin{bmatrix} x\\ y\\ z \end{bmatrix}=\begin{bmatrix} d_1\\ d_2\\ d_3 \end{bmatrix}\end{array}$$

Now,

$$\begin{array}{l}D=|A|=\begin{vmatrix} a_1 & b_1 & c_1\\ a_2& b_2 &c_2 \\ a_3& b_3 & c_3 \end{vmatrix}\end{array}$$

And Therefore, x = Dx/D, y = Dy/D, z = Dz/D; D ≠ 0

Go through the example given below to learn how to solve Cramer’s rule for the 3×3 matrix.

### Cramer’s Rule Example – 3×3

Question:

Solve the following system of equations using Cramer’s rule:

x + y + z =6

y + 3z = 11

x + z =2y or x – 2y + z = 0

Solution:

Given,

x + y + z =6

y + 3z = 11

x + z =2y or x – 2y + z = 0

Let us write these equations in the form AX = B.

$$\begin{array}{l}\begin{bmatrix} 1 & 1 &1 \\ 0& 1 & 3\\ 1 & -2 &1 \end{bmatrix}\begin{bmatrix} x\\ y\\ z \end{bmatrix}=\begin{bmatrix} 6\\ 11\\ 0 \end{bmatrix}\end{array}$$

Now,

$$\begin{array}{l}D=|A|=\begin{vmatrix} 1 & 1 &1 \\ 0& 1 & 3\\ 1 & -2 &1 \end{vmatrix}=1(1 + 6)-1(0-3)+1(0-1) = 7+3-1 = 9\end{array}$$

D ≠ 0 so the given system of equations has a unique solution.

Also,

$$\begin{array}{l}D_x=\begin{vmatrix} 6 & 1 &1 \\ 11& 1 & 3\\ 0 & -2 &1 \end{vmatrix}=6(1+6)-1(11-0)+1(-22-0)=42-11-22=9\end{array}$$
$$\begin{array}{l}D_y=\begin{vmatrix} 1 & 6 &1 \\ 0& 11 & 3\\ 1 & 0 &1 \end{vmatrix}=1(11-0)-6(0-3)+1(0-11)=11+18-11=18\end{array}$$
$$\begin{array}{l}D_z=\begin{vmatrix} 1 & 1 &6 \\ 0& 1 & 11\\ 1 & -2 &0 \end{vmatrix}=1(0+22)-1(0-11)+6(0-1)=22+11-6=27\end{array}$$

Thus,

x = Dx/D = 9/9 = 1

y = Dy/D = 18/9 = 2

z = Dz/D = 27/9 = 3

### Cramer’s Rule Conditions

There are certain conditions to applying Cramer’s rule for solving the given system of equations. Some of them include the following:

• Cramer’s rule fails for the system of equations in which D = 0 since for finding the values of unknowns, D must be in the denominator and hence these values go undefined.
• Also, when D = 0, there will be two possibilities for which:The system may have no solution.

The system may have an infinite number of solutions.

From this, we can say that at least one of the numerator determinants is a 0 (that means infinitely many solutions) or none of the numerator determinants is 0 (that means no solution)

• If D ≠ 0, we say that the system AX = B has a unique solution.

Thus, Cramer’s rule helps us determine whether the given system has “no solution” or “infinite number of solutions”, using the determinants we calculate to apply the rule.

### Cramer’s Rule Questions

1. Solve the following system of equations by Cramer’s rule:2x – 3y + 5z = 113x + 2y – 4z = – 5

x + y – 2z = – 3

2. Solve the following system of linear equations using Cramer’s rule:5x + 7y = -24x + 6y = -3
3. The cost of 4 kg onion, 3 kg wheat and 2 kg rice is Rs 60. The cost of 2 kg onion, 4 kg wheat and 6 kg rice is Rs 90. The cost of 6 kg onion 2 kg wheat, and 3 kg rice is Rs 70. Find the cost of each item per kg by Cramer’s rule.

## Frequently Asked Questions on Cramer’s Rule

### What is Cramer’s rule in the matrix?

In matrices, Cramer’s rule is used to find the solution of a system of linear equations in n variables.

### What is Cramer’s rule also known as?

Cramer’s rule is also known as the determinant method.

### Does Cramer’s rule always work?

No, Cramer’s rule does not always work. As we know, it is applicable only when the given system of equations has a unique solution.

### What is the limitation of Cramer’s rule?

The limitations of Cramer’s rule are given below:
This rule will not give the solution for the system of equations with infinite solutions and no solution.
When D = 0, Cramer’s rule will not give the values of unknowns.
It provides the results only when D ≠ 0.

### In what condition does Cramer’s rule fail?

When the determinant of matrix A in AX = B is equal to 0, Cramer’s rule fails to provide the values of variables.