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, MarcoB May 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.

  • $\begingroup$ Related: (5575), (92698) $\endgroup$ – Michael E2 May 11 '17 at 22:23
  • $\begingroup$ 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 $\endgroup$ – 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}}]}]

enter image description here

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.

  • $\begingroup$ Since the OP asked about "minima" the solutions are sols = NSolve[{f'[x] == 0, f''[x] > 0}, x, Reals] which gives three minima. $\endgroup$ – Bob Hanlon May 11 '17 at 23:14
  • $\begingroup$ Ah yes.... I'll edit my solution when I get a chance. Thanks. $\endgroup$ – David G. Stork May 11 '17 at 23:23
  • $\begingroup$ @BobHanlon, what if the 2nd derivative is also zero vs h.o.t? $\endgroup$ – alancalvitti May 11 '17 at 23:26
  • $\begingroup$ @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. $\endgroup$ – Bob Hanlon May 11 '17 at 23:41
  • $\begingroup$ @BobHanlon, higher order terms. $\endgroup$ – alancalvitti May 11 '17 at 23:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.