Artificial intelligent assistant

Overapproximation of a Trapezoidal Sum Under what conditions will a trapezoidal sum give an over-approximation, and when will it give an under approximation for a function?

If $f$ is concave up (positive second derivative) on $[a,b]$ then the trapezoids all lie above $y=f(x)$ so trapezoid rule overstimates the integral of $f$ on $[a,b].$ On the other hand a concave down $f$ (negative second derivative) has the trapezoids all under $y=f(x)$ and the trapezoid rule underestimates that integral. But if the concavity of $f$ switches back and forth I don't think much can be said in general (without more conditions).

Note it may not be necessary to have the second derivative existing for this, if one uses a definition of a convex/concave function which doesn't mention derivatives.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d3e2e1154bd11ddd1026d725303b515e