From high school maths I know the chain rule as$$\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx}.$$
So if I wanted to differentiate $y=\cos x^{2}$ I would set $u=x^{2}$ and $y=\cos u$.
In this Physics Stack Exchange answer (https://physics.stackexchange.com/questions/120007/why-do-we-need-a-metric-to-define-gradient) Christoph's answer states:$$\frac{\partial f}{\partial x^{i}}=\sum_{j}\frac{\partial f'}{\partial x'^{j}}\frac{\partial\phi^{j}}{\partial x^{i}},$$where $x'=\phi(x)$ and $f=f'\circ\phi$. Is this another version of the chain rule, and if so how does it relate to my version?
In the versions of the multivariable chain rule I've seen there are similar/identical terms in the numerator and denominator. Like this: $$\frac{\partial z}{\partial u}=\frac{\partial z}{\partial x}\frac{\partial x}{\partial u}+\frac{\partial z}{\partial y}\frac{\partial y}{\partial u}.$$
Thanks.