Simpson's rule with precision?

659 Views Asked by At

I have an integral:

$$\int_0^1sinx^2dx$$

Task is to solve this integral using Simpson's rule with precision $\frac{1}{2}10^{-4}$.

I am not sure how should I do that. I have this formula for calculating error:

$$r(\frac{h}{2}) = \frac{I(h) - I(\frac{h}{2})}{k^2 - 1}$$ where $$I = f(x)dx$$ in this case would be: $$I = sinx^2dx$$

(So $I=sinx^2dx$ is same as $I=2xcosx^2$)

Should this be correct way to solution:

$a=0$ and $b=1$, so first I should take some initial $k$ and divide $[a,b]$ into $k$ equal pieces where $h$ would be step. Then plug $h$ and $k$ into formula and see the result. If result is greater then $\frac{1}{2}10^{-4}$ then increase $k$. Repeat until next criteria is satisfied:

$$r(\frac{h}{2}) \le \frac{1}{2}10^{-4}$$.

And at last, I have $h$, now I can simply calculate integral using Simpson's rule and get desired precision.

1

There are 1 best solutions below

1
On

Use the error bound $\frac{(b-a)^5}{90 \cdot 2^5} f^{(4)}(\xi)$ for the one panel Simpson's rule instead.