\chapter{Functions and graphs}
\section{Inverse functions}
Some rules that define a function
can be ``undone''. This means that given the output, we can figure out the
input that produced the output.
For example, if the rule is ``add 3'' and we are told that the output of the rule is 9,
then we know that the input must have been 6.
In this case, we say that the function corresponding to that rule is \textit{invertible},
and the function that ``undoes'' the rule is called
the \textit{inverse function}.
If \(f\) is the name of the function, then we denote the
inverse function (if it exists!) by \(f^{-1}\).
So if we first apply \(f\) to an input value \(x\), and then we apply \(f^{-1}\) to what we get,
we return back to \(x\). And the same works if we first apply \(f^{-1}\), then \(f\).
Another word that is often used for invertible is \textit{one-to-one}.
\begin{definition}A function \(f\) is called \textit{invertible} (or \textit{one-to-one}) if there is another
function \(f^{-1}\) such that
\[(f\circ f^{-1})(x)=x \hspace{3ex} \mbox{ and } \hspace{3ex} (f^{-1} \circ f)(x)=x.\] The function \(f^{-1}\) (if it exists) is called the \textit{inverse} function.\end{definition}
Be careful not to confuse this notation with the notation for the reciprocal of a
number. Remember that \(f\) is not a number.
Compare the different meanings:
\begin{itemize}
\item
\(f^{-1}\) is the name of the inverse function (not a number).
\item
\(f^{-1}(x)\) is a number, and it's the output of the function \(f^{-1}\)
when the input is \(x\).
\item
\({f(x)}^{-1}\) is a number, and it's the reciprocal of the number \(f(x)\).
\end{itemize}
\begin{example}
In function notation, the rule ``add 3'' is:
\[f(x)=x+3\]
and clearly the rule that undoes \(f\) is ``subtract 3''. So we have
\[f^{-1}(x)=x-3.\]
\end{example}
\begin{example}
The rule ``multiply by 5'' is
\[f(x)=5x,\]
and this rule can be undone by dividing by 5. So
\[f^{-1}(x)=\frac{x}{5}.\]
\end{example}
\begin{example}
The rule ``multiply by \(3\), then add \(2\)'' is
\[f(x)=3x+2.\]
To undo this rule, we need to retrace our steps: first we subtract \(2\), then we divide
by \(3\). So
\[f^{-1}(x) = \frac{x-2}{3}.\]
\end{example}
But not all rules can be undone (or, in mathematical language, not all functions have an
inverse). For example, if the rule is
``square the number'', and we are told that the output is 9,
we cannot be sure of the input. It could be \(3\) (because \(3^2=9\)),
but it could also be \(-3\) (because \((-3)^2=9\)).
So the rule ``square a number'' cannot be undone, and the function \(f(x)=x^2\)
does not have an inverse.
\subsection{Properties of inverse functions}
Suppose a function \(f\) is invertible.
\begin{enumerate}
\item If the function \(f\) sends \(a\) to \(b\), then the inverse function
\(f^{-1}\) will send \(b\) to \(a\). So the function \(f(x)=3x+2\) in the last example
sends input \(1\) to output \(f(1)=3(1)=2=5\). The inverse function
\(\displaystyle f^{-1}(x)=\frac{x-2}{3}\) will send \(5\) back to \(1\):
\[f^{-1}(5)=\frac{5-2}{3}=\frac{3}{3}=1.\]
We can picture this using a diagram as we did in Unit 1.1:
\[\img{U1_9F13.png}{}{12em}{}\]
The following \textit{translation formula} will be useful, especially in Chapters 3 and 4:
Translation formula for inverses functions |
\(f(a)=b \hspace{1ex} \Longleftrightarrow \hspace{1ex}f^{-1}(b)=a\) |
\item
The domain and range are interchanged between \(f\) and \(f^{-1}\), that is:
\(\mbox{Domain of } f^{-1} = \mbox{Range of } f\) |
\(\mbox{Range of } f^{-1} = \mbox{Domain of } f\) |
\item
The graph of \(f^{-1}\) is the graph of \(f\) reflected across the line \(y=x\). This means
that if the point \((a,b)\) is on the graph of \(f\), then the point \((b,a)\) is on the
graph of \(f^{-1}\).
\begin{example}
The picture below shows the graph of a function \(f\) as a solid line, and the graph of the inverse
\(f^{-1}\) as a dotted line. The points \((0,3)\), \((1,5)\), \((3,6)\) are on the graph of \(f\), and so
the points \((3,0)\), \((5,1)\), \((6,3)\) are on the graph of \(f^{-1}\). Note that the graph
of \(f^{-1}\) is what we get if we reflect the graph of \(f\) across an imaginary mirror along
the line \(y=x\) (shown as a dashed line in the picture):
\[\img{U1_9F14.png}{}{12em}{}\]
\end{example}
\end{enumerate}
\subsection{The horizontal line test}
Now that we know that some functions have an inverse and others do not,
we ask the question: can we tell if a function has an
inverse by looking at the graph? The answer is yes. We can tell if \(f\)
has an inverse by using the \textit{Horizontal Line Test}:
Horizontal Line Test |
A function \(f\) has an inverse only when every horizontal line
intersects its graph no more than once. |
\begin{example}
We are given functions whose graphs are shown in the figure:
\[
\begin{array}{cc}
\img{U1_9F1.png}{}{12em}{} & \img{U1_9F2.png}{}{12em}{}\\
a. & b.
\end{array}
\]
We want to decide if the functions have an inverse.
For a., any horizontal line will intersect the graph at most once:
\[\img{U1_9F5.png}{}{12em}{}\]
So the function has an inverse.
For b., we can find a horizontal line that intersects the graph more than once:
\[\img{U1_9F6.png}{}{12em}{}\]
So the function does not have an inverse.
\end{example}
\subsection{Inverse functions given by formulas}
We have seen that the inverse function \(f^{-1}\) undoes what \(f\) does. So if we apply \(f\) and
\(f^{-1}\) one after the other (in either order), the input will remain unchanged:
\[(f\circ f^{-1})(x)=x\]
\[(f^{-1}\circ f)(x)=x\]
So, if we are given a pair of functions \(f\) and \(g\) defined by formulas,
we have the following algebraic way to determine if
they are inverses of each other:
Algebraic Test for Inverse Functions |
Two functions \(f\) and \(g\) are inverses of each
other when both the following equations are true: |
\((f\circ g)(x)=x \hspace{5ex}\) and \(\hspace{5ex}(g\circ f)(x)=x\) |
\begin{example}
Let's check that the two functions "add 3" and "subtract 3" are inverses of each other. Using formulas, we have
\[f(x)=x+3 \ \ \mbox{and} \ \ g(x)=x-3\]
and we need to check the two equations
\[(f\circ g)(x)=x \ \ \mbox{and}\ \ (g\circ f)(x)=x\]
We check the first equation:
\[
\begin{array}{rcll}
(f\circ g)(x) & = & f(g(x))& \mbox{The definition of composition}\\[2ex]
& = & f(x-3) & \mbox{Use the formula for \(g\)}\\[2ex]
& = & (x-3)+3 & \mbox{Use the formula for \(f\)}\\[2ex]
& = & x & \mbox{Simplify}
\end{array}
\]
So the first equation is true. Now we check the second equation:
\[
\begin{array}{rcll}
(g\circ f)(x) & = & g(f(x)) & \mbox{The definition of composition}\\[2ex]
& = & g(x+3) & \mbox{Use the formula for \(f\)}\\[2ex]
& = & (x+3)-3 & \mbox{Use the formula for \(g\)}\\[2ex]
& = & x & \mbox{Simplify}
\end{array}
\]
So the second equation is also true, and we conclude that \(f\) and \(g\) are
inverses of each other, and \(g=f^{-1}\).
\end{example}\
\begin{example}
Now we try another pair of functions:
\[f(x)=5x+3 \ \mbox{,} \ \ g(x)=\frac{x}{5}-3\]
\[
\begin{array}{rcll}
(f\circ g)(x) & = & f(g(x)) & \mbox{The definition of composition}\\[2ex]
& = & \displaystyle f\left(\frac{x}{5}-3\right) & \mbox{Use the formula for \(g\)}\\[2ex]
& = & \displaystyle 5\left(\frac{x}{5}-3\right)+3 & \mbox{Use the formula for \(f\)}\\[2ex]
& = & x-15+3 & \mbox{Simplify}\\[2ex]
& = & x-12
\end{array}
\]
This time we found that \((f\circ g)(x)\) is not \(x\), and so we conclude that \(f\) and
\(g\) are not inverses of each other
(we don't even need to check \((g\circ f)(x)=x\)).
\end{example}
\subsection{Finding a formula for the inverse of a given function}
A formula defining a function \(f\) can be made into an equation in two variables if we substitute
\(f(x)\) with \(y\).
So for example, \(f(x)=2x+1\) becomes \(y=2x+1\).
As we have seen in Unit 1.1, if we can solve an equation in two variables for one of the variables
and we get a unique solution, then the equation defines the
solved variable as a function of the other variable.
This gives us a procedure to look for the inverse of a given function \(f(x)\).
First we rename \(f(x)\) as \(y\). Then we try to solve the resulting equation for
\(x\). If we find a unique solution,
that same solution gives us a formula for the inverse function \(f^{-1}\).
\begin{example}
Suppose we want to find the inverse of \(f(x)=2x+1\). We proceed in three steps:
\begin{enumerate}
\item
Rename \(f(x)\) as \(y\) and get an equation in two variables:
\[y=2x+1\]
\item
Solve the resulting equation for \(x\):
\[
\begin{array}{rcll}
y & = & 2x+1 & \mbox{The given equation.}\\[2ex]
y\color{red}{-1} & = & 2x+1\color{red}{-1} & \mbox{Subtract 1 from both sides.}\\[2ex]
y-1 & = & 2x & \mbox{Simplify}\\[2ex]
\displaystyle{\frac{y-1}{\color{red}{2}}} & = & \displaystyle{\frac{2x}{\color{red}{2}}}
& \mbox{Divide both sides by 2.}\\[2ex]
x & = & \displaystyle{\frac{y-1}{2}} & \mbox{Simplify, and switch sides.}
\end{array}
\]
We found a unique solution for \(x\). This means that the inverse of \(f\) exists.
\item
To get a formula for the inverse as a function of \(x\),
switch the names of the variables, and rename \(y\) as \(f^{-1}(x)\):
\begin{eqnarray*}y&=&\frac{x-1}{2}\\
f^{-1}(x)&=&\frac{x-1}{2}.
\end{eqnarray*}
So the inverse \(f^{-1}\) exists, and it is given by the formula:
\[
\fbox{ \( \displaystyle f^{-1}(x)=\frac{x-1}{2}\)}
\]
\end{enumerate}
\end{example}
Problems
\problem
Decide if the functions whose graphs are shown in the figure have an inverse:
\[
\begin{array}{cc}
\img{U1_9F3.png}{}{12em}{} & \img{U1_9F4.png}{}{12em}{}\\
\mbox{a.} & \mbox{b.}
\end{array}
\]
\begin{sol}
\begin{enumerate}
\item
Any horizontal line will intersect the graph at most once:
\[\img{U1_9F7.png}{}{12em}{}\]
So the function has an inverse.
\item
We can find a horizontal line that intersects the graph more than once:
\[ \img{U1_9F8.png}{}{12em}{}\]
So the function does not have an inverse.
\end{enumerate}
\end{sol}
\mproblem
Decide if the functions whose graphs are shown in the figure have an inverse:
\[
\begin{array}{cc}
\img{U1_9F9.png}{}{12em}{} & \img{U1_9F10.png}{}{12em}{}\\[-1ex]
\mbox{a.} & \mbox{b.}\\[3ex]
\img{U1_9F11.png}{}{12em}{} & \img{U1_9F12.png}{}{12em}{}\\[-1ex]
\mbox{c.} & \mbox{d.}
\end{array}
\]
\problem
Check if the following pairs of functions are inverses of each other:
\begin{enumerate}
\item
\(f(x)=2x-7\) and \(\displaystyle{g(x)=\frac{x}{2}+7}\)
\item
\(\displaystyle{f(x)=\frac{x-5}{x}}\) and \(\displaystyle{g(x)=\frac{5}{1-x}}\)
\item
\(f(x)=x^2\) and \(\displaystyle{g(x)=\sqrt{x}}\)
\end{enumerate}
\begin{sol}
In each case, we need to check if the equations \((f\circ g)(x)=x\) and \((g\circ f)(x)=x\)
are both true.
\begin{enumerate}
\item
\(f(x)=2x-7\) and \(\displaystyle{g(x)=\frac{x}{2}+7}\)
\[
\begin{array}{rcll}
(f\circ g)(x) & = & f(g(x))\\[2ex]
& = &\displaystyle f\left(\frac{x}{2}+7\right) & \mbox{Use the formula for \(g\)}\\[2ex]
& = &\displaystyle 2\left(\frac{x}{2}+7\right)-7 & \mbox{Use the formula for \(f\)}\\[2ex]
& = & x+14-7 & \mbox{Simplify}\\[2ex]
& = & x+7
\end{array}
\]
We find that \((f\circ g)(x)=x+7\). So the first equation fails,
and the two functions are not inverses of each other.
\item
\(\displaystyle{f(x)=\frac{x-5}{x}}\) and \(\displaystyle{g(x)=\frac{5}{1-x}}\)
\[
\begin{array}{rcll}
(f\circ g)(x) & = & f(g(x))\\[2ex]
& = & f\left(\frac{5}{1-x}\right) & \mbox{Use the formula for \(g\)}\\[2ex]
& = & \displaystyle{\frac{\frac{5}{1-x}-5}{\frac{5}{1-x}}} & \mbox{Use the formula for \(f\)}\\[3ex]
& = & \displaystyle{\frac{\left(\frac{5}{1-x}-5\right)(1-x)}{\frac{5}{1-x}(1-x)}} & \mbox{Multiply
top and bottom by the LCD}\\[3ex]
& = & \displaystyle{\frac{5-5(1-x)}{5}} & \mbox{Simplify}\\[2ex]
& = & \displaystyle{\frac{5x}{5}} & \mbox{Simplify}\\[2ex]
& = & x
\end{array}
\]
So the equation \((f\circ g)(x)=x\) is true. Now we check the second equation:
\[
\begin{array}{rcll}
g\circ f(x) & = & g(f(x))\\[2ex]
& = & g\left(\frac{x-5}{x}\right) & \mbox{Use the formula for \(f\)}\\[2ex]
& = & \displaystyle{\frac{5}{1-\frac{x-5}{x}}} & \mbox{Use the formula for \(g\)}\\[2ex]
& = & \displaystyle{\frac{5x}{\left(1-\frac{x-5}{x}\right)x}} & \mbox{Multiply top and bottom by the LCD}\\[2ex]
& = & \displaystyle{\frac{5x}{x-(x-5)}} & \mbox{Simplify}\\[2ex]
& = & \displaystyle{\frac{5x}{x-x+5}} & \mbox{Simplify}\\[2ex]
& = & \displaystyle{\frac{5x}{5}}\\[2ex]
& = & x
\end{array}
\]
So the equation \((g\circ f)(x)=x\) is also true, and we conclude that
\(f\) and \(g\) are inverses of each other.
\item
To work this last problem, we need to remember (as discussed in Unit 1.1)
that \(\sqrt{x}\) represents a \textbf{positive}
number. So for example \(\sqrt{4} =2\), and not \(\pm 2\). Of course \((-2)^2\) is also \(4\),
but if we want the negative solution of the equation \(x^2=4\) we write \(-\sqrt{4}\).
So whenever there is no negative sign in front of a square root, it is understood that
it represents a positive number. This means that to find \(\sqrt{x^2}\), we need to use
the absolute value, because \(x\) could be a negative number. So the right way to simplfy \(\sqrt{x^2}\) is
\[\sqrt{x^2}=|x|.\]
We now discuss the example
\(f(x)=x^2\) and \(\displaystyle{g(x)=\sqrt{x}}\).
\[
\begin{array}{rcll}
(f\circ g)(x) & = & f(g(x))\\[2ex]
& = & f(\sqrt{x}) & \mbox{Use the formula for \(g\)}\\[2ex]
& = & (\sqrt{x})^2 & \mbox{Use the formula for \(f\)}\\[2ex]
& = & x & \mbox{Simplify}\\[2ex]
\end{array}
\]
So the equation \((f\circ g)(x)=x\) is true. Now we check \((g\circ f)(x)=x\):
\[
\begin{array}{rcll}
(g\circ f)(x) & = & g(f(x))\\[2ex]
& = & g(x^2) & \mbox{Use the formula for \(f\)}\\[2ex]
& = & \sqrt{x^2} & \mbox{Use the formula for \(g\)}\\[2ex]
& = & |x| & \mbox{Simplify, and use the previous discussion}
\end{array}
\]
So we found that the second equation fails, because \(|x|\) is not the same as \(x\)
in case \(x\) is negative. We conclude that \(f\) and \(g\) are not inverses of each other.
\end{enumerate}
\end{sol} \mproblem
Check if the following pairs of functions are inverses of each other:
\begin{enumerate}
\item
\(f(x)=3x-5\) and \(\displaystyle{g(x)=\frac{x+5}{3}}\)
\item
\(f(t)=\sqrt{t-3}\) and \(\displaystyle{g(t)=t^2+3}\)
\item
\(\displaystyle f(x)=\frac{2}{x-3}\) and \(\displaystyle{g(x)=\frac{2+3x}{x}}\)
\end{enumerate}
\problem
Find the inverse of the following functions, if possible, otherwise state that
the inverse does not exist:
\begin{enumerate}
\item
\(\displaystyle f(x)=\frac{x}{2x-3}\)
\item
\(g(x)=2x^3-3\)
\item
\(h(x)=(3x-1)^2\)
\end{enumerate}
\begin{sol}
\begin{enumerate}
\item \
\[
\begin{array}{rcll}
f(x) & = & \displaystyle{\frac{x}{2x-3}} & \mbox{The given function.}\\[2ex]
y & = & \displaystyle{\frac{x}{2x-3}} & \mbox{Rename \(f(x)\) as \(y\).}\\[2ex]
\end{array}
\]
Now we solve the equation for \(x\):
\[
\begin{array}{rcll}
(2x-3)y & = & \displaystyle{\frac{x}{2x-3}(2x-3)} & \mbox{Multiply both sides by \(2x-3\).}\\[2ex]
2xy-3y & = & x & \mbox{Simplify.}\\[2ex]
2xy-3y\color{red}{+3y} & = & x\color{red}{+3y} & \mbox{Add \(3y\) to both sides.}\\[2ex]
2xy & = & x+3y & \mbox{Simplify.}\\[2ex]
2xy\color{red}{-x} & = & x+3y\color{red}{-x} & \mbox{Subtract \(x\) from both sides.}\\[2ex]
2xy-x & = & 3y & \mbox{Simplify.}\\[2ex]
x(2y-1) & = & 3y & \mbox{Factor \(x\).}\\[2ex]
\displaystyle{\frac{x(2y-1)}{\color{red}{2y-1}}} & = &\displaystyle{ \frac{3y}{\color{red}{2y-1}}} &
\mbox{Divide both sides by \(2y-1\).}\\[2ex]
x & = & \displaystyle{\frac{3y}{2y-1}} & \mbox{Simplify.}
\end{array}
\]
We have found a unique solution for \(x\). This means that the function has an inverse.
To find a formula for the inverse,
we switch the variables and then rename \(y\) as \(f^{-1}(x)\):
\[
\begin{array}{rcll}
& & \displaystyle{y=\frac{3x}{2x-1}} & \mbox{Switch the variables.}\\[2ex]
& & \fbox{\(\displaystyle{f^{-1}(x)=\frac{3x}{2x-1}}\)} & \mbox{Find a formula for \(f^{-1}\)
by renaming \(y\) as \(f^{-1}(x)\).}
\end{array}
\]
\item \
\[
\begin{array}{rcll}
g(x) & = & 2x^3-3 & \mbox{The given function.}\\[2ex]
y & = & 2x^3-3 & \mbox{Substitute \(y\) for \(g(x)\).}\\[2ex]
y\color{red}{+3} & = & 2x^3-3\color{red}{+3} & \mbox{Add 3 to both sides.}\\[2ex]
y+3 & = & 2x^3 & \mbox{Simplify.}\\[2ex]
\frac{y+3}{\color{red}{2}} & = & \frac{2x^3}{\color{red}{2}} & \mbox{Divide both sides by 2.}\\[2ex]
\frac{y+3}{2} & = & x^3 & \mbox{Simplify.}\\[2ex]
\sqrt[3]{\frac{y+3}{2}} & = & \sqrt[3]{x^3} & \mbox{Take the cube root of both sides. Do not use
the \(\pm\) sign.}\\[2ex]
x & = & \sqrt[3]{\frac{y+3}{2}} & \mbox{Simplify, and switch sides.}
\end{array}
\]
We found only one answer. So the inverse exists. Switch the names of the variables,
and rename \(y\) as \(g^{-1}(x)\):
\[
\begin{array}{rcll}
& &\displaystyle{ y=\sqrt[3]{\frac{x+3}{2}}} & \mbox{Switch the variables.}\\[2ex]
& & \fbox{\(\displaystyle{g^{-1}(x)=\sqrt[3]{\frac{x+3}{2}}}\)} & \mbox{Find a formula for \(g^{-1}\)
by renaming \(y\) as \(g^{-1}(x)\).}
\end{array}
\]
\item \
\[
\begin{array}{rcll}
h(x) & = & (3x-1)^2 & \mbox{The given equation}\\[2ex]
y & = & (3x-1)^2 & \mbox{Change \(h(x)\) to \(y\)}\\[2ex]
\end{array}
\]
To solve this equation for \(x\), we need to take the square root of both sides.
This introduces a \(\pm\) sign:
\[\pm{\sqrt{y}}=3x-1\]
If we solve this equation for \(x\), we find two different answers (because of the \(\pm\) sign).
So we conclude that the inverse function does not exist.
\end{enumerate}
\end{sol} \mproblem
Find the inverses of the following functions, if possible, otherwise
state that the inverse does not exist:
\begin{enumerate}
\item
\(f(x)=4x-7\)
\item
\(g(x)=x^2-3\)
\item
\(\displaystyle h(x)=\frac{x+3}{x-1}\)
\end{enumerate}