### Operations for functions: New functions from old

### Composing functions

Composition of functions is a very natural notion: it consists of applying one function first and next another.

Composition of functions

Let #f# and #g# be two real functions. The **composition** of #f# and #g# is the function #f\circ g # with rule \[f\circ g(z)= f(g(z))\tiny.\]

The definition extends to compositions of more than two functions. For instance, if #h# is also a function, then \[f\circ g\circ h(z) = f(g(h(z)))\tiny.\]

The variable #z# represents an arbitrary element of the domain of #f# such that #f(z)# belongs to the domain of #g#.

The compositions #f\circ g# and #g\circ f# need not be equal: if #f(x)=x^2# and #g(x)=x+1#, then \[\begin{array}{rcl} f\circ g(x)&=& f(x+1)=x^2+2x+1\\&\text{and}&\\ g\circ f(x)&=& g(x^2)=x^2+1\end{array}\] so the two functions #f\circ g# and #g\circ f# differ.

It is customary for both #f\circ g# and #f\cdot g# to be abbreviated to #f\,g#, and, similarly, for #f\circ f# and #f\cdot f# to be abbreviated to #f^2#. We will **not** do so, in order to avoid confusion.

If #f# is the function with domain #\{1,2,3\}# and function rule #f(x)=2^x#, and #g(x)=-\frac{1}{12}x^2+\frac{3}{2}x+\frac{1}{3}#, then #h = g\circ f# takes the respective values #h(1)=g(2)=3#, #h(2)=g(4)=5#, #h(3)=g(8)=7# on the domain of #f#. The computation is visualized below.

Here are some examples.

Indeed,

\[

\begin{array}{rcl}

f \circ g(x) &=& f \left(g(x) \right) \\

&&\phantom{xyzuvw}\color{blue}{\text{composition of functions}} \\

&=& {{1}\over{g(x)}} \\

&&\phantom{xyzuvw}\color{blue}{\text{function rule of }f\text{ entered}} \\

&=&{{1}\over{x+1}} \\

&&\phantom{xyzuvw}\color{blue}{\text{function rule of }g\text{ entered}} \\

\end{array}\]

**Pass Your Math**independent of your university. See pricing and more.

Or visit omptest.org if jou are taking an OMPT exam.