Undefined Slope: Why Vertical Lines Have No Slope (Examples)
Undefined
Slope
No Slope
The "slope" of a vertical
line. A vertical
line has undefined slope because all points on the line have the same x-coordinate. As a result the formula used
for slope has a denominator of 0, which makes the slope undefined..
m=x2−x1y2−y1
When x1=x2, the denominator equals 0, so m is **undefined**.
Where:
m = Slope of the line
(x1,y1) = First point on the line
(x2,y2) = Second point on the line
x2−x1 = Change in x (run); equals 0 for a vertical line
y2−y1 = Change in y (rise); can be any nonzero value for a vertical line
Worked Example
Problem: Find the slope of the line passing through the points (4, 1) and (4, 7).
Step 1: Write the slope formula.
m=x2−x1y2−y1
Step 2:Substitute the coordinates: (x1,y1)=(4,1) and (x2,y2)=(4,7).
m=4−47−1
Step 3: Simplify the numerator and denominator.
m=06
Step 4:Division by zero is not allowed, so the slope is undefined. The line is vertical with equation x=4.
Answer: The slope is undefined. The line through (4, 1) and (4, 7) is the vertical line x = 4.
Another Example
This example starts from an equation rather than two given points, showing how to identify undefined slope directly from the form x = constant.
Problem: A line has the equation x = −3. Determine its slope.
Step 1:Recognize the form of the equation. The equation x=−3 means every point on the line has an x-coordinate of −3. This is a vertical line.
Step 2:Pick any two points on the line, for instance (−3,0) and (−3,5).
Step 3: Apply the slope formula.
m=−3−(−3)5−0=05
Step 4: The denominator is 0, so the slope is undefined.
Answer: The slope of the line x = −3 is undefined.
Frequently Asked Questions
What is the difference between undefined slope and zero slope?
Undefined slope belongs to vertical lines (like x = 5), where the run is 0 and you cannot divide by zero. Zero slope belongs to horizontal lines (like y = 3), where the rise is 0 and 0 divided by any nonzero number is simply 0. A horizontal line is flat; a vertical line goes straight up and down.
Is undefined slope the same as 'no slope'?
The phrase 'no slope' is informal and can be confusing because some people use it to mean zero slope. Mathematically, the correct term is 'undefined slope.' To avoid ambiguity, say 'undefined slope' for vertical lines and 'zero slope' for horizontal lines.
Why can't you just say the slope of a vertical line is infinity?
Infinity is not a real number, so saying the slope equals infinity is not mathematically precise in standard algebra. The slope formula yields division by zero, which is undefined—not a finite or infinite number. In more advanced math (like limits), you may describe the slope as approaching infinity, but in algebra courses, the correct answer is simply 'undefined.'
Undefined Slope vs. Zero Slope
Undefined Slope
Zero Slope
Type of line
Vertical line
Horizontal line
Equation form
x = constant (e.g., x = 4)
y = constant (e.g., y = 3)
Rise / Run
Nonzero rise, zero run → division by 0
Zero rise, nonzero run → 0
Slope value
Undefined (does not exist)
m = 0
Visual appearance
Straight up and down
Perfectly flat (left to right)
Why It Matters
Undefined slope appears whenever you work with vertical lines in coordinate geometry, graphing, or linear equations. Recognizing it quickly prevents errors in slope-intercept form (you cannot write a vertical line as y = mx + b). It also matters when you study perpendicular lines: a vertical line is perpendicular to a horizontal line, linking undefined slope and zero slope directly.
Common Mistakes
Mistake: Writing the slope of a vertical line as 0 instead of undefined.
Correction: Zero slope means a horizontal line (flat). For a vertical line, the denominator in the slope formula is 0, which makes the slope undefined—not zero. Remember: zero slope = horizontal, undefined slope = vertical.
Mistake: Trying to write a vertical line in slope-intercept form y = mx + b.
Correction: A vertical line cannot be expressed as y = mx + b because no real value of m exists. Instead, write the equation as x = c, where c is the constant x-coordinate shared by all points on the line.
Related Terms
Slope of a Line — General concept that includes undefined slope