The equation
Take \(x^2+y^2=25\). Differentiate both sides with respect to \(x\), one term at a time, and write each term's factor row before you collect anything.
Term by term
Term 1: \(x^2\). The innermost layer is plain \(x\), so there is no \(\frac{dy}{dx}\) factor.
\[\frac{d}{dx}\left[x^2\right]=2x\]
Term 2: \(y^2\). The innermost layer is \(y\), so the block ends in \(\frac{dy}{dx}\).
\[\frac{d}{dx}\left[y^2\right]=2y\cdot\frac{dy}{dx}\]
Right side: \(25\). A constant has derivative zero.
\[\frac{d}{dx}\left[25\right]=0\]
Assembling
\[2x+2y\frac{dy}{dx}=0\]
Every term kept its own row, and the \(\frac{dy}{dx}\) factor appeared in exactly one of them, because only one term had \(y\) as its innermost layer.
A mixed equation
Now try \(x^2+xy+y^3=7\). The middle term is a product, so the product rule supplies the template, and each factor supplies its own chain rule block.
- \(\frac{d}{dx}[x^2]=2x\)
- \(\frac{d}{dx}[xy]\): the product rule gives \(1\cdot y+x\cdot\frac{dy}{dx}\), because the \(x\) factor is plain \(x\) and the \(y\) factor is a composite whose innermost layer is \(y\)
- \(\frac{d}{dx}[y^3]=3y^2\frac{dy}{dx}\)
Assembling:
\[2x+y+x\frac{dy}{dx}+3y^2\frac{dy}{dx}=0\]
Collecting
Only now, with every row written, group the \(\frac{dy}{dx}\) terms:
\[\frac{dy}{dx}\left(x+3y^2\right)=-2x-y\]
\[\frac{dy}{dx}=-\frac{2x+y}{x+3y^2}\]
Why the order matters
If you try to solve for \(\frac{dy}{dx}\) while terms are still being differentiated, you lose track of which term contributed which factor. Writing all the rows first keeps the bookkeeping visible, and the collection step becomes mechanical.