I have $\int_0^2 \frac{1}{1+x^6} dx$
We vaguely went over this in class today and I understand how to work Simpson's rule but only when I have $n$ already given to me. How can I determine $n$ when it isn't given? Thank you for your time and help.
I have $\int_0^2 \frac{1}{1+x^6} dx$
We vaguely went over this in class today and I understand how to work Simpson's rule but only when I have $n$ already given to me. How can I determine $n$ when it isn't given? Thank you for your time and help.
I'm not clear about your reference to $n$: Perhaps this formula will be of help.
Simpson's Rule (numerical approximation of definite integrals):
$\displaystyle \int_a^b f(x)dx \approx \frac{b-a}{6}\left[f(a) + 4f\left(\frac{a+b}{2}\right) + f(b)\right] $.
For your problem, $f(x) = \dfrac{1}{1 + x^6}, \quad a = 0,\; b = 2$.
If you want the composite Simpson's Rule:
Use
$\int_a^b f(x) \, dx\approx \frac{h}{3}\bigg[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+\cdots+4f(x_{n-1})+f(x_n)\bigg]$
where $h = \dfrac{b-a}{n}$
Note: Usually -- in an exercise -- "$n$" will be explicitly given to you. In real-life scenarios, keep doubling the number of $x_i$ until your answer stabilizes. It turns out that the computation for $n = 2k$ (with $k$ an integer) can be incorporated into the answer for $n = 2(2k)$, so you don't need to start from scratch when doubling the number of $x_i$.
Choose $n$ sufficiently small to bound the error term.
The error term is given by the following:
$\frac{h^4}{180}(b-a) \max_{\xi\in[a,b]} |f^{(4)}(\xi)|$
Using
$\int_a^b f(x) \, dx\approx \frac{h}{3}\bigg[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+\cdots+4f(x_{n-1})+f(x_n)\bigg]$
the error term is given by
$\frac{h^4}{180}(b-a) \max_{\xi\in[a,b]} |f^{(4)}(\xi)|$
Choose $h$ so that the error term is sufficiently small.