Hi! I must find minimum of function as follows.
For example, I have such a graphic
I saw that there are two points of minimum and some of rectangles are exactly higher than others, so I need discard them and continue only with the remaining rectangles.
If I can't see exactly which rectangles are higher I must divide my interval on more rectangles.
Thanks,
Viktoriya.
P.S. I know how draw rectangles on a function:
gr[f_, xmin_, xmax_, slices_] :=
Module[{span = (xmax - xmin)/slices, ext},
ext[op_, r_] := First@Quiet@op[{f[x], r <= x <= r + span}, x];
Plot[f[x], {x, xmin, xmax},
Prolog -> {FaceForm[Gray], EdgeForm,
Rectangle @@@ ({{#, ext[Minimize, #]}, {# + span,
ext[Maximize, #]}} & /@ Most@Range[xmin, xmax, span])}]];
f[x_] := x + 3*Sin[x + 2]; gr[f, -5, 5, 10]