Sub topic 8
One-to-one Functions and the Horizontal Line Test
Assume you know function notation, domain and range, how to solve basic equations, and how to read graphs of lines, parabolas, and square roots. This chapter uses those ideas to decide whether a function can have an inverse function.
What one-to-one means
A function is one-to-one if different inputs always produce different outputs. In symbols,
\[ f(a)=f(b) \implies a=b. \]
Equivalently, if \(a\ne b\), then \(f(a)\ne f(b)\). No output is shared by two different inputs.
For example, \(f(x)=2x+3\) is one-to-one. If \(2a+3=2b+3\), subtracting 3 and dividing by 2 gives \(a=b\).
The function \(f(x)=x^2\), with domain \(\mathbb{R}\), is not one-to-one because
\[ f(3)=9 \quad\text{and}\quad f(-3)=9. \]
Two inputs produce the same output.
| Function | Inputs with the same output? | One-to-one? |
|---|---|---|
| \(2x+3\) | None | Yes |
| \(x^2\), \(x\in\mathbb{R}\) | \(3\) and \(-3\) both give \(9\) | No |
| \(x^3\) | None | Yes |
The horizontal line test
The horizontal line test gives a graphical way to check whether a function is one-to-one:
- Imagine drawing every possible horizontal line across the graph.
- If any horizontal line intersects the graph more than once, the function is not one-to-one.
- If every horizontal line intersects at most once, the function is one-to-one.
A horizontal line represents a fixed output value \(y=c\). Two intersections mean that two different inputs have the same output \(c\).
A nonconstant linear function passes the test because it always increases or always decreases. The parabola \(y=x^2\) fails because horizontal lines above the \(x\)-axis usually cross it twice. The cubic \(y=x^3\) passes because it continually increases.
Why one-to-one matters for inverses
An inverse must reverse the mapping from inputs to outputs. If two inputs share one output, the reverse process would not know which input to choose.
For \(f(x)=x^2\),
\[ f(2)=4 \quad\text{and}\quad f(-2)=4. \]
Trying to reverse \(4\) would require the inverse to return both \(2\) and \(-2\). That is not a function, because a function assigns exactly one output to each input.
One-to-one functions avoid this problem. Each output comes from at most one input, so reversing the function gives a well-defined rule on its range.
> callout note > The horizontal line test checks one-to-one behavior, while the vertical line test checks whether a graph represents a function. They answer different questions.
An algebraic check
For a formula, set two outputs equal:
\[ f(a)=f(b). \]
If the equation always forces \(a=b\), the function is one-to-one. If you can find \(a\ne b\) that satisfy it, the function is not one-to-one.
def is_one_to_one(values):
return len(values) == len(set(values))
linear_values = [2 * x + 3 for x in range(-3, 4)]
square_values = [x ** 2 for x in range(-3, 4)]
print(is_one_to_one(linear_values)) # True
print(is_one_to_one(square_values)) # FalseThis code checks a finite sample, not every real input. A proof or a graph is needed for a conclusion about the entire domain.
Exercise
Is f(x) = (x - 1)^2 one-to-one on the domain x >= 1? Explain using the horizontal line test.
Show answer
Yes. On x >= 1, the graph rises from its vertex and each horizontal line intersects it at most once. Therefore, the restricted function is one-to-one.