Solving Systems Of Linear Equations

What is a “system” of linear equations?

A “system of linear equations” means two or more linear equations that must all be true at the same time.

When represented symbolically, a system of equations will usually have some sort of grouping symbol to one side of them, such as the curly brace below, which is intended to convey that the set of equations should be considered all at once. For example:

\begin{cases}y=-3x+2\\y=x-6\end{cases}

When graphed, all of the equations in a system will be shown on the same set of axes, so that they can be compared to one another easily:

What is “a solution” to a linear system?

A solution to a system of linear equations is the point, or set of points, that satisfy all of the equations in the system. In other words, after substituting the coordinates of a “solution” such as (2,-4) for the variables in the equations above, the simplified expressions will be true statements (such as 2 = 2) for every equation in the system:

\begin{cases}y=-3x+2 \\ y=x-6\end{cases}

\begin{cases}(-4)=-3(2)+2 \\ (-4)=(2)-6\end{cases}

\begin{cases}-4=-4 \\ -4=-4\end{cases}

On a graph, the solution is the set of points that all of the lines in the system have in common. If you examine any “solution” on the graph, all of the lines in the system will pass through that point. In the graph below, the blue point (2,-4) is the only one that all lines pass through:

What points are NOT a solution to a linear system?

If the coordinates of a point are substituted into all of the equations in a system, and one (or more) of the equations results in a false statement once it is simplified (like 3 = 0), then that point is not a solution to the system. Suppose we try a point like (1,-1):

\begin{cases}y=-3x+2 \\ y=x-6\end{cases}

\begin{cases}(-1)=-3(1)+2 \\ (-1)=(1)-6\end{cases}

\begin{cases}-1=-1 \\ -1=-5\end{cases}

In the example above, one equation produces a true statement (-1 = -1), which tells us that the point satisfies that equation (lies on the line it defines). However, the other equation produces a false statement (-1 = -5), which tells us that the point does not satisfy that equation… and therefore does not lie on that line. Since the point fails to satisfy one (or more) of the equations in the system, that point is not a solution to the system.

On a graph, if one (or more) of the lines in a system does not pass through the point, then the point is not a solution to the system. In the graph below, the blue point (1,-1) does have one of the lines passing through it, but not the other… so it is not a solution to the system:

What types of linear systems exist?

Imagine a pencil set on a table in front of you, representing a line that extends infinitely far from both ends of the pencil. Now imagine a second pencil, representing a second line, is being moved around in the vicinity of the first one. Three types of situations can arise as you move the second pencil around:

  • The lines (one represented by each pencil) all intersect somewhere. This means that a solution to this system exists and can be found. Such a system is called a consistent system.
  • The lines do not all intersect. This must mean that one or more of them either:
    – can be made to lie in the same plane but are parallel, or
    – are “skew” lines that cannot be made to lie in the same plane, and therefore do not touch
    A solution to such a system does not exist, since there is no point that all lines in the system have in common.  Such a system is called an inconsistent system.
  • The lines intersect everywhere, because they are actually the same line… one pencil has been made to occupy the exact same space as the other (good luck in simulating this with real pencils!). This means that every point on each line is also on the other(s), therefore there are an infinite number of solutions: any point that satisfies one equation also satisfies the other(s). Such a system is called a redundant system.

Finding the solution to a linear system of equations

There are four ways to find the solution to a system of linear equations:
– Graphing
– Substitution
– Linear Combination
– Matrices

Each approach has its own advantages and disadvantages, depending on the circumstances. It is a good idea to master all of the above approaches, since it is useful to be equally confident in using any of them. The goal is to be able to select and use the most efficient approach for the circumstances.

Graphing

To find the solution to a linear system by graphing, graph all the equations in the system on one set of axes then look to see if all the lines share any common point(s). If the system is consistent, they will share one point. If the system is redundant, the two lines will have been drawn exactly on top of one another. If the system is inconsistent, the lines will be parallel or skew and will not have any points in common.

If there are one or more points that all lines pass through, the coordinates of those points are the solution(s) to the system.

However, this approach has several disadvantages:
– if I don’t know roughly where the lines will intersect, I have to guess at the minimum and maximum coordinates I will show on my graph’s axes… and if I guess wrong, the solution (if one exists) will not appear on my graph
– it can be difficult to be certain of the exact coordinates of the solution from the graph. Is the x-coordinate of the solution below (the blue point) 2.0 or 2.01? It is usually impossible to tell with certainty from a graph alone.

Graphing provides an excellent approximate solution to a system, and is the easiest solution process to understand intuitively. It is sometimes used to double check that an exact solution calculated by one of the methods below is reasonable, however there are more efficient ways to double-check an algebraic solution.

Substitution

The substitution method for solving a system of equations relies upon the principle of equivalence. An equation, any equation, tells you that the expression to the left of the equal sign will always produce the same result as the expression to the right of the equal sign. Therefore, you are welcome to replace one by the other – to “substitute” one for the other – any place you wish within the context of the problem.

But, why is this useful? If one of the equations is (or can be) solved for one of the variables, substitution allows you to eliminate the variable that was solved for from all other equations in the system. This reduces the number of equations you are dealing with by one, and reduces the number of variables by one. For example, if you are working with the following system of three equations and three unknowns:

\begin{cases}3a+b-c=-8 \\ a-4b+2c=9 \\ 2a+3b+3c=13\end{cases}

and you start by solving any one of the equations (in this case, the first one) for any one of the variables (in this case, “b”):

3a+b-c=-8\\*~\\* b=-8-3a+c

and then substitute the resulting expression (-8-3a+c) in for the variable that was solved for (“b”) in all of the other equations:

\begin{cases} a-4(-8-3a+c)+2c=9 \\ 2a+3(-8-3a+c)+3c=13\end{cases}

\begin{cases} a+32+12a-4c+2c=9 \\ 2a-24-9a+3c+3c=13\end{cases}

\begin{cases}13a-2c=-23 \\ -7a+6c=37\end{cases}

you have now simplified the system a bit, and the resulting system has only two equations and two unknowns. Repeat the substitution process one more time and you will have solved for one of the variables.

That result can be substituted back into any of the earlier equations to find the value of a second variable. Then both of the those values can be substituted into any of the earlier equations to find the value of the third variable.

Why is it that you can use any of the earlier equations in the above step? Because this is a “system” of equations, therefore all equations must be satisfied at the same time. If all of the equations must be true simultaneously, any equation created by substituting an equivalence from one equation into another must also be true. By using this insight, and the substitution process, to gradually reduce the number of variables and equations involved to one, you are able to make the problem simpler and simpler until it becomes easy to arrive at a partial solution. That partial solution (the value of one variable) can then be used to find the value of another variable, etc., until the values of all variables have been determined.

A consistent system of linear equations solved by substitution will produce one solution, as described above.  That solution will produce a true statement when substituted into every equation in the system.

An inconsistent system of linear equations solved by substitution will produce a false statement, such as “0 = 3”. You will be unable to solve for a variable because all variable terms will cancel one another out when simplifying after substitution. Only unequal constant terms will remain. This happens because when all lines in the system have the same slopes, the coefficients of their independent variables will all be equal, and will therefore cancel one another out when simplifying after substitution.

A redundant system of linear equations solved by substitution will produce a true statement, such as “0 = 0”. You will once again be unable to solve for a variable, for the same reason as just mentioned. However, since the lines defined by redundant equations will also all have the same vertical axis intercept, their constant terms will be equal too.

When you are done, don’t forget to:
– list your answers all together (or perhaps as a point)
– include the relevant units with each quantity
– explain what the answer means in the context of the original problem

Linear Combination

The Linear Combination method for solving a system of equations relies upon the addition property of equality: given an equation, if you add equal quantities to the expressions on both sides of the equal sign, the resulting expressions must still be equal. For example, when presented with:

2x-3y=4

you could add “5” to both sides to produce:

2x-3y+5=4+5

The initial equation tells us that the two sides will always produce the same result, so when we add five to both sides, the two results must still always be equal… and five greater than they used to be.

The same process is used in solving a system of equations, except that instead of adding identical expressions to both sides (as just described), equivalent expressions are added to both sides. In the above example, we could have confidently added a “3y” to one side and a “2y+y” to the other, because the two expressions are equivalent (even though they are not identical).

So, how does this apply to a system? If we start with the same system as before:

\begin{cases}3a+b-c=-8 \\ a-4b+2c=9 \\ 2a+3b+3c=13\end{cases}

our goal is the same as with substitution: to eliminate a variable. Instead of doing so by substitution, we will add equivalent expressions to both sides of an equation, in a way that gets one of the variables to cancel out. There are usually multiple ways this can be achieved; with the above system, after noting the coefficients of all the “c” terms in the system, one way is to multiply both sides of the first equation in the system by 2:

3a~+b~-c=-8~~\text{1st eq. from system}\\*~\\*6a+2b-2c=-16~~\text{(x 2)}

This creates an “equivalent equation” which defines the same line on a graph as the original first equation. The last line above tells us that the quantity “6a+2b-2c” is equivalent to “-16”, which means we are welcome to add “6a+2b+2c” to one side of any other equation in the system, and “-16” to the other side of the same equation, knowing that the resulting two expressions must still be equal:

~~~~~6a+2b-2c=-16\\*~\\* \underline{(+)~a-4b+2c=9}~~~~\text{2nd eq. from system}

Combining all like terms to the left of both equal signs, then combining all like terms to the right of both equal signs, produces:

7a-2b=-7

Notice that the “c” terms cancelled one another out because they had coefficients that were equal in magnitude but opposite in sign. This achieved the same objective as our first substitution in the discussion of the substitution method: we now have an equation involving one fewer variable.

The same process can be followed with the third equation in the system, the only equation we have not made any use of at all yet. Our objective in working with the third equation is to get the same variable to cancel out, “c” in this case. Why? Because if we can do that, we will have a system of two equations and two unknowns, which is simpler than what we started with. It looks like this will be most easily accomplished by using the first equation in the system, and multiplying both sides by 3:

3a+~b~-c=~-8\\*~\\*9a+3b-3c=-24~~\text{(x 3)}

then add both sides of this equation to both sides of the third equation in the system:

~~~~~~~9a+3b-3c=-24\\*~\\*\underline{(+)~2a+3b+3c=~~13}~~\text{3rd eq. from system}\\*~\\*~~~~~11a+6b~~~~~~=-11

Repeating this process a third time to eliminate one of the two remaining variables gets things down to one equation with one unknown:

\begin{cases}7a-2b=-7 \\ 11a+6b=-11\end{cases}

\begin{cases}21a-6b=-21~~\text{(x 3)} \\ \underline{11a+6b=-11}\end{cases}\\*~~~~32a~~~~=-32\\*~~~~~~a~~~~=-1

And now, the value for “a” can be substituted into either equation above to solve for “b”, then both values can be substituted into any of the three original equations to solve for “c”.

Notice how both Substitution and Linear Combination rely on simplifying the system by eliminating the same variable from one equation at a time, until you are left with one equation that can be solved for its one variable.

Note that in order to obtain coefficients of equal magnitude but opposite sign, so that a variable will cancel out when two equations are added, some systems may require you to either:
– multiply both sides of one equation by a constant (usually an integer or a fraction), or
– multiply each of the two equations you are working with by different constants

Consistent, inconsistent, and redundant linear systems can be identified in the same way as described above for the substitution process.

When you are done, don’t forget to:
– list your answers all together (or perhaps as a point)
– include the relevant units with each quantity
– explain what the answer means in the context of the original problem

For a graphical explanation of how the linear combination process helps solve a system of equations, please read another post of mine: Linear Systems: Why does linear combination work  (graphically).

Matrices

A matrix is an array of numbers arranged in rows and columns. where every row contains the same number of numbers. Matrices and matrix algebra can be used to automate the Linear Combination process. The goal is still to eliminate one variable and equation at a time from the system until we arrive at a solution, but using matrices (and a calculator that can do matrix inversion and multiplication) allows us to find the solution to the system in one step.

In order to represent the system using matrix notation, every equation in the system must have all variable terms on the left side of the equation, and written in the same order, and all constant terms must be alone on the right side of the equation.  Our system of equations from above is already written this way:

\begin{cases}3a+b-c=-8 \\ a-4b+2c=9 \\ 2a+3b+3c=13\end{cases}

This system can be compactly represented using matrix multiplication (a topic you will have to read about elsewhere) like this:

\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}\times\begin{bmatrix}a\\ b\\ c\end{bmatrix}=\begin{bmatrix}-8\\ ~~9\\ 13\end{bmatrix}

The left-most matrix contains the coefficients of all the variables in the system. In this example all of the “a” coefficients from the system are in the left column, the “b” coefficients in the the middle column, etc. Recall that if a variable has no coefficient written in front of it, its coefficient is 1 (since 1a = a).

If you follow the rules for matrix multiplication, and carry out the multiplication described above, the result will be the system of equations exactly as written previously. So, the matrix notation above is equivalent to the system as originally written.

To solve the matrix equation for the [a, b, c] matrix, multiply both sides of the equation by the “matrix inverse” of the left-hand matrix, “from the left”. Matrix multiplication is not commutative, so the order in which you multiply two matrices matters.

\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}^{-1}\times\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}\times\begin{bmatrix}a\\ b\\ c\end{bmatrix}=\\*~\\*\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}^{-1}\times\begin{bmatrix}-8\\ ~~9\\ 13\end{bmatrix}

This will leave the [a, b, c] matrix by itself on the left, and a matrix with one column of numbers on the right.

In solving a matrix equation this way, we are following a process similar to:

3\cdot x=6\\*~\\*\frac{1}{3}\cdot 3\cdot x=\frac{1}{3}\cdot 6\\*~\\*x=\frac{1}{3}\cdot 6\\*~\\*x=2

Since we know that \frac{1}{3}\cdot 3 will produce the multiplicative identity 1, we usually cross out both factors and leave the variable “x” where it is with no coefficent. The only multiplication we need to carry out is on the right side of the equality.

The same thinking applies to how we work with matrices when solving a system of equations: we “cancel out” the product of the matrix inverse and the matrix on the left, and evaluate the product of the matrix inverse and the matrix on the right. Note that when using matrix notation, an “exponent” of negative one indicates the inverse of the matrix:

\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}^{-1}\times\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}\times\begin{bmatrix}a\\ b\\ c\end{bmatrix}=\\*~\\*\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}^{-1}\times\begin{bmatrix}-8\\ ~~9\\ 13\end{bmatrix}

\begin{bmatrix}a\\ b\\ c\end{bmatrix}=\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}^{-1}\times\begin{bmatrix}-8\\ ~~9\\ 13\end{bmatrix}

The processes for calculating the inverse of a matrix and multiplying matrices is something you may research elsewhere, as many courses today rely on calculators like the TI-83 or TI-84 to calculate matrix inverses and matrix products. Therefore, at this point in the problem you should enter the two matrices to the right of the equal sign into your calculator (typically using [A] for the 3×3 matrix and [B] for the 3×1 matrix), then instruct your calculator to evaluate:

[A]=\begin{bmatrix}~3 & ~1 & -1\\ ~1 & -4 & ~2\\ ~2 & ~3 &~3\end{bmatrix}

[B]=\begin{bmatrix}-8\\ ~~9\\ 13\end{bmatrix}

[A]^{-1}\times [B]=

At this point, your calculator will produce a 3×1 matrix which contains the values of each of the variables.  These will be the same values you would obtain by solving the system using either substitution or linear combination.

consistent system of linear equations solved using matrices will produce a matrix solution. This solution will produce a true statement when substituted for the variable matrix in the original equation.

An inconsistent or redundant system of linear equations solved using matrices will produce a “Singular Matrix” error on your calculator, which means than an inverse does not exist for the matrix. This will occur because a single solution to the system does not exist. You will need to examine either the system’s graph or its equations to determine if the system is redundant or inconsistent (it must be one or the other if the matrix inverse does not exist).

When you are done, don’t forget to:
– list your answer as a variable matrix equal to the solution matrix, or as a point
– include the relevant units with each quantity
– explain what the answer means in the context of the original problem

Which solution technique should you use?

For systems of two equations and two unknowns, you are welcome to use any of the above approaches, but it is probably fastest to use either substitution or linear combination when you need an exact answer. While matrices will work quite nicely, the time it takes to enter the matrices into your calculator may be longer than it takes to solve the system by substitution or linear combination.

For systems of three equations and three unknowns, some will be fastest to solve using either substitution or linear combination, while others will be fastest to solve using matrices. Try solving several systems all ways, and you should quickly develop a sense for which systems are likely to be quick to solve using substitution or linear combination, and which are not.

For systems of more than three equations and three unknowns, they are likely to be faster to solve using matrices in most cases.

Verify your solution is correct

Once you have arrived at a solution to a system, using any of the four techniques described above, do yourself a favor and get in the habit of always checking your solution. It is so easy to do, and does not take much time, so why not prove to yourself that your answer must be correct?

Since a solution to a system of equations is a set of values which will satisfy all of the equations in the system, check your solution by plugging it into every equation, and verifying that it produces a true statement.

You can often save some time by not bothering to check the equation you used to find the last variable’s value, because it determined the last value. Your solution need only be checked against the remaining equation(s). If every equation in the system produces a true statement, such as 3=3, then you know that your solution must be correct.

By Whit Ford

Math tutor since 1992. Former math teacher, product manager, software developer, research analyst, etc.

2 comments

  1. That the Simplex Algorithm (pivoting) revises the scalars on the “Tableau of Detached Coefficients” in the way one computes them with matrix-vector algebra is verified by experience only! The revision formula for i \neq i_{0}~~\bar{a_{i, j}} = (a_{i, j}a_{i_{0}, j_{0}} - a_{i, j_{0}}a_{i_{0}, j} ) / a_{i_{0}, j_{0}}

    with pivot a_{i_{0}, j_{0}} is not written in any textbook as if it is unnecessary. A “Fundamental Theorem of Simplex Algorithm” is due to be proven. Am I right?

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.