# find all global minima (there is more than one global minimum)

I have a function with two global minima, I would like mathmatica to find both of them. for example I have the function: and I'm trying to find both global minima using:

FindMinimum[{-5 x^4 + 5 x^6 + x^2}, {x}]


this only find one minimum:

{-0.130734, {x -> 0.737666}}

how do I find both?

I don't care if you use Nminimize, FindMinimum, or any other function as long as you find both minima

• FindMinimum finds only one minimum. – Adi Ro Apr 18 '16 at 9:53
• – Yves Klett Apr 18 '16 at 9:55
• and Nminimize does find the global minimum, It says so in the function details: "NMinimize always attempts to find a global minimum of f subject to the constraints given." – Adi Ro Apr 18 '16 at 9:56
• ... it always attempts, but not necessarily manages. Do you only have polynomial functions? – Yves Klett Apr 18 '16 at 9:57
• @YvesKlett It's actually trigonometric functions, but I tried to simplify my question... – Adi Ro Apr 18 '16 at 10:05

findGlobalMin[func_, x_Symbol] := Module[
{min = MinValue[func, x] // Simplify},
{min, Select[
Solve[{
D[func, x] == 0,
D[func, {x, 2}] > 0},
x] // Simplify,
(func /. #) == min &]}]

f[x_] = -5 x^4 + 5 x^6 + x^2;

findGlobalMin[f[x], x] You can do the example emulating pen/pencil and paper,e.g.:

y[x_] := x^4 - x^2
c = x /. Solve[D[y[x], x] == 0, x]
r = D[y[x], {x, 2}];
ans = Pick[c, (r > 0 /. x -> #) & /@ c]
Plot[y[x], {x, -1.5, 1.5},
Epilog -> {Red, PointSize[0.02], Point[{#, y@#} & /@ ans]}] • I'm looking for the global minima. not all minima. – Adi Ro Apr 18 '16 at 10:35
• @AdiRo in this (special case and without a domain specified:assumed $-\infty$ to$\infty$) these are global minima. But I take your point that this may have been a MWE and not your desired response. I may leave the answer as, perhaps, others might find useful. – ubpdqn Apr 18 '16 at 10:39
• @ubpdqn I edited the question to make It clear – Adi Ro Apr 18 '16 at 10:50