The test is a picture of the definition, which makes it fast. It also has edge cases that cost points: dots at jumps, shapes that open sideways, and the mix-up with the horizontal line test. Each one is covered below with worked examples.
Why does the vertical line test work?
A function assigns each input exactly one output. Every function is a relation, but a relation such as a circle can pair one input with several outputs. That extra condition is what the test checks.
The vertical line is the set of every point whose input is , namely for all . Sweeping it across the plane collects all outputs of one input in a single stroke. Each place it meets the graph is an output of , so the number of crossings is the number of outputs. For a function that number never exceeds one, which is why function notation can write as one definite value.
“At most” is deliberate. Zero crossings is fine: it only means is not in the domain. Lines are vertical because the input conventionally sits on the horizontal axis. If a problem asks whether is a function of , the roles swap and horizontal lines do the job.
Quick check
Answer:
How do you use the vertical line test on a graph?
Hold a pencil upright at the far left of the graph and slide it right. At each position, count how many points of the curve it touches.
- Decide which variable is the input (usually ).
- Sweep an upright line across the whole graph, left to right.
- Watch the places where the curve folds back, loops, or has a vertical edge. Failure can only happen there.
- If the line ever touches two or more points at once, stop. The graph fails.
Passing is a claim about every line, while failing needs only one. That asymmetry is the trap. Checking three or four lines and declaring victory is how a graph with a small loop at one end gets mislabeled. Scan for any spot where one part of the curve sits directly above another part.
Jumps in piecewise functions need a close look at the dots. A filled dot stacked above a filled dot at the same fails. A filled dot above an open dot passes, because an open dot is not on the graph. The same sweep also reads off the domain and range: the domain is every -position where the pencil touches something.
Try this: Sketch and sweep an upright pencil across it. Then turn the paper a quarter turn and sweep again. Explain why the verdict changed.
Which graphs fail the vertical line test?
Three families fail: closed curves (circles and ellipses), curves that open sideways (like ), and vertical lines. In each, some -values have graph points both above and below. To prove failure, pick one such and name both points.
Worked example 1. Decide whether is a function of . The circle spans from to , so choose an inside value, , and substitute:
Check: and . The line meets the circle at and , so the relation fails the test and is not a function.
To fail a graph, name a single input with two outputs, such as giving and . To pass a graph, the argument must cover every at once.
The same failure repeats for every with . Only the leftmost and rightmost points, , are met once. A vertical line that merely grazes the circle there does not rescue it, because the test demands every line. The sideways parabola behaves the same way: each gives .
How do you apply the vertical line test to an equation?
No graph is needed. Solve the equation for and look at what comes out. One expression means a function. A means two outputs for most inputs, so it fails. The fastest mental check is to plug in one convenient and count the -values. An even power of (, , ) is the usual warning sign, while an odd power such as is not.
Worked example 2. Test . Solve for :
At this gives or . Check: and . One input, two outputs, so it is not a function.
Worked example 3. Test . Solve for :
Every real number has exactly one real cube root, so each gives one . Check with : , and . This graph lies on its side like a sideways cubic, yet it passes. Looking sideways is not the problem. Having two outputs is.
The absolute value graph is a V that passes. Swap the roles to get , a V on its side, and at you get or , so it fails.
Quick check
Answer: Yes
Do holes, jumps and vertical lines break the vertical line test?
A vertical line fails dramatically: every point on it has input , so one input has infinitely many outputs. That is also why it has no slope-intercept form, since its slope is undefined. A horizontal line passes, because every input gives the same single output.
Holes cannot cause a failure. A hole deletes a point, so a vertical line through it meets the graph fewer times, never more. Students sometimes drop a line through a hole, see a gap, and think something is wrong. Nothing is: a gap only removes an input from the domain.
Jumps are the subtle case. Take for and for . The graph jumps, but on the line only is a real point, because is an open dot. It passes. Change the second rule to and both dots are filled, giving and , so it fails.
One more trap involves the radical sign. The equation passes, because means the nonnegative root only. It is the upper semicircle. The only appears when it is added by hand.
| Graph | Passes? | Reason |
|---|---|---|
| Yes | one output per input | |
| No | every is paired with | |
| Yes | same single output everywhere | |
| Yes | only the point at | |
| No | when | |
| Yes | upper semicircle only | |
| No | top and bottom halves |
Vertical line test vs horizontal line test: the difference
The two tests answer different questions. The vertical test asks whether a graph is a function. The horizontal test asks whether a function is one-to-one, meaning no output is shared by two inputs. A horizontal line hitting a graph twice means two inputs share an output, which breaks one-to-one but not function-hood.
The parabola shows the split. It passes the vertical test. The horizontal line meets it at and , so it fails the horizontal test. The pattern is general: every even function fails the horizontal test, because pairs each nonzero input with its opposite.
Reflecting a graph over the line turns vertical lines into horizontal ones. That is why an inverse is a function exactly when the original passes the horizontal test.
Restricting the domain repairs the problem. Keep only and passes both tests, so its inverse is a function. The details are in the lessons on the inverse of a quadratic function and the inverse of a square root function.
Transformations of functions preserve the vertical verdict when they shift, stretch, or reflect across either axis. A function stays a function. A quarter turn is not one of those moves, which is why your paper rotation in the pencil exercise changed the answer.
Quick check
Answer:
Where is the vertical line test used in real life?
Any quantity that depends on time must pass the test, because nothing can have two values at the same moment. A position-versus-time graph for a car on a straight road is a function: the car is in one place at each instant. If recorded data produces two different positions at the same timestamp, something is wrong with the sensor or the logging, not the car.
The same idea guards data tables. A lookup table, a spreadsheet column used as a key, or a dictionary in code behaves like a function only if each key has one value. Duplicate keys with different values are a vertical line test failure in disguise.
Graphing tools also depend on it. A calculator that plots expressions cannot draw a circle in one entry. The circle is drawn as two functions, and , each of which passes the test. Splitting a failing relation into passing pieces is a standard move whenever a function is required.
Practice problems
0 of 5 solved
- Does the graph of pass the vertical line test?
Answer: Yes, it is a function
Step 1: Any non-vertical line gives one for each . Step 2: Here produces exactly one output for every input, so every vertical line crosses the graph once. - Does pass the vertical line test?
Answer:
Step 1: Try the line . Step 2: , so or . Step 3: The line meets the circle at and , so the graph fails. - Is a function of when ?
Answer:
Step 1: Solve for : , so . Step 2: At , or (check: ). Step 3: One input has two outputs, so it is not a function. - Does pass the vertical line test?
Answer: Yes, it is a function
Step 1: The square root symbol gives only the nonnegative root, so each in gives exactly one . Step 2: The graph is the upper half of . Step 3: Lines with miss it entirely, which is allowed. - For what value of is for , and for , a function?
Answer:
Step 1: Both pieces include , so their outputs there must match. Step 2: The first piece gives , so . Step 3: , so (check: ).
Common questions
What is the vertical line test?
It is a visual check for whether a graph shows a function. If every vertical line crosses the graph at most once, each input has one output and the graph is a function. If any vertical line crosses it twice or more, it is not.
Does a circle pass the vertical line test?
No. For any strictly between the leftmost and rightmost points, the vertical line hits the top half and the bottom half. For , the line meets the circle at and .
Can a graph pass the vertical line test and still fail the horizontal line test?
Yes. The parabola is a function, so it passes the vertical test, but hits it at and , so it fails the horizontal test. Such a function is not one-to-one.
What if a vertical line does not touch the graph at all?
That is fine. Zero crossings only means that input is outside the domain. The test fails only when a line crosses the graph two or more times.
Does the line x = 4 pass the vertical line test?
No. The line contains infinitely many points with input , so one input has infinitely many outputs. A horizontal line such as does pass.
How do you test whether x is a function of y?
Swap the roles of the axes and use horizontal lines. If every horizontal line meets the graph at most once, then is a function of . For , the answer is yes, even though is not a function of .