Tutorials › Calculus I › Why the Vertical Line Test Works

Function Notation and Representations · Tutorial 11 of 1495

Why the Vertical Line Test Works

See how the unique-output definition of a function leads to the vertical line test, and use the test to distinguish function graphs from other curves.

Beginner 9 min read

What You'll Learn

  • Connect the unique-output rule for functions to intersections with vertical lines.
  • State precisely when the vertical line test applies.
  • Test graphs defined by formulas and by implicit equations.
  • Explain why a circle fails the test, including its two outputs at selected inputs.
  • Recognize that branches sharing an input can make a relation fail to be a function.
  • Avoid mistaking a single chosen branch of a curve for the entire graph.

From One Input to One Vertical Line

A function assigns each allowed input exactly one output. A graph displays input-output pairs as points in the coordinate plane: the point \((a,b)\) represents input \(a\) and output \(b\). This makes it possible to test the function rule by inspecting how the graph meets vertical lines.

The connection is direct. A vertical line fixes the input coordinate while allowing the output coordinate to vary. Thus, if one vertical line meets a graph at two distinct points, those points have the same input but different outputs. That violates the unique-output rule.

Definition: A set of points \(G\) in the coordinate plane is the graph of a function on its set of represented inputs if, for each input \(x\) represented in \(G\), there is exactly one output \(y\) such that \((x,y)\in G\). Equivalently, for every represented input \(x\), there is exactly one point of \(G\) on the vertical line whose equation is \(x=a\).

The phrase “represented input” matters. A graph may not include a point for every real number. Its represented inputs are precisely the first coordinates of its points. For each such input, the graph must contain one and only one point. A vertical line that misses the graph corresponds to an input that is not represented; it does not, by itself, contradict the function rule.

The Vertical Line Test

Theorem: A graph represents a function of the input variable if and only if no vertical line intersects the graph in more than one point. When the domain is specified in advance, the graph must also contain a point for each input in that domain.

In the usual test, we check that every vertical line meets the graph zero or one times. A line that meets it once gives one output at that input. A line that meets it more than once gives multiple outputs at that input. A line that misses it corresponds to an input outside the graph’s represented inputs.

The test concerns the number of distinct intersection points, not the way a line meets the curve. A vertical line that just touches a curve at one point passes the test at that input. A vertical line that crosses the curve at two points fails, even if the curve is smooth at both points.

Why the Test Works

The justification follows from the coordinates of the points. Every point on the vertical line \(x=a\) has the same first coordinate \(a\). Different points on that line must therefore have different second coordinates. The line’s intersections with a graph list the outputs paired with that one input.

1
Fix an input.
Choose a real number \(a\). The vertical line \(x=a\) contains exactly the points whose input coordinate is \(a\).
2
Read off the outputs.
Every intersection \((a,b)\) of the line with the graph gives an output \(b\) for the input \(a\).
3
Check uniqueness.
If there is one intersection, there is one output. If there are two or more, there are different outputs for the same input.

This proves both directions of the test. If a vertical line intersects the graph at two distinct points, they have the form \((a,b_1)\) and \((a,b_2)\), where \(b_1\ne b_2\). The same input \(a\) then has two outputs, so the graph cannot represent a function. Conversely, if a represented input \(a\) has two different outputs \(b_1\) and \(b_2\), the graph contains both points \((a,b_1)\) and \((a,b_2)\). Both lie on \(x=a\), so that vertical line intersects the graph at least twice. Therefore, no vertical line meeting the graph more than once is exactly the condition that each represented input has at most one output. Since represented inputs have at least one point by definition, this gives exactly one output for each of them.

Worked Example: A Parabola That Passes

Worked Example: A Parabola That Passes

Consider the graph \(y=x^2\). To determine how a vertical line meets it, fix any input \(a\). Every point on the graph with first coordinate \(a\) must have second coordinate

$$y=a^2.$$

There is exactly one such value. Therefore, the line \(x=a\) meets the graph at exactly one point, \((a,a^2)\). Since this holds for every real \(a\), no vertical line meets the graph more than once, and it represents a function.

For a numerical check, take \(a=2\). The output is \(2^2=4\), so the intersection is \((2,4)\). Substituting into the rule gives \(4=2^2=4\), as required. At \(a=-2\), the output is \((-2)^2=4\), giving \((-2,4)\). This is a different point, but it has a different input. Having the same output at two different inputs does not violate the function rule.

Worked Example: A Circle That Fails

Worked Example: A Circle That Fails

Consider the circle

$$x^2+y^2=25.$$

Choose the vertical line \(x=3\). Substituting \(x=3\) into the circle equation gives

$$3^2+y^2=25,\qquad 9+y^2=25,\qquad y^2=16.$$

The two solutions are \(y=4\) and \(y=-4\). Thus the line \(x=3\) intersects the circle at \((3,4)\) and \((3,-4)\). Check both points in the original equation:

$$3^2+4^2=9+16=25,\qquad 3^2+(-4)^2=9+16=25.$$

Both points are on the circle, and they have the same input \(3\) but different outputs. The vertical line test therefore shows that the entire circle is not the graph of a function of \(x\).

This does not mean that a circle has no useful relationship between \(x\) and \(y\). It means that the full circle does not assign exactly one \(y\)-value to each \(x\)-value represented on it. Choosing just the upper half or just the lower half would produce a different graph; the test must be applied to the graph actually given.

Worked Example: A Sideways Parabola

Worked Example: A Sideways Parabola

Consider the curve \(x=y^2\). Although this equation describes a familiar parabola, it opens sideways. To test it, choose the vertical line \(x=4\) and substitute \(4\) for \(x\):

$$4=y^2,\qquad y=2\text{ or }y=-2.$$

The two intersection points are \((4,2)\) and \((4,-2)\). Checking them in the equation gives \(4=2^2=4\) and \(4=(-2)^2=4\). Both points belong to the curve, so the vertical line meets it twice. The curve fails the test and is not the graph of a function of \(x\).

The equation can instead be solved for \(x\) in terms of \(y\), with one value of \(x\) for each \(y\). That observation is not needed to apply the vertical line test: the test asks whether each input \(x\) has exactly one output \(y\).

Worked Example: Branches That Share Inputs

Worked Example: Branches That Share Inputs

Suppose a graph consists of the two lines \(y=x\) and \(y=-x\). At \(x=0\), both rules give \(y=0\), so the two branches meet at \((0,0)\). That shared point alone is not a failure: the line \(x=0\) meets the combined graph at just that one point.

Now test \(x=2\). On the first branch, \(y=2\), giving \((2,2)\). On the second branch, \(y=-2\), giving \((2,-2)\). Substitution checks both points: \(2=2\) for the first branch, and \(-2=-2\) for the second. The vertical line \(x=2\) therefore meets the combined graph twice, so the union of the branches is not the graph of a function of \(x\).

This example shows why checking only where branches meet is not enough. Branches may share a point and also have other input values in common, where they give different outputs.

A Common Mistake: Keeping Only One Solution

A common error is to manipulate an equation for a curve, find one possible output, and treat that output as the only one without checking for other solutions. For the circle \(x^2+y^2=25\), one might write

$$y=\sqrt{25-x^2}.$$

This expression gives the nonnegative solution for \(y\), but squaring the equation originally gives \(y^2=25-x^2\), which can have both a positive and a negative solution. At \(x=3\), the full equation gives \(y^2=16\), hence \(y=4\) or \(y=-4\), not just \(y=4\). The positive square root describes only the upper part of the circle. To classify the entire curve, include every point satisfying its equation before applying the test.

Another mistake is to think that a curve fails because it bends, loops, or crosses itself. Those features may suggest where to check, but the criterion is specific: does any vertical line meet the graph at distinct points? A curve can bend sharply and still pass; a smooth circle fails.

Using the Test Carefully

For a graph shown in a diagram, imagine sliding a vertical line across the entire picture. If it encounters two distinct points of the graph at any position, the graph fails. If no position gives more than one point, it passes for its represented inputs. When the graph is given by an equation, fixing an input \(a\) and solving for all possible \(y\)-values makes the same check algebraically.

A sketch is useful, but it can be misleading if branches are close together or if part of a curve is hidden by the drawing. When the equation is available, verify a suspected intersection by substituting the coordinates into it. Conversely, do not count the same point twice just because two pieces of a drawing meet there: the test counts distinct points on the vertical line.

Takeaway: The vertical line test is the geometric form of the unique-output rule. More than one intersection means that one input has multiple outputs; at most one intersection for every vertical line means that each represented input has exactly one output.

Check Your Understanding

For each question, focus on the number of distinct outputs associated with a fixed input.

  1. Why does a vertical line fix the input coordinate while allowing the output coordinate to vary?
  2. At \(x=1\), how many points of the circle \(x^2+y^2=25\) are present, and what are their coordinates?
  3. Does the graph consisting only of \(y=x\) pass the vertical line test? Explain using an arbitrary vertical line \(x=a\).
  4. The graphs \(y=x\) and \(y=2x\) meet at the origin. Why does that fact alone not determine whether their union passes the test?
  5. What part of the circle is represented by \(y=\sqrt{25-x^2}\), and why does that expression not describe the full circle?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon