# Solving Systems of Linear Equations: Substitution

## Gus and Alyce

Gus the snail and his friend, Alyce, are gliding towards each other along straight lines.

1. If Gus glides along the line $y = 3x + 3$ and Alyce glides along the line $y = 3x + 4$, will they crash into each other if they continue along their current routes?
2. The next day, Gus glides along the line $y = 3x - 3$ and Alyce glides along the line $y = 2x + 1$. Will they crash into each other?

In each of these cases, we have two linear equations that we need to consider together to solve a problem. In other words, we have two systems of linear equations to solve: one for each problem.

Each problem boils down to finding out if and where the straight lines corresponding to the linear equations intersect. Any points of intersection will need to satisfy all of the equations in the system.

Let's see if we can use algebra to sort out the situation with Gus and Alyce. We'll start with question 1. We have the system of linear equations:

\begin{align*} y &= 3x + 3\\ y &= 3x + 4 \end{align*}

Both of these equations start with $y = \text{something}$, so the easiest thing to do is to set them both equal to each other like this:

\begin{align*} 3x + 3 &= 3x + 4\\ \end{align*}
Subtracting $3x$ from both sides yields
\begin{align*} 3 &= 4\\ \end{align*}
which is just plain false, so the system has no solution (it is inconsistent) and the snails won't crash.

How about question 2? This time we have the system of linear equations:

\begin{align*} y &= 3x - 3\\ y &= 2x + 1 \end{align*}

If we set them both equal to each other like this:

\begin{align*} 3x - 3 &= 2x + 1,\\ \end{align*}
then adding $3$ to both sides yields
\begin{align*} 3x &= 2x + 4\\ \end{align*}
and subtracting $2x$ from both sides gives
\begin{align*} x &= 4\\ \end{align*}
Now plug this into one of the equations to find $y$:
\begin{align*} y &= 2x + 1\\ y &= 2(4) + 1 = 9 \end{align*}
So, the solution is $x = 4$ and $y = 9$. The snails collide at the point $(4,9)$.

## Subsitution

Sometimes systems of equations aren't set up as nicely as in the Gus and Alyce example, and we have to be a bit trickier when we're trying to solve them. There are two commonly used techniques for solving systems of linear equations: substitution and elimination. We're going to look at solving systems by substitution here. We'll deal with elimination in another article.

There are a number of steps involved in solving systems of linear equations by substitution (the number of times you repeat them depends on the number of variables in your system). Here they are:

1. Make one variable the subject of one of the equations (e.g. $y = 3x - 4$).
2. Replace (substitute) that variable with the expression on the right hand side of the expression from step 1.
3. Solve the other equation(s).
4. You may need to repeat this process for other variables if your system has more than two variables as your solution will be given in terms of some of the other variables.
5. Check your solution satisfies all of the equations.

Let's see this in action on some examples.

### Example 1

Solve the system of linear equations:

\begin{align*} x - y &= 5\\ 2x + y &= 4 \end{align*}

Step 1: Make one variable the subject of one of the equations:
It's easiest to do this with equation 1 to give:

$x = 5 + y$
after adding $y$ to both sides of the equation.

Step 2: Replace $x$ by $5 + y$ in the other equation (equation 2):

$2(5 + y) + y = 4$

Step 3: Solve this equation for $y$:

\begin{align*} 2(5 + y) + y &= 4\\ 10 + 2y + y &= 4\\ 10 + 3y &= 4\\ 3y &= -6 \mbox{ after subtracting 10 from both sides of the equation}\\ y &= -2 \mbox{ after dividing both sides by 3} \end{align*}
So $y = -2$.

Step 4: Plug this $y$-value into $x = 5 + y$ to complete the solution:

\begin{align*} y &= -2\\ x &= 5 + y\\ x &= 5 + (-2)\\ x &= 3 \end{align*}
So the solution is $x = 3$ and $y = -2$. We can see this as the point $(3,-2)$ of intersection of the two lines on the graph below:

Note: Because there is a solution, the equations are consistent. However, you should always check that your solution works for both equations. I'll leave that up to you.

Next, we'll try a system with 3 equations.

### Example 2

Solve the system of linear equations:

\begin{align*} x - z &= 4\\ z - 2y &= 8\\ 3x + y + 4z &= 83 \end{align*}

It's a good idea to line up the variables in columns so that you can keep track of what you're doing:

\begin{align*} x\;\;\;\; &&- &z &= &4\\ &- 2y & + &z &= &8\\ 3x\;\;\;\;& + y& + &4z &= &83 \end{align*}

Step 1: Make one variable the subject of one of the equations (it doesn't matter which equation or which variable):
It's easiest to do this with equation 1 to give:

$x = 4 + z$
after adding $z$ to both sides of the equation.

Step 2: Replace $x$ by $4 + z$ in the other equations (equations 2 and 3):

\begin{align*} &- 2y & + &z &= &8\\ 3(4 + z)\;\;\;\;& + y& + &4z &= &83 \end{align*}

Step 3: Solve these equations for $y$. Equation 2:

\begin{align*} -2y &= 8 - z \mbox{ subtracting } z \mbox{ from both sides}\\ y &= -4 + \dfrac{z}{2} \mbox{ dividing both sides by }-2 \end{align*}
Equation 3 becomes:
\begin{align*} 3(4 + z) + y + 4z &= 83\\ 12 + 3z + y + 4z &= 83\\ y + 7z &= 83 - 12 \mbox{ after collecting like terms and subtracting 12 from both sides of the equation}\\ y + 7z &= 71\\ y &= 71 - 7z \mbox{ after subtracting 7z from both sides of the equation}\\ \end{align*}

Next, choose one of these expressions to plug into the other equation. Again, it doesn't matter which, but I chose $y = 71 - 7z$ because it didn't include a fraction:

\begin{align*} -2y &= 8 - z\\ -2(71 - 7z) &= 8 - z\\ -142 + 14z &= 8 - z \mbox{ after expanding}\\ 15z &= 8 + 142 \mbox{ after collecting like terms: add z to both sides and 142 to both sides}\\ &= 150\\ z &=10 \mbox{ after dividing by 15} \end{align*}

Now, plug $z = 10$ into your expressions for $x$ and $y$ to give:

\begin{align*} -2y &= 8 - z\\ -2y &= 8 - 10\\ -2y &=-2\\ y &= 1 \mbox{ after dividing both sides by } -2\\ x &= 4 + z\\ x &= 4 + 10\\ x &= 14 \end{align*}

So the equations are consistent and the solution is $x = 14$, $y = 1$ and $z = 10$, which may be written as the point $(14,1,10)$. You should plug these values into the three equations to make sure they work for all three equations.

### Conclusion

Finding the solution to the system of three equations involved a bit of extra mucking around. Sometimes, for systems of three or more equations, it's more efficient to use the elimination technique rather than the substitution technique. You can use substitution for systems of 4, 5 or as many equations as you like, it just takes a long time. In fact, I rarely ever use substitution.

The elimination technique takes a bit of getting used to, but it can be more efficient. You can find out about it in the article on solving systems of equations by elimination.

### Description

coordinate geometry is a branch of geometry where the position of the points on the plane is defined with the help of an ordered pair of numbers also known as coordinates. In this tutorial series, you will learn about vast range of topics such as Cartesian Coordinates, Midpoint of a Line Segment etc

### Audience

year 10 or higher, several chapters suitable for Year 8+ students.

### Learning Objectives

Explore topics related to Coordinates Geometry

Author: Subject Coach
You must be logged in as Student to ask a Question.