Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 38 ยท Getting Started

Systems of Linear Equations

Solve systems of two and three linear equations by graphing, substitution and elimination, and learn to spot no-solution and infinite-solution cases.

One equation with two unknowns has infinitely many solutions. Add a second equation and, usually, you pin down exactly one pair. A system of equations is a set of equations that must all be true at once, and a solution is a set of values that satisfies every equation.

Systems appear whenever two conditions meet: two prices and two totals, two moving objects, two investments. This lesson covers the three standard methods and the three possible outcomes.

The three outcomes

Each linear equation in two variables is a straight line. Two lines can meet at one point, never meet, or be the same line.

Picture Slopes and intercepts Solutions
Lines cross different slopes exactly one
Parallel lines same slope, different intercepts none (inconsistent)
Same line same slope and intercept infinitely many (dependent)

Method 1: substitution

Solve one equation for a variable, then substitute into the other.

Example 1. Solve y = 2x - 1 and 3x + y = 9. The first is already solved for y. Substitute: 3x + (2x - 1) = 9, so 5x = 10 and x = 2. Then y = 2(2) - 1 = 3. The solution is (2, 3). Check in the second equation: 3(2) + 3 = 9.

Method 2: elimination

Add or subtract the equations so one variable disappears. You may first multiply an equation to make coefficients match.

Example 2. Solve 2x + 3y = 12 and 4x - 3y = 6. The y terms are opposites (+3y and -3y), so add the equations: 6x = 18, x = 3. Substitute into the first: 6 + 3y = 12, so y = 2. The solution is (3, 2).

Example 3. Solve 3x + 2y = 7 and 5x - 4y = 3. Multiply the first by 2: 6x + 4y = 14. Add to the second: 11x = 17, so x = 17/11. Substitute: 3(17/11) + 2y = 7 gives 2y = 7 - 51/11 = 26/11, so y = 13/11.

Python Solve a 2-by-2 system exactly

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.

The quantity a1*b2 - a2*b1 is called the determinant. When it is zero, the lines have equal slopes, so the system has no solution or infinitely many.

Recognizing special cases by hand

If elimination produces a false statement such as 0 = 5, the system is inconsistent (parallel lines). If it produces a true statement such as 0 = 0, the system is dependent (the same line).

Example 4. Solve x + 2y = 4 and 2x + 4y = 8. Multiply the first by 2: 2x + 4y = 8, identical to the second. Every point on the line works.

Example 5. Solve x + 2y = 4 and 2x + 4y = 9. Multiply the first by 2 and subtract: 0 = -1. No solution.

Systems of three equations

With three unknowns, each equation describes a plane. The strategy is to use elimination twice to remove the same variable, leaving a 2-by-2 system.

Example 6. Solve

Text
x + y + z = 6
2x - y + z = 3
x + 2y - z = 2

Add equations 1 and 3: 2x + 3y = 8. Add equations 2 and 3: 3x + y = 5. Solve the pair: from the second, y = 5 - 3x. Substitute: 2x + 3(5 - 3x) = 8, so -7x = -7 and x = 1. Then y = 2, and from equation 1, z = 3. The solution is (1, 2, 3).

Python Check a 3-by-3 solution with linear algebra

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.

Word problem

A school sells tickets. Adult tickets cost 8 dollars and student tickets cost 5 dollars. In total 120 tickets were sold for 780 dollars. How many of each? Let a be adults and s students: a + s = 120 and 8a + 5s = 780. Substitute s = 120 - a: 8a + 600 - 5a = 780, so 3a = 180 and a = 60, giving s = 60. Check: 8(60) + 5(60) = 480 + 300 = 780.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Solve x + y = 7 and x - y = 1.

    Adding gives 2x = 8, so x = 4 and y = 3.
  2. 2. Elimination gives 0 = 5. What does that mean?

    A false statement means the lines are parallel and never meet.
  3. 3. Which system has infinitely many solutions?

    The second equation is exactly twice the first, so they describe the same line.
  4. 4. How many equations are usually needed to find a unique solution for three unknowns?

    Generally you need as many independent equations as unknowns.

Summary

  • A system's solution satisfies every equation at once.
  • Two lines give one, none or infinitely many solutions.
  • Substitution suits systems where a variable is easy to isolate; elimination suits matching coefficients.
  • 0 = 5-style results mean no solution; 0 = 0 means infinitely many.
  • Three unknowns need three equations; eliminate one variable twice.

Next: Functions and Function Notation