# Inverse and Composite Functions

## Inverse functions

Let $$f(x)=3+2x$$ be a linear function. Each x-value is mapped onto a unique y-value that is given by $$y=3+2x$$. Since the function is linear, you can also find a unique x-value for each y-value. You can describe x as a function of y by letting $$x=\frac{y-3}{2}$$. This "reverse" function is called the inverse function of $$f$$ and it is denoted $$f^{-1}$$. By convention y is used to denote the function value and x is used for the variable. After finding the inverse function (by expressing x in terms of y), you swap the y and the x, which yields $$y=\frac{x-3}{2}$$.

$f(x)=3+2x \Leftrightarrow f^{-1}(x)=\frac{x-3}{2}$

If you consider the graph of a function, you get the graph of the inverse function by letting the x-axis and the y-axis swap places.

The graph of the inverse function $$f^{-1}(x)$$, is the graph $$f(x)$$ reflected in the line $$y=x$$.

Not all functions have an inverse function. For some functions, swapping the axes will yield a curve that is not the graph of a function.

## Composite functions

A composite function is a function of a function. You use the symbol $$\circ$$ to denote a composite function, as in:

$(f\circ g)(x)=f(g(x))$

## Range and domain

The domain of a function $$f(x)$$
is the set of all $$x$$-values for which the function is defined.

The range of a function $$y=f(x)$$
is the set of all $$y$$-values that the function takes.

If you let $$R_f$$ denote the range and $$D_f$$ the domain of a function $$f(x)$$, then:

$R_f=\left\{f(x): x\in D_f\right\}$

In the applet above, you can see the impact of the domain and range on composite functions. The range of the function $$2^{\sqrt{4\sin(x)}}$$ seems to be the interval $$[1,4]$$. If you want to reason about the range, you must start at the innermost function of the composite function. The innermost function is $$4\sin(x)$$.

The range of $$4\sin(x)$$ is the interval $$[-4,4]$$. Since $$\sqrt{x}$$ is not defined for negative $$x$$, the domain of $$\sqrt{x}$$ becomes $$[0,4]$$. Enter $$\sqrt{4\sin(x)}$$ in the applet above (write sqrt(4sin(x)) ), the range of $$\sqrt{4\sin(x)}$$ is $$[0,2]$$.

The interval $$[0,2]$$ is now the domain of the function $$2^x$$. The range of $$2^{\sqrt{4\sin(x)}}$$ becomes $$[2^0,2^2]=[1,4]$$.

## Restricting the domain

A curve is not the graph of a function if there are many $$y$$-values for one single $$x$$-value anywhere on the curve. If you reflect the graph of a function in the line $$y=x$$, you sometimes get a curve that can not be the graph of a function. The inverse function can not be defined in such a case.

As an example, consider $$y=x^2$$. Expressing $$x$$ in terms of $$y$$, yields the expression $$x=\pm \sqrt{y}$$. There is not a unique $$x$$ for each $$y$$. The function $$f(x)=x^2$$ does not have an inverse function. If you however restrict the domain, and make a function that is not defined when $$x$$ is negative, then you can define an inverse function. The function $$g(x)=x^2, x\ge 0$$ has the inverse $$g^{-1}(x)=\sqrt{x}$$.

The domain of a function becomes the range of the inverse function, and the range becomes the domain.

In the applet above you can see that there are several ways of restricting the domain of $$\sin(x)$$ in order to enable the definition of an inverse. As an example, you can restrict $$x$$ to $$\frac{\pi}{2}\le x \le \frac{3\pi}{2}$$. In that case the inverse function gets the range $$\frac{\pi}{2}\le y \le \frac{3\pi}{2}$$ and the domain $$-1\le x \le 1$$. To see how the inverse functions of the trigonometric functions are defined, see Trigonometry - Trigonometric Functions.

Also try the functions $$f(x)=x^2$$, $$f(x)=\tan(x)$$ and $$f(x)=10^x$$ in the applet above.

### Composition of a function and its inverse function

If both the domain and the range are $$\mathbb{R}$$ for a function $$f(x)$$, and if $$f(x)$$ has an inverse $$f^{-1}(x)$$, then:

$$(f\circ f^{-1})(x)=(f^{-1}\circ f)(x)=x$$.

Example: Let $$f(x)=3+2x$$ and $$f^{-1}(x)=\frac{x-3}{2}$$. Then

$(f\circ f^{-1})(x)=f(f^{-1}(x))=f(\frac{x-3}{2})=3+2\frac{x-3}{2}=x$

and

$(f^{-1}\circ f)(x)=f^{-1}(f(x))=f^{-1}(3+2x)=\frac{3+2x-3}{2}=x$

If the domain or the range of $$f(x)$$ is restricted, then the composition of the function and its inverse is also $$x$$, but only on an interval.

Let f(x)=sin(x) and g(x)=asin(x) in the topmost applet on this page!

(The function $$\arcsin(x)$$ is written asin(x) in most computer programs; in a similar way $$\arccos(x)$$ and $$\arctan(x)$$ are written acos(x) and atan(x) respectively. )