Brain Dump

Inverse Function

Tags
math

Often written as \( f^{-1}(x) \) is a function that reverses the affect of another function \( f(x) \). That is it maps from the range of the function \( f(x) \) back to its domain.

The general process of constructing an inverse function from the equation of a function \( f(x) \) is:

  1. write \(y\) instead of \( f(x) \) on the LHS.
  2. Replace each occurrence of \(y\) on both sides of the equation with \( x \) and vice-versa.
  3. Re-arrange \(y\) to make the LHS of the equation y=.
  4. Replace the LHS with \( f^{-1}(x) \).

To be reversible either the function needs to be a one-to-one function or you need to pick a suitable range to ensure the function behaves as a one-to-one function. For example \( y = x^2 \) is not reversible because \( x = \sqrt{y} \) has both positive and negative roots, but \( y = x^2, \forall x \geq 0 \) is reversible.

Diagrammatically, the inverse function draws a reflection of the original function in the y-axis.

\begin{figure}
  \centering
  \begin{tikzpicture}
    \begin{axis}[axis lines=center, xmin=-10, xmax=10, ymin=-10, ymax=10, domain=-10:10, grid=both]
      \addplot+[color=red, mark=none,samples=200,unbounded coords=jump] {-1 + sqrt(x)};,
      \addplot+[color=red, mark=none,samples=200,unbounded coords=jump] {-1 - sqrt(x)};,
      \addplot+[color=blue, mark=none,samples=200,unbounded coords=jump] {(x+1)^2};
      \addplot[color=black, dashed]{x};,
    \end{axis}
  \end{tikzpicture}
  \qquad
  \begin{tikzpicture}
    \begin{axis}[axis lines=center, xmin=-10, xmax=10, ymin=-10, ymax=10, domain=-10:10, grid=both]
      \addplot+[color=blue, mark=none,samples=200,unbounded coords=jump] {sqrt(x) - 1};,
      \addplot+[color=blue, mark=none,samples=200,unbounded coords=jump] {-sqrt(x) - 1};,
      \addplot+[color=red, mark=none,samples=200,unbounded coords=jump] {x^2 + 2*x + 1};,
      \addplot[color=black, dashed]{x};,
    \end{axis}
  \end{tikzpicture}
  \caption{Demonstration of the affect of the inverse function on the graph.
    The top figure shows two functions, both flipped from each other
    along \( y=x \). The bottom figure plots their respective inverse function,
    observe how its simply flipped them.}
  \label{fig:inverse-func-plot}
\end{figure}

Links to this note