Mathwords logoMathwords

Constant Function — Definition, Formula & Examples

Constant Function

A function of the form y = constant or f(x) = constant, such as y = –2.

Key Formula

f(x)=cf(x) = c
Where:
  • f(x)f(x) = the output of the function for any input $x$
  • cc = a fixed real number (the constant value)
  • xx = any real number input

Worked Example

Problem: Let f(x) = 5. Evaluate f(0), f(3), and f(−100), and describe the graph.
Step 1: Substitute each input into the function. Since f(x)=5f(x) = 5 for all xx, every output is 5.
f(0)=5,f(3)=5,f(100)=5f(0) = 5, \quad f(3) = 5, \quad f(-100) = 5
Step 2: The graph of f(x)=5f(x) = 5 is a horizontal line passing through every point whose yy-coordinate is 5.
Step 3: The slope of any horizontal line is zero, so the rate of change is 0.
m=0m = 0
Answer: Every output equals 5, and the graph is the horizontal line y=5y = 5 with slope 0.

Why It Matters

Constant functions serve as the simplest building blocks in algebra and calculus. Their derivative is always zero, making them the baseline case when you study rates of change. They also appear frequently as one piece of a piecewise function, representing intervals where a quantity stays fixed.

Common Mistakes

Mistake: Thinking a constant function has no graph or is not a "real" function.
Correction: A constant function is a valid function — every input maps to exactly one output. Its graph is a horizontal line, not a single point.

Related Terms

  • FunctionGeneral concept that a constant function is a special case of
  • ConstantThe fixed value that defines the function
  • Horizontal LineThe shape of a constant function's graph
  • SlopeAlways equals zero for a constant function
  • Linear FunctionConstant functions are linear functions with slope 0