Composition and inverse functions

f ∘ g and g ∘ f — which function acts first, finding f or g from f ∘ g, inverses of linear and linear-fractional functions, the rule f(a) = b ⇔ f⁻¹(b) = a, and mixed items such as (f ∘ g⁻¹)(a).

  • Intermediate
  • 22 min
  • 15 questions
  • Lesson 48 of 53

In this lesson you will learn

  • Compute f ∘ g and g ∘ f, and find f or g when a composition is known
  • Find the inverse of a linear and of a linear-fractional function, and compute f⁻¹(b) without a formula
  • Evaluate mixed expressions such as (f ∘ g⁻¹)(a) and (f ∘ g)⁻¹ step by step

A typical TR-YÖS item: «f(x) = 3x + 1, g(x) = 2x − 4 ⇒ (f ∘ g⁻¹)(6) = ?». You do not have to find a formula for g⁻¹: g⁻¹(6) = a means g(a) = 6 ⇒ 2a − 4 = 6 ⇒ a = 5. Then f(5) = 16. This lesson teaches two ideas: in a composition the inner function acts first, and an inverse runs the machine backwards.

ÖSYM’s sample items include one that combines an inverse with a composition, and the items published in 2024–2025 ask for function values and compositions too. Take the «Functions» lesson first. Full theory: Mathematics → Functions and their properties.

Composition: from the inside out

(f ∘ g)(x) = f(g(x)) — «f after g». First g acts, and its output becomes the input of f. Although f is written on the left, the g on the right starts the work. In the picture x = 2 goes through g first and then through f.

x = 2g(x) = x² − 3g(2) = 1f(x) = 2x + 1f(1) = 31) first g2) then f(f ∘ g)(2) = 3
In f ∘ g the g on the right acts first.
(f ∘ g)(x) = f(g(x))(g ∘ f)(x) = g(f(x))

Where

g
the inner function of f ∘ g: it acts first
f
the outer function: it acts on the value g(x)

In general f ∘ g ≠ g ∘ f: the order matters.

Computing compositions

Problem

f(x) = 2x + 1; g(x) = x² − 3
1) (f ∘ g)(2), (g ∘ f)(2)
2) (f ∘ g)(x), (g ∘ f)(x)
3) h(x) = 3x − 2 ⇒ (h ∘ h)(x)

Show solutionHide solution

Solution

1) g(2) = 1, f(1) = 3. f(2) = 5, g(5) = 22. The results differ.
2) f(g(x)) = 2(x² − 3) + 1 = 2x² − 5. g(f(x)) = (2x + 1)² − 3 = 4x² + 4x − 2. Check with x = 2: 3 and 22 ✓.
3) h(h(x)) = 3(3x − 2) − 2 = 9x − 8.

Sign up free to keep reading

The rest of the lesson, the quiz and your notes open with an Educora account. Signing up takes a minute, and your progress is saved on all your devices.

Finding f or g from a composition

There are two cases. If the outer f is known, f(g(x)) = … is an ordinary equation for g(x). If the inner g is known, it is the f(ax + b) case from the «Functions» lesson: put t = g(x) and express x through t.

Outer and inner function

Problem

1) f(x) = x + 3; (f ∘ g)(x) = 2x − 1 ⇒ g(x) = ?
2) g(x) = 2x + 1; (f ∘ g)(x) = 6x + 7 ⇒ f(x) = ?

Show solutionHide solution

Solution

1) f(g(x)) = g(x) + 3 = 2x − 1 ⇒ g(x) = 2x − 4.
2) f(2x + 1) = 6x + 7. t = 2x + 1 ⇒ x = (t − 1)/2 ⇒ f(t) = 3(t − 1) + 7 = 3t + 4: f(x) = 3x + 4. Check: f(g(x)) = 3(2x + 1) + 4 = 6x + 7 ✓.

The inverse function

An inverse runs the machine backwards: if f takes 2 to 1, then f⁻¹ takes 1 back to 2. This works only if f gives different values to different x (a one-to-one function). A linear function with a ≠ 0 always is. To find the formula, write y = f(x), express x through y, then swap the letters.

f(a) = b ⇔ f⁻¹(b) = af(f⁻¹(x)) = xf⁻¹(f(x)) = x

Where

f⁻¹
the inverse of f; «−1» is not a power, f⁻¹(x) ≠ 1/f(x)

The first line is the most useful: if f⁻¹(b) is asked, solve f(?) = b.

f(x) = ax + b ⇒ f⁻¹(x) = (x − b)/af(x) = (ax + b)/(cx + d) ⇒ f⁻¹(x) = (−dx + b)/(cx − a)f(x) = ax + b ⇒ f⁻¹(x) = (x − b)/af(x) = (ax + b)/(cx + d) ⇒ f⁻¹(x) = (−dx + b)/(cx − a)

Where

a ≠ 0
the coefficient of x in the linear function
c ≠ 0, ad − bc ≠ 0
the conditions for the linear-fractional function

In the linear-fractional case a and d swap places and signs; b and c stay put.

−4−202468−4−202468yxf(x) = 2x − 4f⁻¹(x) = (x + 4)/2y = x(1, −2)(−2, 1)(4, 4)
y
xy (f(x) = 2x − 4)y (f⁻¹(x) = (x + 4)/2)y (y = x)
−4—0−4
−2—1−2
0−420
2032
4444
6856
8—68
f and f⁻¹ are mirror images in y = x: the coordinates of a point swap places.

Read the graph like this: f and f⁻¹ are mirror images in the line y = x. If (1, −2) lies on f, then (−2, 1) lies on f⁻¹: the coordinates swap. Both lines cross y = x at the same point, (4, 4).

Finding inverses

Problem

1) f(x) = 3x − 5 ⇒ f⁻¹(x) = ?
2) f(x) = (2x + 1)/(x − 3) ⇒ f⁻¹(x) = ?
3) f(x) = x³ + 2x − 1 ⇒ f⁻¹(2) = ?
4) f⁻¹(x) = (x − 1)/2 ⇒ f(x) = ?

Show solutionHide solution

Solution

1) y = 3x − 5 ⇒ x = (y + 5)/3: f⁻¹(x) = (x + 5)/3. Check: f(2) = 1 and f⁻¹(1) = 6/3 = 2 ✓.
2) a = 2, b = 1, c = 1, d = −3: f⁻¹(x) = (3x + 1)/(x − 2), x ≠ 2. Check: f(4) = 9, f⁻¹(9) = 28/7 = 4 ✓.
3) f(a) = 2 ⇒ a³ + 2a − 3 = 0 ⇒ a = 1 (1 + 2 − 3 = 0). f is increasing, so this root is the only one.
4) The inverse of the inverse is f itself: y = (x − 1)/2 ⇒ x = 2y + 1: f(x) = 2x + 1.

Mixed items: composition and inverse together

In a mixed item each step is either «evaluate» or «invert». Start from the innermost part. No need to derive an inverse formula: turn f⁻¹(b) into the equation f(?) = b. The inverse of a composition reverses the order — like socks and shoes: socks go on first, shoes come off first.

(f ∘ g⁻¹)(a) = f(g⁻¹(a))(f ∘ g)⁻¹ = g⁻¹ ∘ f⁻¹

Where

g⁻¹(a)
the root of g(?) = a

Inverting reverses the order.

Step by step

Problem

f(x) = 3x + 1; g(x) = 2x − 4
1) (f ∘ g⁻¹)(6)
2) (f⁻¹ ∘ g)(3)
3) (f ∘ g)⁻¹(x)
4) h(x) = 4x − 3, h(x) = h⁻¹(x) ⇒ x = ?

Show solutionHide solution

Solution

1) g⁻¹(6): 2a − 4 = 6 ⇒ a = 5; f(5) = 16.
2) g(3) = 2; f⁻¹(2): 3a + 1 = 2 ⇒ a = 1/3.
3) f(g(x)) = 3(2x − 4) + 1 = 6x − 11 ⇒ (f ∘ g)⁻¹(x) = (x + 11)/6. Check with the order rule: f⁻¹(x) = (x − 1)/3, g⁻¹(x) = (x + 4)/2, g⁻¹(f⁻¹(x)) = ((x − 1)/3 + 4)/2 = (x + 11)/6 ✓.
4) h is increasing, so h(x) = h⁻¹(x) ⇔ h(x) = x: 4x − 3 = x ⇒ x = 1.
  1. Start inside

    Write (f ∘ g⁻¹)(a) as f(g⁻¹(a)): the innermost step comes first.

  2. Turn an inverse step into an equation

    g⁻¹(a) = ? ⇔ g(?) = a; no formula needed.

  3. Feed the value to the next function

    Each step gives one number that goes into the next machine.

  4. Check

    f(f⁻¹(b)) must equal b; if you found a formula, test it with one number.

How TR-YÖS asks about it

Turkish terms: bileşke fonksiyon (composition), ters fonksiyon (inverse function); f ∘ g is read «f bileşke g». The stem has no words: the functions and «⇒ (f ∘ g⁻¹)(2) = ?». Sometimes a function is given as a set of pairs: f = {(1, 3), (2, 1), (3, 2)}.

Practice (ÖSYM style)

Problem

f(x) = 3x − 1
g(x) = x + 4
⇒ (g ∘ f⁻¹)(8) = ?
A) 5 B) 6 C) 7 D) 8 E) 9

Show solutionHide solution

Solution

1) Innermost: f⁻¹(8) ⇔ f(a) = 8 ⇒ 3a − 1 = 8 ⇒ a = 3.
2) g(3) = 3 + 4 = 7.
Answer C. Mixing up the order gives (f⁻¹ ∘ g)(8) = f⁻¹(12) = 13/3 — no such option, which itself signals the mistake.

Remember

  • (f ∘ g)(x) = f(g(x)): first g, then f; in general f ∘ g ≠ g ∘ f.
  • f(a) = b ⇔ f⁻¹(b) = a — for f⁻¹(b) solve f(?) = b.
  • The inverse of ax + b is (x − b)/a; of (ax + b)/(cx + d) it is (−dx + b)/(cx − a).
  • f⁻¹(x) ≠ 1/f(x); f and f⁻¹ are symmetric about y = x.
  • (f ∘ g)⁻¹ = g⁻¹ ∘ f⁻¹: inverting reverses the order.
Spotted a mistake or something inaccurate in this lesson?

Check yourself

15 questions. Every correct answer earns XP.

Question 1 / 15

Question 1 / 15. f(x) = x² + 1
g(x) = 2x − 3
⇒ (f ∘ g)(2) = ?