# Algorithm to find extrema of a function?

What are some simple algorithms that find the maximum of a function in a certain domain?

The function $f$ is guaranteed to have 1 maximum and no other turning points between $a$ and $b$, how can I find out what the value of this maximum is without knowing anything about the function? I can only query what $f(x)$ is for some $x$. How can I eventually approximate the $x$ for which the function has its maximum?

• Do you know the order of the curve ?
– t123
Nov 27, 2017 at 19:10
• @t123 all I can do is query what $f(x)$ is for a certain $x$. It could be anything, not necessarily a polynomial. Nov 27, 2017 at 19:15
• What do you mean by "no turning points"? Do you mean it is increasing, then decreasing? If so, try a variant on binary search.
– D.W.
Nov 27, 2017 at 19:49
• @D.W. at the moment I'm thinking that I take the midpoint between the two highest values found so far Nov 27, 2017 at 19:56
• Still not clear what you mean by "no turning points", so it's hard to know how to answer your question.
– D.W.
Nov 27, 2017 at 20:43