next up previous
Next: Exercises Up: lab_template Previous: Exponentials and Logarithms

Inverse Functions

Consider the functions $f,g$ defined by

\begin{displaymath}
f(x)=e^x+e^{-x},g(x)=e^x-e^{-x}
\end{displaymath}

To be able to get an inverse the function must be one-to-one. You can plot the functions to get a hint as to whether they are invertible or not.
> f:=x->exp(x)+exp(-x);
> plot(f(x),x=-5..5);
> g:=x->exp(x)-exp(-x);
> plot(g(x),x=-5..5);
Both satisfy the vertical-line test but $f(x)$ is not invertible since it does not satisfy the horizontal-line test. Indeed $f$ is not one-to-one, for instance $f(0.5)=f(-0.5)$. From the plot it seems that the function $g$ is one-to-one. In order to determine its inverse we solve for x.
> solve(g(x)=y,x);
We observe that one of the solutions is not defined since the arguement of the logarithm can only be positive. Thus:

\begin{displaymath}
g^{-1}(y)=ln(\frac{y}{2}+\frac{\sqrt{(y^2+4}}{2})
\end{displaymath}

> ginv:=y->ln(y/2+sqrt(y^2+4)/2);
Let's look at the plot along with the line $y=x$ to see if our functions seem to make sense.
> plot({x,g(x),ginv(x)},x=-20..20,y=-20..20,scaling=constrained);
Let's check that we have computed the right inverse. By definition the composotion of the functions should be the line $y=x$ since an inverse is the reflection about this line.

\begin{displaymath}
(g\circ g^{-1})(y)=y=(g^{-1}\circ g)(x)=x
\end{displaymath}

> g(ginv(y));
> simplify(g(ginv(y)));
> ginv(g(x));
> simplify(ginv(g(x)));
We are having difficulty getting $x$ for the last composition. Again, the logarithm can't have a negative arguement and the computer knows this. To find the variable values that will work solve $g(y) > 0$. You will come across this in the exercises.
> solve(g(y)=0,y);
So, you need to let the computer know that the variable will only be $>0$.
next up previous
Next: Exercises Up: lab_template Previous: Exponentials and Logarithms
Dina J. Solitro-Rassias
2010-12-08