Two-layer composites are the common case, but the same peeling procedure handles deeper nesting. Take
\[h(x)=\sin(\cos(2x)).\]
Peel from the outside in, naming one layer per peel:
- Layer 1 (outermost): the last operation is the sine. Outer function \(\sin(\square)\), contents \(\cos(2x)\).
- Layer 2 (middle): inside that, the last operation is the cosine. Outer function \(\cos(\square)\), contents \(2x\).
- Layer 3 (innermost): inside that, the operation is multiplication by 2. Outer function \(2(\square)\), contents \(x\).
Once a peel leaves plain \(x\), you have reached the bottom and the count is finished. Here the count is three layers.
Two habits make this reliable:
- Peel, do not skip. Each peel removes exactly one operation. If you try to name two layers at once, you will usually miscount.
- Stop at plain \(x\). A layer that acts on plain \(x\) is still a layer, but there is nothing below it. In \(\sin(\cos(2x))\), the factor of 2 is a genuine layer, not a decoration.
Why the count matters: the chain rule produces one derivative factor per layer. A three-layer composite will need three factors, and knowing that in advance is what lets you notice a dropped factor later instead of discovering it on the exam.