Lesson Explainer: Injective Functions | Nagwa Lesson Explainer: Injective Functions | Nagwa

Lesson Explainer: Injective Functions Mathematics • Second Year of Secondary School

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 𝑥4, where 𝑥 is close to 0, and where 𝑥4. 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 𝑓(𝑥)=𝑓(𝑥).

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

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