# How to get the correct answer of this expression with Minimize? [closed]

I want to find minimum value of the expression $$P = 13 x^2 + 12 y^2 + 22 z^2$$ such that $x y + y z + z x = 1$. I tried

Minimize[{13 x^2  + 12 y^2 + 22 z^2, x y +  y z + z x == 1}, {x, y,


z}]

and got

{Root[-13728 + 47 #1^2 + #1^3 &, 3], {x -> (1 - Root[{-13728 + 47 #1^2 + #1^3 &, 663520 + 13728 #1 - 79 #1^2 - 791648 #2^2 - 145288 #1 #2^2 - 3105 #1^2 #2^2 + 2423278 #2^4 + 66924 #1 #2^4 + 597 #1^2 #2^4 + 679536 #2^6 + 1981 #1 #2^6 + 133908 #2^8 &}, {3, 2}] Root[{-13728 + 47 #1^2 + #1^3 &, 663520 + 13728 #1 - 79 #1^2 - 791648 #2^2 - 145288 #1 #2^2 - 3105 #1^2 #2^2 + 2423278 #2^4 + 66924 #1 #2^4 + 597 #1^2 #2^4 + 679536 #2^6 + 1981 #1 #2^6 + 133908 #2^8 &, 13 - #1 #2^2 + 12 #2^4 - 26 #2 #3 - 2 #1 #2 #3 + 24 #2^3 #3 - #1 #3^2 + 47 #2^2 #3^2 + 44 #2 #3^3 + 22 #3^4 &}, {3, 2, 2}])/(Root[{-13728 + 47 #1^2 + #1^3 &, 663520 + 13728 #1 - 79 #1^2 - 791648 #2^2 - 145288 #1 #2^2 - 3105 #1^2 #2^2 + 2423278 #2^4 + 66924 #1 #2^4 + 597 #1^2 #2^4 + 679536 #2^6 + 1981 #1 #2^6 + 133908 #2^8 &}, {3, 2}] + Root[{-13728 + 47 #1^2 + #1^3 &, 663520 + 13728 #1 - 79 #1^2 - 791648 #2^2 - 145288 #1 #2^2 - 3105 #1^2 #2^2 + 2423278 #2^4 + 66924 #1 #2^4 + 597 #1^2 #2^4 + 679536 #2^6 + 1981 #1 #2^6 + 133908 #2^8 &, 13 - #1 #2^2 + 12 #2^4 - 26 #2 #3 - 2 #1 #2 #3 + 24 #2^3 #3 - #1 #3^2 + 47 #2^2 #3^2 + 44 #2 #3^3 + 22 #3^4 &}, {3, 2, 2}]), y -> Root[{-13728 + 47 #1^2 + #1^3 &, 663520 + 13728 #1 - 79 #1^2 - 791648 #2^2 - 145288 #1 #2^2 - 3105 #1^2 #2^2 + 2423278 #2^4 + 66924 #1 #2^4 + 597 #1^2 #2^4 + 679536 #2^6 + 1981 #1 #2^6 + 133908 #2^8 &}, {3, 2}], z -> Root[{-13728 + 47 #1^2 + #1^3 &, 663520 + 13728 #1 - 79 #1^2 - 791648 #2^2 - 145288 #1 #2^2 - 3105 #1^2 #2^2 + 2423278 #2^4 + 66924 #1 #2^4 + 597 #1^2 #2^4 + 679536 #2^6 + 1981 #1 #2^6 + 133908 #2^8 &, 13 - #1 #2^2 + 12 #2^4 - 26 #2 #3 - 2 #1 #2 #3 + 24 #2^3 #3 - #1 #3^2 + 47 #2^2 #3^2 + 44 #2 #3^3 + 22 #3^4 &}, {3, 2, 2}]}}

If I tried

Clear[x, y, z]
FunctionRange[{13 x^2  + 12 y^2 + 22 z^2, x y +  y z + z x == 1}, {x,y, z}, w]


I got

w >= Root[-13728 + 47 #1^2 + #1^3 &, 3]

How to get the correct answer of this expression with commad Minimize?

• Minimize[{13 x^2 + 12 y^2 + 22 z^2, x y + y z + z x == 1}, {x, y, z}] // N Commented Dec 14, 2015 at 1:02
• @belisariushassettled Thank you. I tried. Can I get the correc answer? Commented Dec 14, 2015 at 1:03
• If you just need to get a good approximate answer (assuming there is no exact answer), try NMinimize: NMinimize[{13 x^2 + 12 y^2 + 22 z^2, x y + y z + z x == 1}, {x, y, z}]
– JimB
Commented Dec 14, 2015 at 1:10
• It is my understanding that usually when a root object appears, there is no "nice" form (such as a rational number or a multiple of $\pi$, etc.). The following post might help: mathematica.stackexchange.com/questions/13767/…
– JimB
Commented Dec 14, 2015 at 1:47
• @JimBaldwin that is OP's own question. I am not sure why the answer did not sink in, but I cannot think of anything better than to recommend a review of the documentation. As such, I vote to close. Commented Dec 14, 2015 at 1:56

min = Minimize[{13 x^2 + 12 y^2 + 22 z^2, x y + y z + z x == 1}, {x, y, z}];


The Root expressions are the exact solutions. Use N to convert the Root expressions to their approximate numeric equivalent. You can specify any arbitrary precision using the second argument to N.

min // N

(*  {14.893, {x -> -0.635532, y -> -0.668213, z -> -0.441289}}  *)


This is consistent with the FunctionRange

FunctionRange[{13 x^2 + 12 y^2 + 22 z^2, x y + y z + z x == 1}, {x, y, z},
w] // N

(*  w >= 14.893  *)


Alternatively, using the constraint to remove one variable and again using N to convert the Root expressions to their approximate numeric equivalent.

Minimize[13 x^2 + 12 y^2 + 22 z^2 /. Solve[x y + y z + z x == 1, z], {x, y}] //
N

(*  {14.893, {x -> -0.635532, y -> -0.668213}}  *)

• Well, let me just add that the "numeric equivalent" is not really equivalent. The Root object represents the solution at infinite precision; the numeric value is just an approximation to it. Commented Dec 14, 2015 at 1:58
• @OleksandrR. - agree. I tried to clarify above. Commented Dec 14, 2015 at 2:05

If you only want the minimum value, MinValue would be adequate.

MinValue[{13 x^2 + 12 y^2 + 22 z^2, x y + y z + z x == 1}, {x, y, z}]

(*  Root[-13728 + 47 #1^2 + #1^3 &, 3] *)


If you want to use Minimize:

Minimize[{13 x^2 + 12 y^2 + 22 z^2, x y + y z + z x == 1}, {x, y, z}][[1]]

(*  Root[-13728 + 47 #1^2 + #1^3 &, 3] *)


If you want the exact value and not the Root object:

ToRadicals @ Root[-13728 + 47 #1^2 + #1^3 &, 3]

(* 1/3 (-47 + 2209/(81505 + 36 I Sqrt[3191474])^(1/3)
+ (81505 + 36 I Sqrt[3191474])^(1/3)) *)


(This works because the equation in the Root object is a cubic equation; it may not work for high-order polynomials)

Note that this expression contains imaginary terms but is a real number (Casus Irreducibilis).