Skip to main content

How to Solve Systems of Equations

Written by Awn · Published · 7 min read

Quick Answer

Here is how to solve systems of equations. For substitution, solve one equation for a letter and put that into the other. For elimination, add or subtract the equations so one letter cancels. For graphing, find where the lines cross. Then put your answer into both equations to check it.

What Is a System of Equations?

A system is two or more equations with the same letters. Its solution makes all of them true together. For two linear equations, the solution is the point where two lines meet.

For example, "two tickets and one drink cost 11, and a drink costs 4 less than three tickets" gives 2x+y=112x+y=11 and y=3x−4y=3x-4.

How to Solve Systems of Equations Step by Step

  1. Line up the same letters in each equation.
  2. Choose a method from the table below.
  3. Get down to one equation with one letter, and solve it.
  4. Put that value back to find the other letter.
  5. Check both values in every original equation.

Which Method Should You Use?

What you seeMethod
A letter alone, like y=3x−4y=3x-4Substitution
Opposite terms, like +3y+3y and −3y-3yElimination
Numbers in front of every letterElimination
You want a picture or an estimateGraphing
Three or more lettersElimination, again and again

The system of equations calculator can switch methods so you can compare them.

Method 1: Graphing

Solve y=x+1y=x+1 and y=−x+5y=-x+5.

  1. Draw both lines.
  2. They cross where x+1=−x+5x+1=-x+5, at x=2x=2.
  3. Then y=3y=3. The solution is (2,3)(2,3).

How to solve systems of equations by graphing: the lines cross at 2, 3

Method 2: The Substitution Method

Solve y=3x−4y=3x-4 and 2x+y=112x+y=11.

  1. The first equation already gives yy. Put 3x−43x-4 in place of yy: 2x+3x−4=112x+3x-4=11.
  2. Solve: 5x=155x=15, so x=3x=3.
  3. Put it back: y=3(3)−4=5y=3(3)-4=5.

The solution is x=3x=3, y=5y=5.

Method 3: The Elimination Method

Solve 4x+3y=104x+3y=10 and 2x−3y=142x-3y=14.

  1. The yy terms are opposites, so add the equations: 6x=246x=24.
  2. Solve: x=4x=4.
  3. Put it back: 16+3y=1016+3y=10, so y=−2y=-2.

The solution is x=4x=4, y=−2y=-2.

If nothing cancels, multiply one or both equations first. Multiply every term, including the right side.

Solving systems of equations by elimination, step by step

What If There Is No Solution?

ResultMeaningLines
One value for each letterOne solutionCross once
A false line, like 0=30=3No solutionParallel
A true line, like 0=00=0Infinitely manyThe same line

When You Must Multiply Before Adding

Elimination needs matching terms with opposite signs. If they don't match, multiply first.

Solve 2x+3y=132x+3y=13 and 3x+2y=123x+2y=12.

  1. Choose a letter to remove, say xx. The numbers in front are 2 and 3, so aim for 6.
  2. Multiply the first equation by 3: 6x+9y=396x+9y=39.
  3. Multiply the second by 2: 6x+4y=246x+4y=24.
  4. Subtract: 5y=155y=15, so y=3y=3.
  5. Put it back: 2x+9=132x+9=13, so x=2x=2.

Check in the second equation: 3(2)+2(3)=123(2)+2(3)=12.

Remember to multiply every term, including the number on the right.

Solving With a Matrix

For three or more equations, writing the letters again and again gets slow. An augmented matrix keeps only the numbers.

Take x+y=5x+y=5 and 2x−y=12x-y=1. Write each equation as a row:

[1152−11]\left[\begin{array}{cc|c}1&1&5\\2&-1&1\end{array}\right]

  1. Replace row 2 with row 2 minus 2 times row 1: 0, −3, −90,\,-3,\,-9.
  2. That row says −3y=−9-3y=-9, so y=3y=3.
  3. Row 1 says x+3=5x+3=5, so x=2x=2.

This is elimination in a shorter form. You may swap rows, multiply a row by a number that is not zero, or add a multiple of one row to another. None of these changes the solution.

Worked Examples

Example 1: Terms That Already Cancel

Solve 5x+2y=45x+2y=4 and 3x−2y=123x-2y=12. Here the yy terms already cancel.

  1. Add: 8x=168x=16, so x=2x=2.
  2. Put it back: 10+2y=410+2y=4, so y=−3y=-3.

Example 2: Three Equations

Solve x+y+z=9x+y+z=9, 2x−y+z=82x-y+z=8 and x+2y−z=3x+2y-z=3.

  1. Add the first and third: 2x+3y=122x+3y=12.
  2. Add the second and third: 3x+y=113x+y=11, so y=11−3xy=11-3x.
  3. Substitute: 2x+33−9x=122x+33-9x=12, so −7x=−21-7x=-21 and x=3x=3.
  4. Then y=2y=2 and z=9−3−2=4z=9-3-2=4.

Example 3: A Dependent System

Solve 2x−y=12x-y=1 and 4x−2y=24x-2y=2.

  1. Double the first equation: 4x−2y=24x-2y=2. It is the same as the second.
  2. Subtract: 0=00=0. Every point on the line y=2x−1y=2x-1 works.

Example 4: A Word Problem

A movie theater sells adult tickets for 12 dollars and child tickets for 8 dollars. It sells 50 tickets for 480 dollars. How many of each?

  1. Let aa be adult tickets and cc be child tickets. Then a+c=50a+c=50 and 12a+8c=48012a+8c=480.
  2. From the first, c=50−ac=50-a.
  3. Substitute: 12a+8(50−a)=48012a+8(50-a)=480, so 12a+400−8a=48012a+400-8a=480.
  4. Then 4a=804a=80, so a=20a=20 and c=30c=30.

Check the money: 12⋅20+8⋅30=240+240=48012\cdot 20+8\cdot 30=240+240=480.

Example 5: Fractions in the Equations

Solve x2+y=5\frac{x}{2}+y=5 and x−y3=3x-\frac{y}{3}=3.

  1. Clear the fractions. Multiply the first by 2: x+2y=10x+2y=10. Multiply the second by 3: 3x−y=93x-y=9.
  2. From the second, y=3x−9y=3x-9.
  3. Substitute: x+2(3x−9)=10x+2(3x-9)=10, so 7x=287x=28 and x=4x=4.
  4. Then y=3⋅4−9=3y=3\cdot 4-9=3.

Example 6: A Line and a Curve

Solve y=x2y=x^2 and y=x+2y=x+2.

  1. Both are equal to yy, so set them equal: x2=x+2x^2=x+2.
  2. Move everything left and factor: (x−2)(x+1)=0(x-2)(x+1)=0.
  3. So x=2x=2 or x=−1x=-1.
  4. Find each yy: the points are (2,4)(2,4) and (−1,1)(-1,1).

A line and a curve can meet at two points, so always look for a second one. Straight-line systems never have exactly two.

Example 7: Two Speeds

A boat goes 24 miles downstream in 2 hours. The same trip back upstream takes 3 hours. How fast is the boat in still water, and how fast is the current?

  1. Let bb be the speed of the boat and cc the speed of the current.
  2. Downstream, the current helps: 2(b+c)=242(b+c)=24, so b+c=12b+c=12.
  3. Upstream, the current slows the boat: 3(b−c)=243(b-c)=24, so b−c=8b-c=8.
  4. Add the two equations: 2b=202b=20, so b=10b=10 and c=2c=2.

Check: downstream at 12 miles per hour for 2 hours is 24 miles. The boat goes 10 miles per hour and the current goes 2.

How to Write a System From a Word Problem

  1. Name the two things you don't know with letters.
  2. Look for two facts that involve both of them. Often one is about how many, and the other is about money, weight or distance.
  3. Write one equation for each fact.
  4. Solve with any method.
  5. Answer the question in words, and check both facts.

You need as many separate facts as you have letters. With two letters and one fact, there are many possible answers. This is also why a dependent system has no single answer: its second equation repeats the first.

What the Lines Tell You

Write both equations as y=mx+by=mx+b, where mm is the slope and bb is where the line crosses the yy-axis.

SlopesWhere they cross the yy-axisSolutions
DifferentAnywhereOne
SameDifferent placesNone, the lines are parallel
SameSame placeInfinitely many, it is one line

So you can tell how many solutions there are before you solve. For x−3y=2x-3y=2 and 2x−6y=72x-6y=7, both slopes are 13\frac{1}{3}, but the lines cross the yy-axis in different places. There is no solution.

When you are solving systems of equations on paper, a rough sketch of both lines is a good way to catch a sign mistake.

Common Mistakes

Forgetting Parentheses When You Substitute

To put y=3x−4y=3x-4 into x−2yx-2y, write x−2(3x−4)x-2(3x-4). Without parentheses, the second sign is lost.

Adding When You Should Subtract

If the terms are the same sign, such as 3y3y and 3y3y, subtract. If they are opposite, add.

Stopping After One Letter

Finding xx is only half of the answer. Put it back to find yy, and write both.

Substituting Into the Same Equation

If you solved the first equation for yy, substitute into the second one. Using the first again only gives something like 0=00=0.

Practice Problems

  1. Solve y=x−2y=x-2 and x+y=8x+y=8.
  2. Solve 2x+y=72x+y=7 and x−y=2x-y=2.
  3. Solve 3x+4y=103x+4y=10 and 5x−4y=65x-4y=6.
  4. Solve 3x−y=23x-y=2 and 6x−2y=46x-2y=4.
  5. Solve x−3y=2x-3y=2 and 2x−6y=72x-6y=7.
Show the answers
  1. x=5x=5, y=3y=3
  2. x=3x=3, y=1y=1
  3. x=2x=2, y=1y=1
  4. Infinitely many solutions: every point on y=3x−2y=3x-2
  5. No solution

Check Your Answer With the Systems Solver

Put your values into both original equations, then compare steps in the simultaneous equations calculator. You can also solve a system with determinants, using Cramer's rule. For more examples, see Systems of Linear Equations in OpenStax.

FAQ

What Are the 3 Methods for Solving Systems?

Graphing, substitution and elimination. Matrices give a fourth way, based on elimination.

Which Method Is Easiest?

Substitution, if a letter is already alone. Otherwise elimination usually needs fewer steps.

How Do You Solve a System With 3 Variables?

Eliminate the same letter from two different pairs of equations. That leaves a system with two letters, which you already know how to solve.

How Do You Check a System Solution?

Put the values into every original equation. One failure means there is a mistake.

Can a System Have Exactly Two Solutions?

Not if all the equations are linear. Two different lines can't cross twice. A line and a curve can.

Can You Add Two Equations Together?

Yes. Each side of an equation is equal to the other, so adding one equation to another adds the same amount to both sides. The balance is kept.


Next step: solve one system by substitution and again by elimination. When both agree, you can trust that you know how to solve systems of equations.

Try the Calculator

Related Pages