Yes, a constant function is a linear function. A constant function like f(x) = 5 is simply a linear function where the slope equals zero. It fits the standard linear form y = mx + b with m set to 0, leaving just y = b. That said, there’s one context in higher mathematics where most constant functions don’t qualify, which is worth understanding if you’re moving beyond algebra.
Why Constant Functions Fit the Linear Form
A linear function has the general form f(x) = mx + b, where m is the slope and b is the y-intercept. Both m and b can be any real number. When m happens to be zero, the mx term drops out entirely, and you’re left with f(x) = b. That’s a constant function: no matter what value of x you plug in, the output is always the same number.
So a constant function isn’t some separate category that overlaps with linear functions by coincidence. It’s a specific case of a linear function, the one where the slope is zero. Every constant function is linear, but not every linear function is constant.
What This Looks Like on a Graph
The graph of any linear function is a straight line. A constant function like f(x) = 3 produces a horizontal line crossing the y-axis at 3. It’s still a straight line, which is consistent with it being linear. The line just happens to be flat because the output never changes regardless of x.
This is a useful visual check. If someone asks whether a function is linear, you can ask: is its graph a straight line? Horizontal lines pass that test. Curves, steps, and zigzags don’t.
The Polynomial Degree Distinction
Where things get slightly nuanced is polynomial classification. A linear function like f(x) = 2x + 1 is a first-degree polynomial because the highest power of x is 1. A constant function like f(x) = 5 is a zero-degree polynomial because there’s no x term at all. Some textbooks use this distinction to separate constant functions from “true” linear functions, calling constants degree-0 and linear functions degree-1.
This isn’t a contradiction. It’s just two different ways of slicing the same family. In the slope-intercept framework (y = mx + b), constant functions belong to the linear family. In the polynomial-degree framework, they sit one level below. Both classifications are correct within their own system, so the answer depends on which definition your course or textbook is using. In most algebra and precalculus classes, constant functions count as linear.
The Linear Algebra Exception
If you’re studying linear algebra rather than basic algebra, the word “linear” means something more specific. A linear transformation must satisfy two rules: it preserves addition (meaning T(u + v) = T(u) + T(v)) and it preserves scalar multiplication (meaning T(rv) = rT(v)). It also must map zero to zero.
Most constant functions fail these tests. If f(x) = 5 for all x, then f(0) = 5, which violates the requirement that the zero input maps to zero. And f(1 + 2) = 5, but f(1) + f(2) = 5 + 5 = 10, so the addition rule breaks.
The single exception is the zero function, f(x) = 0 for all x. This constant function does qualify as a linear transformation because it maps everything to zero, preserving both addition and scalar multiplication. So in the linear algebra sense, exactly one constant function is linear, and the rest are not.
Which Definition Applies to You
If you’re in an algebra, precalculus, or introductory calculus course, the answer is straightforward: constant functions are linear functions with a slope of zero. This is the standard taught in most curricula, including the Common Core framework, which defines linear functions using y = mx + b and treats horizontal lines as part of that family.
If you’re in a linear algebra or abstract mathematics course, the rules tighten. Only the zero function qualifies as both constant and linear under the formal definition of a linear transformation. The practical takeaway: check which definition of “linear” your class is using. In everyday math and most school settings, a constant function is absolutely a linear function.

