Worked examples — Vertical line test for functions
This page is the drill hall for the vertical line test. The parent note told you the rule: a graph is a function when no vertical line hits it more than once. Here we hunt down every kind of graph that rule can be aimed at, so that when an exam throws a weird curve at you, you have already seen its cousin.
Before we start, one word we lean on constantly: a vertical line is a line of the form (a fixed number , with free to be anything). Picture holding a ruler perfectly upright and sliding it left–right across the page. At each stop, count how many times it stabs the graph. That count is the whole game.
The scenario matrix
Every problem this topic can hand you falls into one of these case classes. The examples below are labelled with the cell they cover, and together they fill the whole table.
| Cell | Case class | Example that covers it |
|---|---|---|
| A | Explicit — always passes | Ex 1 |
| B | Even power on (e.g. ) — two branches | Ex 2 |
| C | Circle / ellipse — closed loop, top & bottom | Ex 3 |
| D | Vertical line itself — degenerate, infinitely many hits | Ex 4 |
| E | Horizontal line — passes, only one ever | Ex 4 |
| F | Piecewise with a filled/open endpoint clash | Ex 5 |
| G | Function with a gap (undefined at a point) | Ex 6 |
| H | Oscillating graph (looks scary, still passes) | Ex 7 |
| I | Real-world word problem (time → temperature) | Ex 8 |
| J | Exam twist: same equation, two questions | Ex 9 |
The key axes of the matrix: how many -values a chosen produces (0, 1, or many), and whether the graph is written as or as a mixed relation. If you can classify a graph into one of A–J, you can answer instantly.
Example 1 — Cell A: a clean
Forecast: Take a guess before reading on — does a straight slanted line ever get hit twice by an upright ruler?
- Pick any and solve for . At , . Why this step? The vertical line collects every point whose first coordinate is . To count intersections, I ask: how many satisfy the equation once is nailed to ?
- Count the answers. The expression is a single number. One in, exactly one out. Why this step? "Exactly one output per input" is the literal definition of a function — I'm checking it directly.
- Every behaves the same. Nothing about can produce two numbers.
Verify: Try : . Just the point , one hit. ✓ Passes — it is a function.
Example 2 — Cell B: an even power hiding on the side
Forecast: The side is innocent, but look where the square sits. Guess: pass or fail?

- Fix and solve for . or . Why this step? The square root of a positive number has two answers, one positive and one negative. That "" is exactly two -values for one .
- Test a concrete value. At : and . Two points: and . Why this step? One counterexample is enough to fail the test — I only need a single vertical line that hits twice.
- Notice the special columns. At , gives only (one hit). At , has no real solution (zero hits). But those don't save it — the test fails the moment any line hits twice.
Verify: and — both genuinely lie on the curve. ✗ Fails — not a function.
Example 3 — Cell C: the circle (closed loop)
Forecast: A circle is a loop with no gaps. Where would a vertical ruler cut it — how many times?

- Solve for at a fixed . . Why this step? Same manoeuvre as Ex 2 — isolate so I can count how many values come out.
- Interior columns give two hits. Pick : . Points and — the ruler pierces the top and bottom of the loop. Why this step? Two outputs for input is an instant failure.
- Edge columns give one hit. At : , the single tangent point . At : is imaginary — zero hits, the ruler misses the circle entirely. Why this step? Covering the degenerate columns shows I understand every vertical position, not just the easy middle.
Verify: ✓ and ✓. Both points sit on the circle. ✗ Fails — not a function.
Example 4 — Cells D & E: the two straightest lines
Forecast: One of these is the worst possible graph for the test; the other is a guaranteed pass. Which is which?

- Analyse (Cell D). This graph is itself a vertical line. Place your ruler exactly on top of it: it overlaps at — infinitely many points. Why this step? The test asks "at most one hit per vertical line." Here one vertical line () hits infinitely often — the ultimate failure. The input maps to every real at once.
- Analyse (Cell E). Fix : the equation says regardless of . Every column produces the single value . Why this step? One → one every time; the definition of a function is satisfied with a flat rule.
- Contrast them. is a relation but not a function of ; is a perfectly good (constant) function.
Verify: For at , output is — one hit ✓. For , the points and both satisfy — two (indeed infinite) hits. (a) Fails; (b) Passes.
Example 5 — Cell F: piecewise with an endpoint clash
Forecast: The two rules overlap at exactly one . Watch what each rule says there.
- Evaluate both pieces at the shared point . Top rule: . Bottom rule: . Why this step? Overlap points are where piecewise definitions can secretly assign two -values. I must check whether both rules agree.
- They agree. Both give , so the vertical line hits only — a single point. Why this step? Agreement means one output, so the potential double-hit collapses into one.
- Everywhere else only one rule applies, so at most one per .
Verify: and ; the endpoints coincide. ✓ Passes.
Example 6 — Cell G: a function with a gap
Forecast: There is a spot where this graph simply isn't there. Does a hole make it fail?
- Where is it undefined? At the denominator is ; does not exist. Why this step? The test only cares about columns where the graph exists. A missing column means zero hits, which is allowed.
- Everywhere , one output. For any allowed , is a single number. Why this step? One input → one output confirms the function property on the domain.
- The vertical line hits nothing. Zero intersections ≤ one intersection, so the rule is not broken.
Verify: At , , one point. At , undefined — no point to double up. ✓ Passes (see domain from graphs for reading the hole off the picture).
Example 7 — Cell H: the scary wiggle
Forecast: It goes up, down, up, down forever. Surely something that busy fails? Guess first.

- Fix and read off . is a single number for any . Why this step? Oscillation is a left–right story (many share a ). The test is a up–down story (how many per one ). They are different directions.
- Check a value. At , — one hit. At , — one hit. Why this step? Sampling confirms the algebra: never two at one .
- Many can share the same (e.g. ) — but that is fine; the vertical test never forbids repeated -values.
Verify: and , each a lone point in its column. ✓ Passes. (The wiggle does fail the horizontal line test — a different question about being one-to-one.)
Example 8 — Cell I: word problem
Forecast: Real data — can a single instant have two temperatures?
- Identify input and output. Input is time ; output is temperature . The vertical line is "freeze the clock at one instant." Why this step? Naming which axis is the input tells me which direction the ruler slides.
- Two readings at the same instant. gives both and — the vertical line hits the data twice. Why this step? Two outputs for one input is exactly the failing pattern.
- Physical sanity. A single instant can only have one true temperature, so the double reading signals a logging error — if taken literally as data, it is not a function.
Verify (units): Input hours → output °C. At h we listed °C and °C, i.e. two distinct outputs for one input. ✗ Not a function (the two values confirm the clash).
Example 9 — Cell J: the exam twist (one equation, two questions)
Forecast: Same equation as Ex 2 — but the second question swaps the roles. Does the answer flip?
- Part (a): as a function of . Already done in Ex 2 — fixing gives , two outputs. Fails. Why this step? Re-using the earlier result: the vertical-line direction tests -per-.
- Part (b): swap the roles — treat as the input. Rearranged, . Now fix : , a single number. Why this step? When is the output, the relevant test line is horizontal ( fixed). Count how many per one — exactly one.
- Conclusion. As written, is a function of , even though is not a function of .
Verify: For , — one value. For , too (repeated output, still fine for a function). (a) Fails; (b) Passes.
Recall One-line classifier
Given any graph, ask: is there a single upright ruler position that touches it 2+ times? Yes ::: Not a function. No (only ever 0 or 1) ::: It is a function.
Recall Fill the matrix from memory
Even power on (like ) ::: two branches — fails. A gap where the function is undefined ::: zero hits there — still passes. A vertical line as the whole graph ::: infinitely many hits — fails hardest.
Connections
- Hinglish version of the parent
- 2.1.01-Definition-of-a-function — the "exactly one output" rule these examples enforce
- 2.2.01-Graph-of-a-function — reading graphs before testing them
- 2.2.05-Horizontal-line-test-for-injective-functions — the rotated question (Ex 7, Ex 9)
- 2.3.02-Domain-and-rangefrom-graphs — the gap in Ex 6
- 3.1.01-Inverse-functions — needs both tests to pass