Vertical Line Test — How to Tell if a Graph Is a Function
Vertical Line Test — How to Tell if a Graph Is a Function
TL;DR
The vertical line test says a graph represents a function if and only if no vertical line crosses it at more than one point. Draw a vertical line anywhere on the graph — if it hits the curve once (or zero times), keep going. If it hits twice, the relation is not a function. This article covers the rule, the pass-vs-fail table for common graphs, three worked examples, and the mistakes that quietly cost marks.
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 xxx must have exactly one output yyy. A vertical line at x=cx = cx=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 xxx exactly one yyy. A vertical line at x=cx = cx=c collects every point with that xxx-coordinate.
- One intersection: the input ccc has one output. Allowed for a function.
- Zero intersections: the input ccc is outside the domain. Allowed for a function (means ccc is not in the domain).
- Two or more intersections: the input ccc 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+by = mx + by=mx+b | Passes — one intersection at each xxx | Yes |
| Vertical line | x=ax = ax=a | Fails — infinitely many intersections at x=ax = ax=a | No |
| Parabola opening up/down | y=ax2+bx+cy = ax^2 + bx + cy=ax2+bx+c | Passes — one intersection at each xxx | Yes |
| Sideways parabola | x=ay2+by+cx = ay^2 + by + cx=ay2+by+c | Fails — two intersections for most xxx | No |
| Circle | x2+y2=r2x^2 + y^2 = r^2x2+y2=r2 | Fails — two intersections for −r<x<r-r < x < r−r<x<r | No |
| Ellipse | x2a2+y2b2=1\dfrac{x^2}{a^2} + \dfrac{y^2}{b^2} = 1a2x2+b2y2=1 | Fails — two intersections for most xxx | No |
| Cubic | y=ax3+bx2+cx+dy = ax^3 + bx^2 + cx + dy=ax3+bx2+cx+d | Passes — one intersection at each xxx | Yes |
| Hyperbola (rectangular) | y=1/xy = 1/xy=1/x | y=1/xy = 1/xy=1/x | Passes — undefined at x=0x = 0x=0, one intersection elsewhere |
| Square root curve | y=xy = \sqrt{x}y=x | Passes — one intersection at each x≥0x \geq 0x≥0 | Yes |
| x=y | x = \sqrt{y}x=y | Fails if you allow both signs of yyy | Depends on convention |
| Absolute value | y=∣x∣y = |x|y=∣x∣ | Passes | Yes |
| Inverse absolute value | x=∣y∣x = |y|x=∣y∣ | Fails — two intersections for x>0x > 0x>0 | No |
| Sine, cosine | y=sinxy = \sin xy=sinx, y=cosxy = \cos xy=cosx | Passes — periodic but one output per xxx | Yes |
The pattern: any curve where yyy is expressed as a function of xxx passes by construction. Curves where xxx is a function of yyy — 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+3y = 2x + 3y=2x+3 pass the vertical line test?
At any xxx, the equation gives one yyy. A vertical line at x=cx = cx=c meets the graph exactly once at (c,2c+3)(c, 2c + 3)(c,2c+3).
Final answer: Yes — y=2x+3y = 2x + 3y=2x+3 is a function.
The detour students take
Standard. Does the graph of x2+y2=25x^2 + y^2 = 25x2+y2=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 xxx and yyy, 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=3x = 3x=3.
32+y2=25⟹y2=16⟹y=4 or y=−43^2 + y^2 = 25 \implies y^2 = 16 \implies y = 4 \text{ or } y = -432+y2=25⟹y2=16⟹y=4 or y=−4
The vertical line x=3x = 3x=3 meets the circle at (3,4)(3, 4)(3,4) and (3,−4)(3, -4)(3,−4) — two intersections. The graph fails the vertical line test.
Final answer: No — the circle x2+y2=25x^2 + y^2 = 25x2+y2=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 y2=xy^2 = xy2=x represent yyy as a function of xxx?
Solve for yyy: y=±xy = \pm\sqrt{x}y=±x. For any positive xxx, there are two values of yyy — one positive, one negative.
A vertical line at x=4x = 4x=4 hits the curve at (4,2)(4, 2)(4,2) and (4,−2)(4, -2)(4,−2).
Final answer: No — y2=xy^2 = xy2=x is not a function. (If we restrict to y≥0y \geq 0y≥0, the upper half y=xy = \sqrt{x}y=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=x2y = x^2y=x2 passes the vertical line test (is a function) but fails the horizontal line test (the line y=4y = 4y=4 hits at x=±2x = \pm 2x=±2).
- y=x3y = x^3y=x3 passes both (function and one-one).
- y=sinxy = \sin xy=sinx passes the vertical line test (function) but fails the horizontal line test (periodic — every value of yyy 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 x2+y2=25x^2 + y^2 = 25x2+y2=25 a function because it is a single equation in xxx and yyy.
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=x2y = x^2y=x2 fails the vertical line test because the horizontal line y=4y = 4y=4 hits twice.
The correct way: The vertical line test uses vertical lines — those of the form x=cx = cx=c. y=x2y = x^2y=x2 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=xy = \sqrt{x}y=x not a function because the vertical line x=−1x = -1x=−1 does not meet the graph.
The correct way: A vertical line that misses the graph entirely means x=−1x = -1x=−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/x1/x1/x, sinx\sin xsinx 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 xxx 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=x3−xy = x^3 - xy=x3−x pass the vertical line test?
- Does the graph of x=y2+1x = y^2 + 1x=y2+1 pass the vertical line test?
- Does the graph of y=1/xy = 1/xy=1/x pass both the vertical and horizontal line tests?
Frequently Asked Questions
What is the vertical line test?
A graphical rule for deciding whether a curve is the graph of a function. If every vertical line meets the curve in at most one point, the curve is a function. Otherwise, it is not.
How do you apply the vertical line test?
Draw a vertical line (mentally or with a ruler) at several positions across the graph. Count intersections at each position. If you ever get two or more intersections at the same vertical line, the relation fails — it is not a function.
Does y=x2y = x^2y=x2 pass the vertical line test?
Yes. The parabola opens upward and any vertical line meets it exactly once. y=x2y = x^2y=x2 is a function.
Does a circle pass the vertical line test?
No. Any vertical line through the interior of a circle hits it twice — once on the top half, once on the bottom half. A circle is a relation, not a function.
What is the difference between the vertical and horizontal line tests?
Vertical line test asks: "is this curve a function?" Horizontal line test asks: "is this function one-one (injective)?" Two different questions, two different lines.
Can a graph pass the vertical line test but not the horizontal line test?
Yes — that is the most common case. y=x2y = x^2y=x2 passes vertical (is a function) but fails horizontal (not one-one — f(2)=f(−2)=4f(2) = f(-2) = 4f(2)=f(−2)=4).
What happens when a vertical line does not intersect the graph at all?
That means the corresponding xxx-value is not in the domain. The relation can still be a function — the test only fails when there are two or more intersections at the same vertical line.