Module 4 : Trigonometry
403: Inverse Functions
___________________________________________________________________________________
A. The Inverse Idea
Here are two functions.
> f := x -> (37*x - 53) / 89;
> g := x -> (89*x + 53 ) / 37;
If we evaluate f(x) at x = -8, then evaluate g(x) at that result , notice that the result is the number, -8, that we started with.
> f(-8); g(%); simplify(%);
There was nothing special about x = -8. Any number will work. In each case, you will get back the number you originally started with. In other words, however f(x) transforms a number, g(x) does the opposite transformation which returns it to its original value.
> f(33); g(%);
> f(0); g(%);
> f(119/47); g(%);
Even if we do it the other way, the same thing happens.
> g(100); f(%);
> g(-987); f(%);
Composing the functions together, we can see this even more immediately.
> f( g( 39 )); g( f ( -222 ));
What we have found, is that in general, the composition of f(x) and g(x) is equivalent to doing nothing at all.
> f(g(x)); 'f(g(x))' = simplify(%);
> g(f(x)); 'g(f(x))' = simplify(%);
Lets examine this from a numeric point of view.
> array( [[ k, f(k), g(k), f(g(k)), g(f(k)) ] $ k = 0..8]);
The columns are : x, f(x), g(x), f(g(x)), and g(f(x)). Note that f(x) g(x), however x = f(g(x)) = g(f(x)) for all x values shown.
B. The Criteria : One to One
Not every function has an inverse function. This is a special property. What is the criteria which determines whether or not a given function has an inverse? Only functions which are one-to-one inverses.
A function is one-to-one if every x in domain takes a unique value of y. This is usually expressed in the following way, which is not always easy to understand. A function is one-to-one if whenever f(a) = f(b), then a = b. In other words, if it appears that two different x values share the same y value, then it must turn out that they are actually one and the same x value. Don't worry if you're a little baffled. Lets explore this with Maple.
> f := x -> (x-2)/(x-7);
> f(a) = f(b);
> solve(%,a);
This equation f(a) = f(b) can be solved and has a single unique solution. That means the values of a and b are the same. Thus the function IS one-to-one. Lets try another example to see what happens when the function is not one-to-one.
> f := x -> x^4 - 8*x^2 + 16;
> solve(%||a);
Note that there is not a single answer, but rather 4 answers! If there is a single solution, the functioin is one-to-one and has an inverse function. However, if there are multiple solutions, then the function is not one-to-one and no inverse function exists.
When looking at the graph of a function, it is easy to see if its one-to-one. If every horizontal line crosses the function only once, then the funciton is one-to-ont. However, if there is even one horizontal line which crosses in two or more places, it is not one-to-one.
> restart; with(plots):
Warning, the name changecoords has been redefined
> f := x -> 2*x*sqrt(abs(x));
If you try to solve f(a) = f(b) as we did above, even Maple has some trouble. Lets look at the graph.
> display(plot( { k/2 $ k = -9..9}, x = -Pi..2*Pi, color = coral), plot( { f(x) }, x = -2..2, thickness = 3, color = green));
In this case it appears that the function is one-to-one!
Here is another example where it is not one-to-one.
> f := x -> 1.4*x^3 - x*3 + 4;
> display(plot( { k/2 $ k = -2..20} , x = -2..2, color = coral), plot( { f(x) }, x = -2..2, thickness = 3, color = green) );
C. Finding Inverses
We have seen how to test to see if a function has an inverse or not, but how do we actually find the inverse for a function which has one? Just like we would do by hand, we interchange x and y, and solve for y. We then turn this solution into a function using the unapply command.
> solve( x = f(y), y );
> g := unapply (%, x);
Lets verify that f(x) and g(x) are inverses.
> f(g(x)): 'f(g(x))' = simplify(%);
> g(f(x)): 'g(f(x))' = simplify(%);
In both cases we got 'x', which means that f undoes what g does and vice-versa.
D. Graphing The Inverse
There is an intersting relationship between the graph of f(x) and graph of its inverse. They are mirror images of each other through the line y = x. for every point (x,y) on the graph of f(x), there corresponds a point(y,x) on the graph of the inverse. Lets see how this works in action.
> restart: with(plots):
> f := x -> x^3; g:= x -> (x)^(1/3);
> a := 0 : b := 1.8:
> c := min(f(a), f(b)): d := max(f(a), f(b)): m:=min( a,c ): M := max( b,d):
> display( plot([f(x), g(x), x], x= m..M, y = m..M, thickness = 3, color = [red,blue, green], linestyle = [1,1,3] ), plot ( [ [[a,c],[a,d],[b,d], [b,c], [a,c]],[[c,a],[d,a], [d,b], [c,b],[c,a]] ], style = line, color = [coral, violet], linestyle = 2) );
The red graph in the yellow box is f(x). The blue graph in the violet box is g(x). The green line is y = x. Note that the yellow box and violet boxes (and the graphs inside them) are mirror images through the green line.
E. Defining Trig Inverses
The sine function clearly fails the Horizontal Line Test
> display( plot({k/6 $ k = -9..9}, x = -Pi..2*Pi, color = coral), plot( {sin(x) }, x = -Pi..2*Pi, thickness =3, color = green));
However, we can 'fix' it by cutting away most of it, and leaving only a portion that is one-to-one and takes all values the sine takes. This is called 'restricting the domain'.
> display( plot({k/6 $ k = -9..9}, x = -Pi/2 ..Pi/2,discont = true, thickness = 4, color = red), plot( {sin(x) }, x = -Pi..Pi, color = blue));
The restricted version of the sine is one-to-one and therefore has an inverse. In mathematics, we designate the inverse of the sine as the arcsine or sin-1(x). In Maple, we use arcsin(x) . Lets take a peek at the sine and arcsin, and see how they are reflections of one another.
> f := x -> sin(x); g := x -> arcsin(x);
> a := -Pi/2: b := Pi/2:
> c := min(f(a),f(b)): d := max(f(a),f(b)): m := min(a,c): M := max (b,d):
> display( plot([f(x), g(x), x], x= m..M, y = m..M, thickness = 3, color = [red,blue, green], linestyle = [1,1,3] ), plot ( [ [[a,c],[a,d],[b,d], [b,c], [a,c]],[[c,a],[d,a], [d,b], [c,b],[c,a]] ], style = line, color = [coral, violet], linestyle = 2, scaling = constrained) );
As before, the yellow box and violet boxes (and the graphs inside them) are mirror images through the green line.
Lets take a look at the cosine and arccosine. Note the restricted range of the cosine is different. This makes both the restricted cosine and the arccosine appear much different than the sine and arcsine.
> f := x -> cos(x); g := x -> arccos(x);
> a := 0: b:= Pi:
> c := min(f(a),f(b)): d:= max(f(a),f(b)): m := min(a,c): M := max(b,d):
> display( plot( f(x), x= a..b, y = c..a, thickness = 3, color = red), plot( [g(x), x], x= m..M, y = m..M, thickness = [3,1], color = [blue,green], linestyle = [1,4] ), plot ( [ [[a,c],[a,d],[b,d], [b,c], [a,c]],[[c,a],[d,a], [d,b], [c,b],[c,a]] ], style = line, color = [coral, violet], linestyle = 2, scaling = constrained) );
Lets take a look at the tangent and arctangent.
> f := x -> tan(x);
> g := x -> arctan(x);
> a := -Pi/2 + .1: b := Pi/2 - .1:
> c := min(f(a),f(b)): d := max(f(a),f(b)):
> m := min (a, c): M := max( b, d):
> display( plot( f(x), x= a..b, y = m..M, thickness = 3, color = red, discont = true), plot( [g(x), x], x= m..M, y = m..M, thickness = 3, color = [blue,green], linestyle = [1,4] ), plot ( [ [[a,c],[a,d],[b,d], [b,c], [a,c]],[[c,a],[d,a], [d,b], [c,b],[c,a]] ], style = line, color = [coral, violet], linestyle = 2, scaling = constrained) );
F. Evaluating Trig Inverses
Inverse trigonometric functions have the same properties as other inverse functions. However, its important to keep in mind that what goes into a trig function is an angle(usually in radians) while what comes out of an inverse trig function is an angle.
> sin(Pi): % = evalf(%); arcsin(Pi) : % = evalf(%);
In this example, it makes no sense to compute the arcsin for a number larger than 1, so Maple returns a complex number as a solution (why its a complex number is beyond the scope of our discussioin here).
On the other hand, it makes sense to compute the sine of 1 radian, but its not something that comes up very often. However, the inverse sine of 1 is a familiar number.
> sin(1): % = evalf(%); arcsin(1 ) : % : evalf(%);