Example 3. Find the
local maximum of the function
in
the interval
.
Solution 3.
![[Graphics:../Images/GoldenRatioSearchMod_gr_155.gif]](../Images/GoldenRatioSearchMod_gr_155.gif)
We see that the local maximum lies in the
interval
.
So we will search for the local minimum
of
in
the interval
.
![[Graphics:../Images/GoldenRatioSearchMod_gr_163.gif]](../Images/GoldenRatioSearchMod_gr_163.gif)
![[Graphics:../Images/GoldenRatioSearchMod_gr_164.gif]](../Images/GoldenRatioSearchMod_gr_164.gif)
Therefore, to find the local maximum of
we take the negative of the local minimum of
.
![[Graphics:../Images/GoldenRatioSearchMod_gr_168.gif]](../Images/GoldenRatioSearchMod_gr_168.gif)
![[Graphics:../Images/GoldenRatioSearchMod_gr_169.gif]](../Images/GoldenRatioSearchMod_gr_169.gif)
Let us compare this answer with Mathematica's subroutine FindMinimum.
(c) John H. Mathews 2004