PYQ Vault

CBSE Class 12 Maths · Relations and Functions

Composition of Functions and Invertible Functions

The composite gof (apply f, then g), invertible functions and how to find an inverse, and the sum of two functions with its domain.

Why this matters

4 questions, one of them from a board paper. The present NCERT book teaches composition and invertible functions briefly, through three examples and no exercise, and none of this chapter's board questions from 2023 to 2026 is set on them. The one board question here is a 2025 assertion-reason item on the domain of the sum of two functions.

Concept 1 of 3: Composition of two functions

Composition is doing one function after another: the output of f becomes the input of g. The order matters. Squaring and then adding 2 is not the same as adding 2 and then squaring, so gof and fog are usually different functions.

Definition

  • Let f:A→Bf : A \to B and g:B→Cg : B \to C. The composition of f and g, written gof, is the function gof:A→Cgof : A \to C given by gof(x)=g(f(x))gof(x) = g(f(x)) for all x∈Ax \in A.
  • In gof, f acts first and g second.
  • In general gof≠foggof \ne fog: one value of x where they differ is enough to show it.
  • For a function given by a table of values, work out g(f(x))g(f(x)) for each element of A in turn.

Composite function

gof (x)=g(f(x)),x∈Agof\,(x) = g(f(x)), \quad x \in A

Worked example

Let f,g:R→Rf, g : \mathbb{R} \to \mathbb{R} be f(x)=x+2f(x) = x + 2 and g(x)=x3g(x) = x^3. Find gof and fog, and show that gof≠foggof \ne fog.
Practise this conceptself-check · 2 quick reps

The same idea in a textbook question:

NCERT textbook · Misc Eg.16Moderate

Example 1 · Relations and Functions · Composition and Invertible Functions

Find gofgof and fogfog, if f:R→Rf : \mathbf{R} \to \mathbf{R} and g:R→Rg : \mathbf{R} \to \mathbf{R} are given by f(x)=cos⁡xf(x) = \cos x and g(x)=3x2g(x) = 3x^2. Show that gof≠foggof \ne fog.

Doing g first in gof

gof means f first, then g: gof(x)=g(f(x))gof(x) = g(f(x)). Read it from the right.

Assuming gof and fog are equal

They are usually different. To show it, work out both at one value of x and show the numbers differ.

Concept 2 of 3: Invertible functions and the inverse

An inverse undoes a function: if f takes x to y, the inverse takes y back to x. This only works when each y comes from exactly one x and every y is reached, that is, when f is one-one and onto.

Definition

  • A function f:X→Yf : X \to Y is invertible if there is a function g:Y→Xg : Y \to X with gof=IXgof = I_X and fog=IYfog = I_Y. Then g is the inverse of f, written f−1f^{-1}.
  • If f is invertible, f is one-one and onto; conversely, if f is one-one and onto, f is invertible.
  • To find the inverse: put y=f(x)y = f(x), solve for x, and define g(y)g(y) by that expression.
  • Then check both: gof(x)=xgof(x) = x for all x in X and fog(y)=yfog(y) = y for all y in Y.

Inverse of f

gof=IX and fog=IY  ⇒  g=f−1gof = I_X \text{ and } fog = I_Y \;\Rightarrow\; g = f^{-1}

Worked example

Show that f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=5x−2f(x) = 5x - 2, is invertible and find its inverse.
Practise this conceptself-check · 2 quick reps

The same idea in a textbook question:

NCERT textbook · Misc Eg.17Moderate

Example 2 · Relations and Functions · Composition and Invertible Functions

Let f:N→Yf : \mathbf{N} \to \mathrm{Y} be a function defined as f(x)=4x+3f(x) = 4x + 3, where, Y={y∈N:y=4x+3 for some x∈N}\mathrm{Y} = \{y \in \mathbf{N} : y = 4x + 3 \text{ for some } x \in \mathbf{N}\}. Show that ff is invertible. Find the inverse.

Checking only one composition

An inverse must satisfy both gof=IXgof = I_X and fog=IYfog = I_Y. Show both lines.

Inverting a function that is not one-one and onto

Solving y=x2y = x^2 gives two values of x, so no single inverse exists on R\mathbb{R}. Check one-one and onto first.

Concept 3 of 3: The sum of two functions and its domain

To add two functions at a point, both must have a value there. So the sum is defined only where both functions are defined, the common part of their domains. Adding two functions can also spoil a property: two one-one functions can add up to one that is not one-one.

Definition

  • (f+g)(x)=f(x)+g(x)(f + g)(x) = f(x) + g(x), and the domain of f+gf + g is Dom(f)∩Dom(g)\text{Dom}(f) \cap \text{Dom}(g).
  • This domain rule comes from Class 11. The present Class 12 book uses sums of functions only in two examples (sin⁡x\sin x and cos⁡x\cos x on [0,π2]\left[0, \frac{\pi}{2}\right] are one-one but their sum is not; the identity function on N is onto but its double is not) and does not teach the domain rule again. Board 2025 asked it once, as an assertion-reason item.
  • Assertion-reason codes in Maths papers: (A) both true and R explains A; (B) both true and R does not explain A; (C) A true, R false; (D) A false, R true.

Domain of a sum

Dom(f+g)=Dom(f)∩Dom(g)\text{Dom}(f + g) = \text{Dom}(f) \cap \text{Dom}(g)

Worked example

Find the domain of f+gf + g, where f(x)=x−1f(x) = \sqrt{x - 1} and g(x)=1x−3g(x) = \dfrac{1}{x - 3}.
Practise this conceptself-check · 2 quick reps

The same idea in a real exam question:

CBSE Class 12 · 2025 · 65/6/1 · Q20Moderate

Example 3 · Relations and Functions · Composition and Invertible Functions

Questions number 19 and 20 are Assertion and Reason based questions. Two statements are given, one labelled Assertion (A) and the other labelled Reason (R). Select the correct answer from the codes (A), (B), (C) and (D) as given below.
Assertion (A) : Let f(x)=exf(x) = e^x and g(x)=log⁡xg(x) = \log x. Then (f+g) x=ex+log⁡x(f + g)\,x = e^x + \log x where domain of (f+g)(f + g) is R. Reason (R) : Dom(f+g)=Dom(f)∩Dom(g)\text{Dom}(f + g) = \text{Dom}(f) \cap \text{Dom}(g).

Taking the union of the domains

The sum needs both functions at the point, so its domain is the intersection, not the union.

Reading (D) as 'both false'

In CBSE Maths papers, (D) means the Assertion is false and the Reason is true. Read the four codes printed above the item every time.

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)

Watch out for (6)

Test yourself on Relations and Functions

15 past CBSE Class 12 questions from this chapter, timed at 23 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.