3.9.8 Numerical Minimization
FindRoot gives you a way to find points at which a particular function is equal to zero. It is also often important to be able to find points at which a function has its minimum value. In principle, you could do this by applying FindRoot to the derivative of the function. In practice, however, there are much more efficient approaches.
FindMinimum gives you a way to find a minimum value for a function. As in FindRoot, you specify the first one or two points to try, and then FindMinimum tries to get progressively more accurate approximations to a minimum. If FindMinimum returns a definite result, then the result is guaranteed to correspond to at least a local minimum of your function. However, it is important to understand that the result may not be the global minimum point.
You can understand something about how FindMinimum works by thinking of the values of your function as defining the height of a surface. What FindMinimum does is essentially to start at the points you specify, then follow the path of steepest descent on the surface. Except in pathological cases, this path always leads to at least a local minimum on the surface. In many cases, however, the minimum will not be a global one. As a simple analogy which illustrates this point, consider a physical mountain. Any water that falls on the mountain takes the path of steepest descent down the side of the mountain. Yet not all the water ends up at the bottom of the valleys; much of it gets stuck in mountain lakes which correspond to local minima of the mountain height function.
You should also realize that because FindMinimum does not take truly infinitesimal steps, it is still possible for it to overshoot even a local minimum.
This finds the value of which minimizes , starting from .
Here is a function with many local minima.
FindMinimum finds the local minimum closest to . This is not the global minimum for the function.
This finds the local minimum of a function of two variables. As in FindRoot, it is a good idea to choose starting values that are not too "special".