What are some simple (i.e. not overly convoluted and complicated) examples of functions $f$ that have multiple optima over $x>0$?
An example I give below is $f(x)=((x-5)^2-10)^2$ which has two global optima and a local optima.
What are some simple (i.e. not overly convoluted and complicated) examples of functions $f$ that have multiple optima over $x>0$?
An example I give below is $f(x)=((x-5)^2-10)^2$ which has two global optima and a local optima.
On
You can also play with linear combination of smooth functions
$f(x)=\sum\limits_{i=1}^n \alpha_i\,e^{-\sigma_i(x-\omega_i)^2}\quad\sigma_i>0$
At infinity they are $0$ so there are plenty of local minima and maxima.
For instance:
$-5e^{-(x-3)^2}+e^{-(x-6)^2}+3e^{-(x-8)^2}+e^{-(x-11)^2}$
You can see it generates a bump in each of the $\omega_i$ that you can adjust amplitude with the coefficients $\alpha_i$.
Comparatively to polynomials where the bumps appear between the roots, here it is really straightforward to generate local extrema at precise locations and precise amplitude. The downside is that it is difficult to study eventual parasite behaviour like the one around $9.6$ when the $\omega_i$ are too close.
But you can solve this issue by taking bigger values of $\sigma_i$. In the previous example I simply took $\sigma_i=1$, now with $\sigma_i=20$, you can notice the bumps have become narrow like spikes.
On
I can't help but feel that the other examples are too complicated. Unless I've misunderstood your question, take any polynomial with more than 3 positive roots. By Rolle's Theorem, between each pair there is at least one zero of the derivative. These things are smooth, and so these are extrema.
The roots of $p$ are precisely the local optimal of $P(x):=\int_0^x p(t)dt$. So to generate many low-degree examples simply pick several positive numbers, build a function with those as its roots, and integrate. If you want to avoid large coefficients, you can simply scale the resulting polynomial without worrying about the roots of $p$.
For example, we can take $p(x)=(x-1)(x-2)(x-3)$ and integrate it to get $P(x)=x^4-8x^3+22x^2-24x+11$.
To do another, let $p(x)=(x^2-1)(x^2-4)$ which gives $P(x)=3x^5-25x^3+60x+22$
If you want to ensure that the function has no points of inflection, just make sure that each root in $p$ shows up an odd number of times.