A linear equation describes a straight line. Once you can read two numbers from the equation — the gradient (slope) and the y-intercept — you can draw the graph by hand in under a minute and check it with a calculator in seconds.
The gradient–intercept form
Most school courses write a line as
y = mx + c
- m is the gradient: how much y changes when x increases by 1.
- c is the y-intercept: the value of y when x = 0, so the line crosses the y-axis at (0, c).
Our example is y = 2x + 1, so m = 2 and c = 1.
If an equation is not in this form, rearrange it first. For example, 2x − y + 1 = 0 rearranges to y = 2x + 1.
Method 1: intercept and rise over run
- Plot the y-intercept. Put a point at (0, 1).
- Use the gradient as rise over run. m = 2 = 2/1, so from (0, 1) move 1 unit right (run) and 2 units up (rise). That lands on (1, 3).
- Repeat once more to check: one right and two up from (1, 3) gives (2, 5).
- Rule the line through the points and extend it past both ends of your grid.
A negative gradient means the rise is downwards. For y = −3x + 2 you would go 1 right and 3 down.
Method 2: a table of values
A table is slower but catches mistakes. Choose a few x values, substitute each into y = 2x + 1, then plot the pairs.
| x | Working | y |
|---|---|---|
| −1 | 2(−1) + 1 | −1 |
| 0 | 2(0) + 1 | 1 |
| 1 | 2(1) + 1 | 3 |
| 2 | 2(2) + 1 | 5 |
Notice that each y value is 2 more than the one before. That constant difference is the gradient, which is why the points line up exactly.
Why one straight line holds every solution
Each point (x, y) that makes y = 2x + 1 true is a solution. Because y always increases by the same amount for each step in x, the solutions never curve. Between the table rows there are infinitely many more solutions — for example x = 0.5 gives y = 2 — and they all sit on the same line. That is why you rule a continuous line instead of plotting only the dots.
Check it with the graphing calculator
- Open the graphing calculator and type
2x+1. - In Table of values, set start −1, step 1 and 4 rows. You should see −1, 1, 3, 5.
- In Evaluate f(x), enter x = 0.5. The result is 2, a point between the table rows.
- In Roots & intersections, the x-intercept is reported as about (−0.5, 0), because 2x + 1 = 0 when x = −0.5.
Try y = 2x + 1 with a close-up window →
Special cases
- Horizontal lines such as y = 3 have gradient 0. Our calculator notes “Constant function: a horizontal line.”
- Vertical lines such as x = 2 are not functions of x, so they cannot be typed as y = f(x). Draw them by hand: every point has x = 2.
- Lines through the origin such as y = 2x have c = 0.
- Parallel lines have the same gradient: y = 2x + 1 and y = 2x − 3 never meet.
Common mistakes
- Using the run as the rise: for m = 2, go up 2 for every 1 across, not the other way round.
- Reading c from an unarranged equation: in 2x − y + 1 = 0, c is not −1 until you solve for y.
- Uneven axis scales on paper: if one square means 1 on the x-axis but 2 on the y-axis, the line looks less steep. Label your scales.
Common questions
How many points do I need?
Two points determine a line. Plot a third as a check: if it does not land on the line, one of your calculations is wrong.
What if the gradient is a fraction?
Use the numerator as the rise and the denominator as the run. For m = 2/3, go 3 right and 2 up.
Can the calculator show the gradient directly?
Not as a separate feature. Evaluate the function at two x values one unit apart and subtract: y(1) − y(0) = 3 − 1 = 2.
How this guide was made: drafted with AI assistance under the site’s editorial policy. Worked examples and plotted figures are computed by the same maths engine as our calculators and checked by automated tests. Found an error? Report a correction.