Composite Function Calculator

Enter two functions to compose them, or put in a number to find f(g(a)).

Use x, + − × ÷ ^, brackets, sqrt, abs, ln, log and e.

Use x, + − × ÷ ^, brackets, sqrt, abs, ln, log and e.

Try

Result

You enteredf(x)=2x+1,g(x)=x2f\left(x\right) = 2x + 1,\quad g\left(x\right) = x^{2}

g(f(x))=4x2+4x+1\displaystyle g\left(f\left(x\right)\right) = 4x^{2} + 4x + 1
Show the work
  1. Substitute f(x) into g

    In g(f(x))g\left(f\left(x\right)\right) the output of ff becomes the input of gg. Replace every xx in the formula of gg by the whole expression f(x)f(x), kept in brackets so it is treated as one number.

    g(f(x))=(2x+1)2g\left(f\left(x\right)\right) = \left(2x + 1\right)^{2}
  2. Expand the brackets

    Multiply out the brackets and powers, then collect like terms so the composite is one polynomial in xx.

    (2x+1)2=4x2+4x+1\left(2x + 1\right)^{2} = 4x^{2} + 4x + 1
  3. Result

    So g(f(x))=4x2+4x+1g\left(f\left(x\right)\right) = 4x^{2} + 4x + 1.

Worked examples