# Confusion related to calculation of second derivative

I was wondering how this was derived

$f(x)= h(g(x))$

$f''(x) = g'(x)^T\nabla^2{h(g(x)}g'(x) + \nabla(g(x))^Tg''(x)$

-

## migrated from stats.stackexchange.comJan 10 '13 at 8:13

This question came from our site for people interested in statistics, machine learning, data analysis, data mining, and data visualization.

What are the domains of the various functions? It appears that $f$ is a function of one variable, $h$ is a function with domain some subset of $\mathbb{R}^d$, and $g$ is a vector-valued function on one variable? I am basing the above on the notations you used. –  Willie Wong Jan 10 '13 at 9:09