Suppose you have something like
and suppose you want to detect the minima that is between 0 and 2. Note that this minima is not at y = 0 -- it is somewhere near y = 5.
Then:
The way to detect this situation using the bisection method...
Is to give up on using the bisection method for this situation.
The bisection method is strictly for finding locations that cross y = 0.
Now, you could
df = diff(f)
df = 
and use the bisection method on df
location_of_critical_points = solve(df, x)
location_of_critical_points =

value_at_critical_points = subs(f, x, location_of_critical_points)
value_at_critical_points =

vpa(value_at_critical_points)
ans =
