Graph of a linear function: y = mx + b
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.
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.
| x | y = 2x + 1 |
|---|---|
| −3 | −5 |
| −2 | −3 |
| −1 | −1 |
| 0 | 1 |
| 1 | 3 |
| 2 | 5 |
| 3 | 7 |
How to graph 2x + 1 by hand
- 1Plot the y-intercept (0, b) = (0, 1).
- 2From there, use the slope as rise over run: for m = 2, go 1 right and 2 up to (1, 3).
- 3Repeat once more, or go 1 left and 2 down to (−1, −1), to check the points line up.
- 4Draw 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.
y = -x/2 + 1Slope −1/2, same intercept: perpendicular to y = 2x + 1.y = 2x - 3Same slope, intercept −3: a parallel line 4 units lower.y = 1Slope 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?
How do you find the slope from a graph?
How do you find the x-intercept of y = mx + b?
What does the graph of y = 2x look like?
Related graphs
The basic parabola: vertex (0, 0), opens upward.
A V with its vertex at the origin, slopes ±1.
An S-shape through the origin, flat at its inflection point.
y = aˣ: growth when a > 1, decay when 0 < a < 1.
A hyperbola with asymptotes along both axes.
A staircase: jumps of 1 at every integer.
Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.