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?
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?
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.
sols = NSolve[{f'[x] == 0, f''[x] > 0}, x, Reals]
which gives three minima.
$\endgroup$
May 11, 2017 at 23:14