How large does N have to be in order to approximate the integral of cos(x^2) from 0 to 1, using the Midpoint Rule, with error at most 10^(-6)?

1 answer

Use the value of the error term:
max. error ≤M2(b-a)^sup3;/(24N²)
where
M2 is the maximum absolute value of f"(x) on the interval [a,b].

Here f(x)=cos(x²)
f'(x)=-2xsin(x²), and
f"(x)=-2sin(x²)-4x²cos(x²)
(check my differentiation.)

For other cases other than middle-sum, see:
http://en.wikipedia.org/wiki/Riemann_sum