Skip to content
ihateDesmos

Graph of a linear function: y = mx + b

Updated 20 October 2026 · Values computed by the ihateDesmos engine

A linear function graphs as a straight line. In y = mx + b, the number m is the slope (how far the line rises for every 1 unit across) and b is where it crosses the y-axis. For y = 2x + 1 the line climbs 2 for every 1 to the right and crosses the y-axis at 1.

−4−224−220
Open in calculator
The graph of
y=2x+1
for −5 ≤ x ≤ 5. Dots mark its x- and y-intercepts.

Key features

Domain
All real numbers
Range
All real numbers (unless m = 0)
Slope
m = 2: up 2 for every 1 to the right
y-intercept
b = 1, the point (0, 1)
x-intercept
(−1/2, 0), found by solving 2x + 1 = 0
Monotonic
Increasing, because m > 0
y-intercept
(0, 1)
Derivative
2
Antiderivative
x2+x+C

Derivative and antiderivative from the calculator’s algebra system. Domain, range and asymptotes are stated for real x.

What the graph of 2x + 1 looks like

Every linear function has a constant rate of change. Between any two points on the line, the rise divided by the run is the same number, the slope m. That is what makes the graph straight.

A positive slope rises from left to right, a negative slope falls, and m = 0 gives a horizontal line y = b. Vertical lines, x = c, are not functions of x at all, because one x has many y-values.

Two lines are parallel when they have the same slope, and perpendicular when their slopes multiply to −1, such as 2 and −1/2.

Points of interest

Found numerically to about twelve digits in the window −5 ≤ x ≤ 5, then shown in exact form where one exists.

x-intercepts (roots)
x = −1/2
Local maxima
None in this window
Local minima
None in this window
Inflection points
(−5, −9), (−4.9975, −8.995), (−4.995, −8.99), (−4.9925, −8.985), (−4.99, −8.98), (−4.9875, −8.975) … (4001 in view)

Table of values

A few points to plot, with exact values where they are simple.

Values of 2x + 1
xy = 2x + 1
−3−5
−2−3
−1−1
01
13
25
37

How to graph 2x + 1 by hand

  1. 1
    Plot the y-intercept (0, b) = (0, 1).
  2. 2
    From there, use the slope as rise over run: for m = 2, go 1 right and 2 up to (1, 3).
  3. 3
    Repeat once more, or go 1 left and 2 down to (−1, −1), to check the points line up.
  4. 4
    Draw a straight line through the points across the whole grid, with arrows at both ends.

Transformations

How the graph moves when you change the formula. The original is 2x + 1 in blue.

−4−224−220
  • y = -x/2 + 1 Slope −1/2, same intercept: perpendicular to y = 2x + 1.
  • y = 2x - 3 Same slope, intercept −3: a parallel line 4 units lower.
  • y = 1 Slope 0: the horizontal line y = 1.

Common mistakes

  • Swapping rise and run. Slope is change in y over change in x.
  • Reading b as the x-intercept. b is where the line meets the y-axis.

Frequently asked questions

What is the graph of a linear function?
A straight line. In y = mx + b, m is the slope and b is the y-intercept.
How do you find the slope from a graph?
Pick two points on the line, then divide the change in y by the change in x between them.
How do you find the x-intercept of y = mx + b?
Set y = 0 and solve: x = −b/m. For y = 2x + 1 that is x = −1/2.
What does the graph of y = 2x look like?
A straight line through the origin that rises 2 units for every 1 unit to the right.

Related graphs

Graph 2x + 1 your way

Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.

Open in the calculator