Solving Linear Equations by Graphing Both Sides
Graph each side of an equation as a line, read the x-coordinate where they cross, and learn what parallel or identical lines mean.
Key takeaways
- The equation 2x + 1 = 7 − x becomes the two lines y = 2x + 1 and y = 7 − x.
- The solution is the x-coordinate of the intersection; the y-coordinate is the common value of both sides.
- Parallel distinct lines mean no solution, and two identical lines mean every number is a solution.
- You can also graph left side minus right side and look for where it crosses the x-axis.
- A graph reading is an estimate until you substitute it into the original equation.
To solve a linear equation by graphing, treat each side as its own function, draw both lines on the same axes, and find where they cross. The x-coordinate of the crossing point is the solution, because that is the input at which the two sides have equal value.
A graph shows things that symbol-pushing hides: why there is usually one answer, why there is sometimes none, and how the two sides compare everywhere else. Its weakness is precision, so you confirm what you read.
Why the crossing point answers the question
A point lies on the graph of y = 2x + 1 exactly when its coordinates make that equation true. The same holds for y = 7 − x. A point on both lines therefore has one x and one y that satisfy both rules at once, which means 2x + 1 and 7 − x are equal to the same y, and so equal to each other.
The argument runs backward too. If some x solves 2x + 1 = 7 − x, call the common value y. Then the point (x, y) is on both lines, so it is an intersection. Solutions of the equation and intersections of the graphs match up one for one.
Nothing in this reasoning requires straight lines. The same method works for any equation with two sides you can plot, including curves, where there may be several crossings and each gives its own solution.
Two sides, two functions
Take 2x + 1 = 7 − x. Ignore the equals sign for a moment and ask what each side is worth for different x.
| x | 2x + 1 | 7 − x |
|---|---|---|
| 0 | 1 | 7 |
| 1 | 3 | 6 |
| 2 | 5 | 5 |
| 3 | 7 | 4 |
At x = 2 both sides equal 5. On a graph, that is the point (2, 5), which lies on both lines. Solving the equation means finding the x at which the heights agree.
The answer to the equation is x = 2, not the pair (2, 5). The 5 tells you what each side is worth there, which is useful in context but is not what the question asked. This view of equations as comparisons of functions is explored in solving f(x) = g(x).
Drawing the lines
Each side of a linear equation in one unknown has the form mx + b, a straight line with slope m and y-intercept b. Slope is the change in y for each increase of 1 in x.
- Write y = left side and y = right side.
- For each line, plot the y-intercept (0, b).
- Use the slope to step to a second point. For y = 2x + 1, move right 1 and up 2.
- Plot a third point as a check; it should line up.
- Draw both lines long enough to cross, and read the intersection.
You can read more about step 3 in slope-intercept form. If a side is a plain number, as in 3x − 4 = 5, its graph is the horizontal line y = 5, which crosses y = 3x − 4 at x = 3.
If a side has brackets or several terms, you may simplify it first. The graph of 2(x + 3) − 1 is the same line as 2x + 5.
The one-line alternative
Subtract the right side from the left and graph the result. For 2x + 1 = 7 − x:
y = (2x + 1) − (7 − x)
y = 3x − 6 The equation holds exactly when this difference is 0, so you look for the x-intercept. Here the line crosses the x-axis at x = 2.
Both methods are valid. The two-line picture keeps the original sides visible, which helps when they mean something, such as two prices. The difference graph needs only one line and one special place to look. Calculators often have separate commands for intersections and for zeros, matching the two methods. See finding intercepts algebraically for the exact version of the second.
Making an accurate hand sketch
Accuracy on paper depends mostly on choices made before drawing. Use graph paper, give equal steps equal spacing on each axis, and label the scale. The two axes may use different scales from each other, which is often helpful when y values are much larger than x values.
Plot points that are far apart. A line drawn through two points one square apart can swing noticeably if either is slightly off, while two distant points pin it down. Use a ruler and a sharp pencil.
Mark the intersection, then drop a vertical line from it to the x-axis and read the value there. Say your reading is 2.1. Substituting into 2x + 1 = 7 − x gives 5.2 on the left and 4.9 on the right. The left side is already larger, so the true crossing is a little to the left. That one substitution both exposes the error and tells you which way to correct it.
Three possible pictures
Two lines in a plane can relate in only three ways, and those are the three possible outcomes for a linear equation.
| Equation | Picture | Solutions |
|---|---|---|
| 2x + 1 = 7 − x | lines cross once | one: x = 2 |
| 3x + 2 = 3x − 1 | parallel, 3 units apart vertically | none |
| 2(x + 1) = 2x + 2 | one line drawn twice | every real number |
Different slopes guarantee a crossing somewhere, even if it is far off your paper. Equal slopes leave the vertical gap constant, so the lines either never meet or meet everywhere. The algebra behind this appears in why there are zero, one or infinitely many solutions.
Be careful on screen: if only one line appears, check whether the second is hiding exactly beneath it or is outside the window.
When the answer is not a nice number
Graph 0.7x + 2 = 5 − 0.4x. The lines cross between x = 2 and x = 3, somewhat nearer 3. A careful drawing might suggest 2.7.
Algebra gives the exact value.
0.7x + 0.4x = 5 − 2
1.1x = 3
x = 30/11 ≈ 2.727 Both sides then equal about 3.909.
On paper you can expect to read within a fraction of a grid square. Software can zoom in and report more digits, but a displayed decimal is still a rounded value. If an exact answer is wanted, use the graph as an estimate and a check, in the spirit of estimating before solving.
Choosing a window
A crossing you cannot see is easy to mistake for no crossing. Consider 50 + 2x = 3x − 150. Algebra gives x = 200, where both sides equal 450. A window running from −10 to 10 shows two lines nowhere near each other.
Practical steps:
- Make a short table at spread-out values such as 0, 100 and 300.
- Note which side is larger at each. A switch in order means a crossing lies between.
- Set the x range to include that interval and the y range to include the values in the table.
Nearly parallel lines also cause trouble. The equation x + 1 = 1.01x has the solution x = 100, yet in a small window the lines look parallel. Their gap shrinks by only 0.01 for each unit of x. More advice is in setting a graphing window.
Shallow crossings are also hard to read precisely, because a small thickness in the drawn line covers a wide range of x.
A worked situation
Say a hypothetical climbing gym offers two plans. Plan A is a 40 dollar joining fee plus 15 dollars per visit. Plan B has no fee and costs 25 dollars per visit. When do they cost the same?
The equation is 40 + 15v = 25v, where v counts visits. Graph y = 40 + 15v and y = 25v. Plan B starts lower, at 0, but climbs more steeply. The lines meet at v = 4, where both cost 100 dollars.
Invented prices. The gap closes by 10 dollars per visit. Hypothetical example: the numbers are made up to show the method, not a quote or an average.
The graph says more than the equation. Left of v = 4, Plan B is cheaper. Right of it, Plan A is. Only whole numbers of visits make sense, so the meaningful points are dots along each line.
That reading of "which line is higher" is exactly how you solve an inequality graphically.
Working backward from a picture
You can also read an equation from a graph. Say one line passes through (0, −1) and (2, 3), and a second line is horizontal at height 5. The first climbs 4 units over a run of 2, so its slope is 2 and its equation is y = 2x − 1. The second is y = 5.
The picture is therefore solving 2x − 1 = 5. Following the first line up to height 5 lands at x = 3, and algebra agrees: 2x = 6.
Moving the horizontal line up or down changes the target value and slides the solution along. Each height gives exactly one x, because a line with nonzero slope reaches every height once.
Strengths and limits
Graphing is good for seeing how many solutions exist, estimating their size, comparing two quantities across a range and catching sign errors in algebra. If your algebra says x = −2 and the picture shows a crossing on the right of the y-axis, something is wrong.
It is weaker when you need exact fractions, when values are very large, or when you must solve with letters in place of numbers. The same two-line idea with two unknowns becomes the graphing method for systems, which shares both the appeal and the limits.
A sensible routine is to sketch first, solve algebraically, and compare. Then substitute the answer into the original equation, which is the only test that settles the question.