Chalk−1

Math · College algebra · Worked example

Compose two functions in both orders

For f⁡(x)=2⁢x+1 and g⁡(x)=x2, find (f∘g)⁢(x) and (g∘f)⁢(x), and evaluate both at x=3.

f⁡(x)=2⁢x+1,g⁡(x)=x2

Find f⁡(g⁡(x))

Put g⁡(x)=x2 into f. f doubles its input and adds 1, so x2 becomes 2x2+1.

f⁡(g⁡(x))=2x2+1

Find g⁡(f⁡(x))

Put f⁡(x)=2⁢x+1 into g. g squares its input, so the whole of 2⁢x+1 is squared.

g⁡(f⁡(x))=(2⁢x+1)2=4x2+4⁢x+1
g⁡(f⁡(x))=(2⁢x+1)2=4x2+4⁢x+1

Evaluate at 3

Work from the inside out. g⁡(3)=9, and then f⁡(9)=19. In the other order, f⁡(3)=7, then g⁡(7)=49.

f⁡(x)=2⁢x+1g⁡(x)=x2g⁡(3)=9f⁡(9)=19f⁡(3)=7g⁡(7)=49

Compare the orders

19 and 49 differ, so the two composites are different functions. Composition is not commutative.

Result

(f∘g)⁢(x)=2x2+1 and (g∘f)⁢(x) =(2⁢x+1)2 =4x2+4⁢x+1. At x=3 they give 19 and 49.

Your turn

1. One like the example

For f⁡(x)=x+4 and g⁡(x)=3x2, find f⁡(g⁡(x)) and g⁡(f⁡(x)), and evaluate both at x=1.

Show the answer and explanation

f⁡(g⁡(x))=3x2+4 and g⁡(f⁡(x))=3⁢(x+4)2. At x=1 they give 7 and 75.

f adds 4 to whatever it receives, so f⁡(g⁡(x))=3x2+4. g triples the square of what it receives, so g⁡(f⁡(x))=3⁢(x+4)2. Inside first at x=1, g⁡(1)=3 and f⁡(3)=7. In the other order, f⁡(1)=5 and g⁡(5)=75.

f⁡(x)=x+4g⁡(x)=3x2f⁡(g⁡(x))=3x2+4g⁡(f⁡(x))=3⁢(x+4)2g⁡(1)=3f⁡(3)=7f⁡(1)=5g⁡(5)=75

2. A variation

For f⁡(x)=x and g⁡(x)=x−4, find f⁡(g⁡(x)) and g⁡(f⁡(x)) with their domains.

Show the answer and explanation

f⁡(g⁡(x))=x−4 for x≥4, and g⁡(f⁡(x))=x−4 for x≥0.

In f⁡(g⁡(x)), g subtracts 4 first and the root comes last, so the root needs x−4≥0. In g⁡(f⁡(x)), the root comes first and needs only x≥0, and subtracting 4 afterward is always allowed.

f⁡(x)=xg⁡(x)=x−4f⁡(g⁡(x))=x−4g⁡(f⁡(x))=x−4

3. Somewhere new

A ripple’s radius is r⁢(t)=2⁢t cm after t seconds, and a circle of radius r has area A⁢(r)=πr2. Write the area as a function of time, and find it at t=3.

Show the answer and explanation

A⁢(r⁢(t))=4⁢πt2 cm2, which is 36⁢π≈113.1 cm2 at t=3.

The time goes in first and gives the radius, then the radius gives the area, so the composition is A⁢(r⁢(t))=π⁢(2⁢t)2=4⁢πt2. At t=3 the radius is 6 cm and the area is 36⁢π≈113.1 cm2.

r⁢(t)=2⁢tA⁢(r)=πr2A⁢(r⁢(t))=4⁢πt2

Keep exploring

In Graph, plot 2x2+1 and (2⁢x+1)2. The curves cross only where 2x2+1=(2⁢x+1)2, at x=0 and x=−2, so the two composites agree at only those inputs.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Check the values in Math See both composites in Graph Study the 5 key terms Open worked example on a board Composition in Math Reference

Your existing work stays on this device. Examples open as editable copies.