Read · 2 min

Background

We've seen previously how to solve a system of linear equations with substitution, elimination, and graphing. We've also seen how to solve nonlinear equations with substitution, elimination, and graphing. Finally, we learned how to use matrix row operations and an inverse matrix to solve systems of equations.

In this lesson, we'll take a very different approach than what we've seen before. We'll look at using a formula to solve systems of equations with matrices!

Cramer's Rule

Sometimes, it's shocking to think about just how old math is. If we go back to the 16th century, we'll meet Gabriel Cramer, who discovered this neat trick for solving systems of equations. There are a couple of important things to keep in mind before we can use Cramer's Rule, though:

  • There needs to be the same number of unique variables and equations (i.e., if there are three variables, there must be three equations)

  • The determinant cannot be zero (i.e., D≠0D\neq0) because that indicates no solution or an infinite number of solutions

If these two conditions are met, then we can use Cramer's Rule! Cramer's Rule allows us to use determinants to solve a system of equations.

Remember that the determinant of a 2x22x2 square matrix, [abcd]\begin{bmatrix} a&b \\ c&d \\ \end{bmatrix}, is:

[abcd]=ad−bc\begin{bmatrix} a&b \\ c&d \\ \end{bmatrix} = ad - bc

And the determinant of a 3x33x3 matrix, [a1b1c1a2b2c2a3b3c3]\begin{bmatrix} a_1&b_1&c_1 \\ a_2&b_2&c_2 \\ a_3&b_3&c_3 \\ \end{bmatrix}, is:

a1⋅[b2c2b3c3]−b1⋅[a2c2a3c3]+c1⋅[a2b2a3b3]a_1 \cdot \begin{bmatrix} b_2&c_2 \\ b_3&c_3 \\ \end{bmatrix} - b_1 \cdot \begin{bmatrix} a_2&c_2 \\ a_3&c_3 \\ \end{bmatrix} + c_1 \cdot \begin{bmatrix} a_2&b_2 \\ a_3&b_3 \\ \end{bmatrix}

To review how to find the determinant, you can check out this lesson.

Cramer's Rule for a 2x22x2 Matrix

Before we begin, we want to put our system of equations into an augmented matrix. Say we're given the following system of equations:

{a1x+b1y=c1a2x+b2y=c2\begin{cases} a_1x + b_1y &=c_1 \\ a_2x + b_2y &=c_2 \\ \end{cases}

This system can be represented with the following augmented matrix, which is basically a coefficient matrix:

[a1b1c1a2b2c2]\begin{bmatrix} a_1&b_1&c_1 \\ a_2&b_2&c_2 \\ \end{bmatrix}

Cramer's Rule for 2x22x2 matrices tells us that for the above matrix,

x=DxD[c1b1c2b2][a1b1a2b2]x= \frac{D_x}{D} \frac{\begin{bmatrix} c_1&b_1 \\ c_2&b_2 \\ \end{bmatrix}}{\begin{bmatrix} a_1&b_1 \\ a_2&b_2 \\ \end{bmatrix}}

and

y=DyD[a1c1a2c2][a1b1a2b2]y= \frac{D_y}{D} \frac{\begin{bmatrix} a_1&c_1 \\ a_2&c_2 \\ \end{bmatrix}}{\begin{bmatrix} a_1&b_1 \\ a_2&b_2 \\ \end{bmatrix}}

The solved values will give us the coordinates, (x,y)(x,y) for the system of equations!

Cramer's Rule for a 3x33x3 Matrix

Using Cramer's Rule for a 3x33x3 matrix is very similar! The biggest spot that students trip up is when calculating the determinant for a 3x33x3 matrix, so make sure to watch your values there.

For a given system of equations with 33 variables,

{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3\begin{cases} a_1x + b_1y + c_1z &= d_1 \\ a_2x + b_2y + c_2z &= d_2 \\ a_3x + b_3y + c_3z &= d_3 \\ \end{cases}

we can write an augmented matrix:

[a1b1c1d1a2b2c2d2a3b3c3d3]\begin{bmatrix} a_1&b_1&c_1&d_1 \\ a_2&b_2&c_2&d_2 \\ a_3&b_3&c_3&d_3 \\ \end{bmatrix}

The formulas with the determinants are going to get really messy, so I'm going to write out the determinants separate from the formulas!

D=[a1b1c1a2b2c2a3b3c3]D = \begin{bmatrix} a_1&b_1&c_1 \\ a_2&b_2&c_2 \\ a_3&b_3&c_3 \\ \end{bmatrix}

Dx=[d1b1c1d2b2c2d3b3c3]D_x = \begin{bmatrix} d_1&b_1&c_1 \\ d_2&b_2&c_2 \\ d_3&b_3&c_3 \\ \end{bmatrix}

Dy=[a1d1c1a2d2c2a3d3c3]D_y = \begin{bmatrix} a_1&d_1&c_1 \\ a_2&d_2&c_2 \\ a_3&d_3&c_3 \\ \end{bmatrix}

Dz=[a1b1d1a2b2d2a3b3d3]D_z = \begin{bmatrix} a_1&b_1&d_1 \\ a_2&b_2&d_2 \\ a_3&b_3&d_3 \\ \end{bmatrix}

Cramer's Rule for 3x33x3 matrices tells us that for the augmented matrix,

x=DxDx= \frac{D_x}{D} y=DyDy= \frac{D_y}{D} z=DzDz= \frac{D_z}{D}

The solved values will give us the coordinates, (x,y,z)(x,y,z) for the system of equations! This is how you can find the solution to a system of equations.

Video · + 1 min read

(Video) Solving Systems Using Cramer's Rule

by Professor Dave Explains

This video by Professor Dave Explains explains what Cramer's Rule is and walks through an example of how to use it.

Summary

Now that we have learned how to find the determinant, we can use the determinant to solve a system of linear equations. With Cramer's Rule, we can set up a coefficient matrix that corresponds to a system of equations, while also replacing certain columns with the constant terms in the system.

Given the following system,

a1x1+a2x2+a3x3=b1a4x1+a5x2+a6x3=b2a7x1+a8x2+a9x3=b3\begin{align} a_1x_1 + a_2x_2 + a_3x_3 &= b_1 \\ a_4x_1 + a_5x_2 + a_6x_3 &= b_2 \\ a_7x_1 + a_8x_2 + a_9x_3 &= b_3 \\ \end{align}

Cramer's rule tells us that the ithi^{th} component of the solution:

xi=∣Ai∣∣A∣x_i = \frac{|A_i|}{|A|}

, where,

A=[a1a2a3a4a5a6a7a8a9]A = \begin{bmatrix} a_1&a_2&a_3 \\ a_4&a_5&a_6 \\ a_7&a_8&a_9 \\ \end{bmatrix}

We would replace the ithi^{th} column of the matrix with the constant terms, [b1b2b3]\begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix}

For example, if we wanted to solve for x1x_1, we would replace the terms in the first column with the constant terms:

A1=[b1a2a3b2a5a6b3a8a9]A_1 = \begin{bmatrix} b_1&a_2&a_3 \\ b_2&a_5&a_6 \\ b_3&a_8&a_9 \\ \end{bmatrix}

Example

x1+3x2=52x1+2x2=6\begin{align} x_1 + 3x_2 &= 5 \\ 2x_1 + 2x_2 &= 6 \\ \end{align}

Setting up our coefficient matrix, A=[1322]A = \begin{bmatrix} 1&3 \\ 2&2 \\ \end{bmatrix}

The determinant of this matrix is: |A| = (1)(2)−(3)(2)=−4(1)(2) - (3)(2) = -4

Now, we can set up the rest of the matrices:

A1=[5362]A_1 = \begin{bmatrix} 5&3 \\ 6&2 \\ \end{bmatrix}, ∣A1∣=(5)(2)−(6)(3)=−8|A_1| = (5)(2) - (6)(3) = -8

To solve for x1x_1,

x1=∣A1∣∣A∣=−8−4=2x_1 = \frac{|A_1|}{|A|} = \frac{-8}{-4} = 2

Now, we'll solve for A2A_2. Matrix A2=[1526]A_2 = \begin{bmatrix} 1&5 \\ 2&6 \\ \end{bmatrix}. The determinant ∣A2∣=(1)(6)−(2)(5)=−4|A_2| = (1)(6) - (2)(5) = -4

To solve for x2x_2,

x2=∣A2∣∣A∣=−4−4=1x_2= \frac{|A_2|}{|A|} = \frac{-4}{-4} = 1

Our solution to the system is: x1=2x_1=2, x2=1x_2=1

Illustrated · 1 min

Cramer's Rule

We can make solving systems with matrices a lot easier by using Cramer's Rule!

Cramer's Rule

Image source: by Anusha Rahman

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems