# How to establish saddle point?

For didactic purposes I study a critical point of a function f[x_, y_] := 3 x^4 - 4 x^2 y + y^2 at the origin.

Its plot

Plot3D[f[x, y], {x, -1/4, 1/4}, {y, -1/4, 1/4}]


does not clearly say whether this is a saddle point or a local minimum.

Of course, I may consider f[x,y] along a straight line y==0, where it has a minimum at x==0, and along a parabola y==2*x^2 where it, being equal to -x^4, has a maximum at x==0, but this is a trick, not a systematic approach. The same drawback in

Resolve[ForAll[r, r > 0, Exists[{x, y}, x^2 + y^2 <= r^2 && 3 x^4 - 4 x^2 y + y^2 > 0]], Reals]


together with

Resolve[ForAll[r, r > 0, Exists[{x, y}, x^2 + y^2 <= r^2 && 3 x^4 - 4 x^2 y + y^2 < 0]], Reals]


though both say True.

Because of this reason I try

Maximize[{3 x^4 - 4 x^2 y + y^2,  x^2 + y^2 == r^2 && r > 0 && r < 1/4}, {x, y}]


{Piecewise[{{r^2, Inequality[0, Less, r, Less, 1/4]}}, -Infinity], {x -> Piecewise[{{Root[(1 - 16*r^2)*#1^4 + 10*#1^6 + 9*#1^8 & , 1], Inequality[0, Less, r, Less, 1/4]}}, Indeterminate], y -> Piecewise[{{2*Root[(1 - 16*r^2)*#1^4 + 10*#1^6 + 9*#1^8 & , 1]^2 - Sqrt[r^2 + Root[(1 - 16*r^2)*#1^4 + 10*#1^6 + 9*#1^8 & , 1]^4], Inequality[0, Less, r, Less, 1/4]}}, Indeterminate]}}

which is well and

Minimize[{3 x^4 - 4 x^2 y + y^2, x^2 + y^2 == r^2 && r > 0 && r < 1/4}, {x, y}]


{Piecewise[{{Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2], Inequality[0, Less, r, Less, 1/4]}}, Infinity], {x -> Piecewise[{{Root[r^4 - 2*r^2*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2] + Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2]^2 + (-2*r^2 + 2*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2])*#1^2 + (1 - 10*r^2 - 6*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2])*#1^4 + 10*#1^6 + 9*#1^8 & , 1], Inequality[0, Less, r, Less, 1/4]}}, Indeterminate], y -> Piecewise[{{2*Root[r^4 - 2*r^2*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2] + Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2]^2 + (-2*r^2 + 2*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2])*#1^2 + (1 - 10*r^2 - 6*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2])*#1^4 + 10*#1^6 + 9*#1^8 & , 1]^2 - Sqrt[Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2] + Root[r^4 - 2*r^2*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2] + Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2]^2 + (-2*r^2 + 2*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2])*#1^2 + (1 - 10*r^2 - 6*Root[-r^4 - 40*r^6 - 144*r^8 + (-1 - 48*r^2 - 360*r^4 - 864*r^6)*#1 + (72 - 1296*r^4)*#1^2 + 432*#1^3 & , 2])*#1^4 + 10*#1^6 + 9*#1^8 & , 1]^4], Inequality[0, Less, r, Less, 1/4]}}, Indeterminate]}}

which is not well.

Plot[Minimize[{3 x^4 - 4 x^2 y + y^2, x^2 + y^2 == r^2 && r > 0 && r < 1/4}, {x, y}][[1]], {r, 0, 1/4}]


shows negative values, but doesn't prove it. The commands

Root[-r^4 - 40 r^6 -  144 r^8 + (-1 - 48 r^2 - 360 r^4 - 864 r^6) #1 + (72 - 1296 r^4) #1^2 + 432 #1^3 &, 2] /. r -> 0


0

together with

Maximize[{D[Root[-r^4 - 40 r^6 - 144 r^8 + (-1 - 48 r^2 - 360 r^4 - 864 r^6) #1 + (72 -1296 r^4) #1^2 + 432 #1^3 &, 2], r], r >= 0 && r <= 1/4}, r]


{0, {r -> 0}}

complete the proof.

The question is: is there a simpler way to establish the origin as the saddle point?

• BTW, the Student package of Maple which is an advantage of Maple over Mathematica produces an incorrect result LocalMin = [], LocalMax = [], Saddle = [] by Student:-MultivariateCalculus:-SecondDerivativeTest(3*x^4 - 4*x^2*y + y^2, [x, y] = [0, 0]). Oct 29, 2021 at 7:29
• The Hessian at the critical point gives the answer. Look it up Oct 29, 2021 at 16:47
• @DanielHuber: Unfortuately, no answer in this case since the Hessian at the origin is {{0, 0} {0, 2}}. This is a hard matter: see Encyclopedia of Mathematics for more info. Oct 29, 2021 at 16:59
• Well, then you must get the next higher derivatives. It is nothing else than a series expansion. The lowest non-zero term will determine the behavior. Oct 29, 2021 at 19:38
• @DanielHuber: Think of Piecewise[{{Exp[-1/(x^2+y^2)],x^2+y^2!=0},{0,True}}]. It seems you didn't look in the linked article of Encyclopedia of Mathematica. Don't hesitate to ask for further explanation in need. Oct 30, 2021 at 5:10

Here is an elementary answer to the question.

Minimize[{3 x^4 - 4 x^2 y + y^2, x == r && r> 0 && r < 1/4 && y >= -r && y <= r},{x,y}]


{Piecewise[{{-r^4, Inequality[0, Less, r, Less, 1/4]}}, Infinity], {x -> Piecewise[{{r, Inequality[0, Less, r, Less, 1/4]}}, Indeterminate], y -> Piecewise[{{2*r^2, Inequality[0, Less, r, Less, 1/4]}}, Indeterminate]}}

Maximize[{3 x^4 - 4 x^2 y + y^2,x == r && r > 0 && r < 1/4 && y >= -r && y <= r}, {x,y}]


{Piecewise[{{r^2 + 4*r^3 + 3*r^4, Inequality[0, Less, r, Less, 1/4]}}, -Infinity], {x -> Piecewise[{{r, Inequality[0, Less, r, Less, 1/4]}}, Indeterminate], y -> Piecewise[{{2*r^2 - Sqrt[r^2*(1 + 2*r)^2], Inequality[0, Less, r, Less, 1/4]}}, Indeterminate]}}

Therefore, any neighbourhood of the origin includes the points, where f[x,y]>0, and the points, where f[x,y]<0.This answer the question.

• Is it really a saddle point? The contour lines do not cross! Plot3D[3 x^4 - 4 x^2 y + y^2, {x, -2, 2}, {y, -5, 10}, Mesh -> 20, MeshFunctions -> {#3 &}, AxesLabel -> Automatic]
– rmw
Oct 30, 2021 at 20:43
• @rmw: Indeed, the same with Plot3D[x^2 - y^2, {x, -2, 2}, {y, -5, 10}, Mesh -> 20, MeshFunctions -> {#3 &}, AxesLabel -> Automatic]. Think of a publication of your result in a journal. Oct 31, 2021 at 19:59