Vertical Line Test

In this lesson, you will learn

  • what the vertical line test is
  • how to use vertical lines to check if a graph is a function
  • why two crossing points mean the relation is not a function
  • which kinds of graphs and equations pass or fail the test

What Is the Vertical Line Test?

Definition

A vertical line test is a visual way to determine if the graph of a relation is a function using a vertical line.

Rule

If a vertical line passes through at least two points on the graph, then an element in the domain is paired with more than 1 element in the range. As a result, the relation is not a function.

If on the other hand, every vertical line passes through at most 1 point, then an element in the domain is paired with only 1 element in the range. The relation is then a function.

The line has to be vertical as illustrated below. You will see a correct vertical line test and an incorrect vertical line test.

Two lines with arrows: a straight up-and-down line labelled Correct, and a slanted line labelled Incorrect.
Common mistake

Using a slanted line. A slanted line can cross a function's graph twice even when the graph is a function. Only a line that goes straight up and down, parallel to the y-axis, tests the relation.

A vertical line crosses a graph at exactly one point, and every other vertical line crosses it at most once. Is the graph a function?

Show answer

Yes. No vertical line passes through two points, so each element in the domain is paired with only 1 element in the range.

Examples Showing How to Use the Vertical Line Test

Next, we show you a few examples where the vertical line test was used to determine if the graph is a function.

Example #1

A red curve that bends back to the left. A vertical line crosses it at two blue points, (4, 1) and (4, 3).

Notice the two blue points. This means that the vertical line passes through 2 points.

Can you guess what these two points are just by looking at the graph?

These two points are (4, 1) and (4, 3). As you can see, 4, which is an element in the domain, is paired with two elements in the range. As a result, the relation above is not a function.

Example #2

A red V-shaped graph with 5 vertical lines drawn across it. Each vertical line crosses the graph at only one blue point.

Here, there are 5 vertical lines and none of them passes through at least 2 points. Therefore, this graph is a function.

Worked example: Is the graph of x = y2 a function?
  1. Draw the vertical line x = 4.
  2. Find the points on the graph with x = 4: y2 = 4, so y = 2 or y = −2.
  3. The vertical line passes through two points, (4, 2) and (4, −2).
  4. 4 is paired with two elements in the range.

The graph of x = y2 is not a function.

The points (−1, 6) and (−1, 0) are both on a graph. Is the graph a function?

Show answer

No. The vertical line x = −1 passes through both points, so −1 is paired with two elements in the range.

Important Things to Keep in Mind

Remember
  • Notice that a vertical line is always going to be parallel to the y-axis.
  • Draw many vertical lines before you draw your conclusion.
  • You are looking for the point(s) of intersection between the vertical line and the graph.

Relations That Pass or Fail the Vertical Line Test

Some examples of relations that are also functions and will always pass the vertical line test

y = 3x + 1
y = x3
y = |x|
y = |2x + 1|
y = √x − 2
y = x4 + x3 + 1

Some examples of relations that are not functions and will never pass the vertical line test

x2 + y2 = 4
y2 − 3x = 7
y = ±√2 + 5x

All lines, except a vertical line, will pass a vertical line test.

Circles and ellipses will never pass the vertical line test.

Parabolas and hyperbolas may or may not pass the vertical line test.

Common mistake

Thinking every parabola is a function. A parabola that opens up or down, such as y = x2, passes. A parabola that opens to the left or right, such as x = y2, fails.

Does the circle x2 + y2 = 9 pass the vertical line test?

Show answer

No. The vertical line x = 0 passes through (0, 3) and (0, −3).

Summary

  • The vertical line test uses vertical lines to check if the graph of a relation is a function.
  • If any vertical line passes through two or more points, the relation is not a function.
  • If every vertical line passes through at most 1 point, the relation is a function.
  • The test line must be parallel to the y-axis; draw many of them before you decide.
  • Non-vertical lines always pass; circles and ellipses always fail; parabolas and hyperbolas may pass or fail.

Test Yourself: Interactive 10-Question Quiz

Now check what you learned. Every answer is explained, and each time you play you get new questions.

Question 1 of 10Score: 0