Consider a real function $f$ of one variable. Suppose the second order derivative exists. To find the second order derivative of $f$, I usually derivate $f$ two times. I start with $f$, and derivate to get the function $\frac{d}{dx} f(x)$ of one variable, which I then derivate again. I would succinctly describe this by writing
$$\frac{d}{dx} \frac{df}{dx}.$$
But when I consider a real multivariable function which maps elements into $\mathbb{R}^k$, with $k \geq 1$, I do not always know how to find the second order derivative. In the case $k=1$ we can consider the derivative of some function $g$ as the gradient $\nabla g$ of $g$. Then the second order derivative of $g$ would be the hessian matrix $H(g)$ of $g$.
But when $k \geq 2$, for example $h(x, y)=(x^2, y^2)$, I do not find it easy to compute the second order derivative, and our coursebook does not discuss this topic.
I know that
$$[h'(x, y)]=\begin{pmatrix} 2x & 0 \\ 0 & 2y \end{pmatrix}.$$
The difference between finding the derivative of $f$ and $g$ or $h$ is that when derivating $f$ we get a function of the same structure, we still map elements from $\mathbb{R}$ into $\mathbb{R}$, but when derivating $g$ or $h$ the structure changes and instead of, for example, mapping elements from $\mathbb{R}^2$ into $\mathbb{R}^2$, we map elements from $\mathbb{R}^2$ into $\mathbb{R}^{2 \times 2}$ (the set of 2 by 2 matrices with real elements). To me, it seems that the problem of finding the second order derivative of $g$ is to derivate a matrix in which all elements are real functions.
I would be grateful if you could, for example, direct me to any material that would help me solve this general problem.
Thanks.