Resources For Teachers For Tutors For Students & Parents AI New Books Pricing
Year 11 (2026) Maths Advanced (2026) Circles and Properties of Functions

Composite Functions

20 practice questions 2 video lessons Theory + worked examples
Practice 20 questions
Practice questions

Every question with a fully worked solution.

Start practising
Watch 2 video(s)
  • Composite Functions - Video - Composite Functions Watch
  • Composite Functions - Video - Composite functions 2 Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A composite function applies one function to the output of another: \(f(g(x))\) means apply \(g\) first, then apply \(f\) to the result. This Year 11 Mathematics Advanced page shows how to evaluate a composite from the inside out, form \(f(g(x))\) and \(g(f(x))\), solve equations involving composites, find an unknown function or constant, and find the domain and range of a composite function.

A composite function is formed when the output of one function becomes the input of another. \(f(g(x))\) is read "\(f\) of \(g\) of \(x\)". The inner function \(g\) acts on \(x\) first, then the outer function \(f\) acts on \(g(x)\).

To evaluate \(f(g(a))\), work from the inside out: find the number \(g(a)\) first, then substitute that number into \(f\). To form \(f(g(x))\) as an expression, replace every \(x\) in \(f(x)\) by \(g(x)\), in brackets, then expand and simplify.

Order matters. In general \(f(g(x))\neq g(f(x))\). With \(f(x)=x+1\) and \(g(x)=x^{2}\), \(f(g(3))=f(9)=10\) but \(g(f(3))=g(4)=16\).

The domain of \(f(g(x))\) is every \(x\) in the domain of \(g\) for which \(g(x)\) lies in the domain of \(f\). For example, with \(f(x)=\dfrac{1}{x-5}\) and \(g(x)=2x+1\), \(f(g(x))=\dfrac{1}{(2x+1)-5}=\dfrac{1}{2x-4}\), which is undefined when \(x=2\). The range of \(f(g(x))\) is the set of values it takes as \(x\) runs through that domain.

Composite function as two machinesThe input negative 2 goes into machine g, which gives 3 times negative 2 plus 1 = negative 5. That output goes into machine f, which gives negative 5 squared minus 5 = 20. So f of g of negative 2 is 20. −2 g 3x + 1 −5 f x² − 5 20 x g(x) f(g(x)) 1st: inner 2nd: outer
\(f(g(-2))\): the inner function \(g\) acts first, and its output \(-5\) becomes the input of \(f\) (Example 1).
Graph of a composite function with its domain and rangeThe graph of y = 1 over (x minus 6) for x greater than or equal to 2, x not equal to 6. It starts at the closed point (2, negative one quarter), falls towards the vertical asymptote x = 6, and on the right of the asymptote is positive and approaches the x-axis. The range, y less than or equal to negative one quarter or y greater than 0, is marked in orange on the y-axis. xy 2 10 x = 6 −1/4 (2, −1/4) y = 1/(x − 6), x ≥ 2
\(f(g(x))=\dfrac{1}{x-6}\) only for \(x\ge2\), because \(g(x)=\sqrt{x-2}\) needs \(x\ge2\). Orange: the range \(f(g(x))\le-\dfrac{1}{4}\) or \(f(g(x))>0\) (Example 4).

Composite function: apply \(g\) first, then \(f\).

\[f(g(x))=f\big(\text{the value of } g(x)\big)\]
f of g of x equals f applied to the value of g of x

To form it, replace \(x\) in \(f(x)\) by \(g(x)\). For example, if \(f(x)=x^{2}-5\):

\[f(g(x))=\big(g(x)\big)^{2}-5\]
f of g of x equals g of x squared minus 5

Domain of a composite:

\[x \text{ in the domain of } g \quad\text{and}\quad g(x) \text{ in the domain of } f\]
x in the domain of g and g of x in the domain of f
Order matters. In general \(f(g(x))\neq g(f(x))\), so always check which function is inside.
Finding the inner function. If \(f(x)=3x-1\) and \(f(g(x))=6x+8\), then \(3g(x)-1=6x+8\), so \(3g(x)=6x+9\) and \(g(x)=2x+3\).
Equal for all values of \(x\). If \(f(x)=5x+k\) and \(g(x)=2x+3\): \(f(g(x))=5(2x+3)+k=10x+15+k\) and \(g(f(x))=2(5x+k)+3=10x+2k+3\). The \(x\) terms already match, so the constant terms must be equal: \(15+k=2k+3\), giving \(k=12\).
When the composite gives back \(x\). For \(f(x)=4x-3\) and \(g(x)=\dfrac{x+3}{4}\): \(f(g(x))=4\times\dfrac{x+3}{4}-3=x+3-3=x\). One function undoes the other.
A fraction inside a fraction. For \(f(x)=\dfrac{3}{x-2}\) and \(g(x)=\dfrac{1}{x}\), multiply the top and bottom by \(x\): \(f(g(x))=\dfrac{3}{\dfrac{1}{x}-2}=\dfrac{3\times x}{\left(\dfrac{1}{x}-2\right)\times x}=\dfrac{3x}{1-2x}\), with \(x\neq0\) since \(g(0)\) is undefined.

How to evaluate \(f(g(a))\)

  1. Find the inner value \(g(a)\) first.
  2. Substitute that number into \(f\): \(f(g(a))=f(\text{that number})\).
  3. State the answer with \(\therefore\).

How to form and use \(f(g(x))\)

  1. Replace every \(x\) in \(f(x)\) by \(g(x)\), in brackets.
  2. Expand and simplify.
  3. Use it: solve an equation, compare coefficients for "all values of \(x\)", or find where the composite is undefined.

How to find the domain and range of \(f(g(x))\)

  1. Form the composite and simplify.
  2. Domain: start with the domain of \(g\), then remove any \(x\) that makes the composite undefined (a zero denominator, a negative under a square root).
  3. Range: find the values the inner expression takes over that domain, then see what the outer function does to them. Note which values are reached (endpoints) and which are only approached (asymptotes).
Example 1 — Evaluate from the inside out
Given \(f(x)=x^{2}-5\) and \(g(x)=3x+1\), evaluate \(f(g(-2))\) and \(g(f(-2))\).
Solution

Work from the inside out:

\(g(-2)\)\(=\)\(3(-2)+1=-5\)
\(f(g(-2))\)\(=\)\(f(-5)\)
\(\)\(=\)\((-5)^{2}-5\)
\(\)\(=\)\(20\)
f of g of negative 2 equals 20
\(f(-2)\)\(=\)\((-2)^{2}-5=-1\)
\(g(f(-2))\)\(=\)\(g(-1)\)
\(\)\(=\)\(3(-1)+1\)
\(\)\(=\)\(-2\)
g of f of negative 2 equals negative 2

\(\therefore\ f(g(-2))=\mathbf{20}\) and \(g(f(-2))=\mathbf{-2}\). Changing the order changes the answer.

Example 2 — Form both composites
Given \(f(x)=x^{2}-3x\) and \(g(x)=2x+1\), find \(f(g(x))\) and \(g(f(x))\).
Solution

Replace \(x\) in \(f\) by \(g(x)=2x+1\):

\(f(g(x))\)\(=\)\((2x+1)^{2}-3(2x+1)\)
\(\)\(=\)\(4x^{2}+4x+1-6x-3\)
\(\)\(=\)\(\boldsymbol{4x^{2}-2x-2}\)
f of g of x equals 4 x squared minus 2 x minus 2

Replace \(x\) in \(g\) by \(f(x)=x^{2}-3x\):

\(g(f(x))\)\(=\)\(2f(x)+1\)
\(\)\(=\)\(2(x^{2}-3x)+1\)
\(\)\(=\)\(\boldsymbol{2x^{2}-6x+1}\)
g of f of x equals 2 x squared minus 6 x plus 1

The two composites are different functions.

Example 3 — Solve an equation with composites
Given \(f(x)=x^{2}+1\) and \(g(x)=x+2\), solve \(f(g(x))=g(f(x))\).
Solution

Form both composites:

\(f(g(x))\)\(=\)\((x+2)^{2}+1\)
\(\)\(=\)\(x^{2}+4x+4+1\)
\(\)\(=\)\(x^{2}+4x+5\)
\(g(f(x))\)\(=\)\(x^{2}+1+2\)
\(\)\(=\)\(x^{2}+3\)
f of g of x equals x squared plus 4 x plus 5, g of f of x equals x squared plus 3

Set them equal and solve:

\(x^{2}+4x+5\)\(=\)\(x^{2}+3\)
\(4x\)\(=\)\(-2\)
\(\therefore\ x\)\(=\)\(\boldsymbol{-\dfrac{1}{2}}\)
x equals negative one half

Check: \(f\left(g\left(-\dfrac{1}{2}\right)\right)=\left(\dfrac{3}{2}\right)^{2}+1=\dfrac{13}{4}\) and \(g\left(f\left(-\dfrac{1}{2}\right)\right)=\dfrac{5}{4}+2=\dfrac{13}{4}\).

Example 4 — Domain and range of a composite
Given \(g(x)=\sqrt{x-2}\) and \(f(x)=\dfrac{1}{x^{2}-4}\), find the domain and range of \(f(g(x))\).
Solution

Form the composite, keeping the domain of \(g\):

\(f(g(x))\)\(=\)\(\dfrac{1}{\left(\sqrt{x-2}\right)^{2}-4}\)
\(\)\(=\)\(\dfrac{1}{x-2-4}\)
\(\)\(=\)\(\dfrac{1}{x-6}\)
f of g of x equals 1 over x minus 6

\(g(x)=\sqrt{x-2}\) needs \(x\ge2\); \(\dfrac{1}{x-6}\) needs \(x\neq6\).

Domain: \(\boldsymbol{x\ge2,\ x\neq6}\).

For \(2\le x<6\): \(-4\le x-6<0\), so \(\dfrac{1}{x-6}\le-\dfrac{1}{4}\) (equal to \(-\dfrac{1}{4}\) at \(x=2\)).

For \(x>6\): \(x-6>0\), so \(\dfrac{1}{x-6}>0\).

\(\therefore\) range: \(\boldsymbol{f(g(x))\le-\dfrac{1}{4}}\) or \(\boldsymbol{f(g(x))>0}\).

The graph is in the Diagrams tab.

Common pitfalls

Work from the inside out. In \(f(g(x))\), \(f\) is written first but \(g\) is applied first. Find \(g(a)\) before you touch \(f\).
A composite is not a product. With \(f(x)=x^{2}\) and \(g(x)=x+3\), \(f(g(x))=(x+3)^{2}=x^{2}+6x+9\), not \(x^{2}(x+3)\).
Keep the brackets when you substitute. Replacing \(x\) by \(2x+1\) in \(-3x\) gives \(-3(2x+1)=-6x-3\), not \(-6x+1\).
Simplifying can hide a restriction. \(\left(\sqrt{x-2}\right)^{2}=x-2\) only for \(x\ge2\). The domain of the composite keeps every restriction of the inner function, even after simplifying.
"For all values of \(x\)" is not "solve". If \(f(g(x))=g(f(x))\) must hold for every \(x\), compare coefficients. If it is an equation to solve, find the particular \(x\) values.

Frequently asked questions

What is a composite function?

A function applied to the output of another function. \(f(g(x))\) means apply \(g\) to \(x\) first, then apply \(f\) to the result \(g(x)\).

How do you find f(g(x))?

Replace every \(x\) in \(f(x)\) by \(g(x)\), in brackets, then expand and simplify. For a number, work from the inside out: find \(g(a)\) first, then substitute it into \(f\).

Is f(g(x)) the same as g(f(x))?

Not in general. With \(f(x)=x+1\) and \(g(x)=x^{2}\), \(f(g(3))=10\) but \(g(f(3))=16\). Always apply the inner function first.

How do you find the domain of a composite function?

Start with the domain of the inner function \(g\), then remove any \(x\) for which \(g(x)\) is not in the domain of \(f\), such as values that make a denominator zero. Simplifying the formula does not remove the restrictions from \(g\).

How do you find the range of a composite function?

Work out which values the inner expression takes over the domain, then see what the outer function does to those values. Check endpoints (value reached) and asymptotes (value never reached).

How do you find g(x) if you know f(x) and f(g(x))?

Write \(f(g(x))\) by replacing \(x\) in \(f\) by \(g(x)\), set it equal to the given expression, then solve for \(g(x)\). For \(f(x)=3x-1\) and \(f(g(x))=6x+8\): \(3g(x)-1=6x+8\), so \(g(x)=2x+3\).