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)?

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

To find out how large N (the number of subintervals) has to be in order to approximate the integral of a function using the Midpoint Rule with a given error tolerance, we can use the Error Bound Formula for the Midpoint Rule.

The Error Bound Formula states that the error E in approximating the integral using the Midpoint Rule is given by:

E ≤ ((b - a)^3 / 24) * max|f''(x)|,

where [a, b] is the interval of integration and f''(x) is the second derivative of the function being integrated.

In this case, we want the error E to be at most 10^(-6). The interval of integration is [0, 1], and the function being integrated is cos(x^2). To find the second derivative of cos(x^2), we need to take the derivative twice.

First, let's find the first derivative of cos(x^2):

d/dx [cos(x^2)] = -2x * sin(x^2).

Now, let's find the second derivative:

d^2/dx^2 [cos(x^2)] = -2 * sin(x^2) - 4x^2 * cos(x^2).

To find the maximum value of |f''(x)| on the interval [0, 1], we can take the absolute value of the second derivative and evaluate it at the endpoints and critical points in the interval. However, finding the critical points and their corresponding values can be challenging. Alternatively, we can use an upper bound estimate for |f''(x)|.

Since cos(x^2) is continuous and differentiable on the interval [0, 1], the absolute value of its second derivative should have an upper bound on that interval. Let's use an overestimate for simplicity:

|f''(x)| ≤ 2 + 4 * 1 * 1 = 6.

Substituting all the values into the error bound formula, we have:

10^(-6) ≤ ((1 - 0)^3 / 24) * 6,

10^(-6) ≤ 1/8 * 6,

10^(-6) ≤ 3/4 * 10^(-1),

10^(-6) ≤ 3/4 * 10^(-6).

Hence, we can see that the given error tolerance 10^(-6) is less than or equal to the error E. It means that at least N subintervals should be used to get the error below 10^(-6). However, since the error is often reduced as the number of subintervals increase, it is a good practice to increase the value of N to ensure the desired accuracy.

So, to determine the minimum value of N, we need to solve for N in the inequality:

N ≥ 3/4 * 10^(-6).

Rounding up to the nearest integer, we have:

N ≥ 4 * 10^(-6) = 4.

Therefore, N should be at least 4 in order to approximate the integral of cos(x^2) from 0 to 1 using the Midpoint Rule with an error at most 10^(-6).