Constant Function f(x) = c: Graph, Derivative, Integral and Properties
The constant function f(x) = c: its horizontal-line graph, why its derivative is 0, its integral cx + C, limits, and common mistakes with constants.
Algebraic functions Updated 3 min read
At a glance
- Domain
- (-\infty, \infty)
- Range
- The single value \{c\}
- Derivative
- 0
- Integral
- cx + C
- Graph
- A horizontal line through (0, c)
- Slope
- 0 everywhere
On this page
A constant function returns the same number no matter what you put in. Written f(x) = c, where c is a fixed real number, it is the simplest function in calculus and the starting point for every derivative and integral rule.
Definition and formula
Here c can be any real number: f(x) = 3, g(x) = -\tfrac{1}{2}, h(x) = \pi. The input x does not appear on the right-hand side, so changing x never changes the output. Examples you meet in practice include a fixed fee, a constant speed's acceleration (zero), or the value f(a) once a is fixed.
Graph of a constant function
The graph of y = c is a horizontal line crossing the y-axis at (0, c). Every point on it has the same height.
Derivative of a constant
The derivative of a constant is zero:
From the limit definition of the derivative:
Geometrically, a horizontal line has slope 0, so every tangent line is the line itself. This fact is the constant rule, and it explains why the constant term of a polynomial disappears when you differentiate.
Integral of a constant
Going backwards, a function whose derivative is c is cx, so
For a definite integral, the area under y = c from a to b is a rectangle with height c and width b - a:
If c is negative, the rectangle sits below the axis and the signed area is negative.
Key properties
- Continuous and differentiable everywhere. There are no breaks, holes or corners.
- Limits are trivial. \lim_{x \to a} c = c for every a, and also \lim_{x \to \pm\infty} c = c.
- Even function. f(-x) = f(x), so the graph is symmetric about the y-axis.
- Neither increasing nor decreasing. It is both nonincreasing and nondecreasing.
- Every point is a maximum and a minimum. Since the output never changes, every x gives both the largest and smallest value.
- Degree zero polynomial. A nonzero constant is cx^0, the bottom rung of the polynomial functions.
Worked examples
Example 1. Differentiate f(x) = 7. The derivative is f'(x) = 0.
Example 2. Differentiate g(x) = 4x^2 + 9. By the sum rule, g'(x) = 8x + 0 = 8x. The 9 contributes nothing.
Example 3. Differentiate y = \pi^2. Although it looks complicated, \pi^2 \approx 9.87 is just a number, so y' = 0.
Example 4. Evaluate \int_1^4 5\,dx. The antiderivative is 5x, so the value is 5(4) - 5(1) = 15, the area of a 5 \times 3 rectangle.
Common mistakes
- Treating constants that look like expressions as variables. e^2, \ln 3 and \sin\frac{\pi}{6} are numbers, so their derivatives are 0. Students often write \frac{d}{dx}e^2 = e^2 by mistake.
- Forgetting the x when integrating. \int 5\,dx = 5x + C, not 5 + C.
- Mixing up c and C. The constant of integration C is new and arbitrary. It is not the same number as the c in f(x) = c.
- Dropping a constant factor. The derivative of a constant term is 0, but a constant factor stays: \frac{d}{dx}(5x) = 5, not 0. See the constant multiple rule.
How it connects
A constant function is a linear function with slope 0, and the special case n = 0 of the power functions. In applications, a derivative equal to zero on an interval tells you the original function is constant there, a consequence of the mean value theorem. That is also why every antiderivative carries a +\,C: two functions with the same derivative differ by a constant. For more on this, read the guide to antiderivatives.
Practice it now
Sums and constants
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