Is this a version of the chain rule?

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.

• Yes, it's the multivariable version of the chain rule. Commented Apr 16, 2019 at 17:13
• Please see my "multivariable" edit. Commented Apr 16, 2019 at 17:35
• Well, yes: as you wrote, $x'=\phi(x)$, so they really are equal as in the formula you have at the end. Commented Apr 16, 2019 at 17:54

When we write $$\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx},$$ in the first factor on the right hand side we treat $$u$$ as a variable, but in the second factor we treat $$u$$ as a function. This is a bit troublesome mathematically. For this reason it would be somewhat better to introduce a two functions $$f(u)$$ and $$g(x)$$ such that $$y(x) = f(g(x))$$ and say $$\frac{dy}{dx} = \frac{df}{du} \frac{dg}{dx}.$$