Functions & Graphs

How to Graph Linear Equations

Short answer: Write the equation as y = mx + c, plot the y-intercept (0, c), then use the gradient m as rise over run to find a second point and rule a line through them. For y = 2x + 1, start at (0, 1) and go up 2 for every 1 across.

The line y = 2x + 1 with a slope triangle showing a rise of 2 for a run of 1 between the points (0, 1) and (1, 3).

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

  1. Plot the y-intercept. Put a point at (0, 1).
  2. 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).
  3. Repeat once more to check: one right and two up from (1, 3) gives (2, 5).
  4. 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.

Check Slope between (0, 1) and (1, 3): (3 − 1) ÷ (1 − 0) = 2. That matches m = 2.

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.

Table of values for y = 2x + 1
xWorkingy
−12(−1) + 1−1
02(0) + 11
12(1) + 13
22(2) + 15

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.

The input y = 2x + 1, its table for x = −1 to 2, and the four points on a straight line with a slope triangle of rise 2 and run 1.
Input, table and graph together. The yellow run of 1 and the pink rise of 2 show the gradient between (1, 3) and (2, 5).

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

  1. Open the graphing calculator and type 2x+1.
  2. In Table of values, set start −1, step 1 and 4 rows. You should see −1, 1, 3, 5.
  3. In Evaluate f(x), enter x = 0.5. The result is 2, a point between the table rows.
  4. 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

Watch for these
  • 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.

The line y = 2x + 1 with its x-intercept (−0.5, 0) marked by a circle and its y-intercept (0, 1) marked by a square.
Functions & Graphs

How to Find X- and Y-Intercepts on a Graph

Two short procedures — set y = 0 for x-intercepts, set x = 0 for the y-intercept — worked for a line and a parabola, plus how to treat calculator estimates.

Updated 3 min read
Five points of y = x² − 4 at x = −2, −1, 0, 1, 2 joined by guide lines to a table of values 0, −3, −4, −3, 0.
Graphing Basics

How to Make and Read a Graph Value Table

Choose a start value, a step and a number of rows. For y = x² − 4 from −2 to 2 the outputs are 0, −3, −4, −3, 0 — and here's what they do and don't tell you.

Updated 3 min read
Three numbered panels: typing y = 2x + 1, the plotted straight line, and a table showing f(0) = 1 and f(2) = 5.
Graphing Basics

How to Use a Graphing Calculator Online

Enter a function, check the window and read exact values. A step-by-step walkthrough using y = 2x + 1, where f(0) = 1 and f(2) = 5.

Updated 5 min read