Skip to content
IB Diploma ProgrammeSL & HL

Composite and inverse functions

Mathematics: Analysis and Approaches SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Composite and inverse functions notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Composite and inverse functions notes as text: skim, search, and jump between subtopics.

~14 min read

1. Composite functions

A composite function applies one function to the output of another. The notation (f ° g)(x) means f(g(x)): do g first, then put its result into f.

Read it from the inside out. The function next to x acts first. To write (f ° g)(x), replace every x in f by the whole expression g(x), with brackets.

"Write down" asks for a short answer with no reason.

(f ° g)(x) = f(g(x))

Worked example 11 mark

The function f is defined by f(x) = 5(x + 1)(x + 3), where x ∈ R. The function g is defined by g(x) = ln x, where x ∈ R, x > 0. (d)(i) Write down an expression for (f ° g)(x).

  1. 1

    (f ° g)(x) = f(ln x), so every x in f becomes ln x: 5(ln x + 1)(ln x + 3) or 5(ln x + 2)² - 5 or 5(ln x)² + 20ln x + 15 (A1) [1]

2. Domain of a composite function

For (g ° f)(x) to exist, x must be allowed in f, and then f(x) must be allowed in g. The domain of the composite is the set of x that pass both tests.

A logarithm needs a positive input. For (g ° f)(x) = ln(f(x)), the markscheme credits recognition that the domain requires f(x) > 0. Then solve that inequality for x.

The order matters: f ° g and g ° f are usually different functions with different domains. Check which function is on the inside.

(g ° f)(x) = g(f(x)) needs x ∈ domain of f and f(x) ∈ domain of g

Worked example 13 marks

The function f is defined by f(x) = 5(x + 1)(x + 3), where x ∈ R. The function g is defined by g(x) = ln x, where x ∈ R, x > 0.(e) Find the domain of g ° f.

  1. 1

    (g ° f)(x) = ln(f(x))

  2. 2

    recognition that the domain requires f(x) > 0 (M1) [1]

  3. 3

    (x + 1)(x + 3) > 0, with critical values x = -3 and x = -1 (A1) [1]

  4. 4

    x < -3 or x > -1, or (-∞, -3) ∪ (-1, ∞) (A1) [1]

3. Identity function and the inverse

The identity function x mapsto x gives back the input unchanged. The inverse function f⁻¹ undoes f. Do f, then f⁻¹, and you are back where you started.

So a function and its inverse, composed in either order, give the identity function.

If f(a) = b then f⁻¹(b) = a. To find f⁻¹(5), find the input that f sends to 5. The inverse is not the reciprocal 1/(f(x)).

(f ° f⁻¹)(x) = (f⁻¹ ° f)(x) = x

f(a) = b iff f⁻¹(b) = a

Worked example 12 marks

The function f is defined by f(x) = 2x - 7, where x ∈ R. Find the value of f⁻¹(5).

  1. 1

    f⁻¹(5) is the value of x with f(x) = 5, so 2x - 7 = 5 (M1) [1]

  2. 2

    2x = 12, so f⁻¹(5) = 6 (A1) [1]

4. Finding the inverse function

To find f⁻¹(x), write y = f(x). Then interchange x and y and make y the subject. The new y is f⁻¹(x).

The markscheme credits the attempt to interchange x and y, seen anywhere. You may rearrange first and swap last. Either order earns the method mark.

Clear any fraction, collect every y term on one side and factorise. State any x the inverse cannot take.

y = f(x) → x = f(y) → y = f⁻¹(x)

Worked example 13 marks

The function f is defined by f(x) = 4 - 7/(3x + 2), where x ∈ R, x ≠ -2/3.(a) Find an expression for f⁻¹(x).

  1. 1

    attempt to interchange x and y: x = 4 - 7/(3y + 2) (M1) [1]

  2. 2

    7/(3y + 2) = 4 - x, so 3y + 2 = (-7)/(x - 4) (A1) [1]

  3. 3

    f⁻¹(x) = (-7)/(3(x - 4)) - 2/3 or (1 - 2x)/(3x - 12), x ≠ 4 (A1) [1]

5. When an inverse exists

An inverse exists only for a one-to-one function: each output comes from exactly one input. If two inputs give the same output, the inverse would not know which to return.

The graph of f⁻¹ is the reflection of the graph of f in the line y = x. The domain of f⁻¹ is the range of f. The range of f⁻¹ is the domain of f.

The function x² is not one-to-one on all of R, since 2 and -2 both give 4. Restrict the domain, for example to x ≥ 0, and it becomes one-to-one. Then pick the root that matches the restricted domain.

domain of f⁻¹ = range of f

range of f⁻¹ = domain of f

Worked example 14 marks

The function f is defined by f(x) = (x - 2)², where x ≥ 2.(a) Find an expression for f⁻¹(x). [3](b) State the domain of f⁻¹. [1]

  1. 1

    (a)

  2. 2

    interchange x and y: x = (y - 2)², so y - 2 = ±√x (M1) [1]

  3. 3

    the range of f⁻¹ is y ≥ 2, so y - 2 = +√x (R1) [1]

  4. 4

    f⁻¹(x) = 2 + √x (A1) [1]

  5. 5

    (b)

  6. 6

    domain of f⁻¹ = range of f: x ≥ 0 (A1) [1]

6. A function that is its own inverse

Some functions satisfy f⁻¹(x) = f(x). Their graphs are symmetric in the line y = x.

"Show that" means every step is written and the given result is reached. The final line is marked AG (answer given) and earns no mark itself. Do not skip the algebra between the lines.

There are two methods. Find f⁻¹(x) and see that it equals f(x). Or find f(f(x)) and see that it simplifies to x. Both are fully credited.

f⁻¹(x) = f(x) iff (f ° f)(x) = x

Worked example 13 marks

Consider the function f(x) = (2 - 2x)/(x + 2), where x ∈ R, x ≠ -2.(a) Show that f⁻¹(x) = f(x).

  1. 1

    attempt to rearrange and swap x and y: x = (2 - 2y)/(y + 2) (M1) [1]

  2. 2

    xy + 2x = -2y + 2, so xy + 2y = 2 - 2x or y(x + 2) = 2 - 2x (A1) [1]

  3. 3

    f⁻¹(x) = (2 - 2x)/(x + 2) (A1) [1]

  4. 4

    so f⁻¹(x) = f(x) (AG)

7. Solving for a function inside a composite

A composite equation such as (f ° g)(x) = … can be solved for the unknown function. Apply f⁻¹ to both sides. Since f⁻¹ undoes f, it leaves g on its own.

Take care with the argument. If (f ° g)(x/3) = x, then g(x/3) = f⁻¹(x). This is g at x/3, not at x. Replace x by 3x to get g(x).

The markscheme also credits a substitution: let a = x/3, so f(g(a)) = 3a. Then solve for g(a) with f⁻¹ and write the result in x. Either route gives the same expression. State any value of x the final expression cannot take.

f(g(t)) = h(t) ⇒ g(t) = f⁻¹(h(t))

Worked example 13 marks

Consider the following functions. The function f is defined by f(x) = 4 - 7/(3x + 2), where x ∈ R, x ≠ -2/3. Part(a) gave f⁻¹(x) = (-7)/(3(x - 4)) - 2/3. The function g is defined such that (f ° g)(x/3) = x.(b) Using your answer to part(a) or otherwise, find an expression for g(x).

  1. 1

    attempt to use f⁻¹(x) on both sides: g(x/3) = f⁻¹(x) (M1) [1]

  2. 2

    g(x) = f⁻¹(3x) (A1) [1]

  3. 3

    g(x) = (-7)/(3(3x - 4)) - 2/3 or (1 - 6x)/(9x - 12), x ≠ 4/3 (A1) [1]

Recap

  • (f ° g)(x) = f(g(x)). The function next to x acts first.
  • The domain of a composite needs x allowed in the inner function and its output allowed in the outer one.
  • Identity function: (f ° f⁻¹)(x) = (f⁻¹ ° f)(x) = x.
  • Inverse: write y = f(x), interchange x and y, make y the subject.
  • Only a one-to-one function has an inverse. Its graph is the reflection of f in y = x.
  • Domain of f⁻¹ is the range of f. Range of f⁻¹ is the domain of f.
  • Self-inverse: f⁻¹(x) = f(x), equivalently (f ° f)(x) = x. For show that, write every step.
  • To solve for g in f(g(t)) = h(t), apply f⁻¹ to both sides: g(t) = f⁻¹(h(t)).

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. The functions f and g are defined by f(x) = x + 5 and g(x) = 3x, where x ∈ R. Write down the value of (f ° g)(2).1 mark
    Answer
    1. g(2) = 6, then f(6) = 11.

    Trap: Doing f first gives f(2) = 7 and g(7) = 21. That is (g ° f)(2).

  2. Do not use a calculator. The functions f and g are defined by f(x) = 2x - 1 and g(x) = x², where x ∈ R. Find an expression for (g ° f)(x).2 marks
    Answer
    1. (g ° f)(x) = g(2x - 1) (M1)
    2. = (2x - 1)² = 4x² - 4x + 1 (A1)

    Trap: 2x² - 1 is (f ° g)(x). Also (2x - 1)² ≠ 4x² - 1: expand the bracket in full.

  3. Do not use a calculator. The functions f and g are defined by f(x) = 2x + 3 and g(x) = x - 1, where x ∈ R. Solve (f ° g)(x) = 11.3 marks
    Answer
    1. (f ° g)(x) = 2(x - 1) + 3 (M1)
    2. = 2x + 1 (A1)
    3. 2x + 1 = 11, so x = 5 (A1)

    Trap: 2x - 1 + 3 forgets to multiply the -1 by 2. It gives x = 4.5.

  4. Do not use a calculator. The function f is defined by f(x) = 5 - 3x, where x ∈ R. Find f⁻¹(-4).3 marks
    Answer
    1. Interchange x and y: x = 5 - 3y (M1)
    2. 3y = 5 - x, so f⁻¹(x) = (5 - x)/3 (A1)
    3. f⁻¹(-4) = (5 + 4)/3 = 3 (A1). Check: f(3) = 5 - 9 = -4.

    Trap: Rearranging x = 5 - 3y as y = (x - 5)/3 loses a sign and gives -3; check that f of your answer is -4.

  5. Do not use a calculator. The function f is defined by f(x) = (3x + 1)/(x - 2), where x ∈ R, x ≠ 2. Find an expression for f⁻¹(x).4 marks
    Answer
    1. Interchange x and y: x = (3y + 1)/(y - 2) (M1)
    2. xy - 2x = 3y + 1 (A1)
    3. xy - 3y = 2x + 1, so y(x - 3) = 2x + 1 (M1)
    4. f⁻¹(x) = (2x + 1)/(x - 3), x ≠ 3 (A1)

    Trap: Moving 3y across with the wrong sign gives y(x + 3). Check by sending f(0) = -1/2 through f⁻¹: it must return 0.

  6. The function f is defined by f(x) = x² + 1, where x ≤ 0. Find an expression for f⁻¹(x).3 marks
    Answer
    1. Interchange x and y: x = y² + 1, so y = ±√(x - 1) (M1)
    2. The range of f⁻¹ is y ≤ 0, so take the negative root (R1)
    3. f⁻¹(x) = -√(x - 1) (A1)

    Trap: Always writing +√(x - 1). It does not match the domain x ≤ 0 of f.

  7. The function f is defined by f(x) = √(x - 3) + 1, where x ≥ 3. (a) Find an expression for f⁻¹(x). [2] (b) State the domain of f⁻¹. [1]3 marks
    Answer
    1. (a)
    2. x = √(y - 3) + 1, so x - 1 = √(y - 3) (M1)
    3. f⁻¹(x) = (x - 1)² + 3 (A1)
    4. (b)
    5. The domain of f⁻¹ is the range of f: x ≥ 1 (A1)

    Trap: Stating x ≥ 3, the domain of f. The domain of f⁻¹ is the range of f.

  8. The functions f and g are defined by f(x) = x - 5, where x ∈ R, and g(x) = √x, where x ≥ 0. (a) Write down an expression for (g ° f)(x). [1] (b) Find the largest possible domain of g ° f. [2]3 marks
    Answer
    1. (a)
    2. (g ° f)(x) = √(x - 5) (A1)
    3. (b)
    4. The input of g must be at least 0, so x - 5 ≥ 0 (M1)
    5. x ≥ 5 (A1)
    6. Check: x = 9 gives √4 = 2, but x = 4 gives √-1, which is not real.

    Trap: Using x ≥ 0, the domain of g, instead of the condition on f(x). The input of g is f(x), not x, so the condition is on x - 5.

  9. Do not use a calculator. The function f is defined by f(x) = (ax + 5)/(2x - 3), where x ∈ R, x ≠ 3/2, and a is a constant. (a) Find an expression for f⁻¹(x) in terms of a. [3] It is given that f⁻¹(x) = f(x). (b) Determine the value of a. [1] (c) Hence, find the value of (f ° f ° f)(4). [2]6 marks
    Answer
    1. (a)
    2. Interchange x and y: x = (ay + 5)/(2y - 3) (M1)
    3. 2xy - 3x = ay + 5, so 2xy - ay = 3x + 5 or y(2x - a) = 3x + 5 (A1)
    4. f⁻¹(x) = (3x + 5)/(2x - a) (A1)
    5. (b)
    6. Compare with f(x) = (ax + 5)/(2x - 3): a = 3 (A1)
    7. (c)
    8. f⁻¹ = f, so (f ° f)(x) = (f ° f⁻¹)(x) = x and (f ° f ° f)(4) = f(4) (R1)
    9. f(4) = (3(4) + 5)/(2(4) - 3) = 17/5 (A1)

    Trap: Collecting the y terms with a sign slip gives y(2x + a) and no value of a works; in (c), working out f three times wastes time when f ° f is the identity.

  10. Do not use a calculator. A square photograph has side x cm, where x > 0. A frame adds 2 cm on every side, so the framed square has side s(x) = x + 4 cm. The glass for a framed square of side s cm costs A(s) = 0.05s² dollars. (a) Find an expression for (A ° s)(x). [2] (b) Find an expression for (A ° s)⁻¹(x). [3] (c) State the domain of (A ° s)⁻¹. [2] (d) Determine the side of the photograph whose glass costs 12.80 dollars. [2]9 marks
    Answer
    1. (a)
    2. (A ° s)(x) = A(x + 4) (M1)
    3. = 0.05(x + 4)² (A1)
    4. (b)
    5. Interchange x and y: x = 0.05(y + 4)², so (y + 4)² = 20x (M1)
    6. y > 0, so y + 4 > 0 and the positive root is taken: y + 4 = √(20x) (R1)
    7. (A ° s)⁻¹(x) = √(20x) - 4 (A1)
    8. (c)
    9. The domain of the inverse is the range of A ° s: x > 0 gives x + 4 > 4, so 0.05(x + 4)² > 0.05(16) (M1)
    10. x > 0.8 (A1)
    11. (d)
    12. (A ° s)⁻¹(12.8) = √(20(12.8)) - 4 = √(256) - 4 (M1)
    13. = 16 - 4 = 12 cm (A1). Check: 0.05(16)² = 12.8.

    Trap: s(A(x)) = 0.05x² + 4 puts the functions in the wrong order; in (c), x > 0 is the domain of A ° s, not of its inverse.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
f⁻¹(x) = 1/(f(x))The inverse is found by an attempt to interchange x and y, then rearranging for y
(g ° f)(x) treated as f(x) × g(x), or f applied first and then g put inside it(g ° f)(x) = g(f(x)): put f(x) inside g, in brackets
The domain of g ° f is all real x, because f is defined for all xrecognition that the domain requires f(x) > 0 when g = ln, so x < -3 or x > -1
g(x) = f⁻¹(x) from (f ° g)(x/3) = xg(x/3) = f⁻¹(x), so g(x) = f⁻¹(3x)

Frequently asked questions

What does (f ° g)(x) mean and how do I find it?
(f ° g)(x) = f(g(x)). Do g first, then put its result into f, so the function next to x acts first. For f(x) = 5(x+1)(x+3) and g(x) = ln x, every x in f becomes ln x, giving (f ° g)(x) = 5(ln x + 1)(ln x + 3). Write each substitution in brackets.
How do I find the domain of a composite function?
The domain needs x to be allowed in the inner function and its output allowed in the outer one. For (g ° f)(x) = ln(f(x)), the domain requires f(x) > 0. Solving (x+1)(x+3) > 0 gives critical values x = -3 and x = -1, so the domain is x < -3 or x > -1. The order matters.
How do I find the inverse of a function?
Write y = f(x), then interchange x and y and make y the subject. The new y is f⁻¹(x). For f(x) = (x-2)² with x ≥ 2, swapping gives x = (y-2)². The range of f⁻¹ is y ≥ 2, so f⁻¹(x) = 2 + √x. The domain of f⁻¹ is the range of f, so x ≥ 0.
When does a function have an inverse?
Only a one-to-one function has an inverse, meaning each output comes from exactly one input. The function x² is not one-to-one on R, because 2 and -2 both give 4. Restricting the domain, for example to x ≥ 0, makes it one-to-one. The graph of f⁻¹ is then the reflection of f in the line y = x.
How do I show that a function is its own inverse?
Show that f⁻¹(x) = f(x) by swapping x and y and rearranging, writing every step. For f(x) = (2 - 2x)/(x + 2), swapping gives xy + 2y = 2 - 2x, so y(x + 2) = 2 - 2x and f⁻¹(x) = (2 - 2x)/(x + 2). The final line is marked AG. Showing that (f ° f)(x) = x is also a full method.
Why is the inverse of a function not the reciprocal of the function?
The inverse is found by an attempt to interchange x and y, then rearranging for y, not by taking 1/(f(x)). Use the rule f(a) = b iff f⁻¹(b) = a. For f(x) = 2x - 7, f⁻¹(5) is the value of x with f(x) = 5, so 2x = 12 and f⁻¹(5) = 6.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters