Second derivative expression I have $f:\mathbb R^n\to \mathbb R$ and $\gamma:\mathbb R \to \mathbb R^n$, which are both $\mathrm C^2$. Considering $g=f\circ \gamma$, how could I express $g''$, second derivative of $g$ in terms of partial derivatives of $f$ and $\gamma$?. The first I know is that 
$$ \mathrm Dg(a) = \mathrm Df(\gamma(a)) \circ D\gamma(a), $$
so I consider $Dg:x\mapsto Dg(x)$, but this gets complicated. Thanks in advance.
Edit: I know what is the Hessian matrix, I would like to apply it here.
Edit II: Well, it is clear that
$$ g'(a) h = \langle \nabla  g(a), h\rangle = \langle \nabla f(\gamma(a)), \langle \nabla \gamma(a),h\rangle\rangle $$
so, what now?

Sometimes notation gets in the way of understanding things throughly.
It is then, when you need to drop your notation and get your hands dirty; don't be afraid ;).
$$g(x) = f(\gamma(x))$$
$$g'(x) = \frac{d}{dx} f(\gamma(x)) = \sum_{i=1}^n \frac{\partial}{\partial \gamma(x)_i} f(\gamma(x)) \frac{d}{d x} \gamma_i(x) = \\
= \sum_{i=1}^n (\partial_i f)(\gamma(x)) \cdot (\gamma_i)'(x)$$
$$g''(x) = \frac{d}{dx} g'(x) = \sum_{i=1}^n \frac{d}{dx} (\partial_i f)(\gamma(x)) \cdot (\gamma_i)'(x) = \\
= \sum_{i=1}^n \left[ \sum_{j=1}^n (\partial_j \partial_i f)(\gamma(x)) (\gamma_j)'(x) \right] \cdot (\gamma_i)'(x)\ + (\partial_i f)(\gamma(x)) \cdot (\gamma_i)''(x) \\
= \sum_{i,j=1}^n(\partial_j \partial_i f)(\gamma(x)) \cdot (\gamma_j)'(x)(\gamma_i)'(x)\ + \sum_{i=1}^n (\partial_i f)(\gamma(x)) \cdot (\gamma_i)''(x) = \\
= \sum_{i,j=1}^n \nabla \gamma(x)_i H(f)_{ij}(\gamma(x)) \nabla \gamma(x)_j + \sum_{i=1}^n (\nabla f)_i(\gamma(x)) (\gamma_i)''(x) =\\$$
$$ = \nabla\gamma(x)^\top H(f)(\gamma(x)) \nabla \gamma(x) + \nabla f(\gamma(x)) \cdot \gamma''$$
You can rewrite this into your notation...
