Tutorials › Linear Algebra › Solving Two Equations by Substitution

Linear Systems and Solution Sets · Tutorial 13 of 1000

Solving Two Equations by Substitution

Use an equivalent expression for one variable to reduce a two-equation system to one equation, then verify the ordered pair in both equations.

Beginner 8 min read

What You'll Learn

  • Choose an equation and variable that can be isolated without dividing by zero.
  • Substitute the resulting expression into the other equation.
  • Solve the resulting one-variable equation and recover the second variable.
  • Keep the coordinates in the stated variable order.
  • Check a proposed solution in each original equation.

From Two Equations to One

A solution to a two-variable system must satisfy both equations at once. Substitution uses one equation to express one variable in terms of the other, then replaces that variable in the second equation. The result is a single equation with one unknown. After solving it, substitute back to find the other coordinate. The method is useful because each step follows from equality: the replacement does not change which ordered pairs satisfy the system.

Unless stated otherwise, the variables and coefficients in this tutorial are real numbers. We write an ordered pair as \((x,y)\), so its first coordinate is the value of \(x\) and its second coordinate is the value of \(y\). A system such as \(a x+b y=c\) and \(d x+e y=f\) asks for all ordered pairs that satisfy both equations. The substitution steps below focus on finding a pair when the resulting one-variable equation determines one.

Definition: To solve a system by substitution, first rearrange one equation to express one variable in terms of the other, then replace that variable by the expression in the other equation. Solve the resulting one-variable equation, use the value found to recover the remaining variable, and check the ordered pair in the original system.

For example, if \(2x+y=7\), then \(y=7-2x\). Substituting \(7-2x\) for \(y\) in another equation is valid because the first equation says that \(y\) and \(7-2x\) have the same value for every solution of the system. In contrast, dividing an equation by a coefficient that is zero is never valid. When choosing what to isolate, check that the coefficient of that variable is nonzero.

Why Substitution Preserves the Solutions

Proposition: Suppose one equation of a system is \(a x+b y=c\), where \(a\ne0\), and the other is \(d x+e y=f\). The system has exactly the same solutions as the one-variable equation \(d\left(\frac{c-by}{a}\right)+e y=f\), together with the formula \(x=\frac{c-by}{a}\).

Proof. Since \(a\ne0\), the equation \(a x+b y=c\) can be rearranged by subtracting \(b y\) from both sides and dividing both sides by \(a\), giving \(x=\frac{c-by}{a}\). If \((x,y)\) solves the original system, this formula holds, and replacing \(x\) by \(\frac{c-by}{a}\) in the second equation gives \(d\left(\frac{c-by}{a}\right)+e y=f\). Conversely, suppose \(y\) satisfies that one-variable equation and set \(x=\frac{c-by}{a}\). Then \(a x+b y=a\left(\frac{c-by}{a}\right)+b y=c-by+by=c\), and the assumed one-variable equation gives \(d x+e y=f\). Thus the resulting pair satisfies both original equations. These two implications show that the substitution step neither loses nor adds solutions. \(\square\)

This proposition explains the basic workflow: the first equation supplies a formula, and the second equation supplies the condition on the remaining variable. If the coefficient of \(y\) in the first equation is nonzero, the same argument works with \(y\) isolated instead. The useful choice is often the one that gives a short expression and avoids fractions, though fractions are perfectly valid when needed.

1
Choose a variable to isolate.
Find an equation where the variable has a nonzero coefficient. If possible, choose an equation that gives a simple expression.
2
Substitute carefully.
Replace that variable everywhere it appears in the other equation. Use parentheses around the replacement when it has more than one term.
3
Solve and recover.
Solve the resulting equation for the variable that remains, then use the isolated-variable formula to find the other value.
4
Check both equations.
Insert the ordered pair into each original equation, not just the equation used to recover the second coordinate.

Worked Examples

Worked Example: Integer Values

Solve the system \(2x+y=7\), \(x-y=2\) by substitution.

The second equation gives \(x=y+2\). Substitute this expression for \(x\) in the first equation:

$$ 2(y+2)+y=7. $$

Expand and collect the \(y\)-terms:

$$ 2y+4+y=7,\qquad 3y+4=7,\qquad 3y=3,\qquad y=1. $$

Now use \(x=y+2\), so \(x=1+2=3\). In the fixed order \((x,y)\), the candidate solution is \((3,1)\).

Check: In the first equation, \(2(3)+1=6+1=7\). In the second, \(3-1=2\). Both equations hold, so \((3,1)\) is a solution.

Worked Example: A Fractional Solution

Solve \(2x+3y=1\), \(5x-y=7\). This time isolate \(y\) from the second equation.

Starting from \(5x-y=7\), subtract \(5x\) from both sides to get \(-y=7-5x\). Multiplying by \(-1\) gives \(y=5x-7\). Substitute into the first equation:

$$ 2x+3(5x-7)=1. $$

Expand the product and solve for \(x\):

$$ 2x+15x-21=1,\qquad 17x-21=1,\qquad 17x=22,\qquad x=\frac{22}{17}. $$

Recover \(y\) using \(y=5x-7\):

$$ y=5\left(\frac{22}{17}\right)-7 =\frac{110}{17}-\frac{119}{17} =-\frac{9}{17}. $$

The candidate pair, in the order \((x,y)\), is \(\left(\frac{22}{17},-\frac{9}{17}\right)\).

Check: For the first equation, \(2\left(\frac{22}{17}\right)+3\left(-\frac{9}{17}\right)=\frac{44-27}{17}=\frac{17}{17}=1\). For the second, \(5\left(\frac{22}{17}\right)-\left(-\frac{9}{17}\right)=\frac{110+9}{17}=\frac{119}{17}=7\). The pair satisfies both equations.

Worked Example: One Equation Has a Zero Coefficient

Solve \(0x+2y=6\), \(3x+y=8\). The first equation does not allow us to isolate \(x\), because its coefficient is zero. It does allow us to isolate \(y\).

From \(2y=6\), divide by \(2\) to obtain \(y=3\). Substitute \(3\) for \(y\) in the second equation:

$$ 3x+3=8,\qquad 3x=5,\qquad x=\frac{5}{3}. $$

Thus the candidate pair is \(\left(\frac{5}{3},3\right)\).

Check: In the first equation, \(0\left(\frac{5}{3}\right)+2(3)=6\). In the second, \(3\left(\frac{5}{3}\right)+3=5+3=8\). Both original equations hold.

Choosing an Equation and Reading the Result

Either equation can be used to isolate a variable, as long as the coefficient being divided by is nonzero. The result is equivalent whichever equation is chosen, but the amount of arithmetic may differ. For instance, if one equation already reads \(y=4-x\), use that expression directly rather than rearranging the other equation first. If an equation has a coefficient of \(1\) or \(-1\), isolating the corresponding variable often keeps the calculations especially simple.

Result: If \(a\ne0\), the equation \(a x+b y=c\) has the equivalent rearranged form \(x=\frac{c-by}{a}\). If \(b\ne0\), it has the equivalent rearranged form \(y=\frac{c-ax}{b}\). Each form may be used in substitution, provided the same variable is replaced in the other equation.

Proof. If \(a\ne0\), subtract \(b y\) from \(a x+b y=c\) to obtain \(a x=c-by\), then divide both sides by \(a\) to obtain \(x=\frac{c-by}{a}\). Reversing these steps is allowed because \(a\ne0\): multiplying by \(a\) and adding \(b y\) recovers \(a x+b y=c\). If \(b\ne0\), subtract \(a x\) to obtain \(b y=c-ax\), then divide by \(b\); reversing those steps recovers the original equation. Therefore each displayed form is equivalent to its original equation under the stated condition. \(\square\)

After substitution, the remaining equation may have a nonzero coefficient on its variable, so that variable can be found by division. If its coefficient is zero, do not divide by zero. Instead, read the resulting statement as it stands: it may be a false numerical equality, or it may hold for every value of the remaining variable. In either situation, the calculation has not produced one uniquely determined value by ordinary division. Detailed descriptions of those system outcomes belong with the study of solution sets.

Common Mistakes

Sign error when substituting. Consider \(x+2y=8\), \(3x-y=3\). The first equation gives \(x=8-2y\). Substituting into the second must keep the minus sign before \(y\). A wrong calculation is

$$ 3(8-2y)-y=3 \quad\not\Rightarrow\quad 24-6y+y=3. $$

The term \(-y\) remains negative, so the correct expansion is \(24-6y-y=3\). Hence \(-7y=-21\), \(y=3\), and \(x=8-2(3)=2\). Check: \(2+2(3)=8\), and \(3(2)-3=3\). The wrong expansion would instead give \(y=\frac{21}{5}\) and \(x=-\frac{2}{5}\), which fails the second equation because \(3\left(-\frac{2}{5}\right)-\frac{21}{5}=-\frac{27}{5}\ne3\).

Other checks to make:

  • Use parentheses when substituting an expression such as \(5x-7\), especially if it is multiplied by a coefficient.
  • Do not divide by a zero coefficient. Try isolating the other variable or use an equation with a nonzero coefficient.
  • Do not reverse the coordinate order. If \(x=3\) and \(y=1\), the ordered pair is \((3,1)\), not \((1,3)\).
  • Check the final pair in both original equations. A value obtained from one equation alone need not satisfy the other.

Substitution is more than a shortcut for arithmetic: it is a sequence of equivalent replacements and reversible algebraic steps. Keeping track of why each step is valid helps prevent sign errors and makes the final check meaningful. It also gives a reliable method for solving small systems when one equation can be rearranged conveniently.

Check Your Understanding

For each system, show the isolated-variable expression, the substituted equation, and the ordered pair. Check your pair in both original equations.

  1. Solve \(x+y=6\), \(2x-y=3\) by isolating \(y\) in the first equation.
  2. Solve \(3x+2y=4\), \(x-y=1\) by isolating \(x\) in the second equation.
  3. In \(0x+4y=12\), which variable can be isolated directly, and why can the other not be isolated from this equation alone?
  4. For \(2x-y=5\), \(x+3y=4\), write an equivalent expression for \(y\) from the first equation and substitute it into the second. Do not skip parentheses.
  5. Explain why replacing \(x\) by an expression equal to \(x\) in one equation preserves solutions only when the expression comes from a valid rearrangement.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon