Hersi Maths WhatsApp me

Understand · explore · practise

Composite functions

Learn composite functions fg(x), gf(x) and f²(x), find composite domains, and solve equations. Follow each function machine with a manual model and worked practice.

Before you startFunction notation, domain and range, substitution and basic equations

01 / Rightmost first

The inside function acts on the input first.

The notation fg(x) means f(g(x)): apply g, then feed its output into f. It does not mean f(x) multiplied by g(x). You may also see f ∘ g for the same composition.

x → g → g(x) → f → f(g(x))

Keep the intermediate value visible when you are learning the method. If any stage is undefined, the whole composite is undefined for that input.

02 / Build the composite

Replace every input in the outer rule with the inner expression.

Let f(x) = 2x − 1 and g(x) = x² + 3Worked example

fg(x) = 2(x² + 3) − 1 = 2x² + 5

Insert the whole inner output into f.

gf(x) = (2x − 1)² + 3 = 4x² − 4x + 4

Now f acts first. Brackets are essential.

fg(2) = 13, but gf(2) = 12

The order usually changes the answer. Both domains here are all real numbers.

Some particular functions commute, so fg = gf is possible. It must be checked; it is not a general composition rule.

03 / Iteration and three functions

A repeated function is different from squaring its output.

In composition notation f²(x) means f(f(x)), while [f(x)]² squares the output. Write the brackets if there is any ambiguity.

For f(x) = 2x − 1Worked example

f²(x) = 2(2x − 1) − 1 = 4x − 3

Two applications of the same machine.

[f(x)]² = (2x − 1)² = 4x² − 4x + 1

One application, then square the result.

If h(x) = x + 4 and g(x) = x² + 3,
fgh(x) = 2((x + 4)² + 3) − 1
= 2(x + 4)² + 5

Apply h, then g, then f. Work from the inside out.

04 / Composite domains

Two input tests must both pass.

For fg(x), the original input must lie in the domain of g, and the intermediate output g(x) must lie in the domain of f.

Domain of fg = {x in domain of g: g(x) is in domain of f}

Take f(x) = √x and g(x) = x − 2. Then fg(x) = √(x − 2) requires x ≥ 2. But gf(x) = √x − 2 requires only x ≥ 0. At x = 1 the first order fails while the second is valid.

Follow the intermediate valueExplore

f(x) = √x, defined for x ≥ 0.
g(x) = x − 2, defined for every real x.

Input 3 → g → 1 → f → 1

fg(3) = 1. Both stages are defined.

Domain of fg: x ≥ 2.

A failed stage stops the chain. An algebraic formula cannot make an excluded input valid.

Watch an intermediate value control the domain

Pause, replay or seek freely. The notes explain the same idea and stay in view.

05 / Keep original restrictions

Simplification does not erase a forbidden stage.

A composite that simplifies to xWorked example

f(x) = 1/x, with x ≠ 0

The reciprocal is undefined at zero.

f²(x) = 1/(1/x) = x

The formula simplifies, but the first reciprocal still requires x ≠ 0.

Domain of f²: x ≠ 0

Its range also excludes zero. It is the identity on the nonzero real numbers, not on all real numbers.

A restricted outer domainWorked example

p(x) = x² for x ≥ 1; q(x) = x − 3 for x ≥ 0

Both specified domains matter.

pq(x) = (x − 3)², with x ≥ 0 and x − 3 ≥ 1

The original restriction on p survives even though its formula could be evaluated elsewhere.

Domain: x ≥ 4; range: y ≥ 1

Only the permitted right-hand branch is part of this composite.

06 / Solve composite equations

State the domain before accepting roots.

f(x) = √x and g(x) = x − 2Worked example

Solve fg(x) = 3:
√(x − 2) = 3 ⇒ x = 11

The domain x ≥ 2 is satisfied.

Solve gf(x) = −3:
√x − 2 = −3 ⇒ √x = −1

No real solution. Squaring would give the spurious candidate x = 1.

Solve gf(x) = 1:
√x = 3 ⇒ x = 9

Checking gives 3 − 2 = 1.

For a logarithmic example, let a(x) = ln x and b(x) = x² − 1. Then ab(x) = ln(x² − 1) has domain x < −1 or x > 1. The equation ab(x) = ln 8 gives x = ±3, and both satisfy that domain.

For e(x) = eˣ and a(x) = ln x, ae(x) = x for all real x, but ea(x) = x only for x > 0. Reversing operations can still leave different domains.

07 / Graphs and piecewise rules

Use the intermediate input to choose the second branch.

When a function is given by a graph, read one output, use that as the next input, and read again. Do not simply multiply two graph heights.

p(t) = t + 2 for t < 0; p(t) = t² for t ≥ 0. Let q(x) = x − 1.Worked example

pq(x) = p(x − 1)

The branch test is on x − 1, not on x.

For x < 1: pq(x) = (x − 1) + 2 = x + 1

The intermediate input is negative.

For x ≥ 1: pq(x) = (x − 1)²

The intermediate input is nonnegative. In particular pq(1) = p(0) = 0.

08 / Your turn

Show the intermediate expression and the domain.

Each question is independent. Keep exact roots where possible.

01 · Two orders

f(x) = 3x + 2 and g(x) = x² − 1, both on all real numbers. Find fg(x) and gf(x).

Hint

Insert one whole expression into the other.

Worked solution

fg(x) = 3(x² − 1) + 2 = 3x² − 1. gf(x) = (3x + 2)² − 1 = 9x² + 12x + 3. Both domains are all real numbers.

02 · Repeated function

For f(x) = 3x + 2, find f²(x) and [f(x)]².

Hint

The first repeats the machine; the second squares its output.

Worked solution

f²(x) = 3(3x + 2) + 2 = 9x + 8. [f(x)]² = 9x² + 12x + 4.

03 · Three stages

For f(x) = 2x, g(x) = x² and h(x) = x − 3, find fgh(5).

Hint

Start with h(5).

Worked solution

5 → h → 2 → g → 4 → f → 8. Thus fgh(5) = 8.

04 · Order and domain

f(x) = √(x + 1), x ≥ −1; g(x) = 2x. Find fg and gf, including domains.

Hint

Check the input to the square root in each order.

Worked solution

fg(x) = √(2x + 1), domain x ≥ −1/2. gf(x) = 2√(x + 1), domain x ≥ −1.

05 · A hidden exclusion

r(x) = 2/x for x ≠ 0. Find r²(x) and its domain.

Hint

Retain the original restriction through cancellation.

Worked solution

r²(x) = 2/(2/x) = x, but only for x ≠ 0. The inner output 2/x is never zero for these inputs, so there are no additional exclusions.

06 · Solve and check

f(x) = √x and g(x) = x + 5. Solve fg(x) = 4.

Hint

First find fg and its domain.

Worked solution

fg(x) = √(x + 5), domain x ≥ −5. Squaring the nonnegative sides gives x + 5 = 16, so x = 11. It satisfies the domain and gives output 4.

07 · Logarithmic domain

a(x) = ln x and b(x) = 9 − x². State the domain of ab, and solve ab(x) = ln 5.

Hint

The logarithm argument must be strictly positive.

Worked solution

Require 9 − x² > 0, so −3 < x < 3. The equation gives 9 − x² = 5, hence x = ±2. Both are allowed.

08 · Move a branch boundary

p(t) = 2t for t < 1 and p(t) = t + 3 for t ≥ 1. If q(x) = x + 2, express pq as a piecewise function and find pq(−1).

Hint

Translate the test x + 2 < 1.

Worked solution

pq(x) = 2x + 4 for x < −1, and pq(x) = x + 5 for x ≥ −1. At x = −1 the second branch applies, giving pq(−1) = 4.

09 · A specified domain

f(x) = x² for x ≥ 2 and g(x) = x − 1 for x ≥ 0. Find the domain and range of fg.

Hint

Require x ≥ 0 and x − 1 ≥ 2 simultaneously.

Worked solution

fg(x) = (x − 1)², with domain x ≥ 3. On this domain x − 1 ≥ 2, so the range is y ≥ 4.

10 · Exponential and logarithm

e(x) = eˣ and a(x) = ln x. Are ae and ea the same function on their natural domains?

Hint

The simplified formulas agree. Do the domains?

Worked solution

No. ae(x) = ln(eˣ) = x for all real x, whereas ea(x) = e^(ln x) = x only for x > 0. A function includes its domain, so these are different functions despite sharing a simplified formula.

09 / Recap

Follow the chain and retain every input restriction.

  • fg means f after g: the rightmost function goes first.
  • Use brackets when substituting a whole expression.
  • Check both the first input and each intermediate output.
  • Iteration f² differs from the square [f(x)]².
  • Simplifying a formula does not restore excluded inputs.

Back to functions and graphs →

Section 1 of 9 · Rightmost first