1

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?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
nightmarish
  • 283
  • 1
  • 7

1 Answers1

3
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.

David G. Stork
  • 41,180
  • 3
  • 34
  • 96