Educerie

Educerie · IB Diploma · Mathematics: analysis and approaches

IB Mathematics AA 2.5 · SL and HL

Composite and inverse functions

What happens when the output of one function becomes the input of another, and how do you build, by algebra, the function that undoes a function?

What you will learn

  • Understand that (f ∘ g)(x) = f(g(x)) means g acts first, and that the order changes the result.
  • Know that only a one-to-one function has an inverse, whose domain is the range of f.
  • Understand the identity function and that f(f⁻¹(x)) = f⁻¹(f(x)) = x, with f⁻¹ the reflection of f in y = x.
  • HL Know how to restrict a domain so an inverse exists, and what makes a function self-inverse.

You must be able to

  1. Find and simplify a composite function, and evaluate it at a number in the right order.
  2. Find f⁻¹(x) by algebra, including for a rational or restricted quadratic function, and state its domain.
  3. Solve an equation involving a composite function, keeping every valid root.
  4. Sketch the graph of f⁻¹ as the reflection of f in y = x, with key points swapped.
  5. Find unknown constants from composite information, or explain why a composite or inverse does not exist.
  6. HL Find the largest domain on which a function has an inverse, and show that a function is self-inverse.

In the exam. Paper 1 Section A, very often, as "find (f∘g)(x)(f \circ g)(x)", "find f−1(x)f^{-1}(x)" or "solve (f∘g)(x)=k(f \circ g)(x) = k", typically 5 to 7 marks over three parts. It also opens Section B questions, where later parts sketch ff and f−1f^{-1}, and the chain rule in 5.6 is built on these chains. Paper 2 uses them in conversion and pricing contexts. The command words are mostly Find and Write down, with a steady supply of Show that, Sketch and State.

1Composite functions

Figure 1 shows a composite as two machines in a row, for f(x)=2x+1f(x) = 2x + 1 and g(x)=x2g(x) = x^{2}.

Figure 1 · f ∘ g means g first, then f 3 g square it 9 g(3) f double, add 1 19 f(g(3)) f(x) = 2x + 1, g(x) = x², (f ∘ g)(x) = 2x² + 1 (f ∘ g)(3) = f(g(3)) = f(9) = 19. The function written nearest the x acts first.
Figure 1 · f ∘ g means g first, then f

(f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)): gg acts first, then ff. Read it as a bracket, from the inside out.

At a number. Do the inner function, write the middle value down, then do the outer one.

(f∘g)(3)=f(g(3))(f \circ g)(3) = f(g(3))g(3)=9inside firstg(3) = 9 \qquad \textcolor{#838c91}{\text{inside first}}f(9)=2(9)+1=19f(9) = 2(9) + 1 = 19

As an expression. Put the whole inner function, in brackets, wherever the outer function has an xx.

(f∘g)(x)=f(x2)=2x2+1(f \circ g)(x) = f(x^{2}) = 2x^{2} + 1(g∘f)(x)=g(2x+1)=(2x+1)2=4x2+4x+1(g \circ f)(x) = g(2x + 1) = (2x + 1)^{2} = 4x^{2} + 4x + 1

Test it: 2(3)2+1=192(3)^{2} + 1 = 19, as before.

Order matters

  • Figure 2 sends the same input through both orders. (f∘g)(3)=19(f \circ g)(3) = 19 but (g∘f)(3)=72=49(g \circ f)(3) = 7^{2} = 49.
  • A question that asks for one will not accept the other.
Figure 2 · Swap the order and the answer changes 3 g square it 9 f double, add 1 19 (f ∘ g)(3) = 19 3 f double, add 1 7 g square it 49 (g ∘ f)(3) = 49 f ∘ g and g ∘ f are different functions: 2x² + 1 and (2x + 1)². Order is read from the right.
Figure 2 · Swap the order and the answer changes

A function with itself. (h∘h)(x)=h(h(x))(h \circ h)(x) = h(h(x)). For h(x)=3x−4h(x) = 3x - 4, (h∘h)(x)=3(3x−4)−4=9x−16(h \circ h)(x) = 3(3x - 4) - 4 = 9x - 16.

From a table or a graph

  • With no formula, look up the inner function's output, then use it as the input of the outer one.
    • (p∘q)(2)(p \circ q)(2): q(2)=1q(2) = 1, then p(1)=5p(1) = 5. The answer is 5.
    • (q∘p)(4)(q \circ p)(4): p(4)=2p(4) = 2, then q(2)=1q(2) = 1. The answer is 1.
xx1234
p(x)p(x)50−1-12
q(x)q(x)3142
  • On graphs, read the height of the inner curve. Use that height as a position on the xx-axis of the outer one.

With a GDC (Paper 2). Store ff and gg separately. Enter f(g(x))f(g(x)) as a third function, and sketch or analyse that.

Solving an equation with a composite

  • Build the composite first, then solve as usual, and keep every root. Take f(x)=5−2xf(x) = 5 - 2x and g(x)=x2+1g(x) = x^{2} + 1.
(f∘g)(x)=5−2(x2+1)=3−2x2(f \circ g)(x) = 5 - 2(x^{2} + 1) = 3 - 2x^{2}3−2x2=−93 - 2x^{2} = -9x2=6x^{2} = 6x=±6x = \pm\sqrt{6}
  • Both roots work because gg squares away the sign.

Finding unknown constants

  • If a function holds letters, build the composite with the letters in. Then turn each given value into an equation.
  • Let f(x)=4x−1f(x) = 4x - 1 and g(x)=ax+bg(x) = ax + b, with (f∘g)(2)=27(f \circ g)(2) = 27 and (g∘f)(1)=10(g \circ f)(1) = 10.
(f∘g)(2)=4(2a+b)−1=27⇒2a+b=7(f \circ g)(2) = 4(2a + b) - 1 = 27 \Rightarrow 2a + b = 7(g∘f)(1)=g(3)=3a+b=10(g \circ f)(1) = g(3) = 3a + b = 10a=3,b=1a = 3, \quad b = 1
  • Check: g(x)=3x+1g(x) = 3x + 1, so f(g(2))=f(7)=27f(g(2)) = f(7) = 27 and g(f(1))=g(3)=10g(f(1)) = g(3) = 10.

Finding a missing function

  • Suppose gg and (g∘f)(x)(g \circ f)(x) are known and ff is linear. Write f(x)=ax+bf(x) = ax + b, expand, and equate coefficients.
  • Let g(x)=x2−6xg(x) = x^{2} - 6x and (g∘f)(x)=4x2−8x−5(g \circ f)(x) = 4x^{2} - 8x - 5.
(ax+b)2−6(ax+b)=a2x2+(2ab−6a)x+b2−6b(ax + b)^{2} - 6(ax + b) = a^{2}x^{2} + (2ab - 6a)x + b^{2} - 6ba2=4so a=2 or a=−2a^{2} = 4 \qquad \textcolor{#838c91}{\text{so }a = 2\text{ or }a = -2}b2−6b=−5(b−1)(b−5)=0, so b=1 or b=5b^{2} - 6b = -5 \qquad \textcolor{#838c91}{(b - 1)(b - 5) = 0\text{, so }b = 1\text{ or }b = 5}2ab−6a=−8a(b−3)=−4: decides which pairs survive2ab - 6a = -8 \qquad \textcolor{#838c91}{a(b - 3) = -4\text{: decides which pairs survive}}
  • Of the four pairs, only a=2,b=1a = 2, b = 1 and a=−2,b=5a = -2, b = 5 satisfy the middle equation. There are two functions, f(x)=2x+1f(x) = 2x + 1 and f(x)=5−2xf(x) = 5 - 2x.

2Domain, range and taking a composite apart

The output of gg becomes the input of ff. So it must be a number ff is allowed to take. For xx to be in the domain of f∘gf \circ g, two things must hold:

  • xx is in the domain of gg.
  • g(x)g(x) is in the domain of ff.

Let f(x)=1xf(x) = \dfrac{1}{x} (x≠0x \ne 0) and g(x)=2x−5g(x) = 2x - 5.

  • (f∘g)(x)=12x−5(f \circ g)(x) = \dfrac{1}{2x - 5}. The inner result 2x−52x - 5 must not be 0, so the domain is x≠52x \ne \tfrac{5}{2}.
  • (g∘f)(x)=2x−5(g \circ f)(x) = \dfrac{2}{x} - 5. Now ff goes first and needs x≠0x \ne 0. Domain x≠0x \ne 0.

Simplifying can hide a restriction

  • Take p(x)=x2p(x) = x^{2} and q(x)=5−xq(x) = \sqrt{5 - x}. Then (p∘q)(x)=(5−x)2=5−x(p \circ q)(x) = (\sqrt{5 - x})^{2} = 5 - x, which looks fine for every xx. But qq needs x≤5x \le 5.
  • State the domain from the original functions, before simplifying.

Range

  • Find it last, from the outputs of the inner function that actually reach the outer one.
  • Example: f(x)=xf(x) = \sqrt{x} and g(x)=6−x2g(x) = 6 - x^{2}. The domain of f∘gf \circ g needs 6−x2≥06 - x^{2} \ge 0, so −6≤x≤6-\sqrt{6} \le x \le \sqrt{6}.
    • The inner output runs from 0 up to 6. So 6−x2\sqrt{6 - x^{2}} runs from 0 to 6\sqrt{6}, and the range is 0≤y≤60 \le y \le \sqrt{6}.

Why a composite does not exist at a point

  • Here g(3)=−3g(3) = -3, outside the domain of  \sqrt{\ }, so (f∘g)(3)(f \circ g)(3) does not exist.
  • The reason to write: the inner output lies outside the domain of the outer function.

Taking a composite apart

  • m(x)=x2+1m(x) = \sqrt{x^{2} + 1} is "square, add 1, then take the root". So m=f∘gm = f \circ g, with inner g(x)=x2+1g(x) = x^{2} + 1 and outer f(x)=xf(x) = \sqrt{x}.
  • The chain rule in 5.6 starts from exactly this.

In context

  • A car uses 0.07 litres per kilometre, and fuel costs 1.80 euros a litre. Let g(d)=0.07dg(d) = 0.07d (distance to litres) and f(L)=1.8Lf(L) = 1.8L (litres to euros).
  • The composite (f∘g)(d)=0.126d(f \circ g)(d) = 0.126d turns distance straight into cost, so 200 km costs 25.20 euros. The units force the order: ff expects litres, so gg runs first.

3The identity function and what an inverse really is

The identity function changes nothing: I(x)=xI(x) = x. Composing with it changes no function. Its graph is the line y=xy = x.

(f∘f−1)(x)=(f−1∘f)(x)=x(f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x

That is the definition of an inverse as algebra. It doubles as a check: compose your answer with ff and simplify. If you do not get xx, the inverse is wrong. For f(x)=2x−53f(x) = \dfrac{2x - 5}{3} the inverse is f−1(x)=3x+52f^{-1}(x) = \dfrac{3x + 5}{2}, and

(f∘f−1)(x)=2⋅3x+52−53=3x+5−53=x ✓(f \circ f^{-1})(x) = \frac{2 \cdot \dfrac{3x + 5}{2} - 5}{3} = \frac{3x + 5 - 5}{3} = x \ \checkmark(f−1∘f)(x)=3⋅2x−53+52=2x−5+52=x ✓(f^{-1} \circ f)(x) = \frac{3 \cdot \dfrac{2x - 5}{3} + 5}{2} = \frac{2x - 5 + 5}{2} = x \ \checkmark

4Which functions have an inverse

  • An inverse must send each output back to exactly one input. So ff needs to be one-to-one = no two inputs share an output. If two do, ff is many-to-one and has no inverse.
    • On a graph, no horizontal line may meet the curve twice (the horizontal line test from 2.2).
  • The standard reason to give is a pair of inputs with the same output.
  • Example: f(x)=x2−4xf(x) = x^{2} - 4x has f(1)=f(3)=−3f(1) = f(3) = -3. So it is many-to-one on R\mathbb{R} and f−1f^{-1} does not exist.

5Finding the inverse by algebra

The inverse undoes the steps of ff in reverse order. Figure 3 shows it for f(x)=4x−7f(x) = 4x - 7. ff multiplies by 4 and then subtracts 7, so f−1f^{-1} adds 7 and then divides by 4.

Figure 3 · The inverse undoes each step in reverse order x step 1 × 4 4x step 2 − 7 4x − 7 f(x) = 4x − 7 x undo 2 + 7 x + 7 undo 1 ÷ 4 (x + 7)/4 f⁻¹(x) = (x + 7)/4, read right to left f multiplies by 4 then subtracts 7. f⁻¹ adds 7 then divides by 4. Together they return x unchanged.
Figure 3 · The inverse undoes each step in reverse order

For longer functions use algebra:

To find f−1(x)f^{-1}(x): write y=f(x)y = f(x), swap xx and yy, then make yy the subject.

Swapping is the algebra of reflecting in y=xy = x: every point (a,b)(a, b) becomes (b,a)(b, a). You may rearrange first and swap last, but never skip the swap.

Domain of f−1f^{-1} = range of ff. Range of f−1f^{-1} = domain of ff.

Example 1 · linear. f(x)=4x−7f(x) = 4x - 7.

x=4y−7swapx = 4y - 7 \qquad \textcolor{#838c91}{\text{swap}}y=x+74y = \frac{x + 7}{4}f−1(x)=x+74f^{-1}(x) = \frac{x + 7}{4}

Example 2 · rational. f(x)=2x+3x−1f(x) = \dfrac{2x + 3}{x - 1}, x≠1x \ne 1. The move to learn: collect every yy term on one side and factorise yy out.

x=2y+3y−1swapx = \frac{2y + 3}{y - 1} \qquad \textcolor{#838c91}{\text{swap}}x(y−1)=2y+3clear the denominatorx(y - 1) = 2y + 3 \qquad \textcolor{#838c91}{\text{clear the denominator}}xy−2y=x+3every y term on the leftxy - 2y = x + 3 \qquad \textcolor{#838c91}{\text{every }y\text{ term on the left}}y(x−2)=x+3factorisey(x - 2) = x + 3 \qquad \textcolor{#838c91}{\text{factorise}}f−1(x)=x+3x−2,x≠2f^{-1}(x) = \frac{x + 3}{x - 2}, \quad x \ne 2
  • The range of ff is every real number except 2 (its horizontal asymptote). So the domain of f−1f^{-1} is x≠2x \ne 2, matching the denominator.
  • Figure 4 shows the reflection. ff has asymptotes x=1x = 1 and y=2y = 2, and f−1f^{-1} has x=2x = 2 and y=1y = 1.
Figure 4 · The inverse swaps the asymptotes x y −4 −2 2 4 6 8 −4 −2 2 4 6 8 f f⁻¹ y = 2 y = 1 x = 1 x = 2 y = x f(x) = (2x + 3)/(x − 1) has asymptotes x = 1, y = 2. Its inverse (x + 3)/(x − 2) has x = 2, y = 1.
Figure 4 · The inverse swaps the asymptotes

Example 3 · a restricted quadratic. f(x)=(x−3)2+1f(x) = (x - 3)^{2} + 1, x≥3x \ge 3. The square root brings a ±\pm, and the domain of ff chooses.

x=(y−3)2+1swapx = (y - 3)^{2} + 1 \qquad \textcolor{#838c91}{\text{swap}}y−3=±x−1y - 3 = \pm\sqrt{x - 1}y=3+x−1range of f−1 is y≥3, so take +y = 3 + \sqrt{x - 1} \qquad \textcolor{#838c91}{\text{range of }f^{-1}\text{ is }y \ge 3\text{, so take }+}f−1(x)=3+x−1,x≥1f^{-1}(x) = 3 + \sqrt{x - 1}, \quad x \ge 1
  • The vertex (3,1)(3, 1) gives the range of ff as f(x)≥1f(x) \ge 1, which is the domain of f−1f^{-1}. The minus root would give values below 3.
  • Figure 5 draws both graphs. They meet on y=xy = x, where f(x)=xf(x) = x:
(x−3)2+1=x(x - 3)^{2} + 1 = xx2−7x+10=0x^{2} - 7x + 10 = 0x=5x=2 lies outside x≥3x = 5 \qquad \textcolor{#838c91}{x = 2\text{ lies outside }x \ge 3}
Figure 5 · A restricted quadratic and its inverse x y 1 3 5 7 1 3 5 7 (3, 1) (1, 3) (5, 5) f f⁻¹ y = x left half removed: not one-to-one f(x) = (x − 3)² + 1, x ≥ 3, and f⁻¹(x) = 3 + √(x − 1), x ≥ 1. They meet on y = x, at (5, 5).
Figure 5 · A restricted quadratic and its inverse
  • For an increasing function, ff and f−1f^{-1} can only meet on y=xy = x. So solving f(x)=xf(x) = x finds every intersection.
    • If it has no real roots (a negative discriminant, for a quadratic), the graphs do not meet.

Example 4 · exponential and root

  • f(x)=5x+2f(x) = 5^{x} + 2. Swap: x=5y+2x = 5^{y} + 2, so 5y=x−25^{y} = x - 2 and y=log⁡5(x−2)y = \log_{5}(x - 2). Since 5x>05^{x} > 0, the range of ff is f(x)>2f(x) > 2. So f−1(x)=log⁡5(x−2)f^{-1}(x) = \log_{5}(x - 2), x>2x > 2.
  • A root works the same way. Take f(x)=2x−3f(x) = \sqrt{2x - 3}, x≥1.5x \ge 1.5. Swap to x=2y−3x = \sqrt{2y - 3}, then square: x2=2y−3x^{2} = 2y - 3. So f−1(x)=x2+32f^{-1}(x) = \dfrac{x^{2} + 3}{2}.
    • Its domain is x≥0x \ge 0, the range of ff, though the formula would accept any xx.

Sketching f−1f^{-1}

  • Draw ff and y=xy = x (dashed). Swap the coordinates of every key point: intercepts, end-points of a restricted graph, turning points. An asymptote y=cy = c becomes x=cx = c.
  • Use equal scales on both axes so the two curves look like mirror images.

6Restricting a domain (HL)

  • When ff is not one-to-one, cut the domain at a turning point.
  • Example: g(x)=x2+6x=(x+3)2−9g(x) = x^{2} + 6x = (x + 3)^{2} - 9 has its vertex at x=−3x = -3, and g(−5)=g(−1)=−5g(-5) = g(-1) = -5 shows the clash. On x≥−3x \ge -3 the function is increasing, so it has an inverse.
    • The least kk for which gg has an inverse on x≥kx \ge k is k=−3k = -3.
    • The left half works equally: the greatest kk for which it has an inverse on x≤kx \le k is also −3-3.
  • For a function that is not a quadratic, sketch it and use the turning points. For x≥kx \ge k use the one with the largest xx-coordinate. For x≤kx \le k use the one with the smallest.
  • Example: the cubic h(x)=x3−3x2−24xh(x) = x^{3} - 3x^{2} - 24x has turning points at x=−2x = -2 and x=4x = 4. Read them off a GDC sketch, or, once you have met differentiation, from h′(x)=3(x+2)(x−4)h'(x) = 3(x + 2)(x - 4). It has an inverse on x≥4x \ge 4 (least k=4k = 4) and on x≤−2x \le -2 (greatest k=−2k = -2).
  • For a reason, say the function is one-to-one up to the turning point and fails the horizontal line test beyond it. At SL the restriction is given to you, as in Example 3.

7Self-inverse functions (HL)

A function is self-inverse if f−1(x)=f(x)f^{-1}(x) = f(x), which is the same as f(f(x))=xf(f(x)) = x. Its graph is symmetric in y=xy = x.

  • The identity is self-inverse.
  • f(x)=c−xf(x) = c - x for any constant cc is self-inverse.
  • f(x)=kxf(x) = \dfrac{k}{x} is self-inverse.
  • A line f(x)=mx+cf(x) = mx + c is self-inverse only for m=−1m = -1 or for the identity, since f(f(x))=m2x+mc+cf(f(x)) = m^{2}x + mc + c.

To show it for any other function, work out f(f(x))f(f(x)) and simplify to xx. Take f(x)=5x−2x−5f(x) = \dfrac{5x - 2}{x - 5}, x≠5x \ne 5.

f(f(x))=5(5x−2x−5)−25x−2x−5−5=25x−10−2x+10x−55x−2−5x+25x−5=23x23=x ✓\begin{aligned}f(f(x)) &= \frac{5\left(\dfrac{5x - 2}{x - 5}\right) - 2}{\dfrac{5x - 2}{x - 5} - 5} \\[6pt] &= \frac{\dfrac{25x - 10 - 2x + 10}{x - 5}}{\dfrac{5x - 2 - 5x + 25}{x - 5}} \\[6pt] &= \frac{23x}{23} = x \ \checkmark\end{aligned}

Any fraction ax+bcx−a\dfrac{ax + b}{cx - a} that is not a constant is self-inverse. The xx-coefficient on top is minus the constant in the denominator.

8Using inverses without finding a formula

f−1f^{-1} at one value

  • f−1(k)f^{-1}(k) is the input that gives output kk, so solve f(x)=kf(x) = k.
  • Example: for f(x)=3x−1x+2f(x) = \dfrac{3x - 1}{x + 2}, finding f−1(5)f^{-1}(5) means 3x−1=5(x+2)3x - 1 = 5(x + 2), so x=−112x = -\tfrac{11}{2}. Check: f(−112)=−17.5−3.5=5f\left(-\tfrac{11}{2}\right) = \dfrac{-17.5}{-3.5} = 5.
    • A mixed composite is still inside-out. With g(x)=x2g(x) = x^{2}, (f−1∘g)(2)=f−1(4)(f^{-1} \circ g)(2) = f^{-1}(4), and 3x−1=4(x+2)3x - 1 = 4(x + 2) gives −9-9.

The inverse of a composite

  • To undo "gg, then ff", undo ff first and gg second. You take off shoes before socks:
(f∘g)−1=g−1∘f−1(f \circ g)^{-1} = g^{-1} \circ f^{-1}
  • Take f(x)=5xf(x) = 5x and g(x)=x−3g(x) = x - 3. Then (f∘g)(x)=5x−15(f \circ g)(x) = 5x - 15, whose inverse is x+155\dfrac{x + 15}{5}.
    • By the rule, f−1(x)=x5f^{-1}(x) = \dfrac{x}{5} and g−1(x)=x+3g^{-1}(x) = x + 3. So (g−1∘f−1)(x)=x5+3(g^{-1} \circ f^{-1})(x) = \dfrac{x}{5} + 3, the same thing. The other order, x+35\dfrac{x + 3}{5}, is not.
  • In the fuel example, the inverse of 0.126d0.126d is x0.126\dfrac{x}{0.126}, so 18.90 euros buys 150 km.
  • You often need one value only. (f∘g)−1(a)=4(f \circ g)^{-1}(a) = 4 says the composite sends 4 to aa. So a=(f∘g)(4)=5(4)−15=5a = (f \circ g)(4) = 5(4) - 15 = 5. Check: 5+155=4\dfrac{5 + 15}{5} = 4.

Practice questions

54 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.