What Is The Vertical Line Test?
The vertical line test is a graphical method for deciding whether a curve in the plane is the graph of a function.
The rule. If every vertical line drawn through the graph meets it in at most one point, the graph is a function. If any vertical line meets the graph in two or more points, it is not a function.
The test enforces the definition of a function: every input $x$ must have exactly one output $y$. A vertical line at $x = c$ shows every output the relation assigns to that input. If you find two outputs, the rule fails.
Why The Test Works
A function assigns each $x$ exactly one $y$. A vertical line at $x = c$ collects every point with that $x$-coordinate.
One intersection: the input $c$ has one output. Allowed for a function.
Zero intersections: the input $c$ is outside the domain. Allowed for a function (means $c$ is not in the domain).
Two or more intersections: the input $c$ has multiple outputs. Forbidden.
The test is a visual restatement of the "one input, one output" rule. The phrase "passes the vertical line test" and "is a function" mean the same thing.
The Pass-vs-Fail Table For Common Graphs
A quick reference covering the curves students meet through Grade 10.
Curve | Equation | Vertical line test | Function? |
|---|---|---|---|
Straight line (not vertical) | $y = mx + b$ | Passes — one intersection at each $x$ | Yes |
Vertical line | $x = a$ | Fails — infinitely many intersections at $x = a$ | No |
Parabola opening up/down | $y = ax^2 + bx + c$ | Passes — one intersection at each $x$ | Yes |
Sideways parabola | $x = ay^2 + by + c$ | Fails — two intersections for most $x$ | No |
Circle | $x^2 + y^2 = r^2$ | Fails — two intersections for $-r < x < r$ | No |
Ellipse | $\dfrac{x^2}{a^2} + \dfrac{y^2}{b^2} = 1$ | Fails — two intersections for most $x$ | No |
Cubic | $y = ax^3 + bx^2 + cx + d$ | Passes — one intersection at each $x$ | Yes |
Hyperbola (rectangular) $y = 1/x$ | $y = 1/x$ | Passes — undefined at $x = 0$, one intersection elsewhere | Yes |
Square root curve | $y = \sqrt{x}$ | Passes — one intersection at each $x \geq 0$ | Yes |
$x = \sqrt{y}$ (rotated 90°) | $x = \sqrt{y}$ | Fails if you allow both signs of $y$ | Depends on convention |
Absolute value $y = |x|$ | $y = |x|$ | Passes | Yes |
Inverse absolute value $x = |y|$ | $x = |y|$ | Fails — two intersections for $x > 0$ | No |
Sine, cosine | $y = \sin x$, $y = \cos x$ | Passes — periodic but one output per $x$ | Yes |
The pattern: any curve where $y$ is expressed as a function of $x$ passes by construction. Curves where $x$ is a function of $y$ — sideways parabolas, circles, ellipses — generally fail.
How To Apply The Vertical Line Test — Three Worked Examples
We will walk through three problems — Quick, Standard, and Stretch.
Quick example
Quick. Does the graph of $y = 2x + 3$ pass the vertical line test?
At any $x$, the equation gives one $y$. A vertical line at $x = c$ meets the graph exactly once at $(c, 2c + 3)$.
Final answer: Yes — $y = 2x + 3$ is a function.
The detour students take
Standard. Does the graph of $x^2 + y^2 = 25$ pass the vertical line test?
Wrong path. A student reads the equation as "one equation, must be a function" and concludes:
"Yes — it is a single equation involving $x$ and $y$, so it represents a function."
That conclusion confuses having an equation with being a function. Every curve has an equation; only some curves are graphs of functions.
Correct path. Test a specific vertical line — say, $x = 3$.
$$3^2 + y^2 = 25 \implies y^2 = 16 \implies y = 4 \text{ or } y = -4$$
The vertical line $x = 3$ meets the circle at $(3, 4)$ and $(3, -4)$ — two intersections. The graph fails the vertical line test.
Final answer: No — the circle $x^2 + y^2 = 25$ is not a function.
In Bhanzu's Grade 10 cohorts, the "every equation is a function" assumption shows up on roughly three out of ten first attempts when students first meet the vertical line test on conic sections. A Bhanzu trainer who hears this draws the circle, then drops a transparent ruler vertically across it — the two intersection points settle the matter without a single word.
Stretch example
Stretch. Does $y^2 = x$ represent $y$ as a function of $x$?
Solve for $y$: $y = \pm\sqrt{x}$. For any positive $x$, there are two values of $y$ — one positive, one negative.
A vertical line at $x = 4$ hits the curve at $(4, 2)$ and $(4, -2)$.
Final answer: No — $y^2 = x$ is not a function. (If we restrict to $y \geq 0$, the upper half $y = \sqrt{x}$ alone is a function — a common technique for "salvaging" failing relations.)
The Horizontal Line Test (for one-one functions)
Once a graph passes the vertical line test (so we know we have a function), the horizontal line test decides whether the function is one-one.
Rule. If every horizontal line meets the graph in at most one point, the function is one-one (injective).
$y = x^2$ passes the vertical line test (is a function) but fails the horizontal line test (the line $y = 4$ hits at $x = \pm 2$).
$y = x^3$ passes both (function and one-one).
$y = \sin x$ passes the vertical line test (function) but fails the horizontal line test (periodic — every value of $y$ in $[-1, 1]$ is hit infinitely often).
The two tests together classify a graph: vertical line for "is it a function?", horizontal line for "is it one-one?"
Why Does The Vertical Line Test Matter?
The test is the first thing a student does after sketching a graph — and the answer determines everything that follows.
Defining functions. Without the test, "function" is just a definition. With the test, "function" becomes a property you can check by looking.
Inverse functions. Only one-one functions have proper inverses (which is why the horizontal line test sits beside the vertical line test). A function whose graph fails the horizontal test needs domain restriction before it can be inverted.
Sketching parametric and implicit curves. Conic sections — circles, ellipses, hyperbolas (some orientations) — fail the vertical line test. Engineers and physicists work with these as relations, not as functions, and the test is the first sorting step.
Statistical scatter plots. A scatter plot of data points (where two y-values can share an x-value because of noise) fails the test — which is precisely why scatter plots represent relationships, not functions.
Where The Test Goes Sideways
Three errors account for most of the marks lost on vertical-line-test problems.
Mistake 1: Confusing "is a function" with "has an equation."
Where it slips in: Students assume any tidy equation defines a function.
Don't do this: Declaring $x^2 + y^2 = 25$ a function because it is a single equation in $x$ and $y$.
The correct way: Always apply the test. Pick a vertical line and count intersections.
Mistake 2: Mistaking the vertical line test for the horizontal line test.
Where it slips in: Reading "vertical line test" but visualising horizontal lines.
Don't do this: Saying $y = x^2$ fails the vertical line test because the horizontal line $y = 4$ hits twice.
The correct way: The vertical line test uses vertical lines — those of the form $x = c$. $y = x^2$ passes the vertical line test (is a function). It fails the horizontal line test (is not one-one).
Mistake 3: Forgetting that zero intersections is OK.
Where it slips in: Some students count "no intersection" as a failure.
Don't do this: Declaring $y = \sqrt{x}$ not a function because the vertical line $x = -1$ does not meet the graph.
The correct way: A vertical line that misses the graph entirely means $x = -1$ is not in the domain — which is fine. The rule is "at most one intersection," and zero counts.
Conclusion
The vertical line test says: a curve is a function if and only if no vertical line crosses it at more than one point.
The test enforces the "one input, one output" definition visually.
The pass-vs-fail table covers the common curves — straight lines, parabolas, cubics, $1/x$, $\sin x$ pass; circles, ellipses, sideways parabolas fail.
The vertical line test answers "function?"; the horizontal line test answers "one-one?". They are complementary.
Zero intersections at a vertical line means that $x$ is outside the domain — still allowed.
A practical next step
Three problems to practise. If you stall, come back to the pass-vs-fail table above.
Does the graph of $y = x^3 - x$ pass the vertical line test?
Does the graph of $x = y^2 + 1$ pass the vertical line test?
Does the graph of $y = 1/x$ pass both the vertical and horizontal line tests?
Want a Bhanzu trainer to walk through more function-test problems live? Book a free demo class — online globally.
Was this article helpful?
Your feedback helps us write better content