PYQ Vault

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.

Test yourself — a quick 16-question Functions recall quiz, instant score.

Concept 1 of 4: Evaluating and combining functions

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).

The same idea in a real exam question:

NDA · Apr 2023 · Q96Easy

Example 1 · Functions · Composition and Inverse of Functions

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

(fg)(fg) is a product, (f∘g)(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 (f∘g)(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

Composition feeds one function's output into the next: (f∘g)(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 — f∘gf\circ g and g∘fg\circ f are usually different.

Definition

(f∘g)(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∘(g∘h)=(f∘g)∘h)(f\circ(g\circ h)=(f\circ g)\circ h) but not commutative (f∘g≠g∘f(f\circ g\neq g\circ f in general)). Iterating f∘f∘⋯f\circ f\circ\cdots just repeats the substitution.

Composition and its inverse

(f∘g)(x)=f(g(x))(f∘g)−1=g−1∘f−1(f\circ g)(x)=f(g(x))\qquad (f\circ g)^{-1}=g^{-1}\circ f^{-1}
(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 (f∘g)(x)(f\circ g)(x) and (g∘f)(x)(g\circ f)(x).
Practice this conceptself-check

The same idea in a real exam question:

NDA · Apr 2022 · Q68Easy

Example 2 · Functions · Composition and Inverse of Functions

If f(x)=4x+3f(x)=4x+3, then what is f∘f∘f(−1)f\circ f\circ f(-1) equal to?

Work inside-out, and keep the order

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

Concept 3 of 4: When do two linear functions commute?

A near-annual NDA question: given two linear functions, find the constant that makes f∘g=g∘ff\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 f∘g=g∘ff\circ g=g\circ f reduces to the constant condition ad+b=bc+dad+b=bc+d, i.e. b(c−1)=d(a−1)b(c-1)=d(a-1).

Commuting condition for linear f, g

f∘g=g∘f  ⟺  b(c−1)=d(a−1)  [f=ax+b, g=cx+d]f\circ g=g\circ f\iff b(c-1)=d(a-1)\ \ [f=ax+b,\ g=cx+d]

Worked example

If f(x)=2x+1f(x)=2x+1 and g(x)=3x+dg(x)=3x+d satisfy f∘g=g∘ff\circ g=g\circ f, find dd.

The same idea in a real exam question:

NDA · Sep 2022 · Q72Moderate

Example 3 · Functions · Composition and Inverse of Functions

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?

Concept 4 of 4: Inverse of a function

The inverse f−1f^{-1} undoes ff: if ff sends a↦ba\mapsto b, then f−1f^{-1} sends b↦ab\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 f−1f^{-1}: write y=f(x)y=f(x), solve for xx in terms of yy, then swap names. Domain and range swap: dom(f−1)=range(f)\text{dom}(f^{-1})=\text{range}(f). Properties: f−1∘f=idf^{-1}\circ f=\text{id}, and the graph of f−1f^{-1} is the reflection of ff in y=xy=x. Note f−1(x)≠1f(x)f^{-1}(x)\neq\dfrac{1}{f(x)}.

  • Self-inverse (involution): if f(f(x))=xf(f(x))=x for all xx then f−1=ff^{-1}=f, and such an ff is automatically one-one AND onto (it has an inverse, namely itself). Examples: f(x)=1−xf(x)=1-x, f(x)=1xf(x)=\tfrac1x, f(x)=x+1x−1f(x)=\tfrac{x+1}{x-1}, f(x)=−xf(x)=-x.
  • Möbius (linear-fractional) inverse: y=ax+bcx+d⇒x=dy−ba−cyy=\dfrac{ax+b}{cx+d}\Rightarrow x=\dfrac{dy-b}{a-cy}, so f−1(x)=dx−b−cx+af^{-1}(x)=\dfrac{dx-b}{-cx+a} — swap a↔da\leftrightarrow d and negate b,cb,c. Its domain excludes x=acx=\tfrac ac, which is exactly the value the original ff never reaches (its range excludes ac\tfrac ac); ff is self-inverse iff a+d=0a+d=0.

Inverse of a linear function

f(x)=ax+b (a≠0) ⇒ f−1(x)=x−baf(x)=ax+b\ (a\neq0)\ \Rightarrow\ f^{-1}(x)=\dfrac{x-b}{a}
y = xf: 2xf⁻¹: x/2(a, b) on f ⟺ (b, a) on f⁻¹

Worked example

Find the inverse of f(x)=3x+2x−1f(x)=\dfrac{3x+2}{x-1}, x≠1x\neq1.
Practice this conceptself-check

The same idea in a real exam question:

NDA · Apr 2019 · Q86Moderate

Example 4 · Functions · Composition and Inverse of Functions

If f(x)=x−2x+2f(x)=\dfrac{x-2}{x+2}, x≠−2x\neq-2, then what is f−1(x)f^{-1}(x) equal to?

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

Only one-one onto functions have an inverse; x2x^2 on R\mathbb{R} has none (not one-one). And f−1f^{-1} is the undo function, not the reciprocal — f−1(x)f^{-1}(x) is generally nothing like 1f(x)\dfrac{1}{f(x)}. When finding it, remember the domain of f−1f^{-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 (3)

  • Composition of functions

    Composition and its inverse

    (f∘g)(x)=f(g(x))(f∘g)−1=g−1∘f−1(f\circ g)(x)=f(g(x))\qquad (f\circ g)^{-1}=g^{-1}\circ f^{-1}
  • When do two linear functions commute?

    Commuting condition for linear f, g

    f∘g=g∘f  ⟺  b(c−1)=d(a−1)  [f=ax+b, g=cx+d]f\circ g=g\circ f\iff b(c-1)=d(a-1)\ \ [f=ax+b,\ g=cx+d]
  • Inverse of a function

    Inverse of a linear function

    f(x)=ax+b (a≠0) ⇒ f−1(x)=x−baf(x)=ax+b\ (a\neq0)\ \Rightarrow\ f^{-1}(x)=\dfrac{x-b}{a}

Watch out for (3)

Test yourself on Functions

20 past NDA questions from this chapter, timed at 25 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.