Number and location of local minima [closed]

Take the function

$$f(x) = ax^{2} + bx^{4} - c \cos(x/d),$$

where $a$, $b$, $c$ and $d$ are arbitrary parameters.

For some given choice of the parameters, how do you find the number of local minima of the function and the location of the minima?

closed as off-topic by rhermans, yohbs, happy fish, glS, MarcoBMay 12 '17 at 13:15

• The question does not concern the technical computing software Mathematica by Wolfram Research. Please see the help center to find out about the topics that can be asked here.
If this question can be reworded to fit the rules in the help center, please edit the question.

• Related: (5575), (92698) – Michael E2 May 11 '17 at 22:23
• Your question may (should?) be put on-hold or migrated because it seems to be off-topic, i.e. its about mathematics and not Mathematica. If that's not your intention, please edit your question to make it explicitly about Wolfram Mathematica programming. Include a formatted minimum example of the code you are working on – rhermans May 11 '17 at 22:25

a = 0.01;
b = 0.0001;
c = 10;
d = 3;
sols = NSolve[
D[a x^2 + b x^4 - c Cos[x/d], x] == 0 &&
D[a x^2 + b x^4 - c Cos[x/d], {x, 2}] > 0, x, Reals];
{Length[sols], sols}

$\{3,\{\{x\to -16.6935\},\{x\to 0.\},\{x\to 16.6935\}\}\}$

The second derivative condition ensures a minimum.

Plot[a x^2 + b x^4 - c Cos[x/d], {x, -20, 20},
Epilog -> {Red, PointSize[0.02],
Point@Transpose[{(x /. sols), {0, 0, 0}}]}]

Notice that your function is symmetric with respect to the interchange $x \leftrightarrow -x$, so you have an odd number of solutions, i.e., one at $x = 0$ and an even number of symmetric solutions.

• Since the OP asked about "minima" the solutions are sols = NSolve[{f'[x] == 0, f''[x] > 0}, x, Reals] which gives three minima. – Bob Hanlon May 11 '17 at 23:14
• Ah yes.... I'll edit my solution when I get a chance. Thanks. – David G. Stork May 11 '17 at 23:23
• @BobHanlon, what if the 2nd derivative is also zero vs h.o.t? – alancalvitti May 11 '17 at 23:26
• @alancalvitti - I do not know what you mean by "h.o.t." If the second derivative is zero it could be an inflection point rather than a minima or maxima. – Bob Hanlon May 11 '17 at 23:41
• @BobHanlon, higher order terms. – alancalvitti May 11 '17 at 23:45