second derivative of the composition of two multivariable functions Let $U \subset \mathbb{R}^n$ be open, and let $\gamma: \mathbb{R} \to U$ and $f: U \to \mathbb{R}$ be to functions that are differentiable at least twice.
I want to show that $\frac{d^2}{dt^2}(f \circ \gamma)(t)$ is then given by:
$$\frac{d^2}{dt^2}(f \circ \gamma)(t) = \dot{\gamma}(t)^t H f(\gamma(t))\dot{\gamma}(t)+ d f(\gamma(t))\dot{\dot{\gamma}}(t)$$
(where $H f(x)$ is the Hesse matrix of $f$ at $x \in U$).
I must admit that I don't really know how to get started. It looks like one could utilise the multivariable chain rule?
 A: $\gamma(t+h) = \gamma(t)+ \gamma'(t)h+\frac{1}{2}\gamma''(t)h^2+o(h^2)$
$f(\vec{t} + \vec{h}) = f(\vec{t}) + df\big|_{\vec{t}}(\vec{h}) + \frac{1}{2}\vec{h}^\top H(\vec{t}) \vec{h} + o(|\vec{h}|^2) $
These are both by the multivariable taylor's series.
Composing these two should give you the beginning of the taylor series for $(f \circ \gamma)(t)$, with a rigorous bound on the error.  This should justify your formula.
Now just compose these approximations:
$\begin{align*}
f(\gamma(t+h)) &\approx f\left( \gamma(t) + \gamma'(t)h + \frac{1}{2} \gamma''(t)h^2\right)\\
&\approx f(\gamma(t))+df\big|_{\gamma(t)}\left(\gamma'(t)h + \frac{1}{2} \gamma''(t)h^2 \right) \\
 &\hphantom{hhhhh}+ \left(\gamma'(t)h + \frac{1}{2} \gamma''(t)h^2\right)^\top Hf\big|_{\gamma(t)}\left(\gamma'(t)h + \frac{1}{2} \gamma''(t)h^2 \right)\\
&=f(\gamma(t))+df\big|_{\gamma(t)}(\gamma'(t))h + \frac{1}{2}\left( df\big|_{\gamma(t)}\left(y''(t)\right) + \gamma'(t)^\top H(f)\big|_{\gamma(t)}(\gamma'(t)) \right)h^2 + \textrm{higher order terms}
\end{align*}
$
So the second derivative is $df\big|_{\gamma(t)}\left(y''(t)\right) + \gamma'(t)^\top H(f)\big|_{\gamma(t)}(\gamma'(t))$ as your thought.
I didn't track the little o terms because it got too messy.  I hope you can see that we are just composing taylor series.  A good exercise would be to find  $(f \circ g)''(x)$ for $f,g :\mathbb{R} \to \mathbb{R}$ this way as well.
A: For the first derivation we get:
$d/dt f(\gamma(t)) = <\nabla f(\gamma_1(t),...,\gamma_n(t)), \dot\gamma_1(t),...\dot\gamma_n(t) > = \sum\limits_{i=1}^n \partial_if(\gamma(t))\dot\gamma_i(t) $
For the second one we get:
$d^2/dt^2 f(\gamma(t)) = \sum\limits_{i=1}^n<(\partial_{i1}f(\gamma(t)),...,\partial_{in}f(\gamma(t)),\dot\gamma_1(t),...\dot\gamma_n(t)>\dot\gamma_i(t) + \partial_if(\gamma(t))\dot{\dot\gamma_i}(t) = \sum\limits_{i=1}^n \sum\limits_{j=1}^n \partial_{ij}f(\gamma(t))\dot\gamma_i(t)\dot\gamma_j(t) + \sum\limits_{i=1}^n \partial_if(\gamma(t))\dot{\dot\gamma_i}(t) = \dot{\gamma}(t)^t H f(\gamma(t))\dot{\gamma}(t)+ <d/dt f(\gamma(t)),\dot{\dot{\gamma}}(t)> $
Where $< . , . >$ denotes the standard scalar product.
