This is “Composition and Inverse Functions”, section 7.1 from the book Advanced Algebra (v. 1.0). For details on it (including licensing), click here.

Has this book helped you? Consider passing it on:
Creative Commons supports free culture from music to education. Their licenses helped make this book available to you.
DonorsChoose.org helps people like you help teachers fund their classroom projects, from art supplies to books to calculators.

## 7.1 Composition and Inverse Functions

### Learning Objectives

1. Perform function composition.
2. Determine whether or not given functions are inverses.
3. Use the horizontal line test.
4. Find the inverse of a one-to-one function algebraically.

## Composition of Functions

In mathematics, it is often the case that the result of one function is evaluated by applying a second function. For example, consider the functions defined by $f(x)=x2$ and $g(x)=2x+5.$ First, g is evaluated where $x=−1$ and then the result is squared using the second function, f.

This sequential calculation results in 9. We can streamline this process by creating a new function defined by $f(g(x))$, which is explicitly obtained by substituting $g(x)$ into $f(x).$

$f(g(x))=f(2x+5)=(2x+5)2=4x2+20x+25$

Therefore, $f(g(x))=4x2+20x+25$ and we can verify that when $x=−1$ the result is 9.

$f(g(−1))=4(−1)2+20(−1)+25=4−20+25=9$

The calculation above describes composition of functionsApplying a function to the results of another function., which is indicated using the composition operatorThe open dot used to indicate the function composition $(f○g)(x)=f(g(x)).$ ($○$). If given functions f and g,

$(f○g)(x)=f(g(x)) Composition of Functions$

The notation $f○g$ is read, “f composed with g.” This operation is only defined for values, x, in the domain of g such that $g(x)$ is in the domain of f.

### Example 1

Given $f(x)=x2−x+3$ and $g(x)=2x−1$ calculate:

1. $(f○g)(x).$
2. $(g○f)(x).$

Solution:

1. Substitute g into f.

$(f○g)(x)=f(g(x))=f(2x−1)=(2x−1)2−(2x−1)+3=4x2−4x+1−2x+1+3=4x2−6x+5$

2. Substitute f into g.

$(g○f)(x)=g(f(x))=g(x2−x+3)=2(x2−x+3)−1=2x2−2x+6−1=2x2−2x+5$

1. $(f○g)(x)=4x2−6x+5$
2. $(g○f)(x)=2x2−2x+5$

The previous example shows that composition of functions is not necessarily commutative.

### Example 2

Given $f(x)=x3+1$ and $g(x)=3x−13$ find $(f○g)(4).$

Solution:

Begin by finding $(f○g)(x).$

$(f○g)(x)=f(g(x))=f(3x−13)=(3x−13)3+1=3x−1+1=3x$

Next, substitute 4 in for x.

$(f○g)(x)=3x(f○g)(4)=3(4)=12$

Answer: $(f○g)(4)=12$

Functions can be composed with themselves.

### Example 3

Given $f(x)=x2−2$ find $(f○f)(x).$

Solution:

$(f○f)(x)=f(f(x))=f(x2−2)=(x2−2)2−2=x4−4x2+4−2=x4−4x2+2$

Answer: $(f○f)(x)=x4−4x2+2$

Try this! Given $f(x)=2x+3$ and $g(x)=x−1$ find $(f○g)(5).$

## Inverse Functions

Consider the function that converts degrees Fahrenheit to degrees Celsius: $C(x)=59(x−32).$ We can use this function to convert 77°F to degrees Celsius as follows.

$C(77)=59(77−32)=59(45)=25$

Therefore, 77°F is equivalent to 25°C. If we wish to convert 25°C back to degrees Fahrenheit we would use the formula: $F(x)=95x+32.$

$F(25)=95(25)+32=45+32=77$

Notice that the two functions $C$ and $F$ each reverse the effect of the other.

This describes an inverse relationship. In general, f and g are inverse functions if,

$(f○g)(x)=f(g(x))=x for all x in the domain of g and(g○f)(x)=g(f(x))=x for all x in the domain of f.$

In this example,

$C(F(25))=C(77)=25F(C(77))=F(25)=77$

### Example 4

Verify algebraically that the functions defined by $f(x)=12x−5$ and $g(x)=2x+10$ are inverses.

Solution:

Compose the functions both ways and verify that the result is x.

 $(f○g)(x)=f(g(x))=f(2x+10)=12(2x+10)−5=x+5−5=x ✓$ $(g○f)(x)=g(f(x))=g(12x−5)=2(12x−5)+10=x−10+10=x ✓$

Answer: Both $(f○g)(x)=(g○f)(x)=x$; therefore, they are inverses.

Next we explore the geometry associated with inverse functions. The graphs of both functions in the previous example are provided on the same set of axes below.

Note that there is symmetry about the line $y=x$; the graphs of f and g are mirror images about this line. Also notice that the point (20, 5) is on the graph of f and that (5, 20) is on the graph of g. Both of these observations are true in general and we have the following properties of inverse functions:

1. The graphs of inverse functions are symmetric about the line $y=x.$
2. If $(a,b)$ is on the graph of a function, then $(b,a)$ is on the graph of its inverse.

Furthermore, if g is the inverse of f we use the notation $g=f−1.$ Here $f−1$ is read, “f inverse,” and should not be confused with negative exponents. In other words, $f−1(x)≠1f(x)$ and we have,

$(f○f−1)(x)=f(f−1(x))=x and(f−1○f)(x)=f−1(f(x))=x$

### Example 5

Verify algebraically that the functions defined by $f(x)=1x−2$ and $f−1(x)=1x+2$ are inverses.

Solution:

Compose the functions both ways to verify that the result is x.

 $(f○f−1)(x)=f(f−1(x))=f(1x+2)=1(1x+2)−2=x+21−2=x+2−2=x ✓$ $(f−1○f)(x)=f−1(f(x))=f−1(1x−2)=1(1x−2)+2=1 1x =x ✓$

Answer: Since $(f○f−1)(x)=(f−1○f)(x)=x$ they are inverses.

Recall that a function is a relation where each element in the domain corresponds to exactly one element in the range. We use the vertical line test to determine if a graph represents a function or not. Functions can be further classified using an inverse relationship. One-to-one functionsFunctions where each value in the range corresponds to exactly one value in the domain. are functions where each value in the range corresponds to exactly one element in the domain. The horizontal line testIf a horizontal line intersects the graph of a function more than once, then it is not one-to-one. is used to determine whether or not a graph represents a one-to-one function. If a horizontal line intersects a graph more than once, then it does not represent a one-to-one function.

The horizontal line represents a value in the range and the number of intersections with the graph represents the number of values it corresponds to in the domain. The function defined by $f(x)=x3$ is one-to-one and the function defined by $f(x)=|x|$ is not. Determining whether or not a function is one-to-one is important because a function has an inverse if and only if it is one-to-one. In other words, a function has an inverse if it passes the horizontal line test.

Note: In this text, when we say “a function has an inverse,” we mean that there is another function, $f−1$, such that $(f○f−1)(x)=(f−1○f)(x)=x.$

### Example 6

Determine whether or not the given function is one-to-one.

Solution:

Answer: The given function passes the horizontal line test and thus is one-to-one.

In fact, any linear function of the form $f(x)=mx+b$ where $m≠0$, is one-to-one and thus has an inverse. The steps for finding the inverse of a one-to-one function are outlined in the following example.

### Example 7

Find the inverse of the function defined by $f(x)=32x−5.$

Solution:

Before beginning this process, you should verify that the function is one-to-one. In this case, we have a linear function where $m≠0$ and thus it is one-to-one.

• Step 1: Replace the function notation $f(x)$ with y.

$f(x)=32x−5y=32x−5$

• Step 2: Interchange x and y. We use the fact that if $(x,y)$ is a point on the graph of a function, then $(y,x)$ is a point on the graph of its inverse.

$x=32y−5$

• Step 3: Solve for y.

$x=32y−5x+5=32y23⋅(x+5)=23⋅32y23x+103=y$

• Step 4: The resulting function is the inverse of f. Replace y with $f−1(x).$

$f−1(x)=23x+103$

• Step 5: Check.

 $(f○f−1)(x)=f(f−1(x))=f(23x+103)=32(23x+103)−5=x+5−5=x ✓$ $(f−1○f)(x)=f−1(f(x))=f−1(32x−5)=23(32x−5)+103=x−103+103=x ✓$

Answer: $f−1(x)=23x+103$

If a function is not one-to-one, it is often the case that we can restrict the domain in such a way that the resulting graph is one-to-one. For example, consider the squaring function shifted up one unit, $g(x)=x2+1.$ Note that it does not pass the horizontal line test and thus is not one-to-one. However, if we restrict the domain to nonnegative values, $x≥0$, then the graph does pass the horizontal line test.

On the restricted domain, g is one-to-one and we can find its inverse.

### Example 8

Find the inverse of the function defined by $g(x)=x2+1$ where $x≥0.$

Solution:

Begin by replacing the function notation $g(x)$ with y.

$g(x)=x2+1y=x2+1 where x≥0$

Interchange x and y.

$x=y2+1 where y≥0$

Solve for y.

$x=y2+1x−1=y2±x−1=y$

Since $y≥0$ we only consider the positive result.

$y=x−1g−1(x)=x−1$

Answer: $g−1(x)=x−1.$ The check is left to the reader.

The graphs in the previous example are shown on the same set of axes below. Take note of the symmetry about the line $y=x.$

### Example 9

Find the inverse of the function defined by $f(x)=2x+1x−3.$

Solution:

Use a graphing utility to verify that this function is one-to-one. Begin by replacing the function notation $f(x)$ with y.

$f(x)=2x+1x−3y=2x+1x−3$

Interchange x and y.

$x=2y+1y−3$

Solve for y.

$x=2y+1y−3x(y−3)=2y+1xy−3x=2y+1$

Obtain all terms with the variable y on one side of the equation and everything else on the other. This will enable us to treat y as a GCF.

$xy−3x=2y+1xy−2y=3x+1y(x−2)=3x+1y=3x+1x−2$

Answer: $f−1(x)=3x+1x−2.$ The check is left to the reader.

Try this! Find the inverse of $f(x)=x+13−3.$

Answer: $f−1(x)=(x+3)3−1$

### Key Takeaways

• The composition operator ($○$) indicates that we should substitute one function into another. In other words, $(f○g)(x)=f(g(x))$ indicates that we substitute $g(x)$ into $f(x).$
• If two functions are inverses, then each will reverse the effect of the other. Using notation, $(f○g)(x)=f(g(x))=x$ and $(g○f)(x)=g(f(x))=x.$
• Inverse functions have special notation. If $g$ is the inverse of $f$, then we can write $g(x)=f−1(x).$ This notation is often confused with negative exponents and does not equal one divided by $f(x).$
• The graphs of inverses are symmetric about the line $y=x.$ If $(a,b)$ is a point on the graph of a function, then $(b,a)$ is a point on the graph of its inverse.
• If each point in the range of a function corresponds to exactly one value in the domain then the function is one-to-one. Use the horizontal line test to determine whether or not a function is one-to-one.
• A one-to-one function has an inverse, which can often be found by interchanging x and y, and solving for y. This new function is the inverse of the original function.

### Part A: Composition of Functions

Given the functions defined by f and g find $(f○g)(x)$ and $(g○f)(x).$

1. $f(x)=4x−1$, $g(x)=3x$

2. $f(x)=−2x+5$, $g(x)=2x$

3. $f(x)=3x−5$, $g(x)=x−4$

4. $f(x)=5x+1$, $g(x)=2x−3$

5. $f(x)=x2−x+1$, $g(x)=2x−1$

6. $f(x)=x2−3x−2$, $g(x)=x−2$

7. $f(x)=x2+3$, $g(x)=x2−5$

8. $f(x)=2x2$, $g(x)=x2−x$

9. $f(x)=8x3+5$, $g(x)=x−53$

10. $f(x)=27x3−1$, $g(x)=x+13$

11. $f(x)=1x+5$, $g(x)=1x$

12. $f(x)=1x−3$, $g(x)=3x+3$

13. $f(x)=5x$, $g(x)=3x−2$

14. $f(x)=2x$, $g(x)=4x+1$

15. $f(x)=12x$, $g(x)=x2+8$

16. $f(x)=2x−1$, $g(x)=1x+1$

17. $f(x)=1−x2x$, $g(x)=12x+1$

18. $f(x)=2xx+1$, $g(x)=x+1x$

Given the functions defined by $f(x)=3x2−2$, $g(x)=5x+1$, and $h(x)=x$, calculate the following.

1. $(f○g)(2)$

2. $(g○f)(−1)$

3. $(g○f)(0)$

4. $(f○g)(0)$

5. $(f○h)(3)$

6. $(g○h)(16)$

7. $(h○g)(35)$

8. $(h○f)(−3)$

Given the functions defined by $f(x)=x+33$, $g(x)=8x3−3$, and $h(x)=2x−1$, calculate the following.

1. $(f○g)(1)$

2. $(g○f)(−2)$

3. $(g○f)(0)$

4. $(f○g)(−2)$

5. $(f○h)(−1)$

6. $(h○g)(−12)$
7. $(h○f)(24)$

8. $(g○h)(0)$

Given the function, determine $(f○f)(x).$

1. $f(x)=3x−1$

2. $f(x)=25x+1$

3. $f(x)=x2+5$

4. $f(x)=x2−x+6$

5. $f(x)=x3+2$

6. $f(x)=x3−x$

7. $f(x)=1x+1$

8. $f(x)=x+12x$

### Part B: Inverse Functions

Are the given functions one-to-one? Explain.

1. $f(x)=x+1$

2. $g(x)=x2+1$

3. $h(x)=|x|+1$

4. $r(x)=x3+1$

5. $f(x)=x+1$

6. $g(x)=3$

Given the graph of a one-to-one function, graph its inverse.

Verify algebraically that the two given functions are inverses. In other words, show that $(f○f−1)(x)=x$ and $(f−1○f)(x)=x.$

1. $f(x)=3x−4$, $f−1(x)=x+43$

2. $f(x)=−5x+1$, $f−1(x)=1−x5$

3. $f(x)=−23x+1$, $f−1(x)=−32x+32$

4. $f(x)=4x−13$, $f−1(x)=14x+112$

5. $f(x)=x−8$, $f−1(x)=x2+8$, $x≥0$

6. $f(x)=6x3−3$, $f−1(x)=(x+3)36$

7. $f(x)=xx+1$, $f−1(x)=x1−x$

8. $f(x)=x−33x$, $f−1(x)=31−3x$

9. $f(x)=2(x−1)3+3$, $f−1(x)=1+x−323$

10. $f(x)=5x−13+4$, $f−1(x)=(x−4)3+15$

Find the inverses of the following functions.

1. $f(x)=5x$

2. $f(x)=12x$

3. $f(x)=2x+5$

4. $f(x)=−4x+3$

5. $f(x)=−23x+13$

6. $f(x)=−12x+34$

7. $g(x)=x2+5$, $x≥0$

8. $g(x)=x2−7$, $x≥0$

9. $f(x)=(x−5)2$, $x≥5$

10. $f(x)=(x+1)2$, $x≥−1$

11. $h(x)=3x3+5$

12. $h(x)=2x3−1$

13. $f(x)=(2x−3)3$

14. $f(x)=(x+4)3−1$

15. $g(x)=2x3+1$
16. $g(x)=1x3−2$
17. $f(x)=5x+1$
18. $f(x)=12x−9$
19. $f(x)=x+5x−5$
20. $f(x)=3x−42x−1$
21. $h(x)=x−510x$
22. $h(x)=9x+13x$
23. $g(x)=5x+23$

24. $g(x)=4x−33$

25. $f(x)=x−63−4$

26. $f(x)=2x+23+5$

27. $h(x)=x+15−3$

28. $h(x)=x−85+1$

29. $f(x)=mx+b$, $m≠0$

30. $f(x)=ax2+c$, $x≥0$

31. $f(x)=ax3+d$

32. $f(x)=a(x−h)2+k$, $x≥h$

Graph the function and its inverse on the same set of axes.

1. $f(x)=x+2$

2. $f(x)=23x−4$

3. $f(x)=−2x+2$

4. $f(x)=−13x+4$

5. $g(x)=x2−2$, $x≥0$

6. $g(x)=(x−2)2$, $x≥2$

7. $h(x)=x3+1$

8. $h(x)=(x+2)3−2$

9. $f(x)=2−x$

10. $f(x)=−x+1$

### Part C: Discussion Board

1. Is composition of functions associative? Explain.

2. Explain why $C(x)=59(x−32)$ and $F(x)=95x+32$ define inverse functions. Prove it algebraically.

3. Do the graphs of all straight lines represent one-to-one functions? Explain.

4. If the graphs of inverse functions intersect, then how can we find the point of intersection? Explain.

1. $(f○g)(x)=12x−1$; $(g○f)(x)=12x−3$

2. $(f○g)(x)=3x−17$; $(g○f)(x)=3x−9$

3. $(f○g)(x)=4x2−6x+3$; $(g○f)(x)=2x2−2x+1$

4. $(f○g)(x)=x4−10x2+28$; $(g○f)(x)=x4+6x2+4$

5. $(f○g)(x)=8x−35$; $(g○f)(x)=2x$

6. $(f○g)(x)=x5x+1$; $(g○f)(x)=x+5$

7. $(f○g)(x)=53x−2$; $(g○f)(x)=15x−2$

8. $(f○g)(x)=12x2+16;$ $(g○f)(x)=1+32x24x2$
9. $(f○g)(x)=x$; $(g○f)(x)=x$

10. 361

11. −9

12. 7

13. 2

14. 2

15. 21

16. 0

17. 5

18. $(f○f)(x)=9x−4$

19. $(f○f)(x)=x4+10x2+30$

20. $(f○f)(x)=x9+6x6+12x3+10$

21. $(f○f)(x)=x+1x+2$

1. No, fails the HLT

2. Yes, passes the HLT

3. Yes, its graph passes the HLT.

4. No, its graph fails the HLT.

5. Yes, its graph passes the HLT.

6. Proof

7. Proof

8. Proof

9. Proof

10. Proof

11. $f−1(x)=x5$

12. $f−1(x)=12x−52$
13. $f−1(x)=−32x+12$
14. $g−1(x)=x−5$

15. $f−1(x)=x+5$

16. $h−1(x)=x−533$
17. $f−1(x)=x3+32$
18. $g−1(x)=2−xx3$
19. $f−1(x)=5−xx$
20. $f−1(x)=5(x+1)x−1$
21. $h−1(x)=−510x−1$
22. $g−1(x)=x3−25$
23. $f−1(x)=(x+4)3+6$

24. $h−1(x)=(x+3)5−1$

25. $f−1(x)=x−bm$
26. $f−1(x)=x−da3$