Solving a System of Equations By Substitution
Introduction
Solving systems of linear equations by graphing is a good way to visualize the types of solutions that may result. However, there are many cases where solving a system by graphing is inconvenient or imprecise. If the graphs extend beyond the small grid with x and y both between −10 and 10, graphing the lines may be cumbersome. And if the solutions to the system are not integers, it can be hard to read their values precisely from a graph.
In this section, we will solve systems of linear equations by the substitution method.
Solving a System of Equations By Substitution
We will use the same system we used first for graphing.
We will first solve one of the equations for either x or y. We can choose either equation and solve for either variable—but we’ll try to make a choice that will keep the work easy.
Then we substitute that expression into the other equation. The result is an equation with just one variable—and we know how to solve those!
After we find the value of one variable, we will substitute that value into one of the original equations and solve for the other variable. Finally, we check our solution and make sure it makes both equations true.
We’ll fill in all these steps now in the example below.
Example: How to Solve a System of Equations by Substitution
Solve the system by substitution. \(\begin{array}{c}2x+y=7\hfill \\ x-2y=6\hfill \end{array}\)
Solution
Solve a system of equations by substitution.
- Solve one of the equations for either variable.
- Substitute the expression from Step 1 into the other equation.
- Solve the resulting equation.
- Substitute the solution in Step 3 into one of the original equations to find the other variable.
- Write the solution as an ordered pair.
- Check that the ordered pair is a solution to both original equations.
If one of the equations in the system is given in slope–intercept form, Step 1 is already done! We’ll see this in the example below.
Example
Solve the system by substitution.
\(\begin{array}{c}x+y=-1\hfill \\ y=x+5\hfill \end{array}\)
Solution
The second equation is already solved for y. We will substitute the expression in place of y in the first equation.
| The second equation is already solved for y. We will substitute into the first equation. |
|
| Replace the y with x + 5. | |
| Solve the resulting equation for x. | |
| Substitute x = −3 into y = x + 5 to find y. | |
| The ordered pair is (−3, 2). | |
| Check the ordered pair in both equations: \(\begin{array}{cccc}\begin{array}{ccc}\hfill x+y& =\hfill & -1\hfill \\ \hfill -3+2& \stackrel{?}{=}\hfill & -1\hfill \\ \hfill -1& =\hfill & -1\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}& & & \begin{array}{ccc}\hfill y& =\hfill & x+5\hfill \\ \hfill 2& \stackrel{?}{=}\hfill & -3+5\hfill \\ \hfill 2& =\hfill & 2\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}\end{array}\) |
|
| The solution is (−3, 2). |
If the equations are given in standard form, we’ll need to start by solving for one of the variables. In this next example, we’ll solve the first equation for y.
Example
Solve the system by substitution. \(\begin{array}{c}3x+y=5\hfill \\ 2x+4y=-10\hfill \end{array}\)
Solution
We need to solve one equation for one variable. Then we will substitute that expression into the other equation.
| Solve for y. Substitute into the other equation. |
|
| Replace the y with −3x + 5. | |
| Solve the resulting equation for x. | |
| Substitute x = 3 into 3x + y = 5 to find y. | |
| The ordered pair is (3, −4). | |
| Check the ordered pair in both equations: \(\begin{array}{cccc}\begin{array}{ccc}\hfill 3x+y& =\hfill & 5\hfill \\ \hfill 3·3+\left(-4\right)& \stackrel{?}{=}\hfill & 5\hfill \\ \hfill 9-4& \stackrel{?}{=}\hfill & 5\hfill \\ \hfill 5& =\hfill & 5\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}& & & \begin{array}{ccc}\hfill 2x+4y& =\hfill & -10\hfill \\ \hfill 2·3+4\left(-4\right)& =\hfill & -10\hfill \\ \hfill 6-16& \stackrel{?}{=}\hfill & -10\hfill \\ \hfill -10& =\hfill & -10\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}\end{array}\) |
|
| The solution is (3, −4). |
In the example above it was easiest to solve for y in the first equation because it had a coefficient of 1. In the example below it will be easier to solve for x.
Example
Solve the system by substitution. \(\begin{array}{c}x-2y=-2\hfill \\ 3x+2y=34\hfill \end{array}\)
Solution
We will solve the first equation for \(x\) and then substitute the expression into the second equation.
| Solve for x. Substitute into the other equation. |
|
| Replace the x with 2y − 2. | |
| Solve the resulting equation for y. | |
|
|
|
| The ordered pair is (8, 5). | |
| Check the ordered pair in both equations: \(\begin{array}{cccc}\begin{array}{ccc}\hfill x-2y& =\hfill & -2\hfill \\ \hfill 8-2·5& \stackrel{?}{=}\hfill & -2\hfill \\ \hfill 8-10& \stackrel{?}{=}\hfill & -2\hfill \\ \hfill -2& =\hfill & -2\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}& & & \begin{array}{ccc}\hfill 3x+2y& =\hfill & 34\hfill \\ \hfill 3·8+2·5& \stackrel{?}{=}\hfill & 34\hfill \\ \hfill 24+10& \stackrel{?}{=}\hfill & 34\hfill \\ \hfill 34& =\hfill & 34\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}\end{array}\) |
|
| The solution is (8, 5). |
When both equations are already solved for the same variable, it is easy to substitute!
Example
Solve the system by substitution. \(\begin{array}{c}y=-2x+5\hfill \\ y=\frac{1}{2}x\hfill \end{array}\)
Solution
Since both equations are solved for y, we can substitute one into the other.
| Substitute \(\frac{1}{2}x\) for y in the first equation. | |
| Replace the y with \(\frac{1}{2}x.\) | |
| Solve the resulting equation. Start by clearing the fraction. | |
| Solve for x. | |
| Substitute x = 2 into y = \(\frac{1}{2}x\) to find y. | |
| The ordered pair is (2,1). | |
| Check the ordered pair in both equations: \(\begin{array}{cccc}\begin{array}{ccc}\hfill y& =\hfill & \frac{1}{2}x\hfill \\ \hfill 1& \stackrel{?}{=}\hfill & \frac{1}{2}·2\hfill \\ \hfill 1& =\hfill & 1\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}& & & \begin{array}{ccc}\hfill y& =\hfill & -2x+5\hfill \\ \hfill 1& \stackrel{?}{=}\hfill & -2·2+5\hfill \\ \hfill 1& =\hfill & -4+5\hfill \\ \hfill 1& =\hfill & 1\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}\end{array}\) |
|
| The solution is (2,1). |
Be very careful with the signs in the next example.
Example
Solve the system by substitution. \(\begin{array}{c}4x+2y=4\hfill \\ 6x-y=8\hfill \end{array}\)
Solution
We need to solve one equation for one variable. We will solve the first equation for y.
| Solve the first equation for y. | |
| Substitute −2x + 2 for y in the second equation. | |
| Replace the y with −2x + 2. | |
| Solve the equation for x. | |
|
|
|
| The ordered pair is \(\left(\frac{5}{4},-\frac{1}{2}\right).\) | |
| Check the ordered pair in both equations. \(\begin{array}{cccc}\begin{array}{ccc}\hfill 4x+2y& =\hfill & 4\hfill \\ \hfill 4\left(\frac{5}{4}\right)+2\left(-\frac{1}{2}\right)& \stackrel{?}{=}\hfill & 4\hfill \\ \hfill 5-1& \stackrel{?}{=}\hfill & 4\hfill \\ \hfill 4& =\hfill & 4\phantom{\rule{0.2em}{0ex}}✓\hfill \\ \\ \\ \\ \\ \end{array}\hfill & & & \begin{array}{ccc}\hfill 6x-y& =\hfill & 8\hfill \\ \hfill 6\left(\frac{5}{4}\right)-\left(-\frac{1}{2}\right)& \stackrel{?}{=}\hfill & 8\hfill \\ \hfill \frac{15}{4}-\left(-\frac{1}{2}\right)& \stackrel{?}{=}\hfill & 8\hfill \\ \hfill \frac{16}{2}& \stackrel{?}{=}\hfill & 8\hfill \\ \hfill 8& =\hfill & 8\phantom{\rule{0.2em}{0ex}}✓\hfill \end{array}\hfill \end{array}\) |
|
| The solution is \(\left(\frac{5}{4},-\frac{1}{2}\right).\) |
In the example below, it will take a little more work to solve one equation for x or y.
Example
Solve the system by substitution. \(\begin{array}{c}4x-3y=6\hfill \\ 15y-20x=-30\hfill \end{array}\)
Solution
We need to solve one equation for one variable. We will solve the first equation for x.
| Solve the first equation for x. | |
| Substitute \(\frac{3}{4}y+\frac{3}{2}\) for x in the second equation. | |
| Replace the x with \(\frac{3}{4}y+\frac{3}{2}.\) | |
| Solve for y. | |
Since 0 = 0 is a true statement, the system is consistent. The equations are dependent. The graphs of these two equations would give the same line. The system has infinitely many solutions.
Look back at the equations in the example above. Is there any way to recognize that they are the same line?
Let’s see what happens in the next example.
Example
Solve the system by substitution. \(\begin{array}{c}5x-2y=-10\hfill \\ y=\frac{5}{2}x\hfill \end{array}\)
Solution
The second equation is already solved for y, so we can substitute for y in the first equation.
| Substitute x for y in the first equation. | |
| Replace the y with \(\frac{5}{2}x.\) | |
| Solve for x. | |
Since 0 = −10 is a false statement the equations are inconsistent. The graphs of the two equation would be parallel lines. The system has no solutions.
This lesson is part of:
Systems of Linear Equations I