A line in the coordinate plane is one of the simplest graphs you can work with, but it still teaches important ideas about domain and range. The domain of a line is the set of all possible x-values, while the range is the set of all possible y-values. In real terms, for most lines, both the domain and range are all real numbers, but vertical and horizontal lines are important exceptions. Understanding how to find the domain and range of a line helps you interpret graphs, solve equations, and recognize when a relation is a function.
Introduction to Domain and Range of a Line
In algebra, the domain tells you what input values are allowed, and the range tells you what output values can result. On a graph, the domain is shown along the x-axis, and the range is shown along the y-axis.
To give you an idea, if a graph stretches left and right forever, its domain is all real numbers. If it stretches up and down forever, its range is all real numbers. A line usually extends forever in both directions, so many lines have the domain and range:
[ (-\infty, \infty) ]
Even so, there are special cases. A vertical line does not have all real numbers as its domain, and a horizontal line does not have all real numbers as its range.
What Is the Domain of a Line?
The domain of a line is the set of all x-values that appear on the line. You can think of the domain as answering this question:
“How far left and right does the line go?”
If the line continues forever to the left and forever to the right, then the domain is all real numbers. This is written as:
[ x \in \mathbb{R} ]
or in interval notation:
[ (-\infty, \infty) ]
For most nonvertical lines, including lines that slope upward or downward, the domain is all real numbers because the line keeps moving left and right as it extends No workaround needed..
To give you an idea, the line
[ y = 2x + 3 ]
has a domain of all real numbers. No matter what x-value you choose, you can plug it into the equation and find a y-value.
What Is the Range of a Line?
The range of a line is the set of all y-values that appear on the line. It answers this question:
“How far up and down does the line go?”
If the line extends upward forever and downward forever, then the range is all real numbers. This is written as:
[ y \in \mathbb{R} ]
or in interval notation:
[ (-\infty, \infty) ]
For most nonhorizontal lines, including lines that slope upward or downward, the range is all real numbers.
To give you an idea, the line
[ y = -4x + 7 ]
has a range of all real numbers. As x gets larger or smaller, y also keeps changing without stopping Most people skip this — try not to..
The Most Common Case: Nonvertical, Nonhorizontal Lines
A line that slopes upward or downward is usually written in slope-intercept form:
[ y = mx + b ]
where:
- (m) is the slope
- (b) is the y-intercept
For any line in this form where (m) is not zero, the domain and range are both all real numbers.
For example:
[ y = 5x - 2 ]
This line slopes upward. It moves left and right forever, so the domain is:
[ (-\infty, \infty) ]
It also moves up and down forever, so the range is:
[ (-\infty, \infty) ]
Another example:
[ y = -\frac{1}{3}x + 4 ]
This line slopes downward. Even though it goes down as x increases, it still continues forever in both directions. Therefore:
[ \text{Domain: } (-\infty, \infty) ]
[ \text{Range: } (-\infty, \infty) ]
Special Case 1: Vertical Lines
A vertical line runs straight up and down. Its equation has the form:
[ x = a ]
where (a) is a constant No workaround needed..
For example:
[ x = 4 ]
This line passes through every point where the x-value is 4. Some points on the line include:
[ (4, 0), (4, 1), (4, -5), (4, 100) ]
Because the x-value never changes, the domain is only:
[ {4} ]
But the y-value can be any real number. The line goes up and down forever. So the range is:
[ (-\infty, \infty) ]
For any vertical line (x = a):
[ \text{Domain: } {a} ]
[ \text{Range: } (-\infty, \infty) ]
Vertical lines are important because they do not represent functions. Also, a function must have exactly one output for each input. On a vertical line, the same x-value has many different y-values.
Special Case 2: Horizontal Lines
A horizontal line runs straight left and right. Its equation has the form:
[ y = c ]
where (c) is a constant.
For example:
[ y = -3 ]
This line passes through every point where the y-value is -3. Some points on the line include:
[ (-2, -3), (0, -3), (5, -3), (100, -3) ]
Because the y-value never changes
...so its range is simply the single constant $c$.
To synthesize the differences between these orientations, let us categorize them by their impact on the domain and the range.
Slanted Lines For any line that is neither vertical nor horizontal—such as those expressed in slope-intercept form $y = mx + b$ where $m \neq 0$—there are no bounds on movement. No matter what $x$-value you choose, the corresponding $y$-value will always exist. Which means, the domain is all real numbers, and the range is also all real numbers. This means the line passes through every level of the vertical axis.
Vertical Lines As introduced earlier, a vertical line $x = a$ acts as a barrier perpendicular to the x-axis. While the y-values extend infinitely up and down, forcing the range to be $(-\infty, \infty)$, the strictness of the x-coordinate forces the domain to be a singleton set containing only $a$. Here, the variable $x$ cannot move; it is permanently fixed.
Horizontal Lines Returning to the horizontal line $y = c$, the situation is reversed. Unlike the slanted line, the y-value is locked at a specific height. The x-values can wander anywhere along