An example of the realroots function is
The numer flag says give a numerical (floating point) answer. Now
the maximum must occur either at a critical point or at an end point
of the interval, so we can tell write a function to find the maximum
on each little subinterval.
Note the graph of the above function fff is: