Cramer’s Rule for a 2×2 System (with Two Variables)
Cramer’s Rule is another method that can solve systems of linear equations using determinants.
In terms of notations, a matrix is an array of numbers enclosed by square brackets while a determinant is an array of numbers enclosed by two vertical bars.
Notations
![square brackets indicate a matrix, for example [a,b;c,d]](https://www.chilimath.com/wp-content/uploads/2022/03/square-brackets-as-determinants.png)

The formula to find the determinant of a 2 x 2 matrix is very straightforward.
Let’s have a quick review:
The Determinant of a 2 x 2 Matrix
![Let matrix A has entries a and b on the first row, and c and d on the second row which can be expressed as A = [a,b;c,d]. Then, the determinant of matrix A is |A| = determinant of [a,b;c,d] = |a,b;c,d| = a*d-b*c.](https://www.chilimath.com/wp-content/uploads/2022/03/formula-of-determinant-of-2-by-2-matrix.png)
Quick Examples of How to Find the Determinants of a 2 x 2 Matrix
Example 1: Find the determinant of the matrix [latex]A[/latex] below.
![Matrix A is a 2x2 square matrix with elements 1 and 2 on its first row, and elements 3 and 4 on its second row. Alternatively, we can write matrix A as A = [1,2;3,4].](https://www.chilimath.com/wp-content/uploads/2017/02/2x2mat5.gif)
![The determinant of matrix A which can be written as det [1,2;3,4] = |A| = |1,2;3,4| = (1)(4) - (2)(3) = 4-6 = -2. Therefore, the determinant of matrix A is negative 2.](https://www.chilimath.com/wp-content/uploads/2017/02/detA.gif)
Example 2: Find the determinant of the matrix [latex]B[/latex] below.
![Matrix B is a 2 by 2 square matrix with entries 5 and -1 on the first row, and entries 2 and -3 on the second row. This matrix can be expressed as B=[5,-1;2,-3].](https://www.chilimath.com/wp-content/uploads/2017/02/2x2mat6.gif)
![The determinant of matrix B which can be written as det [5,-1;2,-3] = |B| = |5,-1;2,-3| = (5)(-3) - (-1)(2) = -15-(-2) = -15 + 2 = -13. That makes the determinant of matrix B as negative 13.](https://www.chilimath.com/wp-content/uploads/2017/02/detB.gif)
Example 3: Find the determinant of the matrix [latex]C[/latex] below.
![Matrix C is a square matrix having two rows and two columns. The elements on the first row are -1 and 3 while the elements on the second row are -7 and -9. Thus, matrix C = [-1,3;-7,-9].](https://www.chilimath.com/wp-content/uploads/2017/02/xmat8.gif)
![The determinant of matrix C which can be written as det [-1,3;-7,-9] = |C| = |-1,3;-7,-9| = (-1)(-9) - (3)(-7) = 9+21 = -15 + 2 = 30. Thus, the determinant of matrix C is positive 30.](https://www.chilimath.com/wp-content/uploads/2017/02/detC.gif)
After knowing how to find the determinant of a 2 x 2 matrix, you’re now ready to learn the procedures or steps on how to use Cramer’s Rule. Here we go!
Cramer’s Rules for Systems of Linear Equations with Two Variables
- Given a linear system

- Assign names for each matrix
coefficient matrix:
![Matrix D is also known as the "coefficient matrix" with entries a1 and b1 on the first row, and entries a2 and b2 on the second row. We can write this as coefficient matrix D = [a1,b1;a2,b2].](https://www.chilimath.com/wp-content/uploads/2017/02/coefmat.gif)
X – matrix:
![Matrix Dx (read as "D subscript x") is also known as the "x-matrix" with elements c1 and b1 on the first row, and elements c1 and b2 on the second row. This can be written as, x-matrix, Dx = [c1,b1;c2,b2].](https://www.chilimath.com/wp-content/uploads/2017/02/xmat.gif)
Y – matrix:
![Matrix Dy (read as "D subscript y") is also known as the "y-matrix" with elements a1 and c1 on the first row, and elements a2 and c2 on the second row. This can be written as, y-matrix, Dy = [a1,c1;a2,c2].](https://www.chilimath.com/wp-content/uploads/2017/02/ymat.gif)
To solve for the variable x:

To solve for the variable y:

Few points to consider when looking at the formula:
1) The columns of [latex]\large{x}[/latex], [latex]\large{y}[/latex], and the constant terms [latex]\large{c}[/latex] are obtained as follows:

2) Both denominators in solving [latex]\large{x}[/latex] and [latex]\large{y}[/latex] are the same. They come from the columns of [latex]\large{x}[/latex] and [latex]\large{y}[/latex].
![D = [a1, a2; b1 b2]](https://www.chilimath.com/wp-content/uploads/2020/01/D-matrix.gif)
3) Looking at the numerator in solving for [latex]\large{x}[/latex], the coefficients of [latex]\large{x}[/latex]-column are replaced by the constant column (in red).
![Dx=[c1, c2; b1, b2]](https://www.chilimath.com/wp-content/uploads/2020/01/D-sub-x-matrix.gif)
4) In the same manner, to solve for [latex]\large{y}[/latex], the coefficients of [latex]\large{y}[/latex]-column are replaced by the constant column (in red).
![Dy=[a1, a2; c1, c2]](https://www.chilimath.com/wp-content/uploads/2020/01/D-sub-y-matrix.gif)
Examples of How to Solve Systems of Linear Equations with Two Variables using Cramer’s Rule
Example 1: Solve the system with two variables by Cramer’s Rule

Start by extracting the three relevant matrices: coefficient, [latex]\large{x}[/latex], and [latex]\large{y}[/latex]. Then solve each corresponding determinant.
- For coefficient matrix
![Solve for the determinant of the coefficient matrix D with elements 4 and -3 on the first row, and elements 6 and 5 on the second row. The determinant of matrix D = [4,-3;6,5] = |D| = |4,-3;6,5| = (4)(5) - (-3)(6) = 20 - (-18) = 20 + 18 = 38.](https://www.chilimath.com/wp-content/uploads/2017/02/ex1_cmat.gif)
- For X – matrix
![Solve for the determinant of the x-matrix D subscript x with elements 11 and -3 on the first row, and elements 7 and 5 on the second row. The determinant of matrix Dx = [11,-3;7,5] = |Dx| = |11,-3;7,5| = (11)(5) - (-3)(7) = 55 - (-21) = 55 + 21 = 76.](https://www.chilimath.com/wp-content/uploads/2017/02/ex1_xmat.gif)
- For Y – matrix
![Solve for the determinant of the y-matrix D subscript y with elements 4 and 11 on the first row, and elements 6 and 7 on the second row. The determinant of matrix Dy = [4,11;6,7] = |Dx| = |4,11;6,7| = (4)(7) - (11)(6) = 28 - (66) = -38.](https://www.chilimath.com/wp-content/uploads/2017/02/ex1_ymat.gif)
Once all three determinants are calculated, it’s time to solve for the values of [latex]\large{x}[/latex] and [latex]\large{y}[/latex] using the formula above.

I can write the final answer as [latex]\large{\left( {x,y} \right) = \left( {2, – 1} \right)}[/latex].
Example 2: Solve the system with two variables by Cramer’s Rule

Setup your coefficient, [latex]\large{x}[/latex], and [latex]\large{y}[/latex] matrices from the given system of linear equations. Then calculate their determinants accordingly.
Remember that we always subtract the products of the diagonal entries.
- For the coefficient matrix (use the coefficients of both [latex]x[/latex] and [latex]y[/latex] variables)
![Solve the determinant of the coefficient matrix D with entries 3 and 5 on the first row, and entries 1 and 4 on the second row. The determinant of matrix D = [3,5;1,4] = |D| = |3,5;1,4| = (3)(4) - (5)(1) = 12 - (5) = 12 - 5 = 7.](https://www.chilimath.com/wp-content/uploads/2017/02/ex2_cmat.gif)
- For the X – matrix (replace the x-column by the constant column)
![Solve the determinant of x-matrix, also known as D subscript x, with entries -7 and 5 on the first row, and entries -14 and 4 on the second row. The determinant of matrix Dx = [-7,5;-14,4] = |D| = |-7,5;-14,4| = (-7)(4) - (5)(-14) = -28 - (-70) = -28 + 70 = 42.](https://www.chilimath.com/wp-content/uploads/2017/02/ex2_xmat.gif)
- For the Y – matrix (replace the y-column by the constant column)
![Solve the determinant of y-matrix, also known as D subscript y, with entries 3 and -7 on the first row, and entries 1 and -14 on the second row. The determinant of matrix Dy = [3,-7;1,-14] = |D| = |3,-7;1,-14| = (3)(-14) - (-7)(1) = -42 - (-7) = -42 + 7 = -35.](https://www.chilimath.com/wp-content/uploads/2017/02/ex2_ymat.gif)
I hope you’re getting comfortable computing for the determinant of a 2-dimensional matrix. To finally solve the required variables, I get the following results.

Writing the final answer in point notation, I got [latex]\large{\left( {x,y} \right) = \left( {6, – 5} \right)}[/latex].
Example 3: Solve the system with two variables by Cramer’s Rule

This problem can actually be solved quite easily by the Elimination Method. This is because the coefficients of variable x are the “same” but only opposite in signs ( +1 and −1 ). To solve this using the elimination method, you add their corresponding columns and the x-variable goes away – leaving you with a one-step equation in [latex]\large{y}[/latex]. I am mentioning this because every technique has shortcomings and it is best to pick the most efficient. Always get clarification from your teacher if it is okay to use another approach when the method is not specified on a given problem.
Anyway, since we are learning how to solve by Cramer’s Rule, let’s go ahead and work it out with this method.
I will construct three matrices ( coefficient, [latex]\large{x}[/latex] and [latex]\large{y}[/latex]) and evaluate their corresponding determinants.
- For coefficient matrix
![For the coefficient matrix D = [1,-4;-1,5], its determinant is solved as follows: |D| = |1,-4;-1,5| = (1)(5) - (-4)(-1) = 5 - (4) = 1. Thus, |D| = 1.](https://www.chilimath.com/wp-content/uploads/2017/02/ex3_cmat.gif)
- For X – matrix ( written as uppercase D with subscript x )
![For the x-matrix Dx = [-9,-4;11,5], its determinant is solved as follows: |Dx| = |-9,-4;11,5| = (-9)(5) - (-4)(11) = -45 - (-44) = -45 + 44 = -1. Thus, |Dx| = -1.](https://www.chilimath.com/wp-content/uploads/2017/02/ex3_xmat.gif)
- For Y – matrix (written as uppercase D with subscript y)
![For the y-matrix Dy = [1,-9;-1,11], its determinant is solved as follows: |Dy| = |1,-9;-1,11| = (1)(11) - (-9)(-1) = 11 - (9) = 11 - 9 = 2. Thus, |Dy| = 2.](https://www.chilimath.com/wp-content/uploads/2017/02/ex3_ymat.gif)
After obtaining the values of the three required determinants, I will calculate [latex]\large{x}[/latex] and [latex]\large{y}[/latex] as follows.

The final answer in the point form is [latex]\large{\left( {x,y} \right) = \left( { – 1,2} \right)}[/latex] .
Example 4: Solve by Cramer’s Rule the system with two variables

Since we have gone over a few examples already, I suggest that you try this problem on your own. Then, compare your answers to the solution below.
If you get it right the first time that means you’re becoming a “pro” with regards to Cramer’s Rule. If you didn’t, try to figure out what went wrong and learn to not commit the same error next time. This is how you become better at math. Study many kinds of problems and more importantly, do a lot of independent practice.
- For coefficient matrix
![Solve for the coefficient matrix D, we have D = [-2,3;3,-4], the steps to solve its determinant is |D| = |-2,3;3,-4| = (-2)(-4) - (3)(3) = 8 - (9) = -1. And so, |D| = -1.](https://www.chilimath.com/wp-content/uploads/2017/02/ex4_cmat.gif)
- For X – matrix
![Solve for the x-matrix Dx, we have Dx= [-3,3;5,-4], the steps to solve its determinant is |Dx| = |-3,3;5,-4| = (-3)(-4) - (3)(5) = 12 - (15) = -3. And so, |Dx| = -3.](https://www.chilimath.com/wp-content/uploads/2017/02/ex4_xmat.gif)
- For Y – matrix
![Solve for the y-matrix Dy, we have Dy = [-2,-3;3,5], the steps to solve its determinant is |Dy| = |-2,-3;3,5| = (-2)(5) - (-3)(3) = -10 - (-9) = -10 + 9 = -1. That makes, |Dy| = -1.](https://www.chilimath.com/wp-content/uploads/2017/02/ex4_ymat.gif)
You should get the answer below…

Example 5: Solve the system with two variables by Cramer’s Rule

For our last example, I included a zero in the constant column. Every time you see the number zero in the constant column, I highly recommend using Cramer’s Rule to solve the system of linear equations. Why? Because the calculation of the determinants for [latex]\large{x}[/latex] and [latex]\large{y}[/latex] matrices drastically become super easy. Check it out yourself!
- For coefficient matrix
![The determinant of the coefficient D = [5,1;3,-2] is solved as |D| = |5,1;3,-2| = (5)(-2) - (1)(3) = -13.](https://www.chilimath.com/wp-content/uploads/2017/02/ex5_cmat.gif)
- For X – matrix
![The determinant of the x-matrix Dx = [-13,1;0,-2] is solved as |Dx| = |-13,1;0,-2| = (-13)(-2) - (1)(0) = 26.](https://www.chilimath.com/wp-content/uploads/2017/02/ex5_xmat.gif)
- For Y – matrix
![The determinant of the y-matrix Dy = [5,-13;3,0] is solved as |Dy| = |5,-13;3,0| = (5)(0) - (-13)(3) = 0 + 39 = 39.](https://www.chilimath.com/wp-content/uploads/2017/02/ex5_ymat.gif)
The final solution to this problem is

You may also be interested in these related math lessons or tutorials: