Suppose that y=f(u)=ln(u) and u=g(x)=sin(x). Since y is a function of u and u is afunction of x the we obtain that y is a function of x: y=f(u)=f(g(x))=f(sin(x))=ln(sin(x)).
The procedure is called composition because the new function is composed of the two given functions f and g.
If we are given two functions f and g, we start with a number x in the domain of g and find value g(x). If this number is in the domain of f, then we can calculate the value of f(g(x)). The result is a new function h(x)=f(g(x)) obtained by substituting g into f.
Definition. Given two functions f and g, the composite functionf∘g is defined by (f∘g)(x)=f(g(x)).
Domain of composite functions is set of all x such that x is in domain of g and g(x) is in domain of f.
Example 1. Find f∘g, g∘f, f∘f, g∘g if f(x)=x3 and g(x)=x−1x.
f∘g=f(g(x))=f(x−1x)=(x−1x)3
g∘f=g(f(x))=g(x3)=x3−1x3.
Notice, that in general f∘g=g∘f.
f∘f=f(f(x))=f(x3)=(x3)3=x9
g∘g=g(g(x))=g(x−1x)=x−1x−1x−1x.
Note, that we can take composition of more than two functions: (f∘g∘h)(x)=f(g(h(x))).
Example 2. Find f∘g∘h if f(x)=x2, g(x)=x−1x and h(x)=sin(x).
It is worth noting, that characteristic of function as composite is not connected with natural functional dependence of f and x, it is just a way to represent this dependence.
For example, let f=1−u2 for u∈[−1,1] and y=sin(x) for x∈[−2π,2π] then (f∘g)(x)=f(g(x))=f(sin(x))=1−(sin(x))2=cos(x). Here cos(x) is represented as composite function.