Explainer: The General Solution of a System of Linear Equations

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 2๐‘ฅ+3๐‘ฆ=1,โˆ’4๐‘ฅ+๐‘ฆ=โˆ’9.

Solving this system of linear equations using any method will give ๐‘ฅ=2 and ๐‘ฆ=โˆ’1. 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 ๐‘ฅโˆ’3๐‘ฆ=2,โˆ’3๐‘ฅ+9๐‘ฆ=โˆ’6.

In this instance we can see that the bottom equation is essentially just a copy of the first equation, with every term multiplied by โˆ’3. In fact, we can multiply each term in the left-hand side by โˆ’13 without changing the solution and the system would become ๐‘ฅโˆ’3๐‘ฆ=2,๐‘ฅโˆ’3๐‘ฆ=2.

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 ๐‘ฅโˆ’3๐‘ฆ=2.

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 ๐‘ฅ=2+3๐‘ฆ. If we picked the example value of ๐‘ฆ=1, then we would find ๐‘ฅ=5 and we could check that this pair of values do actually solve the original system. Equally, we would pick ๐‘ฆ=โˆ’3, which would give ๐‘ฅ=โˆ’7. 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 ๐‘ฅ=2+3๐‘ฆ, 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 3๐‘ฅ+๐‘ฆ=โˆ’2,6๐‘ฅ+2๐‘ฆ=โˆ’6.

We can see that the second equation is very similar to the first equation. We multiply all terms in the second equation by 12, giving 3๐‘ฅ+๐‘ฆ=โˆ’2,3๐‘ฅ+๐‘ฆ=โˆ’3.

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 ๐‘ฅ1,๐‘ฅ2,โ€ฆ,๐‘ฅ๐‘š and the coefficients ๐‘Ž๐‘–๐‘—: ๐‘Ž11๐‘ฅ1+๐‘Ž12๐‘ฅ2โ‹ฏ๐‘Ž1๐‘›๐‘ฅ๐‘›=๐‘1,๐‘Ž21๐‘ฅ1+๐‘Ž22๐‘ฅ2โ‹ฏ๐‘Ž2๐‘›๐‘ฅ๐‘›=๐‘2,โ‹ฎโ‹ฎโ‹ฎโ‹ฑโ‹ฎโ‹ฎโ‹ฎ๐‘Ž๐‘š1๐‘ฅ1+๐‘Ž๐‘š2๐‘ฅ2โ‹ฏ๐‘Ž๐‘š๐‘›๐‘ฅ๐‘›=๐‘๐‘š.

Then the system of linear equations is also described by the matrix equation โŽกโŽขโŽขโŽฃ๐‘Ž11๐‘Ž12โ‹ฏ๐‘Ž1๐‘›๐‘Ž21๐‘Ž22โ‹ฏ๐‘Ž2๐‘›โ‹ฎโ‹ฎโ‹ฑโ‹ฎ๐‘Ž๐‘š1๐‘Ž๐‘š2โ‹ฏ๐‘Ž๐‘š๐‘›โŽคโŽฅโŽฅโŽฆโŽกโŽขโŽขโŽฃ๐‘ฅ1๐‘ฅ2โ‹ฎ๐‘ฅ๐‘›โŽคโŽฅโŽฅโŽฆ=โŽกโŽขโŽขโŽขโŽฃ๐‘1๐‘2โ‹ฎ๐‘๐‘šโŽคโŽฅโŽฅโŽฅโŽฆ.

The augmented coefficient matrix of the system is โŽกโŽขโŽขโŽขโŽขโŽฃ๐‘Ž11๐‘Ž12โ‹ฏ๐‘Ž1๐‘›๐‘1๐‘Ž21๐‘Ž22โ‹ฏ๐‘Ž2๐‘›๐‘2โ‹ฎโ‹ฎโ‹ฑโ‹ฎโ‹ฎ๐‘Ž๐‘š1๐‘Ž๐‘š2โ‹ฏ๐‘Ž๐‘š๐‘›๐‘๐‘šโŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

Suppose that we wished to solve the system of linear equations defined as ๐‘ฅโˆ’2๐‘ฆ=โˆ’3,5๐‘ฅโˆ’10๐‘ฆ=โˆ’15.

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 ๏˜1โˆ’2โˆ’35โˆ’10โˆ’15๏ค.

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 โŽกโŽขโŽขโŽขโŽขโŽฃ๐‘Ž11๐‘Ž12โ‹ฏ๐‘Ž1๐‘›๐‘1๐‘Ž21๐‘Ž22โ‹ฏ๐‘Ž2๐‘›๐‘2โ‹ฎโ‹ฎโ‹ฑโ‹ฎโ‹ฎ๐‘Ž๐‘š1๐‘Ž๐‘š2โ‹ฏ๐‘Ž๐‘š๐‘›๐‘๐‘šโŽคโŽฅโŽฅโŽฅโŽฅโŽฆ, 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: ๐‘ฅโˆ’2๐‘ฆ=โˆ’3,5๐‘ฅโˆ’10๐‘ฆ=โˆ’15, which has the augmented coefficient matrix ๏˜1โˆ’2โˆ’35โˆ’10โˆ’15๏ค.

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 ๐‘Ÿ2โ†’๐‘Ÿ2โˆ’5๐‘Ÿ1 to transform the matrix to ๏˜1โˆ’2โˆ’3000๏ค.

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 ๐‘ฅโˆ’2๐‘ฆ=โˆ’3, 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 ๐‘ฅ=โˆ’3+2๐‘ฆ.

Although it may seem trivial, we then write the nonpivot variables in terms of themselves: ๐‘ฆ=๐‘ฆ.

Aligning these two equations gives ๐‘ฅ=โˆ’3+2๐‘ฆ๐‘ฆ=๐‘ฆ.

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 ๏“๐‘ฅ๐‘ฆ๏Ÿ=๏”โˆ’30๏ +๐‘ฆ๏”21๏ .

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 ๏“๐‘ฅ๐‘ฆ๏Ÿ=๏”โˆ’30๏ +๐‘ก๏”21๏ .

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 ๏˜0โˆ’121011โˆ’25๏ค๏—๐‘ฅ๐‘ฆ๐‘ง๏ฃ=๏˜1โˆ’11๏ค.

Answer

We first create the augmented coefficient matrix of the given system of linear equations: โŽกโŽขโŽขโŽฃ0โˆ’121101โˆ’11โˆ’251โŽคโŽฅโŽฅโŽฆ.

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: โŽกโŽขโŽขโŽฃ0โˆ’121101โˆ’11โˆ’251โŽคโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ1โ†”๐‘Ÿ3, giving โŽกโŽขโŽขโŽฃ1โˆ’251101โˆ’10โˆ’121โŽคโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ2โ†’๐‘Ÿ2โˆ’๐‘Ÿ1, which produces the matrix โŽกโŽขโŽขโŽฃ1โˆ’25102โˆ’4โˆ’20โˆ’121โŽคโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ2โ†’12๐‘Ÿ2, which gives the simpler matrix โŽกโŽขโŽขโŽฃ1โˆ’25101โˆ’2โˆ’10โˆ’121โŽคโŽฅโŽฅโŽฆ.

Now we must remove the nonzero entry that is below the pivot in the second row with the row operation ๐‘Ÿ3โ†’๐‘Ÿ3+๐‘Ÿ2. This gives the matrix โŽกโŽขโŽขโŽฃ1โˆ’25101โˆ’2โˆ’10000โŽคโŽฅโŽฅโŽฆ, 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 ๐‘Ÿ1โ†’๐‘Ÿ1+2๐‘Ÿ2, which gives the reduced echelon form โŽกโŽขโŽขโŽฃ101โˆ’101โˆ’2โˆ’10000โŽคโŽฅโŽฅโŽฆ.

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: ๐‘ฅ+๐‘ง=โˆ’1๐‘ฆโˆ’2๐‘ง=โˆ’1.

Solving both of these equations for the pivot variables gives ๐‘ฅ=โˆ’1โˆ’๐‘ง๐‘ฆ=โˆ’1+2๐‘ง.

We also have the nonpivot variable ๐‘ง=๐‘ง. Writing these 3 equations together gives ๐‘ฅ=โˆ’1โˆ’๐‘ง๐‘ฆ=โˆ’1+2๐‘ง๐‘ง=๐‘ง.

We could have equivalently expressed this solution in the form ๏—๐‘ฅ๐‘ฆ๐‘ง๏ฃ=๏˜โˆ’1โˆ’10๏ค+๐‘ก๏˜โˆ’121๏ค, 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 ๏˜0โˆ’121โˆ’211โˆ’45๏ค๏—๐‘ฅ๐‘ฆ๐‘ง๏ฃ=๏˜1โˆ’11๏ค.

Answer

We first create the augmented coefficient matrix of the system of linear equations, highlighting the pivot entries: โŽกโŽขโŽขโŽฃ0โˆ’1211โˆ’21โˆ’11โˆ’451โŽคโŽฅโŽฅโŽฆ.

We will need to put this matrix in reduced echelon form. To place a 1 in the top-left entry, we first swap rows ๐‘Ÿ1โ†”๐‘Ÿ3: โŽกโŽขโŽขโŽฃ1โˆ’4511โˆ’21โˆ’10โˆ’121โŽคโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ2โ†’๐‘Ÿ2โˆ’๐‘Ÿ1 will achieve this: โŽกโŽขโŽขโŽฃ1โˆ’45102โˆ’4โˆ’20โˆ’121โŽคโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ2โ†’12๐‘Ÿ2 to give โŽกโŽขโŽขโŽฃ1โˆ’45101โˆ’2โˆ’10โˆ’121โŽคโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ3โ†’๐‘Ÿ3+๐‘Ÿ2: โŽกโŽขโŽขโŽฃ1โˆ’45101โˆ’2โˆ’10000โŽคโŽฅโŽฅโŽฆ.

Reduced echelon form is then achieved with the final row operation ๐‘Ÿ1โ†’๐‘Ÿ1+4๐‘Ÿ2: โŽกโŽขโŽขโŽฃ10โˆ’3โˆ’301โˆ’2โˆ’10000โŽคโŽฅโŽฅโŽฆ.

The variables ๐‘ฅ and ๐‘ฆ refer to the two columns which contain pivots and the variable ๐‘ง does not. Writing out the corresponding equations ๐‘ฅโˆ’3๐‘ง=โˆ’3๐‘ฆโˆ’2๐‘ง=โˆ’1 and solving both for the pivot variables gives ๐‘ฅ=โˆ’3+3๐‘ง๐‘ฆ=โˆ’1+2๐‘ง.

Combining this with the nonpivot variable ๐‘ง=๐‘ง gives ๐‘ฅ=โˆ’3+3๐‘ง๐‘ฆ=โˆ’1+2๐‘ง๐‘ง=๐‘ง.

This is the full solution and we also choose to write it in matrix form as ๏—๐‘ฅ๐‘ฆ๐‘ง๏ฃ=๏˜โˆ’3โˆ’10๏ค+๐‘ก๏˜321๏ค.

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 โŽกโŽขโŽขโŽฃ10111โˆ’1103โˆ’1323303โŽคโŽฅโŽฅโŽฆ๏›๐‘ฅ๐‘ฆ๐‘ง๐‘ค๏ง=โŽกโŽขโŽขโŽฃ1243โŽคโŽฅโŽฅโŽฆ.

Answer

We create the augmented coefficient matrix and highlight the pivot entries: โŽกโŽขโŽขโŽขโŽขโŽฃ101111โˆ’11023โˆ’132433033โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ2โ†’๐‘Ÿ2โˆ’๐‘Ÿ1, ๐‘Ÿ3โ†’๐‘Ÿ3โˆ’3๐‘Ÿ1, and ๐‘Ÿ4โ†’๐‘Ÿ4โˆ’3๐‘Ÿ1. The resulting matrix is โŽกโŽขโŽขโŽขโŽขโŽฃ101110โˆ’10โˆ’110โˆ’10โˆ’1103โˆ’300โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

Given that the third row is a copy of the second row, we can remove the whole row with the operation ๐‘Ÿ3โ†’๐‘Ÿ3โˆ’๐‘Ÿ2. This gives a matrix where the third row is a zero row: โŽกโŽขโŽขโŽขโŽขโŽฃ101110โˆ’10โˆ’110000003โˆ’300โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ, which we move to the bottom of the matrix with the row swap operation ๐‘Ÿ3โ†”๐‘Ÿ4, giving โŽกโŽขโŽขโŽขโŽขโŽฃ101110โˆ’10โˆ’1103โˆ’30000000โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ2โ†’โˆ’๐‘Ÿ2 and ๐‘Ÿ3โ†’13๐‘Ÿ3. This gives โŽกโŽขโŽขโŽขโŽขโŽฃ101110101โˆ’101โˆ’10000000โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

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 ๐‘Ÿ3โ†’๐‘Ÿ3โˆ’๐‘Ÿ2 achieves this: โŽกโŽขโŽขโŽขโŽขโŽฃ101110101โˆ’100โˆ’1โˆ’1100000โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

In the penultimate step, we scale the pivot entry in the third row with ๐‘Ÿ3โ†’โˆ’๐‘Ÿ3, which gives โŽกโŽขโŽขโŽขโŽขโŽฃ101110101โˆ’10011โˆ’100000โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ and allows us to remove the remaining nonzero entry above the pivot in the third row, with the the row operation ๐‘Ÿ1โ†’๐‘Ÿ1โˆ’๐‘Ÿ3: โŽกโŽขโŽขโŽขโŽขโŽฃ100020101โˆ’10011โˆ’100000โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

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 ๐‘ฅ=2๐‘ฆ+๐‘ค=โˆ’1๐‘ง+๐‘ค=โˆ’1.

We now solve the three equations for the pivot variables, giving ๐‘ฅ=2๐‘ฆ=โˆ’1โˆ’๐‘ค๐‘ง=โˆ’1โˆ’๐‘ค.

Considering the nonpivot variable ๐‘ค, the full solution is ๐‘ฅ=2๐‘ฆ=โˆ’1โˆ’๐‘ค๐‘ง=โˆ’1โˆ’๐‘ค๐‘ค=๐‘ค.

Written in vector form, we have ๏›๐‘ฅ๐‘ฆ๐‘ง๐‘ค๏ง=โŽกโŽขโŽขโŽฃ2โˆ’1โˆ’10โŽคโŽฅโŽฅโŽฆ+๐‘กโŽกโŽขโŽขโŽฃ0โˆ’1โˆ’11โŽคโŽฅโŽฅโŽฆ.

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 โŽกโŽขโŽขโŽขโŽขโŽฃ1โˆ’10220011โˆ’30000000000โŽคโŽฅโŽฅโŽฅโŽฅโŽฆ.

Assuming that the original variables were ๐‘ฅ, ๐‘ฆ, ๐‘ง, and ๐‘ค, we would have the corresponding equations ๐‘ฅโˆ’๐‘ฆ+2๐‘ค=2,๐‘ง+๐‘ค=โˆ’3.

The pivot variables would be ๐‘ฅ and ๐‘ง and the nonpivot variables would be ๐‘ฆ and ๐‘ค. We solve the two above equations for the pivot variables: ๐‘ฅ=2+๐‘ฆโˆ’2๐‘ค,๐‘ง=โˆ’3โˆ’๐‘ค.

We now include the two trivial equations ๐‘ฆ=๐‘ฆ and ๐‘ค=๐‘ค for the nonpivot variables ๐‘ฅ=2+๐‘ฆโˆ’2๐‘ค๐‘ฆ=๐‘ฆ๐‘ง=โˆ’3โˆ’๐‘ค๐‘ค=๐‘ค.

Group these together as vectors and, using two independent parameters, we have the full solution ๏›๐‘ฅ๐‘ฆ๐‘ง๐‘ค๏ง=โŽกโŽขโŽขโŽฃ20โˆ’30โŽคโŽฅโŽฅโŽฆ+๐‘ โŽกโŽขโŽขโŽฃ1100โŽคโŽฅโŽฅโŽฆ+๐‘กโŽกโŽขโŽขโŽฃโˆ’20โˆ’11โŽคโŽฅโŽฅโŽฆ.

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.

Key Points

  • 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.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.