# Find the global maxima over the interval [0,1]

I am trying to find the global maxima of this function

FindMaximum[{Abs[1/2 Sqrt[x^2 + 1/10]
Exp[-(Cosh[x])/4] - (0.05 +
0.0644541/((0.1 + 0.5*x) (3 + Cos[2*\[Pi]*x])) +
0.875619*x^2*Sin[1/2*Exp[-2 x]*\[Pi]])], 0 <= x <= 1}, {x, 0.5}]


The result it gives is

{0.044611, {x -> 0.418328}}


Which is only a local maxima not a global maxima. The global maxima in the interval $$[0,1]$$ occurs around 1. If I start near 1 then only it shows the real global maxima. How can I modify so that it gives global maxima regardless of my initial value.

• Related Q&A here. Commented Sep 5 at 8:08

NMaximize finds global maximum

NMaximize[{Abs[
1/2 Sqrt[x^2 + 1/10] Exp[-(Cosh[x])/4] - (0.05 +
0.0644541/((0.1 + 0.5*x) (3 + Cos[2*\[Pi]*x])) +
0.875619*x^2*Sin[1/2*Exp[-2 x]*\[Pi]])], 0 <= x <= 1}, x]
(*{0.0949569, {x -> 1.}}*)


FindMaximum searches local maxima. To see this, first plot your function:

Plot[Abs[
1/2 Sqrt[x^2 + 1/10] Exp[-(Cosh[x])/4] - (0.05 +
0.0644541/((0.1 + 0.5*x) (3 + Cos[2*\[Pi]*x])) +
0.875619*x^2*Sin[1/2*Exp[-2 x]*\[Pi]])], {x, 0, 1}]


If you define a start point of x==0.5, FindMaximum it will climb up backwards to x==0.418. However, if you give start point of x>0.65 it will climb to x==1.

• This doesn't answer the question, and in fact all the information in this answer (except perhaps the graph) is already present in the question. Commented Sep 6 at 0:37