MHB Calculating Integral with Simpson's Rule for Error < $0.5\cdot 10^{-3}$

  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Error Integral
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! 😊

Calculate using the Simpson's Rule the integral $\int_0^1\sqrt{1+x^4}\, dx$ approximately such that the error is less that $0,5\cdot 10^{-3}$. Which has to be $h$ ?

So we use here the composite Simpson's rule, right?

An upper bound of the error of that rule is defined as $$\frac{h^4}{180}(b-a)\max_{\xi \in [a,b]}|f^{(4)}(\xi)|$$ and we have to set this equal to $0,5\cdot 10^{-3}$, right?

So we get $$\frac{h^4}{180}\max_{\xi \in [a,b]}|f^{(4)}(\xi)|=0,5\cdot 10^{-3} $$

The $4$.th derivative of $f(x)=\sqrt{1+x^4}$ is $\frac{12 (1 - 14 x^4 + 5 x^8)}{(1 + x^4)^{7/2}}$. If we check if this is increasing or decreasing on $[0,1]$ we see that the maximum on that interval is at $x=0$ and it is equal to $12$.

So we get $$\frac{h^4}{180}\cdot 12=0,5\cdot 10^{-3} \Rightarrow h^4=\frac{180}{12}0,5\cdot 10^{-3} \Rightarrow h^4=7.5\cdot 10^{-3} \Rightarrow h\approx 0.294283$$

Is that correct?
 
Mathematics news on Phys.org
Hey mathmari!

The calculation looks correct to me.
But $h$ cannot be $0.29$. Instead we must have that $h=\frac{b-a}{n}$ for some even $n$. (Worried)
I checked with $n=4$ and found an error of $1.6\cdot 10^{-5}$, which satisfies the condition.
 
Klaas van Aarsen said:
The calculation looks correct to me.
But $h$ cannot be $0.29$. Instead we must have that $h=\frac{b-a}{n}$ for some even $n$. (Worried)
I checked with $n=4$ and found an error of $1.6\cdot 10^{-5}$, which satisfies the condition.

Aaa so do we do the following?

Since $h=\frac{b-a}{n}=\frac{1}{n}$ we get $$\frac{h^4}{180}\cdot 12<0,5\cdot 10^{-3} \Rightarrow h^4<\frac{180}{12}0,5\cdot 10^{-3} \Rightarrow h^4<7.5\cdot 10^{-3}\Rightarrow \frac{1}{n^4}<7.5\cdot 10^{-3}\Rightarrow n^4>\frac{1}{7.5}\cdot 10^{3}\Rightarrow n>3.398 $$
So we take $n=4$ and so $h=\frac{1}{4}$.

Is that correct? :unsure:
 
Yep. (Nod)
 
Klaas van Aarsen said:
Yep. (Nod)

Thank you! 🥳
 
I thought about that again and I have a question. Is this the only way, i.e. to use that formula with the fourth derivative? :unsure:
 
mathmari said:
I thought about that again and I have a question. Is this the only way, i.e. to use that formula with the fourth derivative?
An alternative is to apply Simpson's Rule with n=2, n=4, ... until the difference with the actual integral is less than the required error.
It means we need to evaluate the actual integral somehow, perhaps with a numerical program. 🤔

Yet another alternative is to apply Simpson's Rule with n=2, n=4, ... until the difference with the previous iteration is less than the required error.
This is how most algorithms work, although it's strictly speaking not a full-proof method. 🤔
 

Similar threads

Replies
4
Views
1K
Replies
16
Views
4K
Replies
9
Views
3K
Replies
6
Views
4K
Replies
2
Views
1K
Replies
4
Views
1K
Back
Top