A composite function applies the inner function first
Composite functions and inverse functions are on the Higher tier only. A function is a rule that turns an input into an output, and a composite function uses the output of one function as the input of another.
Composite function
A composite function such as fg(x)=f(g(x)){fg(x) = f(g(x))}fg(x)=f(g(x)) applies two functions in succession, g{g}g first and then f{f}f to its output.
Swapping the order of f{f}f and g{g}g changes the output from 19 to 49.
For a composite at a number, work out the inner function first, then put its value into the outer function.
A composite at a number
f(x)=x2−5{f(x) = x^2 - 5}f(x)=x2−5 and h(x)=4−3x.{h(x) = 4 - 3x\text{.}}h(x)=4−3x. Work out fh(2).{fh(2)\text{.}}fh(2).
- h{h}h is the inner function, so work out h(2)=4−3×2=−2{h(2) = 4 - 3 \times 2 = -2}h(2)=4−3×2=−2 first.
- Substitute −2{-2}−2 into f{f}f in a bracket, so fh(2)=f(−2)=(−2)2−5=4−5=−1.fh(2) = f(-2) = (-2)^2 - 5 = 4 - 5 = -1\text{.}fh(2)=f(−2)=(−2)2−5=4−5=−1.
The bracket matters, because (−2)2=4{(-2)^2 = 4}(−2)2=4 but −22=−4.{-2^2 = -4\text{.}}−22=−4.
Wrong. With f(x)=x+6{f(x) = x + 6}f(x)=x+6 and g(x)=2x,{g(x) = 2x\text{,}}g(x)=2x, fg(5)=f(5)×g(5)=11×10=110.fg(5) = f(5) \times g(5) = 11 \times 10 = 110\text{.}fg(5)=f(5)×g(5)=11×10=110.
Right. fg(5){fg(5)}fg(5) is a chain, not a product. Work out g(5)=2×5=10{g(5) = 2 \times 5 = 10}g(5)=2×5=10 first, then fg(5)=f(10)=10+6=16.fg(5) = f(10) = 10 + 6 = 16\text{.}fg(5)=f(10)=10+6=16.
An inverse function takes each output back to its input
The inverse function f−1{f^{-1}}f−1 undoes f,{f\text{,}}f, taking each output back to the input that made it.
Inverse function
The inverse function f−1{f^{-1}}f−1 reverses f,{f\text{,}}f, so if f(a)=b{f(a) = b}f(a)=b then f−1(b)=a.{f^{-1}(b) = a\text{.}}f−1(b)=a.
The output 14 goes back to the input 4 because each step is undone in reverse order.
Wrong. With f(x)=5x−2,{f(x) = 5x - 2\text{,}}f(x)=5x−2, f−1(8)=1f(8)=138.{f^{-1}(8) = \dfrac{1}{f(8)} = \dfrac{1}{38}\text{.}}f−1(8)=f(8)1=381.
Right. The −1{-1}−1 in f−1{f^{-1}}f−1 means the inverse, not the reciprocal 1f(x).{\dfrac{1}{f(x)}\text{.}}f(x)1. f−1(8){f^{-1}(8)}f−1(8) is the input that f{f}f turns into 8, so solve 5x−2=8,{5x - 2 = 8\text{,}}5x−2=8, giving x=2.{x = 2\text{.}}x=2.
To find f−1(x){f^{-1}(x)}f−1(x) when x{x}x appears once in f(x),{f(x)\text{,}}f(x), make x{x}x the subject of y=f(x),{y = f(x)\text{,}}y=f(x), as in the guide Changing the Subject of a Formula:
- Write y=f(x).{y = f(x)\text{.}}y=f(x).
- Undo the operations on x{x}x one at a time, the last operation first, doing the same to both sides.
- Write the answer as f−1(x)=…,{f^{-1}(x) = \ldots\mathclose{\text{,}}}f−1(x)=…, with x{x}x in place of y.{y\text{.}}y.
The inverse of a fraction
f(x)=2x−75.{f(x) = \dfrac{2x - 7}{5}\text{.}}f(x)=52x−7. Find f−1(x){f^{-1}(x)}f−1(x) and f−1(3).{f^{-1}(3)\text{.}}f−1(3).
- Write y=2x−75.{y = \dfrac{2x - 7}{5}\text{.}}y=52x−7.
- Dividing by 5 was the last operation, so multiply both sides by 5, giving 5y=2x−7.{5y = 2x - 7\text{.}}5y=2x−7.
- Add 7, then divide by 2, giving x=5y+72.{x = \dfrac{5y + 7}{2}\text{.}}x=25y+7.
- Replace y{y}y with x,{x\text{,}}x, so f−1(x)=5x+72.{f^{-1}(x) = \dfrac{5x + 7}{2}\text{.}}f−1(x)=25x+7.
- f−1(3)=5×3+72=222=11.f^{-1}(3) = \dfrac{5 \times 3 + 7}{2} = \dfrac{22}{2} = 11\text{.}f−1(3)=25×3+7=222=11. Check that f(11)=22−75=3.{f(11) = \dfrac{22 - 7}{5} = 3\text{.}}f(11)=522−7=3.
To show that f−1(a)=b,{f^{-1}(a) = b\text{,}}f−1(a)=b, show that f(b)=a,{f(b) = a\text{,}}f(b)=a, as f(11)=3{f(11) = 3}f(11)=3 shows f−1(3)=11.{f^{-1}(3) = 11\text{.}}f−1(3)=11. It needs no rearranging.
When f(x){f(x)}f(x) contains a square root, get the root on its own, then square both sides.
The inverse with a square root
g(x)=4+x−1.{g(x) = 4 + \sqrt{x - 1}\text{.}}g(x)=4+x−1. Find g−1(x).{g^{-1}(x)\text{.}}g−1(x).
- Write y=4+x−1{y = 4 + \sqrt{x - 1}}y=4+x−1 and subtract 4, giving y−4=x−1.{y - 4 = \sqrt{x - 1}\text{.}}y−4=x−1.
- Square both sides, giving (y−4)2=x−1.{(y - 4)^2 = x - 1\text{.}}(y−4)2=x−1.
- Add 1, so x=(y−4)2+1{x = (y - 4)^2 + 1}x=(y−4)2+1 and g−1(x)=(x−4)2+1.{g^{-1}(x) = (x - 4)^2 + 1\text{.}}g−1(x)=(x−4)2+1.
When x{x}x appears twice, as in f(x)=x+1x−3,{f(x) = \frac{x + 1}{x - 3}\text{,}}f(x)=x−3x+1, collect the x{x}x terms on one side and factorise, as the guide Rearranging Harder Formulae shows.
Substitute the whole inner function to write a composite in x,{x\text{,}}x, then solve or invert it
To write fg(x){fg(x)}fg(x) in terms of x,{x\text{,}}x, replace every x{x}x in f(x){f(x)}f(x) with the whole of g(x){g(x)}g(x) in a bracket, then expand and simplify.
Substituting g(x)=x−2{g(x) = x - 2}g(x)=x−2 into f(x)=x2+3x{f(x) = x^2 + 3x}f(x)=x2+3x gives fg(x)=x2−x−2.{fg(x) = x^2 - x - 2\text{.}}fg(x)=x2−x−2.
Wrong. With f(x)=x2−1{f(x) = x^2 - 1}f(x)=x2−1 and g(x)=3x+2,{g(x) = 3x + 2\text{,}}g(x)=3x+2, fg(x)=3x+22−1=3x+3.fg(x) = 3x + 2^2 - 1 = 3x + 3\text{.}fg(x)=3x+22−1=3x+3.
Right. The whole of g(x){g(x)}g(x) is squared, so it needs a bracket, giving fg(x)=(3x+2)2−1=9x2+12x+4−1=9x2+12x+3.fg(x) = {(3x + 2)^2} - 1 = 9x^2 + 12x + 4 - 1 = 9x^2 + 12x + 3\text{.}fg(x)=(3x+2)2−1=9x2+12x+4−1=9x2+12x+3.
To solve an equation with composites, or show what it gives:
- Write each composite in terms of x.{x\text{.}}x.
- Set the two sides equal.
- Expand and simplify, then solve or reach the given result.
An equation with one solution
f(x)=x+4{f(x) = x + 4}f(x)=x+4 and g(x)=x2.{g(x) = x^2\text{.}}g(x)=x2. Show that fg(x)=gf(x){fg(x) = gf(x)}fg(x)=gf(x) has exactly one solution.
- fg(x)=f(x2)=x2+4{fg(x) = f(x^2) = x^2 + 4}fg(x)=f(x2)=x2+4
- gf(x)=g(x+4)=(x+4)2=x2+8x+16gf(x) = g{(x + 4)} = {(x + 4)^2} = x^2 + 8x + 16gf(x)=g(x+4)=(x+4)2=x2+8x+16
- x2+4=x2+8x+16,{x^2 + 4 = x^2 + 8x + 16\text{,}}x2+4=x2+8x+16, so the x2{x^2}x2 terms cancel, leaving 4=8x+16{4 = 8x + 16}4=8x+16 and 8x=−12.{8x = -12\text{.}}8x=−12.
- 8x=−12{8x = -12}8x=−12 is a linear equation, so it has exactly one solution, x=−12÷8=−1.5.{x = -12 \div 8 = -1.5\text{.}}x=−12÷8=−1.5.
Label each composite as you write it, such as gf(x)=…,{gf(x) = \ldots\mathclose{\text{,}}}gf(x)=…, or the working may earn nothing. In a "Show that" question, write every step and end on the exact result given, or, to show exactly one solution, on a linear equation stated to have one solution.
When the x2{x^2}x2 terms do not cancel, rearrange to a quadratic equal to 0 and solve it.
A composite equal to an expression
f(x)=x−3{f(x) = x - 3}f(x)=x−3 and g(x)=x2+1.{g(x) = x^2 + 1\text{.}}g(x)=x2+1. Show that gf(x)=x{gf(x) = x}gf(x)=x gives x2−7x+10=0,{x^2 - 7x + 10 = 0\text{,}}x2−7x+10=0, and solve it.
- gf(x)=g(x−3)=(x−3)2+1=x2−6x+10gf(x) = g{(x - 3)} = {(x - 3)^2} + 1 = x^2 - 6x + 10gf(x)=g(x−3)=(x−3)2+1=x2−6x+10
- Subtract x{x}x from both sides of x2−6x+10=x,{x^2 - 6x + 10 = x\text{,}}x2−6x+10=x, giving x2−7x+10=0.{x^2 - 7x + 10 = 0\text{.}}x2−7x+10=0.
- Factorise, giving (x−2)(x−5)=0,{(x - 2)(x - 5) = 0\text{,}}(x−2)(x−5)=0, so x=2{x = 2}x=2 or x=5.{x = 5\text{.}}x=5.
A composite equal to a number is solved the same way. The number is the composite's output, not a value of x.{x\text{.}}x.
A composite equal to a number
f(x)=2x+5{f(x) = 2x + 5}f(x)=2x+5 and g(x)=x−1.{g(x) = \sqrt{x} - 1\text{.}}g(x)=x−1. Solve gf(x)=4.{gf(x) = 4\text{.}}gf(x)=4.
- gf(x)=g(2x+5)=2x+5−1gf(x) = g{(2x + 5)} = \sqrt{2x + 5} - 1gf(x)=g(2x+5)=2x+5−1
- 2x+5−1=4,{\sqrt{2x + 5} - 1 = 4\text{,}}2x+5−1=4, so 2x+5=5.{\sqrt{2x + 5} = 5\text{.}}2x+5=5.
- Square both sides, giving 2x+5=25,{2x + 5 = 25\text{,}}2x+5=25, so x=10.{x = 10\text{.}}x=10.
You can also undo the outer function first. gf(x)=4{gf(x) = 4}gf(x)=4 means f(x)=g−1(4)=25,{f(x) = g^{-1}(4) = 25\text{,}}f(x)=g−1(4)=25, so 2x+5=25.{2x + 5 = 25\text{.}}2x+5=25.
To invert a composite, build it first, then rearrange it as for any inverse.
Inverting a composite
f(x)=4x−1{f(x) = 4x - 1}f(x)=4x−1 and g(x)=x3.{g(x) = x^3\text{.}}g(x)=x3. Find (fg)−1(x).{(fg)^{-1}(x)\text{.}}(fg)−1(x).
- fg(x)=f(x3)=4x3−1,{fg(x) = f(x^3) = 4x^3 - 1\text{,}}fg(x)=f(x3)=4x3−1, so write y=4x3−1.{y = 4x^3 - 1\text{.}}y=4x3−1.
- Add 1, then divide by 4, giving x3=y+14.{x^3 = \dfrac{y + 1}{4}\text{.}}x3=4y+1.
- Take the cube root and write it in terms of x,{x\text{,}}x, so (fg)−1(x)=x+143.{(fg)^{-1}(x) = \sqrt[3]{\dfrac{x + 1}{4}}\text{.}}(fg)−1(x)=34x+1.
To put an inverse inside another function, such as hg−1(x),{hg^{-1}(x)\text{,}}hg−1(x), find g−1(x){g^{-1}(x)}g−1(x) first, then substitute it and simplify fully.
An inverse inside another function
g(x)=3x+2{g(x) = 3x + 2}g(x)=3x+2 and h(x)=6x.{h(x) = \dfrac{6}{x}\text{.}}h(x)=x6. Find hg−1(x).{hg^{-1}(x)\text{.}}hg−1(x).
- From y=3x+2,{y = 3x + 2\text{,}}y=3x+2, subtract 2, then divide by 3, giving x=y−23,{x = \dfrac{y - 2}{3}\text{,}}x=3y−2, so g−1(x)=x−23.{g^{-1}(x) = \dfrac{x - 2}{3}\text{.}}g−1(x)=3x−2.
- hg−1(x)=h(x−23)=6÷x−23hg^{-1}(x) = h\left(\dfrac{x - 2}{3}\right) = 6 \div \dfrac{x - 2}{3}hg−1(x)=h(3x−2)=6÷3x−2
- Dividing by x−23{\dfrac{x - 2}{3}}3x−2 is multiplying by 3x−2,{\dfrac{3}{x - 2}\text{,}}x−23, so hg−1(x)=18x−2.{hg^{-1}(x) = \dfrac{18}{x - 2}\text{.}}hg−1(x)=x−218.
Check it with a number. g−1(5)=1{g^{-1}(5) = 1}g−1(5)=1 and h(1)=6,{h(1) = 6\text{,}}h(1)=6, matching 185−2=6.{\frac{18}{5 - 2} = 6\text{.}}5−218=6.
- Why does fg(x){fg(x)}fg(x) usually give a different expression from gf(x)?{gf(x)\text{?}}gf(x)?
- How can you check an expression you have found for f−1(x)?{f^{-1}(x)\text{?}}f−1(x)?
- Explain why each x{x}x in the outer function is replaced by the inner function in a bracket.
f(x)=2x−3.{f(x) = 2x - 3\text{.}}f(x)=2x−3. What is ff(4)?{ff(4)\text{?}}ff(4)?
Solution
7
f(x)=7−2x.{f(x) = 7 - 2x\text{.}}f(x)=7−2x. What is f−1(1)?{f^{-1}(1)\text{?}}f−1(1)?
Solution
3
f(x)=x4+3.{f(x) = \dfrac{x}{4} + 3\text{.}}f(x)=4x+3. What is f−1(x)?{f^{-1}(x)\text{?}}f−1(x)?
Solution
f−1(x)=4x−12{f^{-1}(x) = 4x - 12}f−1(x)=4x−12
f(x)=2x{f(x) = 2x}f(x)=2x and g(x)=x+5.{g(x) = x + 5\text{.}}g(x)=x+5. What value of x{x}x solves fg(x)=18?{fg(x) = 18\text{?}}fg(x)=18?
Solution
x=4{x = 4}x=4