In this explainer, we will learn how to find the general solution of a system of linear equations whether it has a unique solution, an infinite number of solutions, or no solution.
When working with a system of linear equations, there are 3 possible categories of solution that are possible to find. The most familiar case will be a system of linear equations which has a unique solution. Take, for example, the system of linear equations
Solving this system of linear equations using any method will give and . Given that both of the variables and have only one possible value, we would say that the solution is unique.
Suppose that we instead have the system of linear equations
In this instance we can see that the bottom equation is essentially just a copy of the first equation, with every term multiplied by . In fact, we can multiply each term in the left-hand side by without changing the solution and the system would become
The first and second equations are identical, which means that there is no benefit of writing them both out. We lose no information by writing the system of linear equations more concisely as
This shows that, unlike the previous example where we had a unique solution, it is now possible for and to take infinitely many values whilst still solving the original system of linear equations. If we were to solve the above equation for , then we would find . If we picked the example value of , then we would find and we could check that this pair of values do actually solve the original system. Equally, we would pick , which would give . It is also the case that this pair of values solve the original system of equations.
Given that we can pick any value of and find a corresponding value of from the equation , we therefore have infinitely many possible solutions. It is this type of solution that we will discuss in this explainer.
For completion, we will briefly mention the final possible solution type. We consider the system of linear equations
We can see that the second equation is very similar to the first equation. We multiply all terms in the second equation by , giving
Now we have a rather curious pair of equations, which have the same left-hand sides but which have different right-hand sides. Reading the two equations above, we have to find values of and that when combined together in exactly the same way, somehow give different outputs. This is patently ludicrous and is not possible to achieve, meaning that the given system of linear equations does not have a solution. We would say that the system is inconsistent or insoluble. Naturally enough, we are not generally interested in these types of systems of linear equations.
The method and difficulty for solving a system of equations with an infinite number of solutions are not notably different to the situation where there is a unique solution. The method is largely the same and does not require advanced knowledge of the solution type, relying on the Gauss–Jordan elimination method for completing the calculations. It is only partway through the calculations, when the solution type has been identified, that the method’s approach begins to deviate. No matter what the solution type of a system of linear equations is, we may always find it by using the same approach to grouping together the coefficients of this system into a particular matrix, which we then manipulate with row operations to find the solution.
Definition: Augmented Coefficient Matrix
Consider a general system of linear equations in the variables and the coefficients :
Then the system of linear equations is also described by the matrix equation
The augmented coefficient matrix of the system is
Suppose that we wished to solve the system of linear equations defined as
By this point it is already apparent that the second equation is the same as the first equation, except for every term being multiplied by 5. We can reasonably anticipate that there will be an infinite number of solutions, but we will initially proceed with no such assumptions. The augmented coefficient matrix of this system of equations is
The second row is a copy of the first row after every entry has been multiplied by 5. The reason for writing the system of linear equations in this form is that it is easier to then manipulate the matrix into the form that represents the solution of the system. This can be understood by the following theorem.
Theorem: Augmented Coefficient Matrix and Reduced Echelon Form
If a system of linear equations has the augmented coefficient matrix then the solution to the system of equations is encoded by the reduced echelon form of this matrix.
We will demonstrate this theorem using the system of linear equations the we had above: which has the augmented coefficient matrix
We have highlighted the pivots in the row above because we will use these as a reference to begin the process of putting the matrix in reduced echelon form. For every pivot, we need to ensure that all other entries in the same column have a value of zero. This means that we can choose to remove the pivot in the first row or the pivot in the second row. It makes most sense to keep the pivot in the top row, so we use the elementary row operation to transform the matrix to
This matrix is now in reduced echelon form and, by the theorem above, it tells us the solution to the original system of linear equations. We could choose to write the solution out in the form , as we did above, but this convention will not be sufficient when we move onto systems of linear equations which have more than two variables, so we choose to write the solution in a particular format that will be useful to us later.
When expressing the solution of a system of linear equations, it is helpful to identify all variables that correspond to a pivot in the reduced echelon form of the matrix and then solve every outputted equation for these variables. In our case we only have one pivot variable, , which we express in terms of the nonpivot variable as
Although it may seem trivial, we then write the nonpivot variables in terms of themselves:
Aligning these two equations gives
Although it may appear highly convoluted, this is an entirely adequate statement of the solution to the original system of equations. We can actually go further and group the terms in vector form as
It is generally considered a better practice to write any variables on the right-hand side as an independent parameter, so we instead write the solution as
Now that we have all of the tools that we need to solve any system of linear equations which has infinitely many solutions, we will apply the techniques to a series of questions which involve larger augmented coefficient matrices.
Example 1: A System of Linear Equations with 3 Variables and 3 Equations
Find a general solution to the linear system
We first create the augmented coefficient matrix of the given system of linear equations:
We will use elementary row operations to reduce the matrix to reduced echelon form, thereby giving the solution to the original system of equations. To help with this, we first highlight the pivots of each row, which are the first nonzero entries:
It will be easier to reach reduced echelon form if we can keep a value of 1 in the top-left entry, so we first perform the row swap , giving
We need to remove any nonzero entry that is above or below the pivot in the first row. There is only one such entry, which is the pivot in the second row. This can be eliminated with the row operation , which produces the matrix
Whenever feasible, it is generally wisest to remove constant factors from entire rows if we can do this without introducing fractions into our calculations. In the matrix, every entry in the second row is divisible by 2, so we scale this row using the operation , which gives the simpler matrix
Now we must remove the nonzero entry that is below the pivot in the second row with the row operation . This gives the matrix which now has a zero row in the third row, meaning that there will be infinitely many solutions to the system, provided that it is not inconsistent. To remove the nonzero entry above the pivot in the second row, we perform , which gives the reduced echelon form
Now we effectively have the solution to the original system of linear equations. Note that the variables corresponding to the pivots are and , and the variable that does not correspond to any pivots is . We write out the matrix in terms of the original variables, not including the zero row:
Solving both of these equations for the pivot variables gives
We also have the nonpivot variable . Writing these 3 equations together gives
We could have equivalently expressed this solution in the form where is an independent parameter.
Example 2: A System of Linear Equations with 3 Variables and 3 Equations
Find a general solution to the linear system
We first create the augmented coefficient matrix of the system of linear equations, highlighting the pivot entries:
We will need to put this matrix in reduced echelon form. To place a 1 in the top-left entry, we first swap rows :
We cannot put the matrix in reduced echelon form if there are any pivots below the pivot in the top row, so we must remove the pivot that currently appears in the second row. The elementary row operation will achieve this:
It will be helpful if the pivot in the second row is made equal to 1, which in this case can be achieved without introducing fractions into the row, by using the row operation to give
Now it is clear that the third row is just a copy of the second row, except for a sign change in every entry. We can therefore eliminate the entire third row with the row operation :
Reduced echelon form is then achieved with the final row operation :
The variables and refer to the two columns which contain pivots and the variable does not. Writing out the corresponding equations and solving both for the pivot variables gives
Combining this with the nonpivot variable gives
This is the full solution and we also choose to write it in matrix form as
All of the techniques practiced above can be used immediately with a larger system of linear equations. As long as we are proficient with row operations and have a full understanding of reduced echelon form, the method is little different to either of the previous examples that we practiced. In the following example, we will show how exactly the same method can be applied to find the solution of a larger system of equations.
Example 3: A System of Linear Equations with 4 Variables and 4 Equations
Find a general solution to the linear system
We create the augmented coefficient matrix and highlight the pivot entries:
We need to remove all of the nonzero entries below the pivot in the first row. We can do this with the three elementary row operations , , and . The resulting matrix is
Given that the third row is a copy of the second row, we can remove the whole row with the operation . This gives a matrix where the third row is a zero row: which we move to the bottom of the matrix with the row swap operation , giving
The bottom two pivot variables can be scaled to give a value of 1, which is generally more convenient to work with, by the row operations and . This gives
Now we need to remove the pivot entry in the third row because this is directly below the pivot in the second row. The row operation achieves this:
In the penultimate step, we scale the pivot entry in the third row with , which gives and allows us to remove the remaining nonzero entry above the pivot in the third row, with the the row operation :
The matrix is now in reduced echelon form, with the pivots corresponding to the variables , , and . The remaining variable is represented by the fourth column, which does not contain any pivots. Writing out the corresponding equations gives
We now solve the three equations for the pivot variables, giving
Considering the nonpivot variable , the full solution is
Written in vector form, we have
Although it was not strictly necessary, we chose to represent the above solutions in a very particular form, in terms of vectors and also in terms of some arbitrary parameter(s). The reasons for this are not entirely superficial, as it is often helpful to have a solution to a system of linear equations that is written in this vector form, encoding the key information that defines the associated vector space. Unlike a solution that is written in terms of equations, it is much easier to understand the key components of a vector space when they are presented in vector form.
So far in this explainer we have not discussed how we would write the solution in terms of vectors if there is more than one pivot variable. As an example, suppose that we had been given a system of linear equations, from which we had already created the augmented coefficient matrix and found the reduced echelon form
Assuming that the original variables were , , , and , we would have the corresponding equations
The pivot variables would be and and the nonpivot variables would be and . We solve the two above equations for the pivot variables:
We now include the two trivial equations and for the nonpivot variables
Group these together as vectors and, using two independent parameters, we have the full solution
In the above example we required 3 vectors to fully express the solution. Of course it is possible for there to be more than 3 vectors that must be used in order to express the full solution and the number of these vectors is related to the rank and nullity of a matrix, both of which are key concepts in linear algebra. It is also possible for there to be only one vector required to express the full solution, although this would mean that the solution is unique and that no parameters are needed to express the solution space.
- The augmented coefficient matrix of a system of linear equations can be operated on using rowoperations. When in reduced echelon form, the solution of the original system is found.
- It is usually helpful to express the solution in terms of the pivot variables, which are the variables that correspond to the columns of a matrix that contain pivots when in reduced echelon form.
- If there are infinitely many solutions to a system of linear equations, then these solutions should generally be expressed in terms of vectors with arbitrary parameters.