2.2.8 · D3Functions

Worked examples — Composition of functions — f(g(x)), g(f(x))

2,671 words12 min readBack to topic

Before anything else, one reminder we will lean on constantly:

Read the figure: the input enters at the right, flows leftward through machine (deep teal), whose output is handed off to machine (burnt orange), which finally emits at the left. The plum circle in the middle is the composition symbol — the arrow curving right-to-left is your reminder that the rightmost function runs first.


The scenario matrix

Every composition problem is one (or a blend) of these cells. Each example below is tagged with the cell it hits.

Cell What makes it tricky Example
A — Plain algebra, both orders Show Ex 1
B — Domain trap (square root / log) Inner output must fit outer's mouth Ex 2
C — Zero & degenerate input Denominator , undefined points Ex 3
D — Self-composition Same machine twice; watch fixed points Ex 4
E — Inverse pair (composition = identity) signals undo Ex 5
F — Decompose a given Split into inner + outer Ex 6
G — Real-world word problem (units!) Chain two rate/conversion functions Ex 7
H — Exam twist: solve Compose, then solve an equation Ex 8
I — Sign/piecewise & limiting behaviour Absolute value, quadrants, Ex 9

Prerequisites we quietly use: Domain and range of function, Inverse functions, and for one aside Exponential and logarithmic functions. If chain-rule calculus tempts you, that lives at Derivatives - chain rule — different topic, same nesting idea.


Cell A — Plain algebra, both orders

Recall Reveal the core rule

In which machine runs first? ::: the inner one, — the rightmost function always processes the input first.


Cell B — Domain trap

Read the figure: the number line below shows the two gatekeeper conditions stacked. The teal band is where accepts input (all ); the orange band is where the handoff holds (). The composite lives only where both bands overlap — the shaded region ending at the plum boundary dot .


Cell C — Zero & degenerate input

Read the figure: the plot of shows the vertical dashed plum asymptote at . To its right (orange) the curve dives down from ; to its left (teal) it climbs from — exactly the two-sided blow-up described in step 3.


Cell D — Self-composition

Read the figure: the plum triangle of arrows shows the 3-cycle . Each arrow is one application of ; after exactly three hops you land back on the start — the visual meaning of .


Cell E — Inverse pair (composition = identity)

Read the figure: (orange) and (teal) are drawn as straight lines that are mirror images across the dotted plum line. Reflecting one across lands exactly on the other — the graphical fingerprint of an inverse pair, matching the algebraic collapse to .

When does an inverse even exist?
only when is bijective — see Bijective functions.

Cell F — Decompose a given function

Read the figure: the onion diagram shows three nested shells — the plum core (), the teal shell (), the orange skin (). Peeling from the outside inward is how you read ; building from the core outward is how you compute it.


Cell G — Real-world word problem (mind the units)

Read the figure: the unit-tracking chain shows three labelled boxes — hours (teal) → gadgets (plum) → rupees (orange) — with the conversion factor written on each arrow. The point is traced through: h → gadgets → rupees, matching the verify line.


Cell H — Exam twist: solve

Read the figure: the parabola is cut by the horizontal plum line . The two intersection points sit symmetrically at and — the picture-proof that a squared inner function hands you a pair.


Cell I — Sign / piecewise & limiting behaviour

The absolute value is the classic sign-splitter: when , and when . We compose with it so every sign region appears.

Read the figure: the horizontal axis is the input , the vertical axis is . The deep-teal line is the left arm (, rule , slope ); the burnt-orange line is the right arm (, rule , slope ); the plum dot marks the corner at where both arms meet at height . The two small arrows show both arms rising to .


Recall Self-test before you close the tab

Compute for Ex 1's functions. ::: . Domain of ? ::: . What signals that and are inverses? ::: both compositions equal (the identity). Where does blow up? ::: at . Innermost function of ? ::: .