# What is function composition?

Sep 26, 2015

See the explanation.

#### Explanation:

Informal speaking: "it's a function of function".
When you use one function as a argument of the other function, we speak of the composition of functions.

$f \left(x\right) \diamond g \left(x\right) = f \left(g \left(x\right)\right)$ where $\diamond$ is composition sign.

Example:

Let $f \left(x\right) = 2 x - 3 , g \left(x\right) = - x + 5$. Then:

$f \left(g \left(x\right)\right) = f \left(- x + 5\right)$

If we substitute:

$- x + 5 = t \implies x = 5 - t$

$f \diamond g = f \left(t\right) = 2 \left(5 - t\right) + 3 = 10 - 2 t + 3 = 13 - 2 t$
$f \diamond g = 13 - 2 x$

You can, however, find $g \left(f \left(x\right)\right)$

$g \left(f \left(x\right)\right) = g \left(2 x - 3\right)$

$2 x - 3 = t \implies x = \frac{t + 3}{2}$

$g \diamond f = g \left(t\right) = - \left(\frac{t + 3}{2}\right) + 5 = - \frac{t}{2} + \frac{7}{2}$

$g \diamond f = - \frac{x}{2} + \frac{7}{2}$

Refer to explanation

#### Explanation:

Combining two functions by substituting one function's formula in place of each $x$ in the other function's formula.
The composition of functions $f$ and $g$ is written $f o g$, and is read "f composed with g." The formula for $f o g$ is written $\left(f o g\right) \left(x\right)$.
The domain and range for the functions are $f : A \to B$ and $g : B \to C$