I am doing homework in Matlab, calculating numeric integration using different methods like simpson, etc. I need to find value n from formulas for error of method like this one for rectangle method
E = (b-a)/24 * max f''(x) * ((b-a)/n)^2
n = sqrt(((b-a)^3 * max f''(x)) / 24 * E)
problem is finding function for finding maximum value of f”(x) in range a to b.
I have only found fminbnd, which calculates minimum value of function in range. Is there function which would calculate maximum value?
Look for the minimum of
-f''(x)(the negative of the function you want to maximize).