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

  • Context: MHB 
  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Error Integral
Click For Summary

Discussion Overview

The discussion revolves around calculating the integral $\int_0^1\sqrt{1+x^4}\, dx$ using Simpson's Rule, specifically aiming to achieve an error less than $0.5\cdot 10^{-3}$. Participants explore the implications of the error bound and the choice of step size $h$ in relation to the number of intervals $n$.

Discussion Character

  • Mathematical reasoning, Technical explanation, Debate/contested

Main Points Raised

  • One participant calculates $h$ to be approximately $0.294283$ based on the error formula for Simpson's Rule and the fourth derivative of the function.
  • Another participant argues that $h$ cannot be $0.29 and emphasizes that $h$ must be expressed as $h=\frac{b-a}{n}$ for some even $n$, suggesting $n=4$ yields an acceptable error.
  • A further participant confirms the previous calculations and reasoning, reiterating the necessity of using an even $n$.
  • Some participants propose alternative methods for determining $n$, such as iterating through values of $n$ until the difference with the actual integral is less than the required error, or until the difference with the previous iteration is less than the required error.
  • Concerns are raised about whether using the fourth derivative is the only method to establish the error bound.

Areas of Agreement / Disagreement

Participants generally agree on the necessity of using an even $n$ for the calculation of $h$, but there is no consensus on whether the method involving the fourth derivative is the only approach available. Multiple competing views on alternative methods for error estimation remain.

Contextual Notes

Participants discuss the implications of using different values of $n$ and the associated errors, but the discussion does not resolve the limitations of the methods proposed or the assumptions made regarding the behavior of the 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?
 
Physics 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 6 ·
Replies
6
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K