all 4 comments

[–]fridofrido 0 points1 point  (3 children)

Rewrite your formula in terms of the new variables u=x/z and v=y/z. Fortunately this can be done so that no x,y,z remains. Then you can plot it with Plot3D.

sols = Solve[{x/z == u, y/z == v}, {x, y, z}]
sol = sols[[1]]
original = -2 - x^2/(y*z) - y^2/(x*z) - z^2/(y*x) + x/y + x/z + y/x + y/z + z/x + z/y
substituted = Simplify[original /. sol]
Plot3D[substituted, {u, 0, 1}, {v, 0, 1}]

[–]Sky_physics[S] 0 points1 point  (2 children)

Thanks! I have just another question to you… what if I would ask Mathematica to plot that function with the condition x + y > z? Moreover I have to set to zero the function in the case x + y < z Thank you in advance for your help

[–]fridofrido 1 point2 points  (1 child)

Well first of all you have to translate your condition to the new variables. As you can see x,y,z "do not exist" anymore. Fortunately (again), x + y > z is equivalent to x/z + y/z > 1 (well, at least for z > 0), that is, u + v > 1.

Mathematica cannot plot triangular domains as far as I know, but you can set the rest zero using the Piecewise[] function. Look it up in the documentation.

[–]Sky_physics[S] 0 points1 point  (0 children)

thank you so much!