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

In summary, the conversation discusses the use of Simpson's Rule to calculate a given integral with an error less than $0.5\cdot 10^{-3}$. The participants discuss the upper bound of the error and determine that $h$ must be equal to $\frac{b-a}{n}$ for some even $n$. They also consider alternative methods of using Simpson's Rule to achieve the desired error.
  • #1
mathmari
Gold Member
MHB
5,049
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
  • #2
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.
 
  • #3
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:
 
  • #4
Yep. (Nod)
 
  • #5
Klaas van Aarsen said:
Yep. (Nod)

Thank you! 🥳
 
  • #6
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:
 
  • #7
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. 🤔
 

1. What is Simpson's Rule for calculating integrals?

Simpson's Rule is a numerical method for approximating the value of a definite integral. It is based on dividing the area under a curve into smaller segments and using a quadratic polynomial to approximate the curve within each segment.

2. How does Simpson's Rule help in calculating integrals with a desired error tolerance?

Simpson's Rule allows for a more accurate approximation of the integral compared to other numerical methods. By using a higher degree polynomial, it can reduce the error in the approximation. By adjusting the number of segments used, the error can be controlled to meet the desired tolerance.

3. What is the formula for Simpson's Rule?

The formula for Simpson's Rule is:

I = (h/3) * [f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + ... + 2f(xn-2) + 4f(xn-1) + f(xn)]

Where h is the step size (distance between x-values) and n is the number of segments used in the approximation.

4. How do I know if the error in my Simpson's Rule approximation is less than a certain value?

The error in the Simpson's Rule approximation can be calculated using the error formula:

E = (h4 / 180) * [b-a] * [max|f(4)(x)|]

Where h is the step size, a and b are the lower and upper limits of integration, and f(4)(x) is the fourth derivative of the function being integrated. By substituting these values and comparing to the desired error tolerance, you can determine if the error is less than the specified value.

5. What are the advantages of using Simpson's Rule for calculating integrals?

Compared to other numerical methods, Simpson's Rule offers a more accurate approximation of the integral. It also has a relatively simple formula and can handle a wide range of functions. Additionally, by adjusting the number of segments used, the error can be controlled to meet a desired tolerance.

Similar threads

Replies
2
Views
623
Replies
6
Views
930
  • General Math
Replies
4
Views
715
Replies
3
Views
224
Replies
4
Views
927
  • General Math
Replies
16
Views
3K
Replies
6
Views
3K
  • Introductory Physics Homework Help
Replies
8
Views
672
  • General Math
Replies
2
Views
788
  • General Math
Replies
4
Views
805
Back
Top