In short
The slope formula is m = \dfrac{\Delta y}{\Delta x} = \dfrac{\text{rise}}{\text{run}}. A vertical line has the same x-coordinate at every point, so \Delta x = 0 — the run is zero. That gives m = \dfrac{\Delta y}{0}, and dividing by zero is undefined in ordinary arithmetic. It is not "infinity" for two reasons: (a) infinity is not a real number you can equal, and (b) if you tilt a line toward vertical from one side the slope grows toward +\infty, but tilting from the other side it grows toward -\infty — the two sides disagree. So the honest answer is "no slope" or "slope undefined", not m = \infty.
You are sitting in maths class and the teacher draws the line x = 2 on the board — a perfectly vertical line. Then she asks, "What is the slope of this line?" Half the class shouts "infinity!" and she shakes her head. The correct answer is undefined. But that feels like a cheat. The line is going straight up — surely "infinitely steep" is exactly what is happening?
This is one of the cleanest little puzzles in early algebra, and it is also a sneak preview of an idea that you will meet again in Class 11 calculus — the idea of a limit that does not exist. Let us take it apart carefully.
The arithmetic — why \dfrac{5}{0} is not a number
Slope is defined by the rise-over-run formula. Pick any two distinct points (x_1, y_1) and (x_2, y_2) on the line and write
For a vertical line, every point has the same x-coordinate. So x_2 - x_1 = 0. The formula tells you to compute something like \dfrac{4}{0} or \dfrac{-7}{0}. Whatever the rise is, the run is zero.
Now ask the simplest question: is there a number q such that q \times 0 = 5? Try anything. 1 \times 0 = 0. 1000 \times 0 = 0. 10^{100} \times 0 = 0. There is no real number that, when multiplied by zero, gives 5. So \dfrac{5}{0} has no answer in the real numbers — the symbol simply does not refer to a number. Mathematicians call this undefined.
Why "infinity" feels right but is wrong: as the run shrinks (1, 0.1, 0.01, …) and the rise stays the same, the quotient grows without bound. So your gut says "the answer is infinity". But \infty is not a real number — you cannot do \infty \times 0 and get 5 back. The arithmetic that defines division simply breaks at zero, and we mark the breakage with the word "undefined" instead of pretending a number lives there.
Worked example 1 — the line $x = 2$
Take two points on the vertical line x = 2: say (2, 3) and (2, 7).
Rise is 4, run is 0. There is no quotient. The line equation is the simple sentence x = 2 — it does not even fit the form y = mx + c, because no value of m works. That is the whole point: the line exists, you can draw it, but the slope-number does not exist.
The "very steep" lie — large does not mean infinite
People sometimes say "well, vertical means infinitely steep, so the slope must be \infty". Let us test that.
Worked example 2 — a nearly-vertical line is finite
Take the line through (0, 0) and (0.001, 100). It looks almost vertical when you draw it on graph paper.
That is a huge number — one lakh. But it is a perfectly ordinary, finite real number. You can multiply it, add to it, plot y = 100000\,x. Now push the second point even closer: (0.0001, 100) gives m = 10^6. Closer still: m = 10^9. Each line is steeper, each slope is bigger — but every single one is a finite number. Vertical is the only line that breaks the rule. It is not "the next number after 10^{100}" — it is off the number line entirely.
This already suggests that "infinity" is the wrong word. Real, drawable, almost-vertical lines have huge but ordinary slopes. The vertical line is qualitatively different — it is not a continuation of the pattern.
The limit picture — two infinities, not one
Here is the deeper reason. Imagine spinning a line around the origin like the hand of a clock. Start at y = x (slope 1). Tilt it more upright. Watch the slope.
So far, so good — the slope marches off toward +\infty.
Now go back to y = x and tilt the line the other way — past vertical, into the second quadrant. The line is still very steep, but now it leans the opposite way, and its slope is negative:
Both sides are approaching the same vertical line — but from one side the slope blows up to +\infty, and from the other side it blows up to -\infty. Why this kills "slope = \infty": for a value to be the slope of the vertical line, both sides of the approach should agree. They do not. One side says +\infty, the other says -\infty. There is no single number — not even an "infinite number" — that both sides converge to. So the slope simply is not assigned a value at all.
Worked example 3 — the limit never arrives
Spin the line y = mx by increasing m:
| m | line equation | how it looks |
|---|---|---|
| 1 | y = x | 45^\circ tilt |
| 100 | y = 100x | almost vertical, leaning right |
| 10{,}000 | y = 10{,}000\,x | indistinguishable from vertical on a normal graph |
| \infty? | — | not a real equation |
| x = 0 | the y-axis | exactly vertical, slope undefined |
No matter how big you make m, the line y = mx is not the y-axis — it still passes through (1, m), a real point. The vertical line x = 0 passes through no point of the form (1, \text{anything}). You never reach vertical by making m bigger; you only approach it. The vertical line is a different kind of line, and it deserves a different kind of answer: undefined.
This is precisely the situation a calculus student calls "the limit does not exist" — the value the function approaches depends on which direction you come from. Slope of a vertical line is your first encounter with that idea, three years before you formally meet it.
The four-line picture
And here is the picture of the two-sided blow-up:
What you actually write in an exam
When a question asks for the slope of a vertical line — say, the line x = 5 — the correct written answer is one of:
- "Slope is undefined."
- "The line has no slope."
- "Slope does not exist."
Do not write m = \infty. CBSE markers, ICSE markers, JEE markers and university lecturers will all dock the mark. Why the strict rule: the symbol \infty is not a real number, so writing m = \infty is the same kind of mistake as writing \dfrac{5}{0} = \infty — it dresses up "I have no answer" as if it were an answer. "Undefined" is the truthful word.
Horizontal lines, by the way, are perfectly well behaved: rise is 0, run is nonzero, so m = 0/\text{something} = 0. Slope zero. Not undefined. The asymmetry between horizontal (slope 0) and vertical (slope undefined) is exactly the asymmetry between \dfrac{0}{5} (a real number) and \dfrac{5}{0} (not a number). That is also why y = c fits the form y = mx + c with m = 0, but x = c does not fit y = mx + c for any m at all.
A preview of calculus
In Class 11 you will learn to make the limit idea formal. You will write things like \lim_{x \to a} f(x), and one of the very first lessons will be: the limit exists only if the left-hand limit equals the right-hand limit. When they disagree, the limit "does not exist" — exactly the situation you just lived through with the vertical line. So when your calculus teacher introduces the idea, you will already have a picture in your head: the spinning line, +\infty on one side, -\infty on the other, no agreement, no answer. Undefined.
That is the gift of taking conceptual doubts seriously. The little puzzle of "why not infinity?" is the same puzzle, scaled down, that calculus is built on.