Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Decompose a Function into Two Functions

Decomposing reverses composition: you write a given hh as f(g(x))f(g(x)) with simpler ff and gg. Follow what the formula does to xx; the last operation becomes the outer function.

Recognize the task

The question asks "find ff and gg such that h=f∘gh = f \circ g", or you need the inner part for the chain rule or for a substitution. Typical forms: a power of a bracket (3x−7)5(3x - 7)^5, a root of an expression x2+1\sqrt{x^2 + 1}, a constant over a power 4(x+2)3\frac{4}{(x + 2)^3}. Test: is there a block of xx-terms that is then treated as one unit?
Decomposition is covered in the lesson section Decomposing Functions.

Steps

StepOn h(x)=x2+1h(x) = \sqrt{x^2 + 1}
1Read the order of operations on x. Say what happens to the input first, second and last, as if you were computing h(2)h(2).square, add 11, take the root
2Make the last operation the outer function. Write it with a plain xx as its input.f(x)=xf(x) = \sqrt{x}
3Make everything before it the inner function. The inner function is the block the outer one acts on.g(x)=x2+1g(x) = x^2 + 1
4Compose back to check. Substitute gg into ff and compare with hh.Substitution ↗f(g(x))=x2+1=h(x)f(g(x)) = \sqrt{x^2 + 1} = h(x) ✓

Worked examples

Example 1 · a power of a bracket

2 layers
h(x)=(3x−7)5h(x) = (3x - 7)^5
form 3x−73x - 7, then fifth power
g(x)=3x−7g(x) = 3x - 7, f(x)=x5f(x) = x^5
last step is outside
f(g(x))=(3x−7)5=h(x)f(g(x)) = (3x - 7)^5 = h(x) ✓
compose back

Example 2 · a constant over a power

keep the constant
h(x)=4(x+2)3h(x) = \dfrac{4}{(x + 2)^3}
add 22, cube, divide into 44
g(x)=x+2g(x) = x + 2, f(x)=4x3f(x) = \dfrac{4}{x^3}
the 44 stays in ff
f(g(x))=4(x+2)3=h(x)f(g(x)) = \dfrac{4}{(x + 2)^3} = h(x) ✓
compose back

Example 3 · three layers

$f \circ g \circ k$
h(x)=(x−1)2+4h(x) = \sqrt{(x - 1)^2 + 4}
subtract, square and add, root
k(x)=x−1k(x) = x - 1, g(x)=x2+4g(x) = x^2 + 4, f(x)=xf(x) = \sqrt{x}
innermost to outermost
h=f∘g∘kh = f \circ g \circ k
brackets can be grouped either way
To build composites in the other direction, see composing two functions.

See it happen

A formula is a recipe read from the inside out. Evaluating x2+1\sqrt{x^2 + 1} at x=2x = 2, you first compute 22+1=52^2 + 1 = 5 and only then take 5\sqrt{5}. The part you finish first is the inner function; the final step is the outer one. Split the recipe at a different place and you get a different, equally valid decomposition. Trace one input through both stages in the composition visualizer.

Common mistakes

Swapping inner and outer

✗ h(x)=(3x−7)5h(x) = (3x - 7)^5 with f(x)=3x−7f(x) = 3x - 7, g(x)=x5g(x) = x^5
✓ that gives f(g(x))=3x5−7f(g(x)) = 3x^5 - 7; the power acts last, so f(x)=x5f(x) = x^5

Losing a constant

✗ 4(x+2)3\frac{4}{(x + 2)^3} with f(x)=1x3f(x) = \frac{1}{x^3}, g(x)=x+2g(x) = x + 2
✓ f(x)=4x3f(x) = \frac{4}{x^3}; check by composing back

Giving a decomposition that does nothing

✗ (x+1)2(x + 1)^2 with f(x)=(x+1)2f(x) = (x + 1)^2 and g(x)=xg(x) = x
✓ f(x)=x2f(x) = x^2, g(x)=x+1g(x) = x + 1: each part does real work
The first one is correct but useless; questions expect neither part to be xx itself.