Solving systems by graphing
Two equations each describe a whole line of points. Is there a point that makes both of them true at once, and how would you find it?
Where you are 7 in Systems of equations
Why this exists
One equation in two unknowns does not pin anything down. The equation x + y = 10 is true for (3, 7), for (4, 6), for (-2, 12) and for infinitely many other pairs, and its graph is a whole line of them (graphing a line).
Real questions often bring two conditions at once. Two car-share schemes each set a price that depends on how long you drive; which trip length gives both schemes the same price? Each condition is a line, and a pair that fits both is a point on both lines. So the first way to answer is to draw the two lines and look where they cross. This lesson is about what that crossing means, why there is usually exactly one, and the two cases where there is not.
Definition
A system of linear equations is two or more linear equations in the same unknowns, to be satisfied together. A brace groups them:
A solution of the system is an ordered pair (x, y) that makes every equation in it true when its numbers are substituted. A pair that makes only one equation true is not a solution of the system. To solve the system is to find all of its solutions.
Here (7, 3) is a solution: 7 + 3 = 10 and 7 - 3 = 4 are both true. The pair (6, 4) is not: 6 + 4 = 10 is true, but 6 - 4 = 2, not 4.
A system of two linear equations has one solution, no solution or infinitely many solutions, and Part 2 shows there is no other possibility. A system with at least one solution is consistent and one with none inconsistent.
Intuition
Part 1: a point on both lines
Figure 1 draws two lines, A for y = 2x - 5 and B for \displaystyle y = -\frac{1}{2}x + 5, and marks three points. Test each one in both equations: work out each right-hand side at the point’s x and see whether it matches the point’s y.
| Point | 2x - 5 | \displaystyle -\frac{1}{2}x + 5 |
|---|---|---|
| P(1, -3) | -3, yes | 4.5, no |
| Q(2, 4) | -1, no | 4, yes |
| C(4, 3) | 3, yes | 3, yes |
The graph of an equation is the picture of every pair that makes it true: points on line A pass the first test and points off it fail. P is on A only, so it passes one test. Q is on B only. Only the crossing C is on both lines, and so only C passes both tests. Two different lines cannot cross twice, so C is the one solution. Solving the system means finding where the lines cross.
Part 2: when the lines do not cross once
Two lines in a plane can sit in three ways, drawn in Figure 2. They can cross at one point. They can be parallel, running side by side forever with no point in common. Or the two equations, written differently, can describe the very same line, so every point of it is on both.
You can tell which case you are in before drawing anything, by putting each equation in the form y = mx + b and reading the slope and the intercept. Sometimes inspection alone is enough. In the system 2x + y = 5 and 2x + y = 8, the same quantity 2x + y would have to equal 5 and 8 at once, which no pair can manage: no solution, with no graph needed.
Results
Part 1: solutions are crossings
Solutions are common points. A pair (a, b) is a solution of a system of two equations exactly when the point (a, b) lies on both graphs.
One crossing at most. Two different lines share at most one point. Two lines with different slopes share exactly one, so their system has exactly one solution.
Part 2: how many solutions
Write both equations as y = m_1x + b_1 and y = m_2x + b_2.
- Different slopes: the lines cross once, and the system has exactly one solution.
- Equal slopes, different intercepts: the lines are parallel, and there is no solution.
- Equal slopes, equal intercepts: both equations are one line, and there are infinitely many solutions, exactly the points of that line.
A vertical line x = c has no slope, so it is compared directly. Two vertical lines x = c and x = d are parallel when c \ne d and the same line when c = d. A vertical line and a non-vertical line always cross exactly once.
Why it is true
A solution lies on both lines. The graph of an equation is the set of all pairs that make it true, no more and no fewer. A pair that makes both equations true is therefore on both graphs, and a point on both graphs gives a pair that makes both equations true.
Two different lines cannot share two points. Through two points there passes exactly one straight line. If lines A and B both went through the same two points, both would be that one line, and they would not be different lines. So two different lines share one point or none.
Different slopes always meet. Measure the vertical gap between y = m_1x + b_1 and y = m_2x + b_2 above each x:
When m_1 \ne m_2 the gap changes by the same amount, m_1 - m_2, at every step to the right, and that amount is not zero. A quantity that keeps changing steadily in one direction passes through zero exactly once, at
and at that x the two lines have the same height: that is the crossing. This is the shrinking gap from Parallel and perpendicular lines, followed all the way to zero.
Equal slopes: the gap never changes. When m_1 = m_2 the gap is b_1 - b_2 above every x. If b_1 \ne b_2 it is never zero and the lines never meet. If b_1 = b_2 it is zero everywhere and the two equations draw one line.
Worked examples
Examples 1 to 4 belong to Part 1 (checking pairs and reading crossings), Examples 5 to 7 to Part 2 (parallel lines, one line written twice, and two price plans).
Checking pairs by substitution
Decide whether each pair is a solution of the system
(a) (5, 1) (b) (2, 3) (c) (6, 2)
SolutionA pair is a solution only if it makes both equations true, so substitute into each in turn.
(a) First equation: 2(5) + 3(1) = 10 + 3 = 13, true. Second: 5 - 1 = 4, true. Both hold, so (5, 1) is a solution.
(b) First equation: 2(2) + 3(3) = 4 + 9 = 13, true. Second: 2 - 3 = -1, which is not 4. So (2, 3) is not a solution. It lies on the first line but not the second.
(c) First equation: 2(6) + 3(2) = 12 + 6 = 18, which is not 13. One failure is enough: (6, 2) is not a solution, although it does satisfy the second equation, since 6 - 2 = 4.
Parts (b) and (c) are why the definition asks for every equation: a pair can fit one condition and not the other.
Graphing two lines in slope-intercept form
Solve by graphing:
Both equations are in slope-intercept form, so each line can be drawn from its intercept by stepping with its slope.
The first line starts at (0, 1) and rises 1 for every 2 to the right: (2, 2), (4, 3), (6, 4).
The second line starts at (0, 7) and falls 1 for every 1 to the right: (1, 6), (2, 5), (3, 4), (4, 3).
Both lists reach (4, 3), and Figure 3 shows the lines crossing there. A drawing can be a little off, so check by substitution:
Both are true, so the solution is (4, 3). The slopes \displaystyle \frac{1}{2} and -1 are different, so it is the only one.
Graphing from standard form
Solve by graphing:
Equations in standard form are quickest to draw through their two intercepts, since putting x = 0 or y = 0 leaves a one-step equation.
For 3x + 2y = 12: with x = 0, 2y = 12, so y = 6, giving (0, 6). With y = 0, 3x = 12, so x = 4, giving (4, 0).
For x - y = -1: with x = 0, -y = -1, so y = 1, giving (0, 1). With y = 0, x = -1, giving (-1, 0).
Draw each line through its two points (Figure 4). They cross at (2, 3). Check:
Both are true, so the solution is (2, 3).
A crossing between the grid lines
Solve by graphing:
The first line starts at (0, 2) with slope 1. The second starts at (0, 6) with slope -2, through (1, 4), (2, 2) and (3, 0). Figure 5 shows them crossing between x = 1 and x = 2, closer to 1, at a height between 3 and 4.
The nearby grid points both fail. At (1, 3) the first equation holds, 1 + 2 = 3, but the second gives -2(1) + 6 = 4, not 3. At (2, 4) the first holds again, but the second gives -2(2) + 6 = 2, not 4. Each lies on one line only.
Reading the graph closely gives an estimate of about (1.3, 3.3). Test it: 1.3 + 2 = 3.3, but -2(1.3) + 6 = 3.4. Close, not equal. An estimate from a drawing is an estimate.
The exact crossing is \displaystyle \left(\frac{4}{3}, \frac{10}{3}\right), about (1.33, 3.33), and substitution confirms it: \displaystyle \frac{4}{3} + 2 = \frac{10}{3}, and
The graph says where to look; finding such a pair without one is the work of solving by substitution.
Parallel lines: no solution
How many solutions has this system?
Compare slopes and intercepts before drawing anything. Rewrite the first equation with y alone: subtract 6x from both sides, then divide both sides by -3.
The two lines are y = 2x - 3 and y = 2x + 2. Both slopes are 2 and the intercepts are -3 and 2: same slope, different intercepts, so the lines are parallel (the middle panel of Figure 2). The gap between them is
for every x: the second line is always 5 above the first and never touches it. No point lies on both, so the system has no solution.
Algebra says the same. Setting the two expressions for y equal gives 2x - 3 = 2x + 2, and subtracting 2x from both sides leaves -3 = 2, a false statement with no x left: the no-solution case of a one-variable equation.
The same line written twice
Solve the system:
Rewrite the first equation with y alone: subtract 3x from both sides, then divide by 6.
That is exactly the second equation. Same slope, same intercept: both equations describe one line (the right-hand panel of Figure 2). Every point on that line is on both graphs, so the system has infinitely many solutions: every pair \displaystyle \left(x, -\frac{1}{2}x + 2\right).
To name some, choose any x. With x = 0, y = 2; with x = 4, y = 0; with x = -2, y = 3. So (0, 2), (4, 0) and (-2, 3) are three of them. Check (4, 0) in the first equation: 3(4) + 6(0) = 12, true.
Infinitely many is not the same as every pair. The pair (1, 1) gives 3(1) + 6(1) = 9, not 12, so it is not a solution: it is off the line.
A quicker sign: the second equation rearranges to x + 2y = 4, and the first is that multiplied by 3. Multiplying both sides by the same non-zero number never changes which pairs make an equation true.
Two car-share schemes
Vikram books cars through a car-share club, and two schemes are on offer. Scheme A charges a booking fee of 12 dollars plus 6 dollars per hour. Scheme B charges a booking fee of 3 dollars plus 9 dollars per hour.
(a) For what length of trip do the two schemes cost the same?
(b) Which scheme is cheaper for shorter trips, and which for longer?
(c) Scheme B changes to a booking fee of 8 dollars plus 6 dollars per hour. Now when do the two cost the same?
Solution(a) Let h be the trip length in hours and C the cost in dollars. Each scheme is a line:
The slopes, 6 and 9, are different, so the lines cross exactly once. Scheme A starts at 12 and climbs 6 each hour: (1, 18), (2, 24), (3, 30). Scheme B starts at 3 and climbs 9 each hour: (1, 12), (2, 21), (3, 30). They meet at (3, 30) (Figure 6).
Check: 12 + 6(3) = 30 and 3 + 9(3) = 30. A trip of 3 hours costs 30 dollars on either scheme.
(b) Left of the crossing, B’s line is lower: for 1 hour, A costs 18 dollars and B costs 12. Right of it, A’s line is lower: for 5 hours, A costs 12 + 30 = 42 dollars and B costs 3 + 45 = 48. B is cheaper for trips under 3 hours and A for trips over 3 hours.
(c) The new scheme B is C = 8 + 6h. Its slope is 6, the same as A’s, and its intercept is 8 against A’s 12: the lines are parallel. The gap is
for every h, so the new B is always 4 dollars cheaper and the two never cost the same. This system has no solution.
Only h \ge 0 means anything here, which is why Figure 6 starts at h = 0. Plans given as tables or graphs are compared in comparing linear functions.
Boundaries
- A graph gives an estimate. Substitution confirms a reading, but when the crossing is not at integer coordinates, as in Example 4, no reading of the graph gives the exact pair. That needs algebra.
- Parallel is decided by slopes, not by eye. The lines y = 0.5x and y = 0.52x + 1 look parallel on any small grid, but their slopes differ, and they cross at (-50, -25).
- The three cases are for lines. A line and a curve, or two curves, can meet twice or more: that is systems with a curve.
- Slopes need a non-vertical line. A vertical line x = c has no slope; compare it directly, as in the Part 2 results.
- In a context, only sensible pairs count. Hours cannot be negative and tickets come in whole numbers, so a crossing at a negative or fractional value may mean nothing.
Where this goes next
Graphing gives exact answers only when the crossing lands on the grid. Solving by substitution and solving by elimination find the same point by algebra every time, and systems in word problems put them to work. The picture stays useful: systems of inequalities look for an overlap of regions instead of a crossing, systems with a curve meet a line and a parabola, and solving f(x) = g(x) with graphs uses the same idea for any two functions. With more unknowns, systems in three variables and row reduction meet the same three outcomes.
Exercises
Part 1: is the pair a solution?
- Is (5, 6) a solution of the system x + y = 11 and 2x - y = 4?
- Is (6, 5) a solution of the same system, x + y = 11 and 2x - y = 4?
- Is (2, 5) a solution of the system y = 4x - 3 and x + 3y = 17?
- Is (-2, -1) a solution of the system 7x - 3y = 4 and y = x + 1?
- Is (-4, 2) a solution of the system \displaystyle y = \frac{1}{2}x + 4 and 3x - 2y = -16?
Part 1: solve by graphing
Solve each system by graphing, then check your answer by substitution.
- y = x - 2 and y = -x + 6
- y = 3x - 5 and \displaystyle y = \frac{1}{2}x
- x + y = 2 and x - y = 8
- 2x + y = -1 and y = x + 5
- x = -3 and y = 2x + 4
- y = -x + 5 and y = 2x + 3. The crossing is not at integer coordinates. Estimate it from your graph, show that the nearest grid point is not a solution, and check that \displaystyle \left(\frac{2}{3}, \frac{13}{3}\right) is.
Part 1: reasoning
- Ursula-Jean graphs a system and reads the crossing as (3, 1). Substituting, she finds the first equation true at (3, 1) and the second false. What does this tell her about (3, 1), and what should she do next?
- Two lines have different slopes. Explain why they meet at exactly one point: never at none, and never at two.
Part 2: how many solutions?
Decide from slopes and intercepts, or by inspection, whether each system has one solution, no solution or infinitely many. When there is exactly one, find it.
- 4x + 5y = 7 and 4x + 5y = -3
- 2x - y = 5 and y = 2x - 5
- y = -x + 3 and y = x + 3
- 9x + 3y = 6 and y = -3x - 4
- x - 2y = 4 and 3x - 6y = 12. If there are infinitely many solutions, name three.
Part 2: in context
- A community garden sells trays of seedlings at 8 dollars each. The greenhouse costs 150 dollars to rent plus 3 dollars for the soil and seed in each tray. With n trays grown and sold, the income is I = 8n and the cost is C = 150 + 3n. Graph both, find the number of trays for which the income exactly covers the cost, and say what happens when more are sold.
- Two escalators run side by side, one up and one down, with their steps numbered from the bottom. Vikram steps onto the up escalator at the bottom, and after t seconds he is level with step s = 2t. At the same moment Wilhelmina steps onto the down escalator at the top, level with step 60, and after t seconds she is level with step s = 60 - 3t. When are they level with each other, and at which step?
Reasoning
- Zebedee says the system y = 2x + 1 and 4x - 2y = -2 has no solution, because the two equations look completely different. Is he right? Explain.
- For which value of k is the line 3x + ky = 12 parallel to y = -x + 2? For that k, how many solutions has the system? Is there any k that makes the two equations the same line?
Answers
- Yes. 5 + 6 = 11 is true and 2(5) - 6 = 4 is true.
- No. 6 + 5 = 11 is true, but 2(6) - 5 = 7, not 4. Order matters: (6, 5) is on the first line only.
- Yes. 4(2) - 3 = 5 is true and 2 + 3(5) = 17 is true.
- No. The second equation holds, -2 + 1 = -1, but the first gives 7(-2) - 3(-1) = -11, not 4.
- Yes. \displaystyle \frac{1}{2}(-4) + 4 = 2 is true and 3(-4) - 2(2) = -16 is true.
- (4, 2). Lines from (0, -2) with slope 1 and from (0, 6) with slope -1. Check: 4 - 2 = 2 and -4 + 6 = 2.
- (2, 1). The first line runs (0, -5), (1, -2), (2, 1); the second (0, 0), (2, 1). Check: 3(2) - 5 = 1 and \displaystyle \frac{1}{2}(2) = 1.
- (5, -3). Lines through (2, 0) and (0, 2), and through (8, 0) and (0, -8). Check: 5 + (-3) = 2 and 5 - (-3) = 8.
- (-2, 3). The first equation is y = -2x - 1; the second has intercept 5 and slope 1. Check: 2(-2) + 3 = -1 and -2 + 5 = 3.
- (-3, -2). The line x = -3 is vertical, and the second line crosses it where y = 2(-3) + 4 = -2.
- About (0.7, 4.3). The nearest grid point, (1, 4), is on the first line, -1 + 5 = 4, but not the second, 2(1) + 3 = 5. For \displaystyle \left(\frac{2}{3}, \frac{13}{3}\right): \displaystyle -\frac{2}{3} + \frac{15}{3} = \frac{13}{3} and \displaystyle \frac{4}{3} + \frac{9}{3} = \frac{13}{3}.
- (3, 1) is on the first line only, so it is not a solution and not the crossing. She should redraw and read again, and if the crossing falls between grid points, find it by algebra.
- At most one: only one line passes through two points, so two different lines cannot share two. At least one: the vertical gap (m_1 - m_2)x + (b_1 - b_2) changes by the non-zero amount m_1 - m_2 at each step, so it reaches zero, at \displaystyle x = \frac{b_2 - b_1}{m_1 - m_2}.
- No solution. The left sides are identical, and 4x + 5y cannot equal 7 and -3 at once.
- Infinitely many. 2x - y = 5 gives -y = -2x + 5, so y = 2x - 5: the same line.
- One solution, (0, 3). The slopes -1 and 1 differ, and both lines pass through their common intercept (0, 3).
- No solution. 3y = -9x + 6 gives y = -3x + 2. Both slopes are -3, with intercepts 2 and -4: parallel lines.
- Infinitely many. The second equation is the first multiplied by 3; both are \displaystyle y = \frac{1}{2}x - 2. Three solutions: (4, 0), (0, -2) and (2, -1). Check (2, -1): 2 - 2(-1) = 4 and 3(2) - 6(-1) = 12.
- 30 trays, when income and cost are both 240 dollars: 8(30) = 240 and 150 + 3(30) = 240. Beyond that the income line is above the cost line, so money is left over: at 40 trays, 320 dollars of income against 270 of cost.
- After 12 seconds, level with step 24. The lines s = 2t and s = 60 - 3t cross at (12, 24): 2(12) = 24 and 60 - 3(12) = 24.
- No. From 4x - 2y = -2, subtract 4x from both sides and divide by -2: y = 2x + 1. The two equations describe the same line, so the system has infinitely many solutions.
- k = 3, with no solution, and no k gives the same line. For k \ne 0, \displaystyle y = -\frac{3}{k}x + \frac{12}{k}, and slope -1 forces k = 3, giving y = -x + 4: parallel to y = -x + 2, so no solution, and the intercept 4 is never 2. (With k = 0 the line is x = 4, which crosses y = -x + 2 once, at (4, -2).)