Some functions do a lot of work. This one does none: whatever you put in, the same number comes out. That makes the constant function the simplest in all of algebra, and a useful test case for definitions — because a rule this plain exposes exactly what “function”, “slope”, and “range” really mean.
The Definition
A constant function has the form
where
Because every point has the same
Why the Slope Is Zero
This is where the marks are lost, so it is worth doing properly. Take any two points on
Zero divided by something is zero. That is an ordinary number, and it is a complete answer.
Compare the vertical line
which is undefined, because dividing by zero is not defined. The two cases are opposites and they are constantly swapped:
| Line | Equation | Rise | Run | Slope |
|---|---|---|---|---|
| Horizontal | 0 | non-zero | ||
| Vertical | non-zero | 0 | undefined |
A memory hook that survives exam pressure: a flat road has no gradient, so zero. A cliff has no horizontal distance to divide by, so the question breaks.
Why y = k Is a Function but x = k Is Not
Apply the vertical line test. A relation is a function when every vertical line crosses its graph at most once.
— any vertical line meets it exactly once. One input, one output. It is a function. — the vertical line at lies on top of it, meeting it at every height. The single input would be paired with every possible output. Not a function.
Notice that a constant function is allowed to repeat outputs — that is all it does. What a function may never do is give one input two different outputs. Repeating outputs costs it nothing as a function; it only costs it the property of being one-to-one.
Domain and Range
- Domain: all real numbers,
. Nothing can break — there is no denominator, no root, no logarithm. - Range: the single value
.
The range is the detail people get wrong, usually by writing
Is It Linear?
Yes. Compare
Some textbooks call it a polynomial of degree zero, for the same reason:
One thing it is not is a proportional relationship, unless
Where Flat Graphs Come From
Constant functions model any quantity that does not respond to the input:
- Flat-rate pricing. A £15 delivery charge however many items you order.
- A fixed monthly fee on a bill, before usage charges are added.
- A thermostat holding a set temperature while the outside temperature changes.
- Base salary independent of hours worked.
- The zero function
, whose graph is the -axis itself.
In each case the flatness is the information: it says the output is insensitive to the input. A constant piece often appears as one branch of a piecewise function — a flat rate up to a threshold, then a rising charge beyond it.
Worked Example A: Evaluate
For
All three are
Worked Example B: Slope and Intercepts
Give the slope and intercepts of
Slope 0. The
The exception is
Worked Example C: Domain and Range
State the domain and range of
Domain
Worked Example D: From Two Points
A line passes through
Both
Whenever two given points share a
Worked Example E: Is It One-to-One?
Does
No.
Since only one-to-one functions have inverses, no constant function has one.
Common Mistakes to Avoid
- Calling the slope undefined. Zero slope is horizontal; undefined slope is vertical.
- Thinking
is a constant function. It is not a function at all. - Writing the range as all real numbers. It is the single value
. - Claiming a constant function is not linear. It is — a line of slope 0.
- Expecting an
-intercept. Only has one. - Assuming it has an inverse. It is never one-to-one.
- Substituting the input anyway. There is no
to substitute into.
Where Constant Functions Lead Next
- Piecewise definitions. Flat segments are the simplest branches of a piecewise function.
- Horizontal asymptotes. Curves that level off approach a constant function far from the origin.
- Calculus. The derivative of a constant is zero — the formal version of “slope zero” — and constants are what an indefinite integral leaves ambiguous.
- Average value. The mean of a data set is the constant function that best summarises it.
- Transformations. Adding a constant to any function shifts its whole graph vertically.
Practice Problems
Work each one before opening the answer.
Problem 1. What is the slope of
Show answer
Zero. It is a horizontal line.
Problem 2. For
Show answer
Problem 3. State the domain and range of
Show answer
Domain
Problem 4. Is
Show answer
No. It is a vertical line and fails the vertical line test.
Problem 5. Is
Show answer
Yes. Every vertical line meets it exactly once.
Problem 6. A line passes through
Show answer
Equal
Problem 7. Does
Show answer
No. It sits three units above the
Problem 8. Write
Show answer
Problem 9. Is
Show answer
No. Every input gives 9, so different inputs share an output.
Problem 10. What is the slope of
Show answer
Undefined. The run is zero, so the division is not defined.
Problem 11. A courier charges £12 regardless of parcel weight. Write the cost as a function of weight
Show answer
Problem 12. What is unusual about the constant function
Show answer
Its graph is the
Quick Reference
| Property | Constant function |
|---|---|
| Graph | horizontal line at height |
| Slope | |
| Domain | |
| Range | |
| none, unless | |
| Is it a function? | yes |
| Is it linear? | yes, with |
| One-to-one? | no |
| Has an inverse? | no |
| vertical line, undefined slope, not a function |
A constant function is the flattest member of the lines family, and it is the cleanest illustration of the slope rules and the vertical line test from functions. Its single-value range is what stops it being one-to-one. To drill the underlying ideas, try the domain and range practice problems. More Algebra lessons are available.