Lesson Explainer: Injective Functions Mathematics

In this explainer, we will learn how to determine whether a function is a one-to-one function (injective).

We recall that the definition of a function requires each element of its domain to be associated with exactly one element of its range. For a function to be injective, it must also satisfy this statement with the roles of its domain and range reversed.

Definition: Injective Function

A function is injective, or one to one, if each element of the range of the function corresponds to exactly one element of the domain.

Together with the requirement for it to be a function, we can say that there is a one-to-one correspondence between each element of the domain and a unique element in the range of an injective function. This is why we also refer to an injective function as a one-to-one function.

In the picture above, two functions 𝑓 and 𝑔 are described by their mapping diagrams. The function 𝑓 has two elements (4 and 5) in its range. While the range element 4 has exactly one arrow pointed to it corresponding to the domain element 3, the range element 5 has two different arrows corresponding to the domain elements 1 and 2. Since each element of the range should correspond to exactly one element of the domain for an injective function, we can say that 𝑓 is not injective. On the other hand, each element of the range of function 𝑔 has exactly one arrow pointed to it, corresponding to exactly one element of the domain. So, function 𝑔 is injective.

Let us think through an example where we use mapping diagrams for functions to determine their injectivity.

Example 1: Sum of Two Injective Functions

True or False: If 𝑓 and 𝑔 are both one-to-one functions, then 𝑓+𝑔 must be a one-to-one function.

Answer

We will show that the statement is false via a counterexample.

We recall that a function is one to one if each element of the range of the function corresponds to exactly one element of the domain. In mapping diagrams, this means that each element in the range has exactly one arrow pointing to it.

Consider functions 𝑓 and 𝑔 represented by the mapping diagrams below:

Both functions 𝑓 and 𝑔 are injective because each element of the range has exactly one arrow from the domain pointed at it. When we add 𝑓 and 𝑔, we obtain the following diagram.

Noting that all three lines in the range give the same number, the mapping diagram for 𝑓+𝑔 is given below.

Since the range element 10 has three arrows pointing to it, this range element corresponds to more than one of the domain elements. Hence, the function 𝑓+𝑔 is not injective.

We have shown by a counterexample that the given statement is false.

We can easily recognize injective functions from their mapping diagrams, but how do we recognize them from their graphs in the π‘₯𝑦-plane? We know that the range of a function is given by the portion of the vertical axis used by its graph, while the domain is given by the portion of the horizontal axis used by its graph. Since an injective function must associate each element of its range with a unique element in its domain, there must be exactly one point on the horizontal axis within the domain associated with each point of the function, within its range on the vertical axis.

We can test for this condition by drawing a horizontal line for each range element and checking how many times the graph intersects with the line. If there is more than one intersection between the horizontal line and the function’s graph, then that range element is associated with more than one domain element. In this case, the function would not be injective. Let us look at two examples.

For function 𝑓 in the first diagram, we are able to draw a horizontal line for the range element 2 which intersects with the graph of 𝑓 more than once. More precisely, the range element 2 corresponds to the three distinct domain elements βˆ’2, 0, and 3. Hence, function 𝑓 is not injective. On the other hand, we can see that any horizontal line drawn across the graph of 𝑔 in the second diagram intersects with the graph at exactly one point. By sliding a ruler horizontally up and down the graph, we can verify that there is no horizontal line that intersects with the graph more than once. This means that each range element of 𝑔 corresponds to exactly one domain element. So, function 𝑔 is injective. This process is called the horizontal line test.

Theorem: Horizontal Line Test

A function is injective, or one to one, if each horizontal line intersects the graph of a function at most once.

A function is not injective, or one to one, if there is a horizontal line that crosses its graph more than once.

This is similar to the vertical line test that is used to verify the definition of a function. In place of vertical lines, we use horizontal lines to verify whether a function satisfies the definition of injective, or one to one.

We note that there is no reference to the range of the function in the horizontal line test. If a given horizontal line does not belong to an element of the range, then it will not intersect the graph, so a horizontal line may intersect the graph of an injective function zero times. In other words, the condition for being injective is that the graph of the function intersects each horizontal line at most once.

Let us consider a few examples where we use the horizontal line test to determine whether or not a function is injective.

Example 2: Identifying One-to-One Functions from Their Graph

Is the function shown in the graph a one-to-one function?

Answer

We recall the horizontal line test, which states that a function is one to one, or injective, if and only if its graph intersects with each horizontal line at most once. Let us use the horizontal line test on the given graph.

In the picture above, we have drawn a horizontal line that crosses the graph at three different points: that is, where π‘₯β‰ˆβˆ’3, where π‘₯ is close to 0, and where π‘₯β‰ˆ3. This means that the function fails the horizontal line test.

Hence, the given function is not one to one.

Let us consider another example applying the horizontal line test to become more familiar with different contexts.

Example 3: Identifying One-to-One Functions from Their Graph

Which curve among those shown in the graph below is a one-to-one function?

Answer

We recall the horizontal line test, which states that a function is one to one, or injective, if and only if its graph intersects with each horizontal line at most once.

Let us begin with the red graph. Our goal is to draw, if possible, a horizontal line that crosses the graph more than once, thereby indicating that the function is not injective.

In the picture above, we have drawn a horizontal line that crosses the red graph twice. So, the function represented by the red graph is not one to one.

Similarly, in the second picture, we are able to draw a horizontal line crossing the green graph three times. Hence, the function represented by the green graph is not one to one.

In the third picture, we are able to draw a horizontal line crossing the yellow graph twice, so by the horizontal line test, the function represented by the yellow graph is not one to one.

Finally, in the fourth picture, we have drawn several horizontal lines to search for one that intersects the blue graph more than once, but we could find no line that does this. By sliding a horizontal ruler up and down the graph, we can be sure that no such horizontal line exists. Each horizontal line crosses the blue graph at most once, so by the horizontal line test, the function represented by the blue graph is one to one.

Hence, only the blue graph represents a one-to-one function.

In the previous two examples, we used the horizontal line test to determine whether a given graph represents an injective function. If we are given the algebraic expressions for functions rather than their graphs, then the horizontal line test is not the ideal method to apply because it requires an accurate graph.

On the other hand, we can apply the horizontal line test algebraically in the following sense. In the horizontal line test, we search for a horizontal line that intersects the graph at more than one point. Consider applying the horizontal line test to function 𝑓 in the graph below.

Since such a horizontal line exists, that is, a line that intersects the graph at more than one point, there are at least two values, say π‘₯ and π‘₯, for a single value π‘¦οŠ¦ such that 𝑓(π‘₯)=𝑦𝑓(π‘₯)=𝑦.and

It may be the case, as in the graph above, that there are more than two π‘₯-values corresponding to a single 𝑦-value; however, we need only find two such points since if two π‘₯-values correspond to the same 𝑦-value, then the given function is not one to one. We state the following method.

How To: Identifying Injective Functions Algebraically

Given an algebraic expression for a function 𝑓,

  • if there are two different π‘₯-values from the domain, say π‘₯ and π‘₯, satisfying 𝑓(π‘₯)=𝑓(π‘₯), then 𝑓 is not injective;
  • 𝑓 is injective if the conditions that 𝑓(π‘₯)=𝑓(π‘₯) and that π‘₯ and π‘₯ belong to the domain imply that π‘₯=π‘₯.

Let us consider an example where we identify injective functions from their algebraic expressions.

Example 4: Identifying One-to-One Functions

Which of the following is a one-to-one function?

  1. 𝑓(π‘₯)=|π‘₯|
  2. 𝑓(π‘₯)=π‘₯
  3. 𝑓(π‘₯)=5
  4. 𝑓(π‘₯)=π‘₯+2

Answer

We recall that a function 𝑓 is not one to one if there are two different π‘₯-values from the domain, say π‘₯ and π‘₯, satisfying 𝑓(π‘₯)=𝑓(π‘₯).

Let us consider each possible option with respect to this condition.

  1. 𝑓(π‘₯)=|π‘₯| is the absolute value function. We know that two numbers of the same size but with opposite signs have the same absolute value. For example, if we choose π‘₯=βˆ’1 and π‘₯=1, then 𝑓(βˆ’1)=|βˆ’1|=1,𝑓(1)=|1|=1. Since 𝑓(βˆ’1)=𝑓(1), 𝑓(π‘₯)=|π‘₯| is not one to one.
  2. 𝑓(π‘₯)=π‘₯ is the square function. Just like the absolute value function, two numbers of the same size but with opposite signs have the same squared value. For example, if we choose π‘₯=βˆ’1 and π‘₯=1, then 𝑓(βˆ’1)=(βˆ’1)=1,𝑓(1)=(1)=1. Since 𝑓(βˆ’1)=𝑓(1), 𝑓(π‘₯)=π‘₯ is not one to one.
  3. 𝑓(π‘₯)=5 is a constant function. Whichever number we input to a constant function, the output will always be the same. For example, if we choose π‘₯=βˆ’1 and π‘₯=1, then 𝑓(βˆ’1)=5,𝑓(1)=5. Since 𝑓(βˆ’1)=𝑓(1), 𝑓(π‘₯)=5 is not one to one.
  4. We recall that a function 𝑓 is one to one if the conditions that 𝑓(π‘₯)=𝑓(π‘₯) and that π‘₯ and π‘₯ belong to the domain of 𝑓 imply that π‘₯=π‘₯.
    Say that 𝑓(π‘₯)=𝑓(π‘₯) for the function 𝑓(π‘₯)=π‘₯+2. Then, π‘₯+2=π‘₯+2.
    Subtracting 2 from both sides of the equation, we see that this condition implies π‘₯=π‘₯. This tells us that 𝑓(π‘₯)=𝑓(π‘₯) is only possible when π‘₯=π‘₯. So, in this case, 𝑓(π‘₯)=π‘₯+2 is one to one.

Thus, the only one-to-one function from the given list is D.

Let us consider an example where we identify injective functions with restricted domains.

Example 5: Identifying One-to-One Functions with Restricted Domains

Which of the following is not a one-to-one function on the interval [0,∞[?

  1. 𝑓(π‘₯)=|π‘₯|
  2. 𝑓(π‘₯)=π‘₯
  3. 𝑓(π‘₯)=10
  4. 𝑓(π‘₯)=2π‘₯+4
  5. 𝑓(π‘₯)=1π‘₯+1

Answer

We recall that a function 𝑓 is one to one if the conditions

  • 𝑓(π‘₯)=𝑓(π‘₯),
  • π‘₯ and π‘₯ belong to the domain of 𝑓

imply that π‘₯=π‘₯. On the other hand, we can say that 𝑓 is not one to one if we can find two distinct π‘₯ and π‘₯, that is, π‘₯β‰ π‘₯, in its domain satisfying 𝑓(π‘₯)=𝑓(π‘₯).

Let us consider each example with this condition.

  1. 𝑓(π‘₯)=|π‘₯| is the absolute value function. Note that the domain of the function is restricted to [0,∞[ in this example; that is, π‘₯β‰₯0. If π‘₯,π‘₯∈[0,∞[, then we note that 𝑓(π‘₯)=|π‘₯|=π‘₯,𝑓(π‘₯)=|π‘₯|=π‘₯. Hence, if 𝑓(π‘₯)=𝑓(π‘₯) and π‘₯,π‘₯∈[0,∞[, then we must have π‘₯=π‘₯. This implies that 𝑓(π‘₯)=|π‘₯| is one to one on the interval [0,∞[.
  2. 𝑓(π‘₯)=π‘₯ is the square function. If 𝑓(π‘₯)=𝑓(π‘₯), then π‘₯=π‘₯. We can factor this equation by using the difference of the square formula, for any constant π‘Ž and 𝑏: π‘Žβˆ’π‘=(π‘Žβˆ’π‘)(π‘Ž+𝑏). Then, the equation π‘₯=π‘₯ can be written as π‘₯βˆ’π‘₯=0(π‘₯βˆ’π‘₯)(π‘₯+π‘₯)=0. For the last equation to hold, we must have either π‘₯βˆ’π‘₯=0π‘₯+π‘₯=0.or Since both π‘₯ and π‘₯ are in [0,∞[ and, therefore, are nonnegative, the second equation π‘₯+π‘₯=0 is only possible if both π‘₯ and π‘₯ are equal to zero. On the other hand, the first equation implies that π‘₯=π‘₯. In either case, we must have π‘₯=π‘₯. Hence, 𝑓(π‘₯)=π‘₯ is one to one on the interval [0,∞[.
  3. 𝑓(π‘₯)=10 is a constant function. Whichever number we input to a constant function, the output will always be the same. For example, if we choose π‘₯=0 and π‘₯=1, then 𝑓(0)=10,𝑓(1)=10. Since 𝑓(0)=𝑓(1) and 0,1∈[0,∞[, the function 𝑓(π‘₯)=10 is not one to one on [0,∞[.
  4. Suppose that 𝑓(π‘₯)=𝑓(π‘₯) for the function 𝑓(π‘₯)=2π‘₯+4. Then, 2π‘₯+4=2π‘₯+4. Subtracting 4 from both sides of the equation, we get 2π‘₯=2π‘₯. Dividing both sides of this equation by 2 gives us π‘₯=π‘₯. This is true for any π‘₯, π‘₯ in ℝ, so it must also be true for π‘₯,π‘₯∈[0,∞[. Hence, 𝑓(π‘₯)=2π‘₯+4 is one to one on the interval [0,∞[.
  5. Suppose that 𝑓(π‘₯)=𝑓(π‘₯) for the function 𝑓(π‘₯)=1π‘₯+1. Then, 1π‘₯+1=1π‘₯+1. Since both π‘₯,π‘₯∈[0,∞[, the denominators on both sides of the equation are positive. Cross-multiplying the equation gives us π‘₯+1=π‘₯+1. Subtracting 1 from both sides of the equation, we get π‘₯=π‘₯. Hence, 𝑓(π‘₯)=1π‘₯+1 is one to one on the interval [0,∞[.

Thus, the only function that is not one to one on [0,∞[ from the given list is 𝑓(π‘₯)=10, which is C.

In our final example, we will examine the injectivity of trigonometric functions using their graphs.

Example 6: Determining Injectivity of a Trigonometric Function

Determine whether 𝑓(π‘₯)=π‘₯sin is a one-to-one function in each of the following cases.

  • π‘₯βˆˆβ„
  • π‘₯βˆˆο“βˆ’πœ‹2,πœ‹2

Answer

We recall the horizontal line test, which states that a function is one to one, or injective, if its graph intersects with each horizontal line at most once.

We begin by graphing 𝑦=π‘₯sin accurately. We know that sinπ‘₯ is a periodic function with the period 2πœ‹. We also know that sinπ‘₯=1 at π‘₯=πœ‹2 and sinπ‘₯=βˆ’1 when π‘₯=βˆ’πœ‹2. So, we have the following graph of 𝑦=π‘₯sin.

We apply the horizontal line test to this graph.

Since the given horizontal line crosses the graph more than once in the interval shown, we can conclude that the function 𝑓(π‘₯)=π‘₯sin is not one to one for π‘₯βˆˆβ„. We note that, in fact, over ℝ, the horizontal line crosses the graph infinitely many times because sinπ‘₯ is periodic.

On the other hand, if we restrict the domain to ο“βˆ’πœ‹2,πœ‹2, then we have the following graph.

We apply the horizontal line test over this graph.

By sliding a ruler horizontally up and down the graph, we can tell that any horizontal line crosses the graph at most once. Hence, the function 𝑓(π‘₯)=π‘₯sin is one to one for π‘₯βˆˆο“βˆ’πœ‹2,πœ‹2.

Thus, the function 𝑓(π‘₯)=π‘₯sin is not one to one for π‘₯βˆˆβ„, but it is one to one for π‘₯βˆˆο“βˆ’πœ‹2,πœ‹2.

Let us summarize a few important concepts from this explainer.

Key Points

  • A function is injective, or one to one, if each element of the range of the function corresponds to exactly one element of the domain.
  • The horizontal line test states that a function is injective, or one to one, if and only if each horizontal line intersects with the graph of a function at most once.
  • A function 𝑓 is one to one if the conditions
    • 𝑓(π‘₯)=𝑓(π‘₯),
    • π‘₯ and π‘₯ belong to the domain of 𝑓
    imply that π‘₯=π‘₯.
  • 𝑓 is not one to one if we can find two distinct π‘₯ and π‘₯ in its domain satisfying 𝑓(π‘₯)=𝑓(π‘₯).

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.