# Inverse and Composite Functions

## Introduction to Inverse Functions

To find the inverse function, switch the [latex]x[/latex] and [latex]y[/latex] values, and then solve for [latex]y[/latex].### Learning Objectives

Calculate the formula of an function's inverse by switching [latex]x[/latex] and [latex]y[/latex] and then solving for [latex]y[/latex].### Key Takeaways

#### Key Points

- An inverse function reverses the inputs and outputs.
- To find the inverse formula of a function, write it in the form of [latex]y[/latex] and [latex]x[/latex], switch [latex]y[/latex] and [latex]x[/latex], and then solve for [latex]y[/latex].
- Some functions have no inverse function, as a function cannot have multiple outputs.

#### Key Terms

**inverse function**: A function that does exactly the opposite of another

### Definition of Inverse Function

An inverse function, which is notated [latex]f^{-1}(x) [/latex], is defined as the inverse function of [latex]f(x)[/latex] if it consistently reverses the [latex]f(x)[/latex] process. That is, if [latex]f(x)[/latex] turns [latex]a[/latex] into [latex]b[/latex], then [latex]f^{-1}(x)[/latex] must turn [latex]b[/latex] into [latex]a[/latex]. More concisely and formally, [latex]f^{-1}(x)[/latex] is the inverse function of [latex]f(x)[/latex] if: [latex-display]f({f}^{-1}(x))=x[/latex-display] Below is a mapping of function [latex]f(x)[/latex] and its inverse function, [latex]f^{-1}(x)[/latex]. Notice that the ordered pairs are reversed from the original function to its inverse. Because [latex]f(x)[/latex] maps [latex]a[/latex] to [latex]3[/latex], the inverse [latex]f^{-1}(x)[/latex] maps [latex]3[/latex] back to [latex]a[/latex].**Inverse functions:**mapping representation: An inverse function reverses the inputs and outputs.

**Inverse functions:**graphic representation: The function graph (red) and its inverse function graph (blue) are reflections of each other about the line [latex]y=x[/latex] (dotted black line). Notice that any ordered pair on the red curve has its reversed ordered pair on the blue line. For example, [latex](0,1)[/latex] on the red (function) curve is reflected over the line [latex]y=x[/latex] and becomes [latex](1,0)[/latex] on the blue (inverse function) curve. Where one curve is on the line [latex]y=x[/latex], the curves intersect, as a reflection over the line leaves the point unchanged.

### Write the Inverse Function

In general, given a function, how do you find its inverse function? Remember that an inverse function reverses the inputs and outputs. So to find the inverse function, switch the [latex]x[/latex] and [latex]y[/latex] values of a given function, and then solve for [latex]y[/latex].### Example 1

Find the inverse of: [latex]f(x)=x^2[/latex] a.: Write the function as: [latex]y=x^2[/latex] b.: Switch the [latex]x[/latex] and [latex]y[/latex] variables: [latex]x=y^2[/latex] c.: Solve for [latex]y[/latex]: [latex]\begin {align} x&=y^2 \\ \pm\sqrt{x}&=y \end {align}[/latex] Since the function [latex]f(x)=x^2[/latex] has multiple outputs, its inverse is not a function. Notice the graphs in the picture below. Even though the blue curve is a function (passes the vertical line test), its inverse would not be. The red curve for the function [latex]f(x)=\sqrt{x}[/latex] is not the full inverse of the function [latex]f(x)=x^2[/latex]**The inverse is not a function:**A function's inverse may not always be a function. The function (blue) [latex]f(x)=x^2[/latex], includes the points [latex](-1,1)[/latex] and [latex](1,1)[/latex]. Therefore, the inverse would include the points: [latex](1,-1)[/latex] and [latex](1,1)[/latex] which the input value repeats, and therefore is not a function. For [latex]f(x)=\sqrt{x}[/latex] to be a function, it must be defined as positive.

### Example 2

Find the inverse function of: [latex]f(x)=2^x[/latex] As soon as the problem includes an exponential function, we know that the logarithm reverses exponentiation. The complex logarithm is the inverse function of the exponential function applied to complex numbers. Let's see what happens when we switch the input and output values and solve for [latex]y[/latex]. a.: Write the function as: [latex]y = {2}^{x}[/latex] b.: Switch the [latex]x[/latex] and [latex]y[/latex] variables: [latex]x = {2}^{y}[/latex] c.: Solve for [latex]y[/latex]: [latex]\begin {align} {log}_{2}x &= {log}_{2}{2}^{y} \\{log}_{2}x &= y{log}_{2}{2} \\{log}_{2}x &= y \\{f}^{1}(x) &= {log}_{2}(x) \end {align}[/latex]**Exponential and logarithm functions:**The graphs of [latex]y=2^x[/latex] (blue) and [latex]x=2^y[/latex] (red) are inverses of one another. The black line represents the line of reflection, in which is [latex]y=x[/latex].

- Pick a number, and plug it into the original function. [latex]2\rightarrow f(x)\rightarrow 4[/latex].
- See if the inverse function reverses this process. [latex]4\rightarrow f^{-1}(x)\rightarrow 2[/latex]. ✓

## Composition of Functions and Decomposing a Function

Functional composition allows for the application of one function to another; this step can be undone by using functional decomposition.### Learning Objectives

Practice functional composition by applying the rules of one function to the results of another function### Key Takeaways

#### Key Points

- Functional composition applies one function to the results of another.
- Functional decomposition resolves a functional relationship into its constituent parts so that the original function can be reconstructed from those parts by functional composition.
- Decomposition of a function into non-interacting components generally permits more economical representations of the function.
- The process of combining functions so that the output of one function becomes the input of another is known as a composition of functions. The resulting function is known as a composite function. We represent this combination by the following notation: [latex](f∘g (x)=f(g(x))[/latex]
- The domain of the composite function [latex](f∘g)[/latex] is all [latex]x[/latex] such that [latex]x[/latex] is in the domain of [latex]g[/latex] and [latex]g(x)[/latex] is in the domain of [latex]f[/latex].

#### Key Terms

**codomain**: The target space into which a function maps elements of its domain. It always contains the range of the function, but can be larger than the range if the function is not subjective.**domain**: The set of all points over which a function is defined.

### Function Composition

The process of combining functions so that the output of one function becomes the input of another is known as a composition of functions. The resulting function is known as a*composite function*. We represent this combination by the following notation: [latex-display](f∘g)(x)=f(g(x))[/latex-display] We read the left-hand side as "[latex]f[/latex]" composed with [latex]g[/latex] at [latex]x[/latex], and the right-hand side as "[latex]f[/latex] of [latex]g[/latex] of [latex]x[/latex]." The two sides of the equation have the same mathematical meaning and are equal. The open circle symbol, [latex]∘[/latex], is called the

*composition operator*. Composition is a binary operation that takes two functions and forms a new function, much as addition or multiplication takes two numbers and gives a new number.

### Function Composition and Evaluation

It is important to understand the order of operations in evaluating a composite function. We follow the usual convention with parentheses by starting with the innermost parentheses first, and then working to the outside. In general, [latex](f∘g)[/latex] and [latex](g∘f)[/latex] are different functions. In other words, in many cases [latex]f(g(x))\ne g(f(x))[/latex] for all [latex]x[/latex]. Note that the range of the inside function (the first function to be evaluated) needs to be within the domain of the outside function. Less formally, the composition has to make sense in terms of inputs and outputs.### Evaluating Composite Functions Using Input Values

When evaluating a composite function where we have either created or been given formulas, the rule of working from the inside out remains the same. The input value to the outer function will be the output of the inner function, which may be a numerical value, a variable name, or a more complicated expression.### Example 1

If [latex]f(x)=-2x[/latex] and [latex]g(x)=x^2-1[/latex], evaluate [latex]f(g(3))[/latex] and [latex]g(f(3))[/latex]. To evaluate [latex]f(g(3))[/latex], first substitute, or input the value of [latex]3[/latex] into [latex]g(x)[/latex] and find the output. Then substitute that value into the [latex]f(x)[/latex] function, and simplify: [latex-display]g(3)=(3)^2-1=9-1=8[/latex-display] [latex-display]f(8)=-2(8)=-16[/latex-display] Therefore, [latex]f(g(3))=-16[/latex] To evaluate [latex]g(f(3))[/latex], find [latex]f(3)[/latex] and then use that output value as the input value into the [latex]g(x)[/latex] function: [latex-display]f(3)=-2(3)=-6[/latex-display] [latex-display]g(-6)=(-6)^2-1=36-1=35[/latex-display] Therefore, [latex]g(f(3))=35[/latex]### Evaluating Composite Functions Using a Formula

While we can compose the functions for each individual input value, it is sometimes helpful to find a single formula that will calculate the result of a composition [latex]f(g(x))[/latex] or [latex]g(f(x))[/latex]. To do this, we will extend our idea of function evaluation. In the next example we are given a formula for two composite functions and asked to evaluate the function. Evaluate the inside function using the input value or variable provided. Use the resulting output as the input to the outside function.### Example 2

If [latex]f(x) =-2x[/latex] and [latex]g(x)=x^2-1[/latex], evaluate [latex]f(g(x))[/latex] and [latex]g(f(x))[/latex]. First substitute, or input the function [latex]g(x)[/latex], [latex]x^2-1[/latex] into the [latex]f(x)[/latex] function, and then simplify: [latex-display]f(g(x))=-2(x^2-1)[/latex-display] [latex-display]f(g(x))=-2x^2+2[/latex-display] For [latex]g(f(x))[/latex], input the [latex]f(x)[/latex] function, [latex]-2x[/latex] into the [latex]g(x)[/latex] function, and then simplify: [latex-display]g(f(x))=(-2x)^2-1 [/latex-display] [latex-display]g(f(x))=4x^2-1[/latex-display]### Functional Decomposition

Functional decomposition broadly refers to the process of resolving a functional relationship into its constituent parts in such a way that the original function can be reconstructed (i.e., recomposed) from those parts by function composition. In general, this process of decomposition is undertaken either for the purpose of gaining insight into the identity of the constituent components (which may reflect individual physical processes of interest), or for the purpose of obtaining a compressed representation of the global function; a task which is feasible only when the constituent processes possess a certain level of modularity (*i.e.*, independence or non-interaction). In general, functional decompositions are worthwhile when there is a certain "sparseness" in the dependency structure;

*i.e*. when constituent functions are found to depend on approximately disjointed sets of variables. Also, decomposition of a function into non-interacting components generally permits more economical representations of the function.

## Restricting Domains to Find Inverses

Domain restriction is important for inverse functions of exponents and logarithms because sometimes we need to find an unique inverse.### Learning Objectives

Determine inverses of functions by restricting their domains### Key Takeaways

#### Key Points

- [latex]f^{-1}(x)[/latex] is defined as the inverse function of [latex]f(x)[/latex] if it consistently reverses the [latex]f(x)[/latex]process.
- Informally, a restriction of a function [latex]f[/latex] is the result of trimming its domain.
- [latex]f(x)={x}^{2}[/latex], without any domain restriction, does not have an inverse function, as it fails the horizontal line test.

#### Key Terms

**domain**: The set of points over which a function is defined.

### Inverse Functions

[latex]f^{-1}(x)[/latex] is defined as the inverse function of [latex]f(x)[/latex] if it consistently reverses the [latex]f(x)[/latex] process. That is, if [latex]f(x)[/latex] turns [latex]a[/latex] into [latex]b[/latex], then [latex]f^{-1}x[/latex] must turn [latex]b[/latex] into [latex]a[/latex]. More concisely and formally, [latex]f^{-1}x[/latex] is the inverse function of [latex]f(x)[/latex] if [latex]f({f}^{-1}(x))=x[/latex].**Inverse functions' domain and range:**If [latex]f[/latex] maps [latex]X[/latex] to [latex]Y[/latex], then [latex]f^{-1}[/latex] maps [latex]Y[/latex] back to [latex]X[/latex].

### Domain Restrictions: Parabola

Informally, a restriction of a function is the result of trimming its domain. Remember that: If [latex]f[/latex] maps [latex]X[/latex] to [latex]Y[/latex], then [latex]f^{-1}[/latex] maps [latex]Y[/latex] back to [latex]X[/latex]. This is not true of the function [latex]f(x)=x^2[/latex]. Without any domain restriction, [latex]f(x)=x^2[/latex] does not have an inverse function as it fails the horizontal line test. But if we restrict the domain to be [latex]x > 0[/latex] then we find that it passes the horizontal line test and therefore has an inverse function. Below is the graph of the parabola and its "inverse." Notice that the parabola does not have a "true" inverse because the original function fails the horizontal line test and must have a restricted domain to have an inverse.**Failure of horizontal line test:**Graph of a parabola with the equation [latex]y=x^2[/latex], the U-Shaped curve opening up. This function fails the horizontal line test, and therefore does not have an inverse. The inverse equation, [latex]y=\sqrt{x}[/latex] (other graph) only includes the positive input values of the parabola's domain. However, if we restrict the domain to be [latex]x>0[/latex], then we find that it passes the horizontal line test and will match the inverse function.

### Domain Restriction: Exponential and Logarithmic Functions

Domain restriction is important for inverse functions of exponents and logarithms because sometimes we need to find an unique inverse. The inverse of an exponential function is a logarithmic function, and the inverse of a logarithmic function is an exponential function.### Example 1

Is [latex]x=0[/latex] in the domain of the function [latex]f(x)=log(x)[/latex]? If so, what is the value of the function when [latex]x=0[/latex]? Verify the result. No, the function has no defined value for [latex]x=0[/latex]. To verify, suppose [latex]x=0[/latex] is in the domain of the function [latex]f(x)=log(x)[/latex]. Then there is some number [latex]n[/latex] such that [latex]n=log(0)[/latex]. Rewriting as an exponential equation gives: [latex]10n=0[/latex], which is impossible since no such real number [latex]n[/latex] exists. Therefore, [latex]x=0[/latex] is not in the domain of the function [latex]f(x)=log(x)[/latex].## Inverses of Composite Functions

A composite function represents, in one function, the results of an entire chain of dependent functions.### Learning Objectives

Solve for the inverse of a composite function### Key Takeaways

#### Key Points

- The composition of functions is always associative. That is, if [latex]f[/latex], [latex]g[/latex], and [latex]h[/latex] are three functions with suitably chosen domains and co-domains, then [latex] f ∘ (g ∘ h) = (f ∘ g) ∘ h[/latex], where the parentheses serve to indicate that composition is to be performed first for the parenthesized functions.
- Functions can be inverted and then composed, giving the notation of: [latex](f' \circ g' ) (x)[/latex].
- Functions can be composed and then inverted, yielding the following notation: [latex]{(f\circ g)}'(x)[/latex].

#### Key Terms

**composite function**: A function of one or more independent variables, at least one of which is itself a function of one or more other independent variables; a function of a function

### Composition and Composite Functions

In mathematics,*function composition*is the application of one function to the results of another.

**Composition of functions:**[latex]g \circ f[/latex], the composition of [latex]f[/latex] and [latex]g[/latex]. For example, [latex](g\circ f)(c) = \#[/latex].

*composite function*represents in one function the results of an entire chain of dependent functions. For example, if a school becomes larger, the supply of food in the cafeteria must become larger. This would entail ordering more sandwiches, which means ordering more ingredients, drinks, plates, etc. The entire chain of dependent functions are the ingredients, drinks, plates, etc., and the one composite function would be putting the entire chain together in order to calculate a larger population at the school.

### Inverses and Composition

Let's go through the relationship between inverses and composition in this example. let's take two functions, compose and invert them. Find: [latex](f∘g)'(x)(f\circ g)' (x)[/latex] [latex]\begin {align}f(x)&={x}^{2} \\g(x)&=x+1 \end {align}[/latex] First, compose them by applying the function [latex]f[/latex] to the result of applying function [latex]g[/latex]: [latex]\begin {align}(f\circ g)(x)&=f(x+1)=(x+1)^2 \\y&=(x+1)^2 \\\sqrt {y}&=x+1 \\\sqrt{y}-1&=x \end {align}[/latex] [latex][/latex]Then, invert it by switching the [latex]x[/latex] and [latex]y[/latex] variables: [latex]\begin {align} \sqrt{x}-1&=y \\\sqrt{x}-1&=(f\circ g)' (x) \end {align}[/latex]## Licenses & Attributions

### CC licensed content, Shared previously

- Curation and Revision.
**Authored by:**Boundless.com.**License:**Public Domain: No Known Copyright.

### CC licensed content, Specific attribution

- inverse function.
**Provided by:**Wiktionary**Located at:**https://en.wiktionary.org/wiki/inverse_function.**License:**CC BY-SA: Attribution-ShareAlike. - Source: Boundless. u201cIntroduction to Exponential and Logarithmic Functions.u201d Boundless Algebra. Boundless, 26 May. 2016. Retrieved 18 Jun. 2016 from .
**Provided by:**Boundless**License:**CC BY-SA: Attribution-ShareAlike. - Inverse function.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Kenny Felder, Function Concepts -- Inverse Functions. September 17, 2013.
**Provided by:**OpenStax CNX**Located at:**https://cnx.org/contents/9968d60a-8c92-4ab9-9816-466bb3db5fd7@4.**License:**CC BY: Attribution. - Inverse_Function_Graph.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Function.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Composition of Functions.
**Provided by:**Openstax**Located at:**https://openstax.org/books/college-algebra/pages/3-4-composition-of-functions.**License:**CC BY-SA: Attribution-ShareAlike. - Functional decomposition.
**Provided by:**Wikipedia**Located at:**https://en.wikipedia.org/wiki/Functional_decomposition.**License:**CC BY-SA: Attribution-ShareAlike. - Function composition.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - codomain.
**Provided by:**Wiktionary**License:**CC BY-SA: Attribution-ShareAlike. - domain.
**Provided by:**Wiktionary**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Function_Graph.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Function.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Logarithmic Functions.
**Provided by:**Openstax**Located at:**https://openstax.org/books/college-algebra/pages/6-3-logarithmic-functions.**License:**CC BY-SA: Attribution-ShareAlike. - Kenny Felder, Function Concepts -- Inverse Functions. September 17, 2013.
**Provided by:**OpenStax CNX**License:**CC BY: Attribution. - Function (mathematics.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - domain.
**Provided by:**Wiktionary**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Function_Graph.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Function.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Functions_Domain_and_Range.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Composition of functions.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Kenny Felder, Function Concepts -- Composite Functions. September 17, 2013.
**Provided by:**OpenStax CNX**Located at:**https://cnx.org/contents/6639d378-b481-460b-b762-c8376e70efde@2.**License:**CC BY: Attribution. - Inverse function.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - composite function.
**Provided by:**Wiktionary**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Function_Graph.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Function.png.
**Provided by:**Wikipedia**Located at:**https://en.wikipedia.org/wiki/Inverse_function.**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Original figure by Julien Coyne. Licensed CC BY-SA 4.0.
**Provided by:**Julien Coyne**License:**CC BY-SA: Attribution-ShareAlike. - Inverse_Functions_Domain_and_Range.png.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike. - Composition of functions.
**Provided by:**Wikipedia**License:**CC BY-SA: Attribution-ShareAlike.