I am looking to find the local maximum value of the function
$$f(x,y,z) = 9+ \frac{(x-y)^2}{xy} + \frac{(y-z)^2}{yz}+ \frac{(z-x)^2}{zx}$$
at a point within the cube $[a,b] \times [a,b] \times [a,b],$ where $0<a<b$. I took the partial derivative of f with respect to x, y, and z. I set those to zero. I used the second-derivative test for multi-variable functions.
The second-derivative test requires the computation of a 3 by 3 matrix. (Because the function is a three-variable function)
$D= \det \pmatrix{f_{xx} & f_{xy} &f_{xz} \\ f_{yx} & f_{yy} &f_{yz} \\ f_{zx} & f_{zy} &f_{zz}}$
I found that the first dervatives equal to zero at $x=y=z$. On the other hand, Wolfram Alpha confirms that the max for the $[1,3] \times [1,3] \times [1,3]$ is for $y=z=\frac{x}{3}$ and $x=\frac{y}{3}=\frac{z}{3}$. I got confused
$$\frac{\partial^2f}{\partial x^2}=\frac{2(y+z)}{x^3}>0.$$ Similarly, $\frac{\partial^2f}{\partial y^2}>0$ and $\frac{\partial^2f}{\partial z^2}>0.$
Thus, $f$ is a convex function of $x$, of $y$ and of $z$, which says: $$\max_{(x,y,z)\in[a,b]^3}f=\max_{\{x,y,z\}\subset\{a,b\}}f=f(a,a,b)=$$ $$=9+\frac{(a-a)^2}{a\cdot a}+\frac{(a-b)^2}{ab}+\frac{(a-b)^2}{ab}=9+\frac{2(a-b)^2}{ab}.$$ A local maximum does not exist.
A local minimum is equal to $9$.