Horizontal Line Test
In this lesson, you will learn
- what the horizontal line test is
- how to use horizontal lines to check if a function is one-to-one
- why two crossing points mean two x-values share the same y-value
- the difference between the horizontal line test and the vertical line test
What Is the Horizontal Line Test?
In mathematics, one can use the horizontal line test in order to determine if a function is one-to-one or injective.
The image below shows what a horizontal line test is supposed to look like.
The green line is the line that we use to do the test. It is basically a horizontal line that can cross or intersect a graph in at least 1 point.
In the image below, the line intersects the graph in two points and these points are (−1, −1) and (2, −1).
Study the image carefully!
Horizontal Line Test and One-to-One Function
If a horizontal line intersects the graph in more than one point, then the graph is not one-to-one.
Therefore, the graph above is not one-to-one since the line intersects the graph in two points.
See below another horizontal line test that intersects the graph in only 1 point.
Here we draw two lines to emphasize the fact that no matter how many horizontal lines you draw, they will always cut or intersect this graph in only 1 point.
Since every horizontal line will always cut the graph in only 1 point, we say that the graph immediately above is one-to-one.
- Draw the horizontal line y = 9.
- Find the points on the graph with y = 9: x2 = 9, so x = 3 or x = −3.
- The horizontal line intersects the graph in two points, (3, 9) and (−3, 9).
- Two different x-values, 3 and −3, are mapped to the same y-value, 9.
y = x2 is not one-to-one.
Stopping after one horizontal line. One line that crosses the graph once doesn't prove anything; draw many horizontal lines. A single line that crosses twice is enough to show the graph is not one-to-one.
The points (−4, 5) and (1, 5) are both on the graph of a function. Is the function one-to-one?
Show answer
No. The horizontal line y = 5 crosses the graph at both points, so −4 and 1 are mapped to the same y-value.
What Is the Difference Between a Horizontal Line Test and a Vertical Line Test?
The first graph we drew above is not one-to-one because the horizontal line crossed the two points (−1, −1) and (2, −1). As you can see here, two different x-values, −1 and 2, are mapped to the same y-value, −1.
- When you do a horizontal line test, each x-value in the domain should be mapped to a different y-value in the range every time.
- On the other hand, when you do a vertical line test, each x-value in the domain should be mapped to only one y-value in the range.
Which test tells you if a graph is a function, and which tells you if a function is one-to-one?
Show answer
The vertical line test checks for a function; the horizontal line test checks for one-to-one. A one-to-one function must pass both tests.
Summary
- The horizontal line test shows if a function is one-to-one (injective).
- If a horizontal line intersects the graph in more than one point, the function is not one-to-one.
- If every horizontal line intersects the graph in at most 1 point, the function is one-to-one.
- Two crossing points mean two different x-values are mapped to the same y-value.
- The vertical line test checks for a function; the horizontal line test checks for one-to-one.
Test Yourself: Interactive 10-Question Quiz
Now check what you learned. Every answer is explained, and each time you play you get new questions.
Quiz Complete! 🎉