Skip to main content
Logo image

Chapter 5 Variables and Substitutions

Section 5.1 This is a That

We have previously seen how we can substitute a number for a variable. This led us to write sentences like "If \(x = 3\text{,}\) then \(2x + 1 = 7\text{.}\)"
We are not restricted to just single variable expressions. It is often the case that a problem is modeled using multiple variables. Algebraically, this is just a matter of making sure you use the correct value for the correct variable. But there are some potential pitfalls as the substitutions become more complex.

Activity 5.1. Substituting for Multiple Variables.

The problem is fundamentally about demonstrating that you can make substitutions and perform the corresponding arithmetic correctly. When making a substitution, it is helpful to be in the habit of putting that substitution inside of parentheses. Sometimes it’s necessary, and sometimes it’s extraneous. Over time, you will have the experience and insight to see whether it’s necessary, but to start off it’s best be in the habit of using parentheses all the time.
Here is a presentation for finding the value of \(3a - 2b\) when \(a = 2\) and \(b = 4\text{:}\)
\begin{equation*} \begin{aligned} 3a - 2b \amp = 3(2) - 2(4) \amp \eqnspacer \amp \text{Substitute $a = 2$ and $b = 4$} \\ \amp = 6 - 8 \amp \amp \text{Arithmetic} \\ \amp = -2 \amp \amp \text{Arithmetic} \end{aligned} \end{equation*}
\begin{equation*} \text{If and then } \end{equation*}
Try it!
Determine the value of the expression \(2x + 5y\) when \(x = 3\) and \(y = -2\text{.}\) Show the calculation and write your result as an if-then statement.
Solution.
\begin{equation*} \begin{aligned} 2x + 5y \amp = 2(3) + 5(-2) \amp \amp \text{Substitute $x = 3$ and $y = -2$} \\ \amp = 6 + (-10) \amp \amp \text{Arithmetic} \\ \amp = -4 \amp \amp \text{Arithmetic} \end{aligned} \end{equation*}
\begin{equation*} \text{If $x = 3$ and $y = -2$, then $2x + 5y = -4$.} \end{equation*}
A major step in your mathematical thinking is the ability to apply previous results in new settings, and combining old ideas in new ways. We have talked about substituting a value for a variable, and we’ve talked about solving for a variable. We can combine the two into a new type of problem.

Activity 5.2. Substituting a Value for a Variable and Solving.

Here is an example of combining the two ideas together. Consider the equation \(3m + 5n = 30\text{.}\) This equation has two variables in it. If we declare a value for one of the variables, then we can solve for the other one. For example, if we are told that \(m = 5\text{,}\) then we have the following:
\begin{equation*} \begin{aligned} 3m + 5n \amp = 30 \\ 3(5) + 5n \amp = 30 \amp \eqnspacer \amp \text{Substitute $m = 5$} \\ 15 + 5n \amp = 30 \amp \amp \text{Arithmetic} \\ 5n \amp = 15 \amp \amp \text{Subtract $15$ from both sides} \\ n \amp = 3 \amp \amp \text{Divide both sides by 5} \end{aligned} \end{equation*}
Try it!
Solve the equation \(3m + 5n = 30\) for when \(n = -2\text{.}\) Use a complete presentation.
Solution.
\begin{equation*} \begin{aligned} 3m + 5n \amp = 30 \\ 3m + 5(-2) \amp = 30 \amp \amp \text{Substitute $n = -2$} \\ 3m + (-10) \amp = 30 \amp \amp \text{Arithmetic} \\ 3m \amp = 40 \amp \amp \text{Add $10$ to both sides} \\ m \amp = \frac{40}{3} \amp \amp \text{Divide both sides by $3$} \end{aligned} \end{equation*}
There are other types of substitutions that we can make. In the definition of a variable (Definition 2.1), we said that variables can also represent mathematical expressions. Fortunately, there is no conceptual difference between the two. It all comes down to the proper execution of algebra.

Activity 5.3. Substituting an Expression for a Variable.

When substituting an expression for a variable, it is important to wrap the expression inside of parentheses. This small detail is extremely important because it represents a container that holds the entire contents of the variable. Failure to do so will often lead to failing to properly apply the distributive property or committing other types of errors.
This is how it looks to substitute \(x = 2y - 1\) into the expression \(-x + 6\text{:}\)
\begin{equation*} \begin{aligned} -x + 6 \amp = -(2y - 1) + 6 \amp \eqnspacer \amp \text{Substitute $x = 2y - 1$} \\ \amp = -2y + 1 + 6 \amp \amp \text{Distributive property} \\ \amp = -2y + 7 \amp \amp \text{Combine like terms} \end{aligned} \end{equation*}
Try it!
Substitute \(a = -2b + 3\) into the expression \(-2a - 5\) and simplify the result. Use a presentation.
Solution.
\begin{equation*} \begin{aligned} -2a - 5 \amp = -2(-2b + 3) - 5 \amp \amp \text{Substitute $a = -2b + 3$} \\ \amp = 4b - 6 - 5 \amp \amp \text{Distributive property} \\ \amp = 4b - 11 \amp \amp \text{Combine like terms} \end{aligned} \end{equation*}

Activity 5.4. Substituting an Expression for a Variable and Solving.

Conceptually, substituting into an expression is not different from substituting into an equation because an equation is just two expressions that are claimed to represent the same value.
Try it!
Substitute \(x = 2y + 1\) into the equation \(3x - 2y = 7\) and solve for Use a complete presentation.
Solution.
\begin{equation*} \begin{aligned} 3x - 2y \amp = 7 \\ 3(2y + 1) - 2y \amp = 7 \amp \amp \text{Substitute $x = 2y + 1$} \\ 6y + 3 - 2y \amp = 7 \amp \amp \text{Distributive property} \\ 4y + 3 \amp = 7 \amp \amp \text{Combine like terms} \\ 4y \amp = 4 \amp \amp \text{Subtract $6$ from both sides} \\ y \amp = 1 \amp \amp \text{Divide both sides by $4$} \end{aligned} \end{equation*}

Section 5.2 Worksheets

PDF Version of these Worksheets
 1 
external/worksheets/05-Worksheets.pdf

Worksheet Worksheet 1

1.
Determine the value of the expression \(3p + 5q\) when \(p = -2\) and \(q = -1\text{.}\) Show the calculation and write your result as an if-then statement.
2.
Substitute \(b = 3a - 5\) into the expression \(2b + 3\) and simplify the result. Use a complete presentation.
3.
Check the presentation for errors. If you find one, circle it and describe the mistake in words.
\begin{equation*} \begin{aligned} -x + 5 \amp = -y + 3 + 5 \amp \eqnspacer \amp \text{Substitute $x = y + 3$} \\ \amp = -y + 8 \amp \amp \text{Arithmetic} \end{aligned} \end{equation*}

Worksheet Worksheet 2

1.
Determine the value of the expression \(4a - 3b\) when \(a = -3\) and \(b = 4\text{.}\) Show the calculation and write your result as an if-then statement.
2.
Substitute \(n = -2m + 1\) into the expression \(-n + 2\) and simplify the result. Use a complete presentation.
3.
Substitute \(y = 2x - 3\) into the expression \(2x + 3y\) and simplify the result. Use a complete presentation.

Worksheet Worksheet 3

1.
Determine the value of the expression \(x - y^2\) when \(x = 2\) and \(y = -3\text{.}\) Show the calculation and write your result as an if-then statement.
2.
Solve the equation \(-3a + 4b - 7 = 5\) for when \(b = -2\text{.}\) Use a complete presentation.
3.
Check the presentation for errors. If you find one, circle it and describe the mistake in words.
\begin{equation*} \begin{aligned} -3p + 4q \amp = 5 \\ -3(q - 4) + 4q \amp = 5 \amp \eqnspacer \amp \text{Substitute $p = q - 4$} \\ -3q - 12 + 4q \amp = 5 \amp \amp \text{Distributive property} \\ q - 12 \amp = 5 \amp \amp \text{Combine like terms} \\ q \amp = 17 \amp \amp \text{Add 12 to both sides} \end{aligned} \end{equation*}

Worksheet Worksheet 4

1.
Substitute \(s = -2t + 1\) into the equation \(2s + 1 = 4\) and solve for the variable. Use a complete presentation.
2.
Solve the equation \(3m - 2n - 7 = 5\) for when \(m = 4n - 3\text{.}\) Use a complete presentation.
3.
Substitute \(x = 3\) into the expression \(x^2 - 6x + 9\) and simplify the result. Use a complete presentation.

Worksheet Worksheet 5

1.
Check the presentation for errors. If you find one, circle it and describe the mistake in words.
\begin{equation*} \begin{aligned} 5x - y \amp = 4 \\ 5x - (3x + 4) \amp = 4 \amp \eqnspacer \amp \text{Substitute $y = 3x - 2$} \\ 5x - 3x - 4 \amp = 4 \amp \amp \text{Distributive property} \\ 2x - 4 \amp = 4 \amp \amp \text{Combine like terms} \\ 2x \amp = 0 \amp \amp \text{Subtract $4$ from both sides} \\ x \amp = 0 \amp \amp \text{Divide both sides by $2$} \end{aligned} \end{equation*}
2.
Substitute \(n = -2m - 3\) into the expression \(-3m - 2n + 5\) and simplify the result. Use a complete presentation.
3.
Solve the equation \(-2a + 3b - 7 = b\) for when \(b = -a + 2\text{.}\) Use a complete presentation.

Section 5.3 Deliberate Practice: Substitute and Solve

Algebra is a skill, which means it requires practice to become proficient. But it will take more than rote repetition to get there. Deliberate practice is the thoughtful repetition of a task. For each of these sections, you will be given a list of specific skills or ideas to focus on as you practice thinking through the problems.
Focus on these skills:
  • Write the original equation.
  • Use parentheses with the substitution.
  • Be careful with negative signs and the distributive property.
  • Present your work legibly.

Worksheet Worksheet

Instructions: Substitute the first equation into the second equation, then solve for the remaining variable.
1.
\(y = 3x + 4; \quad 2x + 3y = -6\)
2.
\(a = 3b - 2; \quad 4a - 3b = 7\)
3.
\(m = n - 4; \quad -2m + 3m - 5 = -8\)
4.
\(t = -2s + 3; \quad 3s - 2t + 7 = 7\)
5.
\(b = -3a + 1; \quad 4a - b - 4 = 4\)
6.
\(x = - y + 3; \quad -3x - 4y + 6 = 0\)
7.
\(u = 2v - 4; \quad 3u + 4v - 3 = -2u - 5\)
8.
\(r = 3s + 1; \quad -r + 3s - 3 = 4r - 3s + 7\)
9.
\(x = -2y + 3; \quad 2x - y + 4 = x - 3y - 6\)
10.
\(n = -3m - 4; \quad 2m - 3n - 1 = -2m + 4n + 5\)

Section 5.4 Closing Ideas

The use of variables to represent other variable expressions is an extremely important skill in mathematics. In your college math course, you will likely see that function notation can lead you to make the exact same type of substitutions. Here is a brief preview of that.
Suppose we define the function \(f(x) = x^2 - 2\text{.}\) To evaluate the function means to substitute for the variable and simplify the result. Here are some examples.
  • \(\displaystyle f(y) = y^2 - 2\)
  • \(\displaystyle f(x - 3) = (x - 3)^2 - 2\)
But students start to struggle with this concept as soon as we start substituting objects other than numbers:
  • \(\displaystyle f(y) = y^2 - 2\)
  • \(\displaystyle f(x - 3) = (x - 3)^2 - 2\)
(In the second case, you might be asked to simplify the expression.)
The actual concept involved is exactly what we’ve done in this section. We’ve simply replaced the variable of the function with a variable expression. But students who lack a clear understanding of this concept end up with all sorts of wrong answers. Here are some examples:
  • \(\displaystyle f(x - 3) = (x^2 - 3) - 2\)
  • \(\displaystyle f(x - 3) = x - 3^2 - 2\)
  • \(\displaystyle f(x - 3) = (x^2 + 2) - 3\)
These sorts of erroneous manipulations stem from a much deeper place than most students realize. Some students don’t even want to try to think through the problem, and so they just guess and hope for the best. And there’s some human psychology to this. They feel so accustomed to being wrong in math classes that they’ve simply given up trying to be right. Their mentality has shifted to "I’m just going to write down something and wait for someone to tell me what the right thing is." And so they just scribble down symbols and hope for the best. As we keep making our way through the different topics, remember that mathematical thinking includes having a clear sense of what you’re doing and why you’re doing it. Everything is supposed to be logical, and everything is supposed to make sense.
Most of the errors above stem from students simply not taking the time to think carefully. In fact, many students can find their errors after they start to try to explain what they’re doing and why they’re doing it. In other words, most students know enough to fix their own errors, if they would just take the time to think more carefully about it.
Success in mathematics is attainable through the consistent effort of careful and thoughtful practice. It’s not about being fast or even being smart. Math is a learned skill like every other learned skill, which means that you can learn it by putting in the time and the effort. So do not sell yourself short by refusing to try to learn. You’re going to make mistakes, and that’s okay. Just keep trying to do a little bit better every time.

Section 5.5 Going Deeper: Disappearing Variables

In all the equations that we’ve solved so far, it has always been the case that the last line of work has given us a specific number or expression for the variable of interest. Let’s look at solving the equation \(3x + 7 = -2\text{.}\)
\begin{equation*} \begin{aligned} 3x + 7 \amp = -2 \\ 3x \amp = -9 \amp \eqnspacer \amp \text{Subtract $7$ from both sides} \\ x \amp = -3 \amp \amp \text{Divide both sides by $3$} \\ \end{aligned} \end{equation*}
We have been interpreting the last line as telling us that when \(x = -3\text{,}\) the original equation is true. We can even check this by explicit substitution.
\begin{equation*} \begin{aligned} 3x + 7 \amp = - 2 \\ 3(-3) + 7 \amp \overset{?}{=} -2 \amp \eqnspacer \amp \text{Substitute $x = -3$} \\ -2 \amp \overset{\checkmark}{=} -2 \\ \end{aligned} \end{equation*}
But what happens when the variable disappears? Consider the following attempt at solving an equation:
\begin{equation*} \begin{aligned} 3(x + 2) + 5 \amp = 3x + 7 \\ 3x + 6 + 5 \amp = 3x + 7 \amp \eqnspacer \amp \text{Distribute} \\ 3x + 11 \amp = 3x + 7 \amp \amp \text{Arithmetic} \\ 11 \amp = 7 \amp \amp \text{Subtract $3x$ from both sides} \end{aligned} \end{equation*}
How can we interpret the this? The first thing to observe is that the equation is false. The numbers 11 and 7 are definitely not the same.
What this is telling us is that there are no values of the variable that make the equation true. The equation will always be false, no matter what value we choose the variable to be. A concise way of saying this is to say that there are no solutions to the equation. We can pick some values of and check this.
\begin{equation*} \begin{array}{cc} \begin{array}{c} \underline{x = 1} \\ \begin{aligned} 3(x + 2) + 5 \amp = 3x + 7 \\ 3(1 + 2) + 5 \amp \overset{?}{=} 3(1) + 7 \\ 14 \amp \neq 10 \\ \end{aligned} \end{array} \hspace{2cm} \begin{array}{c} \underline{x = 2} \\ \begin{aligned} 3(x + 2) + 5 \amp = 3x + 7 \\ 3(2 + 2) + 5 \amp \overset{?}{=} 3(2) + 7 \\ 17 \amp \neq 13 \\ \end{aligned} \end{array} \\ \\ \begin{array}{c} \underline{x = 3} \\ \begin{aligned} 3(x + 2) + 5 \amp = 3x + 7 \\ 3(3 + 2) + 5 \amp \overset{?}{=} 3(3) + 7 \\ 20 \amp \neq 16 \\ \end{aligned} \end{array} \hspace{2cm} \begin{array}{c} \underline{x = 4} \\ \begin{aligned} 3(x + 2) + 5 \amp = 3x + 7 \\ 3(4 + 2) + 5 \amp \overset{?}{=} 3(4) + 7 \\ 23 \amp \neq 19 \\ \end{aligned} \end{array} \end{array} \end{equation*}
Here is something else that may happen:
\begin{equation*} \begin{aligned} 2(2x - 1) + 3 \amp = 4(x + 1) - 3 \\ 4x - 2 + 3 \amp = 4x + 4 - 3 \amp \eqnspacer \amp \text{Distribute} \\ 4x + 1 \amp = 4x + 1 \amp \amp \text{Arithmetic} \\ 1 \amp = 1 \amp \amp \text{Subtract $4x$ from both sides} \end{aligned} \end{equation*}
Once again, the variable disappeared. But this time, we have a true equation. What this means is that regardless of the value of the variable, the equation will always be true. A shorter way of saying that is that can be any real number. We will check a few examples to demonstrate this.
\begin{equation*} \begin{array}{cc} \begin{array}{c} \underline{x = 1} \\ \begin{aligned} 2(2x - 1) + 3 \amp = 4(x + 1) - 3 \\ 2(2(1) - 1) + 3 \amp \overset{?}{=} 4(1 + 1) - 3 \\ 5 \amp \overset{\checkmark}{=} 5 \\ \end{aligned} \end{array} \hspace{2cm} \begin{array}{c} \underline{x = 2} \\ \begin{aligned} 2(2x - 1) + 3 \amp = 4(x + 1) - 3 \\ 2(2(2) - 1) + 3 \amp \overset{?}{=} 4(2 + 1) - 3 \\ 9 \amp \overset{\checkmark}{=} 9 \\ \end{aligned} \end{array} \\ \\ \begin{array}{c} \underline{x = 3} \\ \begin{aligned} 2(2x - 1) + 3 \amp = 4(x + 1) - 3 \\ 2(2(3) - 1) + 3 \amp \overset{?}{=} 4(3 + 1) - 3 \\ 13 \amp \overset{\checkmark}{=} 13 \\ \end{aligned} \end{array} \hspace{2cm} \begin{array}{c} \underline{x = 4} \\ \begin{aligned} 2(2x - 1) + 3 \amp = 4(x + 1) - 3 \\ 2(2(4) - 1) + 3 \amp \overset{?}{=} 4(4 + 1) - 3 \\ 17 \amp \overset{\checkmark}{=} 17 \\ \end{aligned} \end{array} \end{array} \end{equation*}
As we continue with various types of algebraic calculations and manipulations, there will be other times when a variable will be missing from an equation or an expression. For example, consider the following: Substitute \(x = 4\) and \(y = 2\) into the expression \(2x - 7\text{.}\) The substitution into the \(x\) term is clear, but what does it mean to substitute for when there is no \(y\) variable?
The insight comes from looking at our calculations above. What caused the variable terms to disappear? It’s both obvious and subtle at the same time. In the last step, we subtracted off a certain quantity that caused the variable terms to cancel out. Let’s break that down more carefully:
\begin{equation*} \begin{aligned} 4x + 1 \amp = 4x + 1 \\ (4x + 1) - 4x \amp = (4x + 1) - 4x \amp \eqnspacer \amp \text{Subtract $4x$ from both sides} \\ 4x - 4x + 1 \amp = 4x - 4x + 1 \amp \amp \text{Rearrange the terms} \\ (4 - 4)x + 1 \amp = (4 - 4)x + 1 \amp \amp \text{Group and factor out the $x$} \\ 0x + 1 \amp = 0x + 1 \amp \amp \text{Arithmetic} \\ 0 + 1 \amp = 0 + 1 \amp \amp \text{Arithmetic} \\ 1 \amp = 1 \amp \amp \text{Arithmetic} \\ \end{aligned} \end{equation*}
The last two arithmetic steps are what cause the variable term to go away. We’re using the fact that zero multiplied by any number is zero and that zero added to any number does not change the value. And by these observations, we are explaining why it makes sense for us to simplify the expression so that the variable is not shown. But this does not say that the variable doesn’t exist anymore. In some sense, the term is still there. We’re just not bothering to write it down because it doesn’t have any impact on the quantity being expressed.
And that brings us back to the two-variable substitution. Even though we’re only writing \(2x - 7\text{,}\) you should really be thinking about it as something like \(2x + 0y - 7\text{.}\) We say that the expression \(2x - 7\) is \emph{independent of the variable and that simply means that changing the value of has no impact on the value of the expression.
The first place that students run into this is when we define functions. For example, let’s say we define the function \(f(x) = 4\text{.}\) What is \(f(2)\text{?}\) We know that this means we’re supposed to plug in 2 for \(x\) but there are no \(x\) variables anywhere. The expression is independent of and so \(f(x) = 4\) regardless of what value of \(x\) is chosen.
This may seem like a small point, but the concept of functions or other expressions being independent of certain variables comes up regularly in both pure and applied mathematical settings. So it’s helpful to understand this idea sooner rather than later.