The domain of a linear function is all real numbers. Any value of x, whether positive, negative, zero, a fraction, or a decimal, can be plugged into a linear function and produce a valid output. In interval notation, this is written as (−∞, ∞).
Why the Domain Is All Real Numbers
A linear function has the form f(x) = mx + b, where m is the slope and b is the y-intercept. There’s nothing in that equation that can break. You’re multiplying x by a constant, then adding another constant. No division by zero is possible, no square roots of negative numbers, no logarithms of zero. Every real number works as an input.
Take f(x) = 2x + 1 as an example. You can input 0, and get 1. You can input −1,000,000 and get −1,999,999. You can input 3.7 or π, and the function returns a perfectly valid output every time. The line extends infinitely in both directions along the x-axis, which is the visual confirmation that its domain has no boundaries.
Constant Functions Follow the Same Rule
A constant function like f(x) = 5 is technically a linear function where the slope m equals zero. Its graph is a horizontal line. Even though the output never changes, you can still plug in any real number for x. The domain remains all real numbers, written as (−∞, ∞). The fact that the output is always 5 affects the range (which is just {5}), not the domain.
Why Vertical Lines Are Different
You might wonder about a vertical line like x = 3. A vertical line is not a function at all. It fails the vertical line test because a single x-value (3, in this case) maps to infinitely many y-values. Since it isn’t a function, the question of domain doesn’t apply in the usual sense. Every linear function, by definition, passes the vertical line test, meaning no vertical line crosses its graph more than once.
How to Write the Domain
There are three standard ways to express “all real numbers” as a domain:
- Interval notation: (−∞, ∞)
- Set-builder notation: {x | x ∈ ℝ}, which reads “the set of all x such that x is a real number”
- Plain language: “all real numbers” or “the set of all real numbers”
Parentheses are used around the infinities because infinity is not a number you can reach or include. It simply indicates the domain keeps going without end in both directions.
When Real-World Problems Restrict the Domain
In pure math, a linear function always has a domain of all real numbers. But in word problems and applied contexts, the domain is often restricted by physical reality. A few common examples:
- Time: If a function models distance traveled over time, negative time values usually don’t make sense, so the domain might be restricted to x ≥ 0.
- Counting objects: If a function tracks the cost of buying n items, n has to be a whole number. You can’t buy 2.7 shirts. This makes the domain discrete rather than continuous.
- Physical limits: A function modeling someone climbing a 15-step ladder can only accept integer values within the range of steps available.
These restrictions come from the context, not from the math itself. The equation f(x) = 3x + 10 has a domain of all real numbers. But if that equation models the cost in dollars of buying x pounds of coffee, the domain is realistically limited to non-negative values.
Lines, Rays, and Segments on a Graph
When you look at a graph, a full line with arrows on both ends extends infinitely in each direction. Its domain is all real numbers. But not every straight graph is a full line.
A ray starts at a specific point and extends infinitely in one direction. If a ray starts at x = −4 and goes to the right forever, its domain is x ≥ −4, or [−4, ∞) in interval notation. The filled dot at −4 means that point is included.
A line segment has two endpoints. If a segment runs from x = −4 to x = 8, with a closed dot at −4 and an open dot at 8, the domain is −4 ≤ x < 8, or [−4, 8). The open circle at 8 means the function is not defined at that exact point. These are still linear relationships, but they're defined only over a portion of the x-axis, so their domains are limited intervals rather than all real numbers.
If your homework or test asks for “the domain of a linear function” without any graph or word problem attached, the answer is all real numbers: (−∞, ∞). Context is what narrows it down.

