Composite Function Calculator + Online Solver With Free Steps

The Composite Function Calculator expresses a function f(x) as a function of another function g(x).

This composition of functions is usually represented by h = f  $\circ$, g or h(x) = f [ g(x) ]. Note that the calculator finds h = f  $\circ$ g and this is not the same as h = g $\circ$ f.

Multivariate functions are supported, but the composition is partial to x (that is, limited to only x). Note that x must be replaced by the symbol “#” in the input text box. All other variables are considered constants during calculations.

composite function calculator

What Is the Composite Function Calculator?

The Composite Function Calculator is an online tool that determines the final expression for a composite function h = f  $\circ$ g given two functions f(x) and g(x) as input.

The result is also a function of x. The symbol “$\circ$” shows composition.

The calculator interface consists of two input text boxes labeled as:

  1. f(x): The outer function parameterized by variable x.
  2. g(x): The inner function also parametrized by variable x. 

In the case of multivariate functions at the input such as f(x, y) and g(x, y), the calculator evaluates the partial composition to x as:

h(x, y) = f [ g(x, y), y ] 

For functions of n variables f(x1, x2, x3, … xn) and g(x1, x2, x3, … xn), the calculator evaluates:

h(x1, x2, x3, … xn) = f [ g(x1, x2, x3 … xn), x2, x3, … xn ] 

How To Use the Composite Function Calculator?

You can use the Composite Function Calculator to find h = f $\circ$ g by entering any two functions f(x) and g(x) in their respective input text boxes. Replace all occurrences of the variable x with the symbol “#” without the commas. 

Note that spaces between characters in the text boxes do not matter so “1 / (# + 1)” is equivalent to “1/(#+1)”. As an example, let us suppose we want to enter the function: 

\[ f(x) = \frac{1}{x+1} \quad \text{and} \quad g(x) = 3x+1 \] 

Here are the stepwise guidelines on how to use this calculator:

Step 1

Enter the outer function in the input text box labeled f(x) and replace all instances of the variable x with the symbol #. For our example, we enter “1 / (# + 1)”.

Step 2

Enter the inner function in the input text box labeled g(x). Again, replace all x with #. For our example, we can enter either “3# + 1” or “3*# + 1” as they both mean the same thing.

Step 3

Press the Submit button to get the resulting composite function h(x) = f [ g(x) ].


All instances of # will automatically revert to x in the result and the expression will be simplified or factorized if possible.

Composing More Than Two Functions

The calculator is only capable of directly composing two functions. If you need to find the composition of say, three functions, then the equation changes: 

i = j  $\circ$ k $\circ$ l =j [ k { l(x) } ] 

To find i(x), we must now run the calculator two times:

  1. In the first run, get the composite function of the two innermost functions. Let m = k $\circ l$. In the input boxes labeled f(x) and g(x), put the functions k(x) and l(x) respectively to get m(x).
  2. In the second run, find the composite function of the outermost function with m(x) from the previous step. To do this, put the functions j(x) and m(x) within the input boxes f(x) and g(x) respectively. 

The result of the above steps is the final composite function i(x) of three functions.

For the most general case of composing n functions:

i = f  $\circ$ g $\circ$ h $\circ$ … $\circ$ n 

You can compose all n functions by running the calculator a total of n – 1 times. Though this is inefficient for large n, we usually only need to compose two functions. Three and four compositions are fairly common but they only require running the calculator two and three times respectively.

How Does the Composite Function Calculator Work?

The Composite Function Calculator works by using the substitution method. A convenient way to think of a composition of functions is to think of it as a substitution. That is, consider f [ g(x) ] as evaluating f(x) at x = g(x). In other words, composition is essentially h = f [ x = g(x) ]. 

The calculator uses this approach to get the final result. It replaces all occurrences of the variable x in the function f(x) with the complete expression for the function g(x). 


f [ g(x) ] is usually read as “f of g of x” or simply “f of g” to avoid confusing the variable x with a function. Here, f(x) is termed the outer function and g(x) the inner function.

The outer function f(x) is a function of the inner function g(x). In other words, x in f(x) is not treated as a simple variable, but rather another function expressed in terms of that variable.

Composition Condition

For the composition of two functions to be valid, the inner function must produce values within the domain of the outer function. Otherwise, the latter is undefined for the values returned by the former.

In other words, the co-domain (possible outputs) of the inner function should strictly be a subset of the domain (valid inputs) of the outer function. That is:

\[ \forall \; f: X \to Y, \, g: X’ \to Y’ \; \, \exists \; \, h: Y’ \to Y \mid h = f \, \circ \, g \iff Y’ \subset X \]


Composition of functions may or may not be a commutative operation. That is, f [ x = g(x) ] might not be the same as g [ x = f(x) ]. Generally, commutativity does not exist except for some particular functions, and even then, it exists only under some special conditions.

However, composition does satisfy associativity so that (f $\circ$ g) $\circ$ h = f $\circ$ (g $\circ$ h). Further, if both the functions are differentiable, the derivative of the composite function is obtainable via the chain rule.

Solved Examples

Example 1

Find the composite of the following functions:

\[ f(x) = \frac{1}{x+1} \]

g(x) = 3x+1 


Let $h(x)$ represent the desired composite function. Then:

h(x) = f [ g(x) ] 

h(x) = f [ x = g(x) ]

\[ h(x) = \left. \dfrac{1}{x+1} \, \right \rvert_{\, x \,  = \, 3x \,+ \, 1} \]

\[ h(x) = \frac{1}{(3x+1)+1} \]

Solving, we get the calculator output:

\[ h(x) = \frac{1}{3x+2} \]

Example 2

Find f $\circ$ g given f(x) = 6x-3x+2 and $g(x) = x^2+1$ the following functions.


Let h = f $\circ$ g, then:

h(x) = f [ x = g(x) ] 

\[ h(x) = \left. 6x-3x+2 \, \right \rvert_{\, x \,  = \, x^2 \,+ \, 1} \]

\[ h(x) = 6(x^2+1)-3(x^2+1)+2 \]

\[ h(x) = 3x^2+4 \]

Which is a pure quadratic equation with a = 3, b = 0, c = 4. The calculator solves for the roots with the quadratic formula and converts the above answer into factored form. Let the first root be x1 and the second x2.

\[ x_1, \, x_2 = \frac{-b+\sqrt{b^2 – 4ac}}{2a} , \frac{-b-\sqrt{b^2 – 4ac}}{2a} \]

\[ x_1, \, x_2 = \frac{\sqrt{-48}}{6} ,\frac{-\sqrt{-48}}{6} \]

\[ x_1, \, x_2 = \frac{2 \sqrt{3} i}{3} ,\frac{-2 \sqrt{3} i}{3} \]

The roots are complex. Factorizing:

h(x) = (x-x1)(x-x2) 

\[ h(x) = \left ( x-\frac{2 \sqrt{3}i}{3} \right ) \left ( x-\frac{-2 \sqrt{3}i}{3} \right ) \]

Knowing that $\frac{1}{i} = -i$, we take iota common in both product terms to get:

\[ h(x) = \dfrac{1}{3} \left ( 2 \sqrt{3}-ix \right ) \left ( 2 \sqrt{3}+ix \right ) \]

Example 3

Given the multivariate functions: 

\[ f(x) = \dfrac{1}{5x+6y} \quad \text{and} \quad g(x) = \log_{10}(x+y) \] 

Find f [ g(x) ].


Let h = f [ g(x) ], then:

 h(x) = f [ x = g(x) ] 

\[ h(x) = \left. \frac{1}{5x+6y} \, \right \rvert_{\, x \,  = \, \log_{10}(x \,+ \, y)} \]

\[ h(x) = \frac{1}{5 \log_{10}(x+y)+6y } \]

Example 4

For the given functions, find the composite function where f(x) is the outermost function, g(x) is in the middle, and h(x) is the innermost function.

\[ f(x) = \sqrt{4x} \]

\[ g(x) = x^2 \]

h(x) = 10x-12 


Let i(x) = f $\circ$ g $\circ$ h be the required composite function. First, we calculate g $\circ$ h. Let it be equal to t(x), then:

\[ t(x) = g \, \circ \, h = \left. x^2 \, \right \rvert_{\, x \,  = \, 10x \, – \, 12}  \]

\[ t(x) = (10x-12)^2 \]

\[ t(x) = 100x^2-240x+144\]

Since,  $(a-b)^2 = a^2-2ab+b^2 $.


\[ t(x) = 4(25x^2-60x+36) \]

\[ t(x) = 4(6-5x)^2 \iff 4(5x-6)^2  \]

Since, $(a-b)^2 = (b-a)^2$.

Now, we calculate $f \, \circ \, t$:

\[ i(x) = f \, \circ \, t  = \left. \sqrt{4x} \, \right \rvert_{\, x \,  = \, 4(6 \, – \, 5x)^2} \]

\[ i(x) = \sqrt{16 \, (6-5x)^2} \]

\[ i(x) = \sqrt{4^2 \, (6-5x)^2} \]

Solving, we get the calculator output:

\[ h(x) = 4 \sqrt{(6-5x)^2} = 4 \sqrt{(5-6x)^2} \]

There is an apparent sign ambiguity because of the quadratic nature of $(5-6x)^2$. Thus, the calculator does not solve it further. A further simplification would be:

\[ h(x) = \pm 4(6-5x) =  \pm (120-100x) \]

Big O Calculator < Math Calculators List > Mixture Problem Calculator