Mathwords logoMathwords

Vertical Line Test — Definition, Graph & Examples

Vertical Line Test

A test use to determine if a relation is a function. A relation is a function if there are no vertical lines that intersect the graph at more than one point.

 

Graph with x and y axes showing a curved function with vertical dashed lines, none intersecting the curve more than once.

 

See also

Horizontal line test, one-to-one function

Key Formula

For every x=a, the vertical line x=a intersects the graph at most once.\text{For every } x = a, \text{ the vertical line } x = a \text{ intersects the graph at most once.}
Where:
  • x=ax = a = A vertical line at any constant value a in the domain
  • at most once\text{at most once} = The graph has zero or one point at that x-value, meaning each input maps to exactly one output

Example

Problem: Use the Vertical Line Test to determine whether the equation y = x² represents a function.
Step 1: Sketch or visualize the graph of y = x². This is an upward-opening parabola with its vertex at the origin.
y=x2y = x^2
Step 2: Imagine drawing a vertical line at x = 2. Substituting into the equation gives one output: y = 4. The line x = 2 crosses the parabola at exactly one point, (2, 4).
x=2    y=(2)2=4x = 2 \implies y = (2)^2 = 4
Step 3: Try another vertical line at x = −3. Again, there is only one output: y = 9. The line crosses the graph at exactly one point, (−3, 9).
x=3    y=(3)2=9x = -3 \implies y = (-3)^2 = 9
Step 4: No matter what value of a you choose, the vertical line x = a hits the parabola at most once. Every x-value produces exactly one y-value.
Answer: The graph of y = x² passes the Vertical Line Test, so it is a function.

Another Example

This example shows a relation that fails the test. Unlike the parabola in Example 1, the circle has x-values that produce two y-values, which is the classic situation the Vertical Line Test is designed to detect.

Problem: Use the Vertical Line Test to determine whether the equation x² + y² = 25 (a circle of radius 5) represents a function.
Step 1: Recognize that x² + y² = 25 is the equation of a circle centered at the origin with radius 5.
x2+y2=25x^2 + y^2 = 25
Step 2: Draw or imagine a vertical line at x = 3. Substitute x = 3 into the equation to find the y-values.
9+y2=25    y2=16    y=4 or y=49 + y^2 = 25 \implies y^2 = 16 \implies y = 4 \text{ or } y = -4
Step 3: The vertical line x = 3 intersects the circle at two points: (3, 4) and (3, −4). This means a single input x = 3 corresponds to two different outputs.
Intersection points: (3,4) and (3,4)\text{Intersection points: } (3,\, 4) \text{ and } (3,\, -4)
Step 4: Since we found a vertical line that crosses the graph at more than one point, the test fails immediately — there is no need to check additional lines.
Answer: The circle x² + y² = 25 fails the Vertical Line Test, so it is not a function.

Frequently Asked Questions

Why does the Vertical Line Test work?
A function requires that each input (x-value) maps to exactly one output (y-value). A vertical line represents all points with the same x-value. If a vertical line hits the graph twice, then that single x-value has two different y-values, which violates the definition of a function.
What is the difference between the Vertical Line Test and the Horizontal Line Test?
The Vertical Line Test tells you whether a relation is a function. The Horizontal Line Test tells you whether a function is one-to-one (injective). A graph can pass the Vertical Line Test but fail the Horizontal Line Test — for example, y = x² is a function but is not one-to-one because both x = 3 and x = −3 give y = 9.
Can you use the Vertical Line Test on an equation without graphing it?
Strictly speaking, the Vertical Line Test is a graphical method. However, the underlying idea translates algebraically: if you can solve the equation for y and get more than one value of y for some x in the domain, the relation is not a function. For instance, solving x² + y² = 25 for y gives y = ±√(25 − x²), showing two outputs for most x-values.

Vertical Line Test vs. Horizontal Line Test

Vertical Line TestHorizontal Line Test
PurposeDetermines if a relation is a functionDetermines if a function is one-to-one
Line directionVertical lines (x = a)Horizontal lines (y = b)
Condition to passEvery vertical line intersects the graph at most onceEvery horizontal line intersects the graph at most once
What failure meansOne x-value maps to multiple y-values — not a functionMultiple x-values map to the same y-value — not one-to-one
Example that passesy = x² (parabola)y = 2x + 1 (line with nonzero slope)
Example that failsx² + y² = 25 (circle)y = x² (parabola, since y = 4 gives x = ±2)

Why It Matters

The Vertical Line Test appears in nearly every algebra and precalculus course when students first study functions. It provides an immediate, visual way to classify graphs without needing to manipulate equations algebraically. Understanding this test also builds the foundation for studying inverse functions, where the Horizontal Line Test becomes essential.

Common Mistakes

Mistake: Confusing the Vertical Line Test with the Horizontal Line Test and concluding that y = x² is not a function because horizontal lines can cross it twice.
Correction: The Vertical Line Test uses vertical lines (x = a) to check if a relation is a function. The Horizontal Line Test is a separate test for one-to-one functions. y = x² passes the Vertical Line Test and is a function, even though it fails the Horizontal Line Test.
Mistake: Checking only one or two vertical lines and assuming the graph passes the test.
Correction: The test requires that every possible vertical line intersects the graph at most once. A single counterexample is enough to fail, but passing requires considering all x-values in the domain. Think about the overall shape of the graph, not just a few sample lines.

Related Terms