Let \begin{align*} V\colon \mathbb R & \to \mathbb R \\ x & \longmapsto V(x). \end{align*} and \begin{align*} w\colon \mathbb R^3 & \to \mathbb R \\ (a,b,c) & \longmapsto w(a,b,c). \end{align*} I thought that using the chain rule we have $\dfrac{dV(w)}{dw(a,b,c)} = \dfrac{dV}{da} \dfrac{\partial a}{\partial w} + \dfrac{dV}{db} \dfrac{\partial b}{\partial w}+ \dfrac{dV}{dc} \dfrac{\partial c}{\partial w}$?
Numerically, I am finding that $\dfrac{dV(w)}{dw(a,b,c)} = \dfrac{1}{3}\cdot\left(\dfrac{dV}{da} \dfrac{\partial a}{\partial w} + \dfrac{dV}{db} \dfrac{\partial b}{\partial w}+ \dfrac{dV}{dc} \dfrac{\partial c}{\partial w}\right)$.
Which is correct? Why do I need multiply by $\dfrac{1}{3}$?
$\endgroup$ 113 Answers
$\begingroup$Let $f:A\longrightarrow B$. We denote the Jacobian of $f$ at $x\in A$ by $J_f(x)$. The chain rule for the Jacobian is
$$J_{f\circ g}(x) = J_f\big(g(x)\big)\cdot J_g(x).$$
Applying this to your case we have
$$J_{V\circ w}(a,b,c) = J_V\big(w(a,b,c)\big)\cdot J_w(a,b,c).$$
Now, $V$ is a single variable function and hence $J_V\big(w(a,b,c)\big) = V'\big(w(a,b,c)\big)$, where $V'$ is the usual derivative.
On the other hand, $w:\mathbb R^3\longrightarrow \mathbb R$, so $J_w(a,b,c)$ is just the transpose of $\nabla w(a,b,c)$. Therefore:
$$J_{V\circ w}(a,b,c) = V'\big(w(a,b,c)\big)\cdot \left( \frac{\partial w}{\partial a}(a,b,c), \frac{\partial w}{\partial b}(a,b,c), \frac{\partial w}{\partial c}(a,b,c) \right)$$
$\endgroup$ 1 $\begingroup$Using the chain rule should be correct. I've recently used it in multiple Partial Differential Equations exams, with the formula you've given: $$\dfrac{dV}{dw(a,b,c)} = \dfrac{dV}{da} \dfrac{\partial a}{\partial w} + \dfrac{dV}{db} \dfrac{\partial b}{\partial w}+ \dfrac{dV}{dc} \dfrac{\partial c}{\partial w}$$ Wikipedia also says this is the correct way to apply the chain rule in higher dimensions:
I'd say check your numerical findings again, or even show it to us, to see where this might have gone wrong.
$\endgroup$ 4 $\begingroup$Consider the following functions:
$$f = f(x,y)$$
$$g = g(f)$$
It's clear that $g$ can be written in terms of $(x,y)$ once the form of $f$ and $g$ is known. Thus using the chain rule,
$$dg = \dfrac{\partial{g}}{\partial{x}} dx + \dfrac{\partial{g}}{\partial{y}} dy$$
Also we can write:
$$\dfrac{\partial{g}}{\partial{x}} = \dfrac{\partial{g}}{\partial{f}} \dfrac{\partial{f}}{\partial{x}}$$$$\dfrac{\partial{g}}{\partial{y}} = \dfrac{\partial{g}}{\partial{f}} \dfrac{\partial{f}}{\partial{y}}$$
Hence:
$$dg = \dfrac{\partial{g}}{\partial{f}}(\dfrac{\partial{f}}{\partial{x}} dx + \dfrac{\partial{f}}{\partial{y}} dy)$$
Finally:
$$\dfrac{dg(f)}{df(x,y)} = \dfrac{\partial{g}}{\partial{f}}(\dfrac{\partial{f}}{\partial{x}} \dfrac{dx}{df} + \dfrac{\partial{f}}{\partial{y}} \dfrac{dy}{df})$$
$\endgroup$