In practice, the function is constructed as a measure of "goodness" for some procedure, and we want to find out the best way to perform that procedure. In this case we are performing global optimisation, which is much harder than local optimisation. Local optimisation is the procedure of finding a local optimum, which can easily be accomplished iteratively by a greedy algorithm. (The construction of such an algorithm is left as an exercise).

Optimisation can be performed analytically or numerically. Numerical methods may often be stochastic. A simple analytic optimisation of a polynomial can be conducted by first finding the roots of the first derivative: these are the turning points x_{i}. One can then sort the points by the y-coordinate to find the largest.