# Composition of functions

The composition of functions is the successive application of functions. The resulting function is called a composite function.

The composite of $$f(x)=2x$$ and $$g(x)=x^2$$ is $$h(x)=f(g(x))=2x^2$$.

More formally, if $$g:D_g\to R_g$$ and $$f:D_f\to R_f$$ are two functions with $$$R_g\subset D_f,$$$ the composite function $$f\circ g$$ is the function from $$D_g$$ to $$R_f$$ defined by $$$f\circ g (x) = f\big(g(x)\big).$$$

The composite function is written either as $$f\circ g$$ or $$fg$$ and is read $$f$$ of $$g$$. $$fg$$ is often used for the product of functions, so $$f\circ g$$ should be preferred.

$$h(x) = \sin(x^2)$$ is the composite $$\sin\circ g$$ where $$g(x) = x^2$$. $$\vert x^3\vert$$ is the composite function $$f\circ g$$ with $$f(x) =\vert x\vert$$ and $$g(x) = x^3$$.