Login

Concepts

Read through concept notes with worked explanations and diagrams, chapter by chapter.

Concept 07 / 10Sets, Relations and Functions

Composition of Functions and Inverse Functions

How gof is formed and what its domain really is, why composition is associative but not commutative, when an inverse exists, how to compute it, the reflection of graphs in y = x, and solving f(x) = f^-1(x) correctly.

Figure 1
Composition means feeding the output of one function into another. If f:A→Bf : A \to B and g:B→Cg : B \to C, then g∘f:A→Cg \circ f : A \to C is defined by (g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x)). Read it right to left: apply ff first, then gg. The composite makes sense for an input xx only if f(x)f(x) lands inside the domain of gg. So for real functions given by formulas, dom(g∘f)={x∈domf:f(x)∈domg}\text{dom}(g \circ f) = \{x \in \text{dom} f : f(x) \in \text{dom} g\}. It is a serious mistake to find the domain by simplifying the formula for g(f(x))g(f(x)) first. For f(x)=xf(x) = \sqrt{x} and g(x)=x2g(x) = x^{2}, the formula g(f(x))=(x)2=xg(f(x)) = (\sqrt{x})^{2} = x looks as though it is defined everywhere, but g∘fg \circ f is only defined for x≥0x \ge 0, because ff is. Algebraic properties. Composition is associative: h∘(g∘f)=(h∘g)∘fh \circ (g \circ f) = (h \circ g) \circ f, since both mean 'apply ff, then gg, then hh'. It is not commutative: with f(x)=x+1f(x) = x + 1 and g(x)=2xg(x) = 2x, g(f(x))=2x+2g(f(x)) = 2x + 2 while f(g(x))=2x+1f(g(x)) = 2x + 1. The identity function I(x)=xI(x) = x is neutral: f∘I=I∘f=ff \circ I = I \circ f = f. Properties carry through composition: the composite of two one-one functions is one-one, and of two onto functions is onto. Partial converses: if g∘fg \circ f is one-one then ff must be one-one, and if g∘fg \circ f is onto then gg must be onto. These are the favourite true/false options in JEE multiple-correct questions. Inverse functions. The inverse of f:A→Bf : A \to B is a function f−1:B→Af^{-1} : B \to A that undoes ff: f−1(f(x))=xf^{-1}(f(x)) = x for all x∈Ax \in A and f(f−1(y))=yf(f^{-1}(y)) = y for all y∈By \in B. For f−1f^{-1} to be a function on all of BB, each y∈By \in B needs exactly one pre-image. 'At least one' is onto-ness and 'at most one' is one-one-ness, so ff has an inverse if and only if it is a bijection. The inverse is then unique and is itself a bijection, with (f−1)−1=f(f^{-1})^{-1} = f. For a composition, (g∘f)−1=f−1∘g−1(g \circ f)^{-1} = f^{-1} \circ g^{-1}: to undo 'put on socks, then shoes', you take off the shoes first. Computing the inverse: write y=f(x)y = f(x), solve for xx in terms of yy, then rename the variable. For f(x)=2x+3x−1f(x) = \frac{2x + 3}{x - 1} from R−{1}\mathbb{R} - \{1\} to R−{2}\mathbb{R} - \{2\}: y(x−1)=2x+3y(x - 1) = 2x + 3 gives x=y+3y−2x = \frac{y + 3}{y - 2}, so f−1(x)=x+3x−2f^{-1}(x) = \frac{x + 3}{x - 2}. When the function is not one-one on its natural domain, restrict the domain to a piece where it is monotonic and take the inverse there. This is exactly how x\sqrt{x} inverts x2x^{2} on [0,∞)[0, \infty), and how the inverse trigonometric functions are defined. Graphs. The point (a,b)(a, b) lies on the graph of ff exactly when (b,a)(b, a) lies on the graph of f−1f^{-1}, and swapping coordinates is reflection in the line y=xy = x. So the graph of f−1f^{-1} is the mirror image of the graph of ff in y=xy = x, as shown for exe^{x} and ln⁡x\ln x: the point (0,1)(0, 1) on one matches (1,0)(1, 0) on the other. Consequently the domain and range swap, and at mirrored points the slopes are reciprocals: (f−1)′(f(a))=1f′(a)(f^{-1})'(f(a)) = \frac{1}{f'(a)}. Solving f(x)=f−1(x)f(x) = f^{-1}(x). If ff is strictly increasing, the two graphs can meet only on the line y=xy = x, so the equation reduces to f(x)=xf(x) = x. Proof: suppose f(a)=bf(a) = b with b>ab > a, and let c=f−1(a)c = f^{-1}(a), so f(c)=af(c) = a. Then f(c)=a<b=f(a)f(c) = a < b = f(a), and since ff is increasing this forces c<ac < a. So f−1(a)=c<a<b=f(a)f^{-1}(a) = c < a < b = f(a), and f(a)≠f−1(a)f(a) \neq f^{-1}(a). The case b<ab < a is symmetric. If ff is decreasing, this shortcut fails: the graphs can also meet off the line y=xy = x, at pairs of points symmetric about it. Brain-Teaser 3 shows this happening. Key Takeaways: - (g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x)): apply ff first. dom(g∘f)={x∈domf:f(x)∈domg}\text{dom}(g \circ f) = \{x \in \text{dom} f : f(x) \in \text{dom} g\}. - Composition is associative but not commutative. - g∘fg \circ f one-one ⇒f\Rightarrow f one-one; g∘fg \circ f onto ⇒g\Rightarrow g onto. - f−1f^{-1} exists   ⟺  f\iff f is bijective; (g∘f)−1=f−1∘g−1(g \circ f)^{-1} = f^{-1} \circ g^{-1}. - The graph of f−1f^{-1} is the reflection of the graph of ff in y=xy = x; domain and range swap. - For increasing ff: f(x)=f−1(x)  ⟺  f(x)=xf(x) = f^{-1}(x) \iff f(x) = x. Not valid for decreasing ff. - f∘f−1=If \circ f^{-1} = I on the codomain, and f−1∘f=If^{-1} \circ f = I on the domain; these are different identity maps when A≠BA \neq B. - Pitfall: finding the domain of a composite from its simplified formula. Brain-Teaser 1: Let f(x)=x2f(x) = x^{2} and g(x)=xg(x) = \sqrt{x}. Find f∘gf \circ g and g∘fg \circ f with their domains. Are they the same function? Solution: (f∘g)(x)=(x)2=x(f \circ g)(x) = (\sqrt{x})^{2} = x, defined only where gg is, so x≥0x \ge 0. (g∘f)(x)=x2=∣x∣(g \circ f)(x) = \sqrt{x^{2}} = |x|, defined for all real xx, since x2≥0x^{2} \ge 0 always. These are different functions: different domains, and different values would appear if both were defined at negative xx. The key fact is x2=∣x∣\sqrt{x^{2}} = |x|, not xx. The square root always returns the non-negative root, so it undoes squaring only for non-negative inputs. Brain-Teaser 2: Let f:[1,∞)→[1,∞)f : [1, \infty) \to [1, \infty) be f(x)=x2−2x+2f(x) = x^{2} - 2x + 2. Find f−1f^{-1} and solve f(x)=f−1(x)f(x) = f^{-1}(x). Solution: Write f(x)=(x−1)2+1f(x) = (x - 1)^{2} + 1. On [1,∞)[1, \infty) it is increasing, and its range is [1,∞)[1, \infty), so it is a bijection. Solving y=(x−1)2+1y = (x - 1)^{2} + 1 with x≥1x \ge 1 gives x=1+y−1x = 1 + \sqrt{y - 1}, so f−1(x)=1+x−1f^{-1}(x) = 1 + \sqrt{x - 1}. Because ff is increasing, f(x)=f−1(x)f(x) = f^{-1}(x) reduces to f(x)=xf(x) = x: x2−3x+2=0x^{2} - 3x + 2 = 0, so x=1x = 1 or x=2x = 2. Check: f(2)=2f(2) = 2 and f−1(2)=1+1=2f^{-1}(2) = 1 + 1 = 2. Solving (x−1)2+1=1+x−1(x - 1)^{2} + 1 = 1 + \sqrt{x - 1} directly would also work, but it leads to a quartic; the monotonicity shortcut turns it into a quadratic. Brain-Teaser 3: Let f(x)=−x3f(x) = -x^{3} on R\mathbb{R}. Solve f(x)=f−1(x)f(x) = f^{-1}(x). Why does the f(x)=xf(x) = x shortcut fail here? Solution: ff is a strictly decreasing bijection with f−1(x)=−x1/3f^{-1}(x) = -x^{1/3}. The equation −x3=−x1/3-x^{3} = -x^{1/3} gives x9=xx^{9} = x, so x(x8−1)=0x(x^{8} - 1) = 0, and x=0,1,−1x = 0, 1, -1. At x=1x = 1, f(1)=−1=f−1(1)f(1) = -1 = f^{-1}(1), so the graphs meet at (1,−1)(1, -1), which is not on y=xy = x. Similarly they meet at (−1,1)(-1, 1). Meanwhile f(x)=xf(x) = x gives only x=0x = 0, so the shortcut would have lost two solutions. For a decreasing function, reflecting the graph in y=xy = x can create crossing points that come in mirror pairs, (a,b)(a, b) and (b,a)(b, a). The shortcut depended on monotonic increase, which is why the hypothesis matters.