STEP-BY-STEP LEARNING

Learn Composition & Inverse Functions · Mathematics

Learn Composition & Inverse Functions in Mathematics step by step with concepts, examples, quick checks and revision for government exams.

—Due now
—Next revision
—Mastered
—Study streak
Text size
Complete Topic Lesson

Composition & Inverse Functions: Complete Aptitude Lesson

Composition builds a new function by feeding one function's output into another; inversion reverses a function's action. This lesson derives the rules, proves key shortcuts, and works through eight examples from basic to exam level, with common traps and a revision checklist.

On this page
  1. What Composition Means
  2. Evaluating Composites: Substitution Method
  3. Why Order Matters: A Proof by Counterexample
  4. Inverse Function: Definition and Test
  5. Finding an Inverse: Swap-and-Solve
  6. Composition of Inverses: Cancellation Rules
  7. Reverse Problems: Given the Composite, Find the Inner Function
  8. Self-Inverse and Special Cases
  9. Shortcuts with Proof
  10. Domain and Range in Composites and Inverses
  11. Exam Strategy and Time Management
  12. Worked examples
  13. Common mistakes
  14. Frequently asked questions

Function composition and inverse functions are favourite areas for quantitative aptitude because they test order of operations, algebraic manipulation, and logical reversal. The core idea is simple: composition is a chain of machines, and inversion is running a machine backwards. Once you internalise the order rule and the swap-and-solve method, most questions become one or two lines of algebra. This lesson builds from definitions to exam-level reverse problems, with proofs of every shortcut so you never apply a rule blindly.

Core Formulas at a Glance
Composition(f∘g)(x) = f(g(x))
Inverse cancellationf⁻¹(f(x)) = f(f⁻¹(x)) = x
Inverse of composite(f∘g)⁻¹ = g⁻¹∘f⁻¹
Linear inversef(x) = ax + b ⇒ f⁻¹(x) = (x − b)/a
Linear iterationfⁿ(x) = aⁿx + b(aⁿ − 1)/(a − 1), a ≠ 1
Self-inversef(f(x)) = x ⇔ f = f⁻¹
Aspectf(g(x))g(f(x))
First appliedgf
Second appliedfg
Example f = 2x+3, g = x²2x² + 34x² + 12x + 9
Value at x = 1525
Generally equal?NoNo
1Identify inner and outer functions from notation.
2For numeric input, evaluate inner function first.
3For symbolic input, substitute inner expression in brackets.
4Simplify and verify with a test value.
5For inverse, swap x and y, then solve for y.
6Check by composing f with f⁻¹ to get x.

What Composition Means

If f and g are functions, the composite f(g(x)) means: first apply g to x, then apply f to the result. Read it inside-out. The output of g becomes the input of f. For f(g(x)) to be defined at x, x must lie in the domain of g, and g(x) must lie in the domain of f. Composition is generally not commutative: f(g(x)) and g(f(x)) are usually different functions. It is associative: f(g(h(x))) = (f∘g)(h(x)), so bracketing does not matter, but order does.

  • f(g(x)): g acts first, f acts second.
  • Domain condition: x ∈ dom(g) and g(x) ∈ dom(f).
  • Composition is associative but not commutative.
  • Notation: (f∘g)(x) = f(g(x)).
(f∘g)(x) = f(g(x)); (g∘f)(x) = g(f(x))

Evaluating Composites: Substitution Method

To compute f(g(a)) for a number a, do not expand algebra first. Compute g(a), then substitute that single number into f. This avoids carrying unnecessary expressions and reduces arithmetic errors. For symbolic composites f(g(x)), replace every x in f's formula by the entire expression g(x), using brackets. The brackets are essential: if f(x) = x² and g(x) = x + 1, then f(g(x)) = (x + 1)², not x + 1².

  • Numeric input: evaluate the inner function first.
  • Symbolic input: substitute g(x) in brackets wherever x appears in f.
  • Simplify only after substitution.
  • Check the final expression by testing one convenient value of x.
f(g(x)): replace x in f(x) by g(x), keeping brackets.

Why Order Matters: A Proof by Counterexample

Take f(x) = 2x + 3 and g(x) = x². Then f(g(x)) = 2x² + 3, while g(f(x)) = (2x + 3)² = 4x² + 12x + 9. At x = 1, the first gives 5 and the second gives 25. Since one example where they differ disproves equality for all x, composition is not commutative in general. This is why exam questions deliberately ask for f(g(x)) versus g(f(x)); the order in the notation is the instruction, not a suggestion.

  • f(g(x)) applies g first; g(f(x)) applies f first.
  • A single counterexample proves the two are not identical.
  • Always underline which function is written outside.

Inverse Function: Definition and Test

A function f has an inverse f⁻¹ if and only if f is one-one (injective) and onto its codomain (surjective), i.e., bijective. The inverse undoes f: f⁻¹(f(x)) = x for every x in the domain, and f(f⁻¹(y)) = y for every y in the codomain. Graphically, f⁻¹ is the reflection of f in the line y = x. A quick horizontal-line test decides one-oneness: if every horizontal line meets the graph at most once, the function is one-one and an inverse can exist on that domain.

  • Inverse exists ⇔ f is bijective.
  • f⁻¹(f(x)) = x and f(f⁻¹(x)) = x.
  • Graph of f⁻¹ is the mirror image of f about y = x.
  • Horizontal-line test checks one-oneness.
f⁻¹(f(x)) = x; f(f⁻¹(x)) = x

Finding an Inverse: Swap-and-Solve

Write y = f(x). Swap x and y to get x = f(y). Solve for y; the resulting expression is f⁻¹(x). The swap works because the inverse interchanges input and output roles: a point (a, b) on f becomes (b, a) on f⁻¹. For linear functions f(x) = ax + b with a ≠ 0, this gives f⁻¹(x) = (x − b)/a directly. Always state the domain restriction if the original function was restricted to make it one-one.

  • Step 1: y = f(x). Step 2: swap x and y. Step 3: solve for y.
  • Linear shortcut: inverse of ax + b is (x − b)/a.
  • Verify by checking f(f⁻¹(x)) = x.
  • Respect any domain restriction stated in the question.
If f(x) = ax + b, a ≠ 0, then f⁻¹(x) = (x − b)/a.

Composition of Inverses: Cancellation Rules

Because f⁻¹ undoes f, composing them in either order returns the identity: f⁻¹∘f = f∘f⁻¹ = I, where I(x) = x. More generally, (f∘g)⁻¹ = g⁻¹∘f⁻¹. The reversal of order is intuitive: to undo 'first g, then f', you must first undo f, then undo g, like removing shoes before socks. Also, (f⁻¹)⁻¹ = f. These identities let you collapse long chains without computing each function.

  • f⁻¹∘f = f∘f⁻¹ = identity.
  • (f∘g)⁻¹ = g⁻¹∘f⁻¹ (reverse order).
  • (f⁻¹)⁻¹ = f.
  • Use cancellation to simplify nested expressions quickly.
(f∘g)⁻¹ = g⁻¹∘f⁻¹

Reverse Problems: Given the Composite, Find the Inner Function

Exam questions often give f and f(g(x)), asking for g(x). Method: write f(g(x)) = given expression, replace f's variable by a placeholder t, and solve for t in terms of x. That t equals g(x). For example, if f(x) = 2x + 3 and f(g(x)) = 4x + 1, then 2g(x) + 3 = 4x + 1, so g(x) = 2x − 1. The same logic works when the outer function is unknown: use the known inner function to substitute and compare.

  • Set f(g(x)) equal to the given expression.
  • Solve algebraically for g(x).
  • If the outer function is unknown, substitute the known inner expression.
  • Verify by recomposing.

Self-Inverse and Special Cases

A function is self-inverse if f(f(x)) = x, i.e., f = f⁻¹. Examples include f(x) = 1/x (x ≠ 0), f(x) = −x, and f(x) = c − x. Recognising self-inverse functions saves time: any even number of applications returns x, and any odd number returns f(x). Also note that constant functions have no inverse (not one-one), and even powers like x² need a domain restriction such as x ≥ 0 before an inverse exists.

  • Self-inverse: f(f(x)) = x.
  • f applied an even number of times gives x; odd gives f(x).
  • Constant functions are not invertible.
  • Restrict domain of x² to x ≥ 0 to get inverse √x.
f = f⁻¹ ⇔ f(f(x)) = x

Shortcuts with Proof

Shortcut 1: For f(x) = ax + b, fⁿ(x) = aⁿx + b(aⁿ − 1)/(a − 1) for a ≠ 1. Proof by induction: the case n = 1 is trivial; assuming it for n, applying f once more gives a[aⁿx + b(aⁿ − 1)/(a − 1)] + b, which simplifies to the formula for n + 1. Shortcut 2: If f(x) = x + k, then fⁿ(x) = x + nk. Shortcut 3: For f(x) = 1/x, fⁿ(x) = x when n is even and 1/x when n is odd. These patterns turn repeated-composition questions into arithmetic.

  • Linear iteration formula avoids repeated substitution.
  • Translation f(x) = x + k iterates to x + nk.
  • Reciprocal function alternates between x and 1/x.
  • Prove or recall the pattern before applying under time pressure.
fⁿ(x) = aⁿx + b(aⁿ − 1)/(a − 1), a ≠ 1

Domain and Range in Composites and Inverses

For f(g(x)), the domain is the set of x in dom(g) for which g(x) lies in dom(f). For f⁻¹, the domain equals the range of f and the range equals the domain of f. This swap is a frequent exam trap: if f(x) = √(x − 2), then dom(f) = [2, ∞) and range(f) = [0, ∞), so dom(f⁻¹) = [0, ∞). Always compute the original range before writing the inverse's domain.

  • Composite domain: x ∈ dom(g) and g(x) ∈ dom(f).
  • dom(f⁻¹) = range(f); range(f⁻¹) = dom(f).
  • Check restrictions such as denominators ≠ 0 and radicands ≥ 0.
  • State domains explicitly in written answers.

Exam Strategy and Time Management

In objective tests, prefer numeric substitution over full symbolic expansion when a specific value is asked. For symbolic composites, substitute in brackets and simplify only the needed part. For inverse questions, use the linear shortcut or swap-and-solve; verify with one value. For reverse problems, isolate the inner function immediately. For iteration, identify the pattern (linear, translation, reciprocal) and jump to the formula. Reserve full algebraic derivation for questions that explicitly demand proof.

  • Numeric question: evaluate inside-out, no expansion.
  • Symbolic question: bracket substitution, then simplify.
  • Inverse: swap-and-solve or linear shortcut.
  • Iteration: detect pattern, apply formula, verify with n = 1.

Worked examples

If f(x) = 2x + 3 and g(x) = x², find f(g(2)).
Show solution

Inner first: g(2) = 2² = 4. Then f(4) = 2(4) + 3 = 11.

11
If f(x) = x + 5 and g(x) = 3x, find g(f(x)) and f(g(x)).
Show solution

g(f(x)) = 3(x + 5) = 3x + 15. f(g(x)) = 3x + 5. They differ, confirming non-commutativity.

g(f(x)) = 3x + 15; f(g(x)) = 3x + 5
Find the inverse of f(x) = (2x − 1)/3.
Show solution

Write y = (2x − 1)/3. Swap: x = (2y − 1)/3.

Solve: 3x = 2y − 1, so y = (3x + 1)/2.

Check: f((3x + 1)/2) = (3x + 1 − 1)/3 = x.

f⁻¹(x) = (3x + 1)/2
If f(x) = 2x + 3 and f(g(x)) = 4x + 1, find g(x).
Show solution

Set 2g(x) + 3 = 4x + 1. Then 2g(x) = 4x − 2, so g(x) = 2x − 1. Verify: f(2x − 1) = 2(2x − 1) + 3 = 4x + 1.

g(x) = 2x − 1
If f(x) = 1/x, find f(f(f(x))).
Show solution

f(f(x)) = 1/(1/x) = x. Then f(f(f(x))) = f(x) = 1/x.

Since f is self-inverse, odd applications give f(x).

1/x
If f(x) = 3x + 2, find f²(x) and f³(x).
Show solution

f²(x) = 3(3x + 2) + 2 = 9x + 8. f³(x) = 3(9x + 8) + 2 = 27x + 26. Using the formula with a = 3, b = 2: f²(x) = 9x + 2(9 − 1)/2 = 9x + 8; f³(x) = 27x + 2(27 − 1)/2 = 27x + 26.

f²(x) = 9x + 8; f³(x) = 27x + 26
If f(x) = x² for x ≥ 0 and g(x) = √x, find f(g(x)) and g(f(x)).
Show solution

f(g(x)) = (√x)² = x for x ≥ 0. g(f(x)) = √(x²) = x since x ≥ 0. Both equal x, so f and g are inverses on this domain.

Both equal x; f and g are inverse functions on x ≥ 0
If f(x) = 2x + 1 and g(x) = x − 3, find (f∘g)⁻¹(x) using the reversal rule.
Show solution

f⁻¹(x) = (x − 1)/2 and g⁻¹(x) = x + 3. By the rule, (f∘g)⁻¹ = g⁻¹∘f⁻¹ = (x − 1)/2 + 3 = (x + 5)/2.

Check directly: f(g(x)) = 2(x − 3) + 1 = 2x − 5; its inverse is (x + 5)/2. Matches.

(f∘g)⁻¹(x) = (x + 5)/2

Common mistakes

  • Applying the outer function first: f(g(x)) means g first, not f first.
  • Forgetting brackets when substituting: writing x + 1² instead of (x + 1)².
  • Assuming f(g(x)) = g(f(x)); composition is not commutative.
  • Writing (f∘g)⁻¹ = f⁻¹∘g⁻¹ instead of the correct reversed order g⁻¹∘f⁻¹.
  • Ignoring domain restrictions, especially for even roots and denominators.
  • Claiming an inverse exists for a non-one-one function such as x² without restricting the domain.
  • Swapping x and y but forgetting to solve back for y.
  • Confusing f⁻¹(x) with 1/f(x); the superscript −1 denotes inverse, not reciprocal.

Frequently asked questions

What is the difference between f(g(x)) and f(x)·g(x)?

f(g(x)) is composition: the output of g becomes the input of f. f(x)·g(x) is multiplication of the two outputs. For f(x) = x + 1 and g(x) = x², f(g(x)) = x² + 1, while f(x)·g(x) = x³ + x². They are entirely different operations.

Is composition always commutative?

No. In general f(g(x)) ≠ g(f(x)). A single counterexample, such as f(x) = 2x + 3 and g(x) = x² at x = 1 giving 5 versus 25, proves they are not identical. Composition is associative, however: f(g(h(x))) can be bracketed either way.

When does a function have an inverse?

A function has an inverse exactly when it is bijective: one-one and onto its codomain. The horizontal-line test checks one-oneness graphically. If a function such as x² is not one-one on its full domain, restrict the domain (for example x ≥ 0) to make it invertible.

Does f⁻¹(x) mean 1/f(x)?

No. The superscript −1 in f⁻¹ denotes the inverse function, not the reciprocal. For f(x) = 2x, f⁻¹(x) = x/2, whereas 1/f(x) = 1/(2x). These are different functions with different domains.

How do I find g(x) when f(g(x)) is given?

Set f(g(x)) equal to the given expression and solve algebraically for g(x). For example, if f(x) = 2x + 3 and f(g(x)) = 4x + 1, then 2g(x) + 3 = 4x + 1, giving g(x) = 2x − 1. Always verify by recomposing.

What is a self-inverse function?

A function satisfying f(f(x)) = x, so f equals its own inverse. Examples are f(x) = 1/x, f(x) = −x, and f(x) = c − x. For such functions, an even number of applications returns x and an odd number returns f(x).

How do I handle domains in composite functions?

For f(g(x)), x must be in the domain of g, and g(x) must be in the domain of f. Intersect these conditions. For inverses, the domain of f⁻¹ equals the range of f, so compute the original range first.

What is the fastest way to compute repeated composition like f³(x)?

Detect the pattern. For f(x) = ax + b with a ≠ 1, use fⁿ(x) = aⁿx + b(aⁿ − 1)/(a − 1). For f(x) = x + k, use x + nk. For f(x) = 1/x, alternate between x and 1/x. Verify the formula with n = 1 before trusting it.

Practice this lesson ↓

Loading…