# Composite Functions

Composite functions are what you get when you take the output of one function and use it for the input of the next one. In this discussion, we will discuss the composition of functions which are R1 R1, i.e. a real number as an input and a real number as an output. The notation for this is (fg)(x)=f(g(x)), where the output of g(x) becomes the input of f(x) and is described as (fg)(x). As a real example, let's use f(x)=x2+2*x-2, and g(x)=3*x+2. By replacing all of the occurrances of x in f(x) by the formula for g(x) we can find the formula in x for the composite function. So:
(fg)(x) = f(g(x)) = f(3*x+2)
(fg)(x) = (3*x+2)2+2*(3*x+2)-2
(fg)(x) = (9*x2+12*x+4)+(6*x+4)-2
(fg)(x) = 9*x2+18*x+6

We can also find (gf)(x):
(gf)(x) = g(f(x)) = g(x2+2*x-2)
(gf)(x) = 3*(x2+2*x-2)+2
(gf)(x) = 3*x2+6*x-4

That's basic composite functions. Compositing functions can do weird things to the domain and range, though, because your doing mappings onto mappings (i.e. mapping one domain to another domain to a range). One important point is that the composite of a function with its inverse yields an identity function. That is f(f-1(x))=f-1(f(x))=x. What's happening is that your mapping the original function to its range and then straight back into the domain.