Cramer's Rule Calculator
Welcome to the Cramer's rule calculator, a quick and easy 2- and 3-variable system of equations solver. Together, we'll learn how to construct a coefficient matrix and then try using those matrices to solve systems of equations. You might have already seen one or two different ways to tackle similar mathematical problems. However, we're here to convince you that Cramer's rule for 3x3 matrices is almost as easy as Cramer's rule for 2x2 matrices (which is super easy)!
So, would you like to learn how to solve systems of equations with a matrix or two, without any substitution, elimination, or drawing graphs - just simple arithmetics?
What is a system of equations?
You know how not everything in life is known, or easy to describe? Like how fast does the universe expand, how much can you save on Black Friday, or how many apples did Mr. Smith buy if he paid $3.50 and one costs $0.50? You know, the essential questions in life.
Whenever we don't know some number explicitly, but we can describe it in relation to some other numbers, we obtain an equation. Mathematically speaking, it's a symbolic description of an equality that our value must satisfy. For example, we can write the third question as follows:
The is the value that we don't know and would like to find. Usually, we call such a thing a variable and denote it by a single letter, say, . The equation above then looks like this:
That's a pretty simple one, and we can easily calculate that Mr. Smith bought seven apples. However, life is not always that easy. Not only can Mr. Smith buy more apples, but he can also, for example, give a tip to the shopkeeper. We would then have to include that in the equation we construct, which would make it a little more complicated. But what if Mr. Smith wants to buy some oranges as well?
If a new value enters the picture and we don't know it either, we must introduce it as a new variable, say . When we describe our two variable question, what we get is still an equation, however, in general, they become more difficult to calculate.
Nevertheless, if we have more information, the problem looks much more promising. For instance, if on one occasion Mr. Smith bought 7 apples and 3 oranges and paid $5.60, and on another he bought 1 apple and 5 oranges, and paid $4.00, then this is enough information to calculate how much an apple and an orange cost. This is because we can write two equations (one for each shopping) with two variables. We call such a thing a system of equations.
To sum up, in general, a system of equations is a number of equations with a few variables, and we want to find numbers that satisfy all of these equations. We will now describe how to solve such a system of equations with a matrix.
How about checking out our matrix multiplication calculator to learn about an interesting concept on matrices.
Using matrices to solve systems of equations
Let's look at a traveling-themed problem:
At first, it may not look like a system of equations, but in fact, it is just that. After all, the 's and 's we used in the section above are just examples of how we can denote a variable; there is no reason why we can't use bikes instead.
However, for simplicity of notation, and for the sake of our 3-variable system of equations solver, let's switch to the boring mathematical notation, and say that will denote the bike, the car, and the plane. Then we can write the above system as
We have three equations and three variables, so our end-goal is to use Cramer's rule for 3x3 matrices (the first 3 denote the number of equations, the second the number of variables). To do this, we first need to construct an array of numbers, which we'll call the coefficient matrix.
Before that, however, we have to work a little to make our system more like the one we see in our Cramer's rule calculator. Note that we can simplify the two last equations, i.e., add together the same variables in each line. For example, in the bottom equation, we have , which we can write as (one copy of plus one copy of equals two copies of ). All in all, we obtain
Now we're ready to form the coefficient matrix. It will be an array with three rows (because we have three equations) and three columns (because we have three coefficients). The first column will correspond to the variable , the second to , and the third to . Here, by "correspond," we mean that it will contain the coefficients of that variable in consecutive equations (hence the name coefficient matrix). Note, that we don't have all the variables in all the lines. For example, the second equation doesn't have the variable. Fortunately, this simply means that the coefficient of in that line is, in fact, zero.
To sum up, the number in row and column in the coefficient matrix contains the number next to -th coefficient (the first being , the second , and the third ) in the -th equation. In our case, it will look as follows:
Quite often, it is useful to define the so-called augmented coefficient matrix. It is the same thing with an additional column to the right, with the right-hand side numbers of the equalities of our system. Usually, it is separated from the others by a dashed line. In our case, it looks like this:
Let's not waste a minute more and start using these matrices to solve systems of equations using Cramer's rule for 3x3 systems.
Cramer's rule for 2x2 and 3x3 systems
Most of the ways of dealing with systems of equations is to change the system itself a lot - reducing its rows, substituting one value for another, and so on. It tends to get messy in more complicated examples. Cramer's rule is a way to hide all of that with a few simple arithmetic operations on the coefficient matrix, namely calculating a few determinants.
The determinant of a square matrix is a number that we get from multiplying and adding some of the cells of the matrix. Since our Cramer's rule calculator is a 2- and 3-variable system of equations solver, we'll focus on the formulas for when we have two equations with two variables and three equations with three variables.
then the determinant of , denoted or , is
then the determinant of is
Now denote the coefficient matrix of our system by (note that it is a 2x2 matrix when we have two equations and two variables, and 3x3 when we have three equations and three variables). We will now define some additional matrices, , , and , that will correspond to each variable of our system ( exists only when we have in the equations).
You may want to try out our eigenvalue and eigenvector calculator.
Recall the augmented coefficient matrix from the section above. It had an additional column with the numbers on the right hand side of the sign in the system. We define the matrices corresponding to variables to be the initial coefficient matrix with the column of the variable in question swapped for the extra, right hand side column. For instance, the matrix will have the same first two columns (corresponding to and ) as , while its third column will be the additional one from the augmented coefficient matrix.
The Cramer's rule for 2x2 systems states that the system's solution is given by
and the Cramer's rule for 3x3 systems adds to that a third variable:
Note, that when we use these formulas to solve a system of equations, each matrix mentioned above is 2x2 in size when we have two equations and two variables, and 3x3 in size when we have three equations and three variables.
Things to remember:
- Using matrices to solve systems of equations with Cramer's rule allows us to find the answer by simply following a few predetermined calculations. There is almost no thinking here, only multiplication, addition, and division;
- We can use the above description as a step-by-step 2- and 3-variable system of equations solver. However, Cramer's rule still applies to larger matrices, although the calculations can get a little messy. In particular, the determinant gets pretty ugly. The number of summands in the formula is equal to the number of permutations. This means that for four equations with four variables, it has 24, and for five, it has 120 summands;
- The determinant of a matrix can be zero. If it's the matrix, then we have a problem: we cannot divide by zero! This can mean two things: either we have no solutions, or we have infinitely many of them. The first case is when at least one of the variable matrices is non-zero, and the latter when all of them are zero (together with );
- Our Cramer's rule calculator will tell you if we're dealing with one of the two special cases we've mentioned above. Even better, if there are infinitely many solutions, it will also describe the form of the pairs/triples that satisfy the system; and
- Try to get a decent amount of sleep every day. It's always good to remember that.
Example: using the Cramer's rule calculator
Recall the traveling-based example from section two and the system of equations that we got from it after simplifying each line:
Let's also remind ourselves of the augmented coefficient matrix:
Before we move on to construct the four matrices used in Cramer's rule for 3x3 systems, let's take some time to describe how we can input the data into the Cramer's rule calculator.
We have three equations to deal with, so let's tell the calculator that by choosing the right option in the "Number of equations" field. This will turn our tool into a 3-variable system of equations solver and show us a picture of what such a system looks like, with a few mysterious symbols, like or . These denote the coefficients of our system, i.e., the numbers that stand to the left of the variables in each line and the numbers to the right of the sign.
This notation is listed in the calculator, where you can input the values from the problem that you want to solve. The 's correspond to the numbers next to 's, the 's to 's, the 's to 's, the 's are the numbers on the right, and the indices tell us the number of the row. Note that our Cramer's rule calculator accepts only linear equations. This means that we cannot, for example, have a quadratic one, or an expression with a variable under a square root.
Observe that those coefficients are also in our augmented coefficient matrix. In fact, it is enough to copy them into the Cramer's rule calculator. For example, the first row of the matrix has numbers , , , and . It corresponds to the first equation, which has coefficients denoted with the subscript . Therefore, we have:
, , , .
Similarly, the other two rows give us:
, , , ; and
, , , .
Once you get all that data into the Cramer's rule calculator, it should spit out the values of the four determinants, followed by the solution to the system. Let's look how it figured that out.
As we've mentioned in the section above, Cramer's rule for 2x2 and 3x3 systems means that we have to calculate the determinants of a few matrices. The first one, the so-called main one, is simply the coefficient matrix that we've defined in section two:
To construct the other three, we'll need to exchange one column of this matrix with the fourth extra column of the augmented coefficient matrix, which in our case has numbers , , and . To get , the matrix, we put those numbers instead of the column corresponding to the variable, namely the first one:
Similarly, we get
All we need to do is use the determinant formula from the section above for all four of the matrices:
Lastly, we use Cramer's rule for 3x3 systems and obtain the solution:
Going back to the problem we started with, this means that the bike is equal to , the car is equal to , and the plane is equal to .
We have a tool called reduced row echelon form calculator, where we solve a system of equations of your choice using the matrix row reduction and elementary row operations.