Section2.9Composition and Inverse Functions¶ permalink

In the context of covarying variables, a function is a rule (operation) that predicts the value of the dependent variable (output) given the value of the independent variable (input). An inverse function is a function that predicts the reverse relation. What happens when these two functions are composed?

Suppose \(f : x \mapsto y\) has an inverse function \(f^{-1}: y \mapsto x\). The equivalent inverse equations are given by \begin{equation*}y=f(x) \quad \Leftrightarrow \quad x=f^{-1}(y).\end{equation*} When viewed as a map, these functions reverse one another's operations.

When inverse operations are applied in sequence (composition), there is no net change. We call the function that does not change the input the identity function, \begin{equation*}\mathrm{id}(x) = x.\end{equation*} An alternate definition of an inverse function is through composition and the identity function.

Definition2.9.1

Suppose a function \(f\) defines the relationship \(x \mapsto y=f(x)\). A function \(g\) is the inverse function of \(f\) (and we write \(g=f^{-1}\) if \(f \circ g = \mathrm{id}\) and \(g \circ f= \mathrm{id}\). That is, \begin{gather*}
g \circ f(x) = g(f(x)) = x \qquad (x \overset{f}{\mapsto} y \overset{g}{\mapsto} x),\\
f \circ g(y) = f(g(y)) =y \qquad (y \overset{g}{\mapsto} x \overset{f}{\mapsto} y).
\end{gather*}

Recall that exponentials and logarithms are inverse functions and that \(\ln\) is the natural logarithm with base \(e\). We write \(\exp\) without a base to refer to the natural exponential, \(\exp(x) = e^x\). We often use the identity property of their compositions. \begin{gather*}
\exp(\ln(x)) = e^{\ln(x)} = x, \\
\ln(\exp(x)) = \ln(e^x) = x.
\end{gather*} It is important to recognize that it is not the symbols \(e\) and \(\ln\) that cancel. It is that the composition of inverse functions create the identity.

Example2.9.2

Find the inverse function for \(f(x) = 3x+4\). Then show that the compositions of \(f\) and \(f^{-1}\) are the identity function.

Recall that to find an inverse function, you start with the equation \(y=f(x)\) and then solve for the independent variable \(x\) as a function of the dependent variable \(y\). \begin{equation*} y=3x+4 \quad \Leftrightarrow \quad y-4 = 3x \quad \Leftrightarrow \quad x=\frac{y-4}{3} \end{equation*} This formula gives the inverse function:\begin{gather*}
f: x \mapsto y=f(x) = 3x+4, \\
g: y \mapsto x=g(y) = \frac{y-4}{3}.
\end{gather*}

You may have learned that you should change the names of the variables when finding an inverse function. This is not actually necessary, but was just used so that your new function had \(x\) as the independent variable, \begin{equation*} f^{-1}(x)=g(x)=\frac{x-4}{3}.\end{equation*} Unfortunately, this extra step obscures the significance of a function's role as a mapping relationship between two variables, not just as an operation on numbers.

To verify that the composition yields the identity, where \(f : x \mapsto y\) and \(f^{-1}=g : y \mapsto x\), we compute: \begin{align*}
g \circ f(x) &= g(f(x)) = g(3x+4) \\
&= \frac{(3x+4)-4}{3} = \frac{3x}{3} = x \\
f \circ g(y) &= f(g(y)) = f(\frac{y-4}{3}) \\
&= 3(\frac{y-4}{3}) + 4 = y-4+4 = y
\end{align*} Both compositions yield the identity \(g \circ f(x)=\mathrm{id}(x)=x\) and \(f \circ g(y)=\mathrm{id}(y)=y\), which is exactly what is needed for \(g=f^{-1}\).

Example2.9.3

Find the inverse function for \(\displaystyle f(x) = \frac{2x}{x+1}\). Then show that the compositions of \(f\) and \(f^{-1}\) are the identity function.

Start with the equation \(y=f(x)\) and solve for \(x\). \begin{gather*}
y=\frac{2x}{x+1} \\
y(x+1) = 2x \qquad \Leftrightarrow \qquad xy + y = 2x \\
xy-2x = -y \qquad \Leftrightarrow \qquad x(y-2) = -y \\
x = \frac{-y}{y-2}
\end{gather*} Consequently, our pair of inverse functions are given by \begin{gather*}
f : x \mapsto y=f(x) = \frac{2x}{x+1}, \\
g : y \mapsto x=g(y) = \frac{-y}{y-2}.
\end{gather*}

Composition in this example will require using properties of fractions. Specifically, we will need to find common denominators and use the fact that division by a fraction is multiplication by the reciprocal. \begin{align*}
g \circ f(x) &= g(f(x)) = g(\frac{2x}{x+1}) \\
&= \frac{-(\frac{2x}{x+1})}{(\frac{2x}{x+1})-2}
= \frac{-(\frac{2x}{x+1})}{(\frac{2x}{x+1})-2} \cdot \frac{(x+1)}{(x+1)} \\
&= \frac{-2x}{2x-2(x+1)}
= \frac{-2x}{-2} = x \\
f \circ g(y) &= f(g(y)) = f(\frac{-y}{y-2}) \\
&= \frac{2(\frac{-y}{y-2})}{(\frac{-y}{y-2})+1}
= \frac{2(\frac{-y}{y-2})}{(\frac{-y}{y-2})+1} \cdot \frac{(y-2)}{(y-2)} \\
&= \frac{-2y}{-y+(y-2)} = \frac{-2y}{-2} = y
\end{align*} This verifies that \(f^{-1}=g\).

Example2.9.4

Find the inverse function for \(f(x) = 2e^{x-5}\). Then show that the compositions of \(f\) and \(f^{-1}\) are the identity function.

Start with the equation \(y=f(x)\) and solve for \(x\). Because this equation involves an exponential, we will rewrite this equation so that it an exponential equation of the form \(e^a=b\) and then convert it to its equivalent logarithmic equation \(a = \ln(b)\). \begin{gather*}
y=2e^{x-5} \\
\frac{y}{2} = e^{x-5} \\
\ln \left(\frac{y}{2}\right) = x-5 \\
x = \ln\left(\frac{y}{2}\right) + 5
\end{gather*} Consequently, our pair of inverse functions are given by \begin{gather*}
f: x \mapsto y=f(x) = 2e^{x-5}, \\
g: y \mapsto x=g(y) = \ln\left(\frac{y}{2}\right) + 5.
\end{gather*}

Now, compute the compositions, taking advantage of the fact that the natural exponential and natural logarithm are inverse functions. \begin{align*}
g \circ f(x) &= g(f(x)) = f(2e^{x-5}) \\
&= \ln\left(\frac{(2e^{x-5})}{2}\right) + 5
= \ln(e^{x-5}) + 5\\
&= (x-5)+5 = x\\
f \circ g(y) & = f(g(y)) = g(\ln(\frac{y}{2})+5) \\
&= 2 e^{(\ln(\frac{y}{2})+5)-5} = 2e^{\ln(\frac{y}{2})} \\
&= 2 \cdot (\frac{y}{2}) = y
\end{align*} Because the compositions result in the identity function, we have inverse functions \(g=f^{-1}\).