I’m sorry I’m not sure how to word this question. I’ve returned to school after a long break where I was working full time. In school I did calculus, but most of it seems to have left me.

I have started schooling again in data science and I am trying to compute a Hessian Matrix for a simple function. The function is:

$$f(x_1, x_2) = (x_1-1)^2 + 100(x_1^2-x_2)^2$$

I have calculated the gradient vector by taking the first order derivative

$$Delta f(x_1, x_2) = begin{bmatrix}

2(x_1-1) + 400x_1(x_1^2-x_2) \

-200(x_1^2-x_2)

end{bmatrix}$$

In attempting to calculate the Hessian Matrix I am confused by the notation of entry 1,2 and 2,1:

$$ Delta^2f(x_1, x_2) = begin{bmatrix}

frac{delta^2f}{delta x_1^2} & frac{delta^2f}{delta x_2 delta x_1}\

frac{delta^2f}{delta x_1 delta x_2} & frac{delta^2f}{delta x_2^2} \

end{bmatrix}$$

For entry (1,1) and (2,2), I just retake the derivative of the above gradient vector

$$ frac{delta^2f}{delta x_1^2} = frac{delta f}{delta x_1} (2(x_1-1) + 400x_1(x_1^2-x_2)) = 1200x^2-400x_2+2 $$

and

$$ frac{delta^2f}{delta x_2^2} = frac{delta f}{delta x_2} ( -200x_1^2+200x_2 ) = 200 $$

Therefore the matrix as it stands is:

$$ Delta^2f(x_1, x_2) = begin{bmatrix}

1200x^2-400x_2+2 & frac{delta^2f}{delta x_2 delta x_1}\

frac{delta^2f}{delta x_1 delta x_2} & 200 \

end{bmatrix}$$

How would I go about calculating $$ frac{delta^2f}{delta x_2 delta x_1} and frac{delta^2f}{delta x_1 delta x_2} $$?

Thank you for your time