##### Definition0.6.2

A function \(f\) is one-to-one (injective) when it never takes the same \(y\) value more than once. That is

\begin{gather*} \mbox{if } x_1 \neq x_2 \mbox{ then } f(x_1) \neq f(x_2) \end{gather*}There is one last thing that we should review before we get into the main material of the course and that is inverse functions. As we have seen above functions are really just rules for taking an input (almost always a number), processing it somehow (usually by a formula) and then returning an output (again, almost always a number).

\begin{gather*} \text{input number}\;\; x \quad \mapsto \quad f\;\; \text{does ``stuff'' to}\;\; x \quad \mapsto \quad \text{return number}\;\; y \end{gather*}In many situations it will turn out to be very useful if we can undo whatever it is that our function has done. ie

\begin{gather*} \text{take output}\;\;y \quad \mapsto \quad \text{do ``stuff'' to}\;\; y \quad \mapsto \quad \text{return the original}\;\; x \end{gather*}When it exists, the function “which undoes” the function \(f(x)\) is found by solving \(y=f(x)\) for \(x\) as a function of \(y\) and is called the inverse function of \(f\text{.}\) It turns out that it is not always possible to solve \(y=f(x)\) for \(x\) as a function of \(y\text{.}\) Even when it is possible, it can be really hard to do ^{ 1 } .

For example — a particle's position, \(s\text{,}\) at time \(t\) is given by the formula \(s(t) = 7t\) (sketched below). Given a calculator, and any particular number \(t\text{,}\) you can quickly work out the corresponding positions \(s\text{.}\) However, if you are asked the question “When does the particle reach \(s=4\text{?}\)” then to answer it we need to be able to “undo” \(s(t)=4\) to isolate \(t\text{.}\) In this case, because \(s(t)\) is always increasing, we can always undo \(s(t)\) to get a unique answer:

\begin{align*} s(t) &= 7t = 4 & \text{ if and only if }&& t&= \frac{4}{7}. \end{align*}However, this question is not always so easy. Consider the sketch of \(y=\sin(x)\) below; when is \(y=\half\text{?}\) That is, for which values \(x\) is \(\sin(x)=\half\text{?}\) To rephrase it again, at which values of \(x\) does the curve \(y=\sin x\) (which is sketched in the right half of Figure 0.6.1) cross the horizontal straight line \(y=\frac{1}{2}\) (which is also sketched in the same figure)?

We can see that there are going to be an infinite number of \(x\)-values that give \(y=\sin(x)=\half\text{;}\) there is no unique answer.

Recall (from Definition 0.4.1) that for any given input, a function must give a unique output. So if we want to find a *function* that undoes \(s(t)\text{,}\) then things are good — because each \(s\)-value corresponds to a unique \(t\)-value. On the other hand, the situation with \(y=\sin x\) is problematic — any given \(y\)-value is mapped to by many different \(x\)-values. So when we look for an *unique* answer to the question “When is \(\sin x = \half\text{?}\)” we cannot answer it.

This “uniqueness” condition can be made more precise:

A function \(f\) is one-to-one (injective) when it never takes the same \(y\) value more than once. That is

\begin{gather*} \mbox{if } x_1 \neq x_2 \mbox{ then } f(x_1) \neq f(x_2) \end{gather*}There is an easy way to test this when you have a plot of the function — the horizontal line test.

A function is one-to-one if and only if no horizontal line \(y=c\) intersects the graph \(y=f(x)\) more than once.

i.e. every horizontal line intersects the graph either zero or one times. Never twice or more. This test tell us that \(y=x^3\) is one-to-one, but \(y=x^2\) is not. However note that if we restrict the domain of \(y=x^2\) to \(x \geq 0\) then the horizontal line test is passed. This is one of the reasons we have to be careful to consider the domain of the function.

When a function is one-to-one then it has an inverse function.

Let \(f\) be a one-to-one function with domain \(A\) and range \(B\text{.}\) Then its inverse function is denoted \(f^{-1}\) and has domain \(B\) and range \(A\text{.}\) It is defined by

\begin{align*} f^{-1}(y) &= x & \text{ whenever }&& f(x)&=y \end{align*}for any \(y \in B\text{.}\)

So if \(f\) maps \(x\) to \(y\text{,}\) then \(f^{-1}\) maps \(y\) back to \(x\text{.}\) That is \(f^{-1}\) “undoes” \(f\text{.}\) Because of this we have

\begin{align*} f^{-1}( f(x) ) &= x &\mbox{ for any $x \in A$}\\ f( f^{-1}(y) )&=y &\mbox{ for any $y \in B$} \end{align*}We have to be careful not to confuse \(f^{-1}(x)\) with \(\ds \frac{1}{f(x)}\text{.}\) The “\(-1\)” is not an exponent.

Let us now turn to finding the inverse of \(\sin(x)\) — it is a little more tricky and we have to think carefully about domains.

It is an easy matter to construct the graph of an inverse function from the graph of the original function. We just need to remember that

\begin{equation*} Y=f^{-1}(X) \iff f(Y)=X \end{equation*}which is \(y=f(x)\) with \(x\) renamed to \(Y\) and \(y\) renamed to \(X\text{.}\)

Start by drawing the graph of \(f\text{,}\) labelling the \(x\)– and \(y\)–axes and labelling the curve \(y=f(x)\text{.}\)

Now replace each \(x\) by \(Y\) and each \(y\) by \(X\) and replace the resulting label \(X=f(Y)\) on the curve by the equivalent \(Y=f^{-1}(X)\text{.}\)

Finally we just need to redraw the sketch with the \(Y\) axis running vertically (with \(Y\) increasing upwards) and the \(X\) axis running horizontally (with \(X\) increasing to the right). To do so, pretend that the sketch is on a transparency or on a very thin piece of paper that you can see through. Lift the sketch up and flip it over so that the \(Y\) axis runs vertically and the \(X\) axis runs horizontally. If you want, you can also convert the upper case \(X\) into a lower case \(x\) and the upper case \(Y\) into a lower case \(y\text{.}\)

Another way to say “flip the sketch over so as to exchange the \(x\)– and \(y\)–axes” is “reflect in the line \(y=x\)”. In the figure below the blue “horizontal” elliptical disk that is centred on \((a,b)\) has been reflected in the line \(y=x\) to give the red “vertical” elliptical disk centred on \((b,a)\text{.}\)