**Example 1:** Estimate \int_0^1 \cos(x^2)dx using (a) the Trapezoidal Rule and

(b) the Midpoint Rule, each with n = 4. From a graph of the integrand, decide whether your answers are underestimates or overestimates. What can you conclude about the true value of the integral?

**Solution 1:** (a) T_4 = \frac{1}{4\times 2}[f(0)+2f(1/4)+2f(2/4)+2f(3/4)+f(1)]\approx 0.895759. (b) M_4=\frac{1}{4}[f(1/8)+f(3/8)+f(5/8)+f(7/8)]\approx 0.908907. Because f is concave down on [0,1], T_4 is an underestimate and M_4 is an overestimate. We can conclude that 0.895759 < \int_0^1 \cos(x^2)dx< 0.908907.

**Example 2:** (a) Find the approximations T_8 and M_8 for the integral \int_0^1 \cos(x^2)dx. (b) Estimate the errors in the approximations of part (a). (c) How large do we have to choose n so that the approximations T_n and M_n to the integral in part (a) are accurate to within 0.0001?

**Solution 2:** Part (a) is similar to (a) in the previous example. (b) f(x)=\cos(x^2), f'(x)=-2x\sin(x^2), f''(x)=-2\sin(x^2)-4x^2\cos(x^2). For 0\leq x\leq 1, x^2\leq 1 implies that |f''(x)| \leq 2 |\sin(x^2)|+4|\cos(x^2)| \leq 6. So far n=8, we take K=6, a=0, b=1 to get |E_T| \leq 6\times 1^3 / (12 \times 8^2) = 0.0078125 and |E_M| \leq 1^3 / (24 \times 8^2) = 0.00390625. (c) In order to have |E_T|\leq 0.0001, we need 6\times 1^3/(12\times n^2) \leq 10^{-4}, which means n^2\geq 5000. Therefore n=71 works for T_n. For T_M, we need n^2 \geq 2500. Take n=50 would work.