NDA Maths · Functions

Composition and Inverse of Functions

Chain functions together (f∘g) or run one backwards (f⁻¹) — the chapter's richest source of HARD questions.

Why this matters

Twenty-eight PYQs and the chapter's difficulty hot-spot — 7 of the chapter's HARD questions live here. The staples: evaluate f at a point, compose two functions (and notice f∘g ≠ g∘f), find the constant that makes two linear functions commute (a near-annual question), and invert a rational/exponential function. Order and bijectivity are where marks are won and lost.

Concept 1 of 4

Evaluating and combining functions

Intuition

To evaluate ff at something, substitute it everywhere xx appears — the input can be a number, another variable, or an expression like sinθ\sin\theta. Sums and products of functions are done pointwise: (f+g)(x)=f(x)+g(x)(f+g)(x)=f(x)+g(x), (fg)(x)=f(x)g(x)(fg)(x)=f(x)\,g(x).

Definition

  • Value: f(a)f(a) replaces xx by aa throughout the rule.
  • Substitution: f(sinθ)f(\sin\theta) replaces xx by sinθ\sin\theta (use identities to simplify).
  • Pointwise sum/product: (f±g)(x)=f(x)±g(x)(f\pm g)(x)=f(x)\pm g(x), (fg)(x)=f(x)g(x)(fg)(x)=f(x)g(x), (fg)(x)=f(x)g(x)\left(\tfrac fg\right)(x)=\tfrac{f(x)}{g(x)} where g(x)0g(x)\neq0.

Worked example

If f(x)=x+1f(x)=x+1 and g(x)=x2g(x)=x^2, find (fg)(2)(fg)(2).
  1. (fg)(2)=f(2)g(2)(fg)(2)=f(2)\,g(2) — a product, evaluated at x=2x=2.
  2. f(2)=3f(2)=3, g(2)=4g(2)=4.
  3. Product =3×4=12=3\times4=12.
Answer:(fg)(2)=12(fg)(2)=12.

From the bank · past-year question

Example 1FunctionsEASY
If f(x)=x2+2f(x)=x^{2}+2 and g(x)=2x3g(x)=2x-3, then what is (fg)(1)(fg)(1) equal to?

[Q96 · Apr · 2023]

(fg)(fg) is a product, (fg)(f\circ g) is a composition

NDA writes the product as (fg)(x)=f(x)g(x)(fg)(x)=f(x)g(x) and the composition as (fg)(x)=f(g(x))(f\circ g)(x)=f(g(x)). They are completely different operations — read the symbol carefully before computing.

Concept 2 of 4

Composition of functions

Intuition

Composition feeds one function's output into the next: (fg)(x)=f(g(x))(f\circ g)(x)=f(g(x)) means 'do gg first, then ff'. Work inside-out, and remember the order matters — fgf\circ g and gfg\circ f are usually different.

Definition

(fg)(x)=f(g(x))(f\circ g)(x)=f(g(x)); the range of gg must sit inside the domain of ff. Composition is associative (f(gh)=(fg)h)(f\circ(g\circ h)=(f\circ g)\circ h) but not commutative (fggf(f\circ g\neq g\circ f in general)). Iterating fff\circ f\circ\cdots just repeats the substitution.

(f ∘ g)(x) = f(g(x)) — do g firstxgg(x)ff(g(x))Reverse the order and you usually get a different result: f∘g ≠ g∘f.

Worked example

With f(x)=2x+1f(x)=2x+1 and g(x)=x2g(x)=x^2, find (fg)(x)(f\circ g)(x) and (gf)(x)(g\circ f)(x).
  1. (fg)(x)=f(g(x))=f(x2)=2x2+1(f\circ g)(x)=f(g(x))=f(x^2)=2x^2+1.
  2. (gf)(x)=g(f(x))=g(2x+1)=(2x+1)2=4x2+4x+1(g\circ f)(x)=g(f(x))=g(2x+1)=(2x+1)^2=4x^2+4x+1.
  3. They differ — concrete proof that composition is not commutative.
Answer:(fg)(x)=2x2+1(f\circ g)(x)=2x^2+1; (gf)(x)=4x2+4x+1(g\circ f)(x)=4x^2+4x+1.
Practice this conceptself-check

Try it yourself

If f(x)=3x2f(x)=3x-2, find (ff)(2)(f\circ f)(2).

From the bank · past-year question

Example 2FunctionsEASY
If f(x)=4x+3f(x)=4x+3, then what is fff(1)f\circ f\circ f(-1) equal to?

[Q68 · Apr · 2022]

Work inside-out, and keep the order

(fg)(x)=f(g(x))(f\circ g)(x)=f(g(x)) means gg acts first. Students often apply ff first or read fgf\circ g as a product. For iterated composition, peel one layer at a time — don't try to do all of ffff\circ f\circ f in one leap.

Concept 3 of 4

When do two linear functions commute?

Intuition

A near-annual NDA question: given two linear functions, find the constant that makes fg=gff\circ g=g\circ f. Both compositions are linear, so just expand both, match coefficients, and solve.

Definition

For f(x)=ax+bf(x)=ax+b and g(x)=cx+dg(x)=cx+d: f(g(x))=acx+ad+bf(g(x))=acx+ad+b and g(f(x))=acx+bc+dg(f(x))=acx+bc+d. The xx-coefficients always match (both acac), so fg=gff\circ g=g\circ f reduces to the constant condition ad+b=bc+dad+b=bc+d, i.e. b(c1)=d(a1)b(c-1)=d(a-1).

Commuting condition for linear f, g

f(x)=ax+b, g(x)=cx+d:fg=gf    b(c1)=d(a1)f(x)=ax+b,\ g(x)=cx+d:\quad f\circ g=g\circ f \iff b(c-1)=d(a-1)

Worked example

If f(x)=2x+1f(x)=2x+1 and g(x)=3x+dg(x)=3x+d satisfy fg=gff\circ g=g\circ f, find dd.
  1. Here a=2, b=1, c=3a=2,\ b=1,\ c=3. Use b(c1)=d(a1)b(c-1)=d(a-1).
  2. 1(31)=d(21)2=d1\cdot(3-1)=d\cdot(2-1)\Rightarrow 2=d.
Answer:d=2d=2.

From the bank · past-year question

Example 3FunctionsMODERATE
If f(x)=4x+1f(x) = 4x+1 and g(x)=kx+2g(x) = kx+2 such that fog(x)=gof(x)fog(x) = gof(x), then what is the value of k?

[Q72 · Sep · 2022]

Concept 4 of 4

Inverse of a function

Intuition

The inverse f1f^{-1} undoes ff: if ff sends aba\mapsto b, then f1f^{-1} sends bab\mapsto a. It exists only when ff is a bijection, and its graph is the mirror image of ff across the line y=xy=x.

Definition

To find f1f^{-1}: write y=f(x)y=f(x), **solve for xx** in terms of yy, then swap names. Domain and range swap: dom(f1)=range(f)\text{dom}(f^{-1})=\text{range}(f). Properties: f1f=idf^{-1}\circ f=\text{id}, and the graph of f1f^{-1} is the reflection of ff in y=xy=x. Note f1(x)1f(x)f^{-1}(x)\neq\dfrac{1}{f(x)}.

y = xf: 2xf⁻¹: x/2(a, b) on f ⟺ (b, a) on f⁻¹

Worked example

Find the inverse of f(x)=3x+2x1f(x)=\dfrac{3x+2}{x-1}, x1x\neq1.
  1. Set y=3x+2x1y=\dfrac{3x+2}{x-1} and clear the fraction: y(x1)=3x+2y(x-1)=3x+2.
  2. Expand and collect xx: yxy=3x+2x(y3)=y+2yx-y=3x+2\Rightarrow x(y-3)=y+2.
  3. Solve: x=y+2y3x=\dfrac{y+2}{y-3}; rename yxy\to x.
Answer:f1(x)=x+2x3f^{-1}(x)=\dfrac{x+2}{x-3}.
Practice this conceptself-check

Try it yourself

Find the inverse of f(x)=2x5f(x)=2x-5.

From the bank · past-year question

Example 4FunctionsMODERATE
If f(x)=x2x+2f(x)=\dfrac{x-2}{x+2}, x2x\neq-2, then what is f1(x)f^{-1}(x) equal to?

[Q86 · Apr · 2019]

Inverse needs a bijection — and f11/ff^{-1}\neq1/f

Only one-one onto functions have an inverse; x2x^2 on R\mathbb{R} has none (not one-one). And f1f^{-1} is the undo function, not the reciprocal — f1(x)f^{-1}(x) is generally nothing like 1f(x)\dfrac{1}{f(x)}. When finding it, remember the domain of f1f^{-1} is the range of ff.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (1)

  • When do two linear functions commute?

    Commuting condition for linear f, g

    f(x)=ax+b, g(x)=cx+d:fg=gf    b(c1)=d(a1)f(x)=ax+b,\ g(x)=cx+d:\quad f\circ g=g\circ f \iff b(c-1)=d(a-1)

Watch out for (3)

Mastery check — 5 interleaved questions

Try each one before clicking. Questions are interleaved across the concepts above, not grouped — interleaving sharpens transfer.

Example 1FunctionsHARD
For the following two (02) items: Consider the function f(x)=x1xf(x)=\dfrac{x}{1-x} (x>0,x1)(x>0,\,x\neq1).
What is (1x)f(x)+xf(x+1)(1-x)f(\sqrt{x})+xf(\sqrt{x}+1) equal to?

[Q77 · Sep · 2025]

Example 2FunctionsEASY
Directions for the following two (02) items : Read the following information and answer the two items that follow : Let f(x)=x2f(x) = x^{2}, g(x)=tanxg(x) = \tan x and h(x)=lnxh(x) = \ln x.
What is [f(ff)](2)[f \circ (f \circ f)](2) equal to ?

[Q80 · Sep · 2019]

Example 3FunctionsHARD
If f(x)=axbf(x)=ax-b and g(x)=cx+dg(x)=cx+d are such that f(g(x))=g(f(x))f(g(x))=g(f(x)), then which one of the following holds?

[Q73 · Apr · 2024]

Example 4FunctionsMODERATE
For the following two (02) items: Consider the function f(x)=10x10x10x+10xf(x)=\dfrac{10^x-10^{-x}}{10^x+10^{-x}}.
What is the inverse of the function?

[Q90 · Sep · 2025]

Example 5FunctionsMODERATE
If f(x)=x(4x23)f(x)=x(4x^{2}-3), then what is f(sinθ)f(\sin\theta) equal to?

[Q98 · Apr · 2023]

Drill every past-year question on this subtopic

28 questions from the bank — paginated, with cart and Word-export support.