Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 37 ยท Systems of Equations

Solving Systems by Elimination

Learn the elimination (addition) method: add or subtract equations, multiply to match coefficients, solve a system exactly, and check with code.

Substitution works well when a variable is easy to isolate. When both equations look like Ax + By = C, elimination is often faster. The idea: add or subtract the two equations so that one variable cancels (is eliminated). That leaves one equation in one variable.

Adding equations is legal because adding equal things to equal things keeps equality: if A = B and C = D, then A + C = B + D.

Opposite coefficients: add

Example 1. Solve:

Text
x + y = 9
x - y = 3

The y terms are +y and -y: opposites. Add the equations: 2x = 12, so x = 6. Substitute in the first: 6 + y = 9, so y = 3. Solution: (6, 3). Check the second: 6 - 3 = 3.

Same coefficients: subtract

Example 2. Solve:

Text
3x + 2y = 16
3x - y = 4

The x terms match. Subtract the second equation from the first (careful with signs): (3x + 2y) - (3x - y) = 16 - 4, giving 3y = 12, so y = 4. Then 3x - 4 = 4, so x = 8/3.

Check the first: 3(8/3) + 2(4) = 8 + 8 = 16. Correct. Answers need not be whole numbers.

Multiplying first

Often no variable cancels at once. Multiply one or both equations by a number to match coefficients.

Example 3. Solve:

Text
2x + 3y = 12
5x - 2y = 11

Make the y coefficients opposites: multiply the first by 2 and the second by 3.

Text
4x + 6y = 24
15x - 6y = 33

Add: 19x = 57, so x = 3. Substitute in the first equation: 2(3) + 3y = 12, so 3y = 6 and y = 2. Solution: (3, 2).

Check the second: 5(3) - 2(2) = 15 - 4 = 11. Correct.

Multiply every term on both sides, including the right-hand constant.

flowchart TD
    A["Write both equations as Ax + By = C"] --> B["Match or oppose the<br/>coefficients of one variable"]
    B --> C["Add or subtract to<br/>eliminate it"]
    C --> D["Solve for the other variable"]
    D --> E["Substitute back and check"]

The elimination routine.

Python Elimination in code (Cramer-style elimination)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

When the elimination step produces 0x = something, the lines are parallel or identical, matching the special cases in earlier lessons.

Special cases with elimination

No solution. x + y = 4 and x + y = 9. Subtract: 0 = -5. False: no solution.

Infinitely many. 2x + 2y = 6 and x + y = 3. Multiply the second by 2: both equations are the same. Subtract: 0 = 0. True: infinitely many solutions.

Substitution or elimination?

Situation Better choice
A variable is already isolated (y = ...) Substitution
A coefficient is 1 or -1 Substitution, easily
Both in Ax + By = C form Elimination
Matching or opposite coefficients Elimination

Both give the same answer. Pick whichever keeps the arithmetic simple.

Python Verify with a linear solver

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

NumPy solves the system by a more general version of elimination. It is a handy way to confirm your hand work, not a replacement for it.

Common mistakes

  1. Subtracting signs wrongly. (3x - y) subtracted gives -3x + y.
  2. Multiplying only the left side. The right-hand side must be multiplied too.
  3. Eliminating nothing. Check that the chosen variable really cancels.
  4. Giving only one coordinate.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Solve x + y = 10 and x - y = 2. What is x?

    Adding gives 2x = 12, so x = 6 (and y = 4).
  2. 2. To eliminate y from 2x + 3y = 7 and 4x - 6y = 2, what is a good move?

    Doubling the first gives 4x + 6y = 14. The y terms are now +6y and -6y, so adding eliminates y.
  3. 3. Solve 3x + y = 10 and x + y = 4. What is y?

    Subtract: 2x = 6, so x = 3. Then y = 4 - 3 = 1.
  4. 4. Elimination of x + 2y = 5 and 2x + 4y = 11 leads to 0 = 1 after multiplying the first by 2 and subtracting. What does it mean?

    A false statement means parallel lines, so no solution.

Summary

  • Add or subtract equations to cancel a variable.
  • If no variable cancels, multiply one or both equations (every term) first.
  • Solve, back-substitute, then check both equations.
  • 0 = nonzero means no solution; 0 = 0 means infinitely many.

Next: Systems: Word Problems and Special Cases