Loading…
Learn Composition & Inverse Functions in Mathematics step by step with concepts, examples, quick checks and revision for government exams.
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.
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.
| Aspect | f(g(x)) | g(f(x)) |
|---|---|---|
| First applied | g | f |
| Second applied | f | g |
| Example f = 2x+3, g = x² | 2x² + 3 | 4x² + 12x + 9 |
| Value at x = 1 | 5 | 25 |
| Generally equal? | No | No |
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.
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².
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.
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.
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.
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.
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.
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.
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.
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.
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.
Inner first: g(2) = 2² = 4. Then f(4) = 2(4) + 3 = 11.
g(f(x)) = 3(x + 5) = 3x + 15. f(g(x)) = 3x + 5. They differ, confirming non-commutativity.
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.
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.
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).
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(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.
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)) 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.
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.
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.
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.
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.
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).
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.
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.
Loading…