Linear Function f(x) = mx + b: Graph, Slope, Derivative and Integral
The linear function f(x) = mx + b: slope and intercept, its straight-line graph, why its derivative is the slope m, its integral and worked examples.
Algebraic functions Updated 3 min read
At a glance
- Domain
- (-\infty, \infty)
- Range
- (-\infty, \infty) if m \ne 0
- Derivative
- m
- Integral
- \frac{m}{2}x^2 + bx + C
- Slope
- m = \frac{y_2 - y_1}{x_2 - x_1}
- y-intercept
- (0, b)
On this page
A linear function has a constant rate of change, so its graph is a straight line. Written f(x) = mx + b, the number m is the slope (how much f rises per unit of x) and b is the y-intercept (the output at x = 0).
Formula and forms
The same line can be written in other ways, depending on what you know:
| Form | Equation | Use it when you know |
|---|---|---|
| Slope-intercept | y = mx + b | the slope and y-intercept |
| Point-slope | y - y_1 = m(x - x_1) | the slope and one point |
| Standard | Ax + By = C | an equation to rearrange |
Point-slope form is the one calculus uses most, because a tangent line is built from a point (a, f(a)) and a slope f'(a).
Graph of a linear function
- m > 0: increasing. m < 0: decreasing. m = 0: a horizontal line, the constant function.
- The larger |m| is, the steeper the line.
- The x-intercept is where mx + b = 0, that is x = -\frac{b}{m} when m \ne 0.
Derivative of a linear function
The derivative of mx is m by the power rule and constant multiple rule, and the derivative of b is 0. This matches the geometry: the tangent line to a line is the line itself, and its slope never changes. The second derivative is 0, so a line has no concavity.
Integral of a linear function
Integrating a line gives a quadratic function. For a definite integral over [a, b], the region under a line is a trapezoid (or two triangles if it crosses the axis), so you can check any answer with geometry.
Worked examples
Example 1: slope from two points. Find the line through (1, 3) and (4, 9).
Example 2: derivative. If f(x) = -4x + 7, then f'(x) = -4 for every x.
Example 3: definite integral. Evaluate \int_0^2 (3x + 1)\,dx.
Check: the region is a trapezoid with parallel sides f(0) = 1 and f(2) = 7 and width 2, so its area is \frac{1 + 7}{2} \cdot 2 = 8.
Example 4: a tangent line. The tangent line to y = x^2 at x = 3 has slope 2(3) = 6 and passes through (3, 9), so it is the linear function y = 6x - 9.
Common mistakes
- Swapping the order in the slope formula. Keep the same point first on top and bottom: \frac{y_2 - y_1}{x_2 - x_1}, not \frac{y_2 - y_1}{x_1 - x_2}.
- Calling f(x) = x^2 + 1 linear. Linear means the variable appears only to the first power.
- Integrating mx as mx^2. The reverse power rule divides by the new exponent: \int mx\,dx = \frac{m}{2}x^2 + C.
- Confusing "linear function" with "linear equation in two unknowns". A vertical line x = 2 is a linear equation but not a function.
How it connects
Lines are the reason derivatives exist: the derivative at a point is the slope of the best line through it. That idea powers tangent lines, linear approximation and Newton's method. Lines are degree-one polynomial functions, and integrating them leads to quadratics.
Practice it now
Slope and rate of change
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson