# How to find this global minimum?

This is a problem from a Russian school math olympiad:

Minimize[(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y +
30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2), {x, y}]


The above code is running on my comp as well as on MathematicaOnline without any response for hours. Also

NMinimize[(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y +
30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2), {x, y}]


NMinimize::nrnum: The function value 0. +0.00126832 I is not a real number at {x,y} = {0.918621,0.716689}.

and

Plot3D[(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y +
30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2), {x, -3, 3}, {y, -2, 2},PlotPoints->50 ]


do not help.

• Did you try analytical approach? – Rom38 Mar 30 '19 at 9:41
• As @Rom38 mentioned: Solve[Thread[Numerator[Together[D[(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y + 30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2), {{x, y}}]]] == 0], {x, y}, Reals]. Then, check the solution with PositiveDefiniteMatrixQ[D[(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y + 30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2), {{x, y}, 2}] /. First[%]]. – J. M.'s technical difficulties Mar 30 '19 at 9:42
• @J.M.isslightlypensive, yes, my point is that global minimum corresponds to minimum of numerator and maximum of denominator. Drawing them separately, one can see that denominator is a linear fold and numerator is a smooth decreasing slope.. – Rom38 Mar 30 '19 at 9:50
• @J.M. is slightly pensive: Thank you for your suggestions. However, on that way only a local minimum $x=5/3,y=-1/3$ is found. It's unclear whether one is a global minimum. – user64494 Mar 30 '19 at 9:52
• @Rom38: Can you kindly base your "Drawing them separately, one can see that denominator is a linear fold and numerator is a smooth decreasing slope"? – user64494 Mar 30 '19 at 9:53

The graphical solution is simple:

Plot3D[{
(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y + 30),
(4 - x^2 - 10 x*y - 25 y^2)^(7/2)},
{x, -7, 7}, {y, -5, 5},
ImageSize -> 500, PlotPoints -> 50, PlotRange->All]


The global minimum lies on the top of blue fold and, therefore, you need find the equation of maximum of denominator as y(x) just solving the equation for its total derivative. Further, you need find the minimum of the numerator along the earlier obtained direction.

The top of the denominator surface is:

ss = Solve[D[(4-x^2-10*x*y-25*y^2)^(7/2), x]+D[(4-x^2-10*x*y-25*y^2)^(7/2), y]==0, {y}, Reals]


It gives {{y -> 1/5 (-2 - x)}, {y -> (2 - x)/5}, {y -> -(x/5)}} and only last of them corresponds to top of the fold. Next, let's find the minimum of numerator on the top of fold:

Solve[#==0,x]&@D[(5*x^2+8*x*y+5*y^2-14*x-10*y+30)/.ss[[-1]], x]


{{x -> 5/3}}

Taking in account the y=-x/5, the global minimum is:

(5*x^2+8*x*y+5*y^2-14*x-10*y+30)/(4-x^2-10*x*y-25*y^2)^(7/2)/.{y-> -(x/5)}/.{x->5/3}


5/32 at {5/3,-1/3}

• Thank you. I find it rather a plausible argument than a solution of the problem under consideration. One of the ungrounded places is "The global minimum lays on the top of blue fold". – user64494 Mar 30 '19 at 11:09
• Minimal value of the fraction appears when you have minimum of numerator and maximum of denominator simultaneously. The fold is horizontal (4-(x+5y)^2)^7/2 and it clearly has a maximum on the top. – Rom38 Mar 30 '19 at 11:16
• "Minimal value of the fraction appears when you have minimum of numerator and maximum of denominator simultaneously" . Yes, but Minimize[5 x^2 + 8 xy + 5 y^2 - 14 x - 10 y + 30, {x, y}] performs {20,{x->5/3,y->-(1/3)}} and Maximize[4 - x^2 - 10 xy - 25 y^2, {x, y}] produces {4, {x -> 0, y -> 0}}. – user64494 Mar 30 '19 at 11:27
• I upvoted because it is a reasonably clever, if somewhat hand-waving, approach. Next question. – Daniel Lichtblau Mar 30 '19 at 20:51
• I'm pretty much done reading any comments of yours. My advice, unsolicited though it might be, is that the comments go away. – Daniel Lichtblau Mar 30 '19 at 20:57

My numerical solution is as follows.

NMinimize[{(  30 - 14 x + 5 x^2 - 10 y + 8 x y +  5 y^2)/(4 - x^2 - 10 x y - 25 y^2)^(7/2),
x^2 + 10 x y + 25 y^2 < 4},{x, y}, Method -> "RandomSearch",  WorkingPrecision -> 15]


{0.156250000000000,{x->1.66666666666667,y->-0.333333333333333}}

Addition. My exact solution is as follows.

Minimize[{(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y +
30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2), 4-x^2-10 x*y- 25 y^2 >= 0} /. x -> t - 5 y, {t, y}]


{5/32, {t -> 0, y -> -(1/3)}}

PS. Even the following works.

Minimize[(5 x^2 + 8 x*y + 5 y^2 - 14 x - 10 y +
30)/(4 - x^2 - 10 x*y - 25 y^2)^(7/2) /. x -> t - 5 y, {t, y}]

• Method -> "RandomSearch" would be, well, "built on sand" unless you can be sure the random sampling has sufficiently covered a wide enough portion of the function's domain. As for your first: what happened to the 7/2 exponent? You are getting 5 because that is the result of evaluating your "new" function at those values of x and y. – J. M.'s technical difficulties Mar 30 '19 at 16:24
• @J. M. is slightly pensive: Do you know an option of NMinimize to this end? The DirectSearch of Maple produces the same numerical result. – user64494 Mar 30 '19 at 16:28
• There is never an assurance that NMinimize[] will return a global optimum except in the linear case (points 9 and 10 under "Details and Options" in the documentation). (Same goes for Maple's method.) Recall that the general procedure of such methods is to take multiple samples and take the "best" result out of all those samples, so there is still a nonzero chance of missing extrema. – J. M.'s technical difficulties Mar 30 '19 at 16:32
• @J. M. is slightly pensive: When two different CASes, making use of different methods, produce the same result, then its reliability increases, is not so? – user64494 Mar 30 '19 at 16:43
• I do not see that being any more rigorous than e.g. rmw's answer, but I suppose opinions differ. – J. M.'s technical difficulties Mar 30 '19 at 16:45