Multivariate Chain Rule and second order partials For the function
$g(t) = f(x(t),y(t))$, how would I find $g''(t)$ in terms of the first and second order partial derivatives of $x,y,f$? I'm stuck with the chain rule and the only part I can do is:
$$g'(t) = \frac{\partial f}{\partial x}\frac{\partial x}{\partial t} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial t}$$
and one I differentiate again, I'm not sure how I can differentiate w.r.t $t$ with the partials involving $\frac{\partial f}{\partial x}$ etc.
 A: You can apply the chain rule again, as well as the product rule. Notice that $x,y$ are only functions of $t$, so the appropriate notation is $dx/dt$ and so on. Now, for example,
$$ \frac{d}{dt} \left( \frac{\partial f}{\partial x} \frac{dx}{dt} \right) = \frac{\partial f}{\partial x} \frac{d}{dt} \left(  \frac{dx}{dt} \right) + \frac{d}{dt} \left( \frac{\partial f}{\partial x} \right) \frac{dx}{dt} \\
= \frac{\partial f}{\partial x} \frac{d^2x}{dt^2} + \frac{dx}{dt} \left( \frac{dx}{dt} \frac{\partial}{\partial x} \frac{\partial f}{\partial x} + \frac{dy}{dt} \frac{\partial}{\partial y} \frac{\partial f}{\partial x} \right) \\
= \frac{\partial f}{\partial x} \frac{d^2x}{dt^2} + \left( \frac{dx}{dt} \right)^2 \frac{\partial^2 f}{\partial x^2} + \frac{dx}{dt} \frac{dy}{dt} \frac{\partial^2 f}{\partial y\partial x},
$$
as you successfully did for the first derivative. Equally,
$$ \frac{d}{dt} \left( \frac{\partial f}{\partial y} \frac{dy}{dt} \right) = \frac{\partial f}{\partial y} \frac{d^2y}{dt^2} + \left( \frac{dy}{dt} \right)^2 \frac{\partial^2 f}{\partial y^2} + \frac{dy}{dt} \frac{dx}{dt} \frac{\partial^2 f}{\partial x\partial y}
$$
so adding gives
$$ g''(t) = \frac{\partial f}{\partial x} \frac{d^2x}{dt^2} + \frac{\partial f}{\partial y} \frac{d^2y}{dt^2} + \left( \frac{dx}{dt} \right)^2 \frac{\partial^2 f}{\partial x^2} + \frac{dx}{dt} \frac{dy}{dt} \left( \frac{\partial^2 f}{\partial y\partial x} + \frac{\partial^2 f}{\partial x\partial y} \right) + \left( \frac{dy}{dt} \right)^2 \frac{\partial^2 f}{\partial y^2} $$
The important thing to remember is that $\partial f/\partial x$ and friends are all still just functions, in the same way that $f$ itself is, albeit with rather more complicated symbols. Indeed, one can use the abbreviated notation $f_x$ (or sometimes $f_{,x}$) for $\partial f/\partial x$ and $\dot{x}=dx/dt$ (or sometimes $x'=dx/dt$), which makes the expression look a lot shorter, although perhaps not simpler:
$$ \ddot{g} = f_x \ddot{x} + f_y \ddot{y} + \dot{x}^2 f_{xx} + \dot{x}\dot{y}(f_{xy}+f_{yx})+ \dot{y}^2 f_{yy}. $$
A: $g'(t) = \frac{\partial g}{\partial x}\frac{d x}{dt} + \frac{\partial g}{\partial y}\frac{dy}{dt}$
$g''(t) = $$(\frac{\partial}{\partial x})g'(t)\frac{d x}{dt} + (\frac{\partial}{\partial y})g'(t)\frac{d y}{dt}\\
\frac{\partial^2 g}{\partial x^2}(\frac{d x}{dt})^2 + 2\frac{\partial^2 g}{\partial x\partial y}(\frac{d x}{dt}\frac{d y}{dt}) +\frac{\partial^2 g}{\partial y^2}(\frac{d y}{dt})^2 + \frac{\partial g}{\partial x}\frac{d^2 x}{dt^2} + \frac{\partial g}{\partial y}\frac{d^2y}{dt^2}$
A: Another way to write it is as follows: let $\gamma (t) =(x(t),y(t))$. So, by chain rule,
$$
\dot g(t)=(Df)_{\gamma (t)} \cdot \gamma(t) =\langle \vec \nabla f (\dot\gamma(t)), \dot \gamma (t)\rangle.
$$
And applying it again, using the Leibniz rule,
$$
\begin{align}
\ddot{g} (t) &= \frac{\mathrm{d}}{\mathrm{d}t}\left[ 
(Df)_{\gamma (t)} \cdot \dot\gamma(t)
\right] 
\\
&= \frac{\mathrm{d}}{\mathrm{d}t}\left[ 
(Df)_{\gamma (t)}
\right] \cdot \dot\gamma(t)
+
(Df)_{\gamma (t)}\cdot \ddot{\gamma} (t) 
\\
&= \left( (D^2 f)_{\gamma (t)} \cdot \dot \gamma (t)  \right)\cdot \dot \gamma (t) 
+ \vec \nabla f(\gamma(t)) \cdot \ddot{\gamma} (t)\\
&= \left(
\left[ \begin{matrix}
f_{xx} (\gamma (t))  & f_{xy}(\gamma (t)) \\ f_{yx} (\gamma (t)) & f_{yy}(\gamma (t))
\end{matrix}\right]
\cdot 
\dot \gamma(t)
\right)
\dot \gamma(t)
+ f_x(\gamma(t))\ddot{x}(t)+f_y (\gamma(t))\ddot{y} (t) \\
&= f_{xx}(\gamma(t))\dot{x} ^2 +f_{yy} (\gamma(t))\dot{y}^2+2\dot{x}\dot{y} f_{xy} (\gamma(t))
+
 f_x(\gamma(t))\ddot{x}(t)+f_y (\gamma(t))\ddot{y} (t)
.
\end{align}
$$
(Assuming second derivatives are equal, which is the case when $f$'s second-order mixed partial derivatives $f_{xy}(x,y)$ and $f_{yx}(x,y)$ exist and are continuous.)
Re-writing the last equality while removing the "implicit" dependency on the varible $t$, we have
$$
\ddot{g} = f_{xx}\dot{x} ^2 +f_{yy}\dot{y}^2+2\dot{x}\dot{y} f_{xy}
+
 f_x\ddot{x}+f_y \ddot{y} .
$$
