Simpson's Rule/Trapezoidal Approximation - Error rate help

In summary, when using the trapezoidal and Simpson's rule to approximate the integral of sin(x) from 0 to pi, the estimations are 1.5708 and 2.0944 respectively. However, the actual error is not zero as the maximum values of the second and fourth derivatives of sin(x) are not zero over the entire interval. The error for the trapezoidal approximation is calculated to be approximately 0.65 and for Simpson's rule it is approximately 0.1.
  • #1
Asphyxiated
264
0

Homework Statement



[tex] \int^{ \pi}_{0} sin(x)dx \;\;\;\;\;\;\;\; dx=\frac{ \pi}{2}[/tex]

Homework Equations



Trapezoidal Approximation:

[tex]|f''(x)| \leq M \;\;\;\;\; for \;\;\;\;\; a \leq x \leq b [/tex]

[tex] \frac {b-a}{12}(M)(dx)^{2} = Error [/tex]

Simpson's Rule:

[tex] |f^{(4)}(x)| \leq M \;\;\;\;\; for \;\;\;\;\; a \leq x \leq b [/tex]

[tex] \frac{b-a}{180}(M)(dx)^{4} = Error [/tex]

The Attempt at a Solution



Ok so I have found the correct estimations using both methods easily, the trapezoidal approximation is: 1.5708 and Simpson's Rule is: 2.0944, those numbers check out in the back of the book, but when it comes to finding the error I think that it should be 0 because the max (M) is zero for both the second and fourth derivative but the book says otherwise. Heres what I did:

[tex] y=sin(x) [/tex]

[tex] y'=cos(x) [/tex]

[tex] y''=-sin(x) [/tex]

[tex] y^{(3)}= -cos(x) [/tex]

[tex] y^{(4)}= sin(x) [/tex]

and Trapezoidal Rule using y'' is:

[tex]|y''( \pi)|=0 [/tex]

and

[tex] |y''(0)|=0 [/tex]

and that follows the same for [tex] y^{(4)} [/tex] so M is 0 and thus the entire equation is 0 and Error = 0 but the book states that the error for the trapezoidal approximation is:

[tex] \frac { \pi^{3}}{48} \;\;\;\;\; or \;\;\;\; .65 [/tex]

and the Error for Simpson's Rule is:

[tex] \frac { \pi^{5}}{2880} \;\;\;\; or \;\;\;\; .1 [/tex]

I don't see how they got this... but I don't think the actual error rate is zero either because if it were then the trapezoidal and simpson approximation would be exactly equal, so where did I go wrong?
 
Physics news on Phys.org
  • #2
Asphyxiated said:

Homework Statement



[tex] \int^{ \pi}_{0} sin(x)dx \;\;\;\;\;\;\;\; dx=\frac{ \pi}{2}[/tex]

Homework Equations



Trapezoidal Approximation:

[tex]|f''(x)| \leq M \;\;\;\;\; for \;\;\;\;\; a \leq x \leq b [/tex]

[tex] \frac {b-a}{12}(M)(dx)^{2} = Error [/tex]

Simpson's Rule:

[tex] |f^{(4)}(x)| \leq M \;\;\;\;\; for \;\;\;\;\; a \leq x \leq b [/tex]

[tex] \frac{b-a}{180}(M)(dx)^{4} = Error [/tex]

The Attempt at a Solution



Ok so I have found the correct estimations using both methods easily, the trapezoidal approximation is: 1.5708 and Simpson's Rule is: 2.0944, those numbers check out in the back of the book, but when it comes to finding the error I think that it should be 0 because the max (M) is zero for both the second and fourth derivative but the book says otherwise.
f''(x) = -sin(x) and f(4)(x) = sin(x). The maximum value of the absolute values of these functions is not zero. What you're looking for is the maximum value over the entire interval [0, pi].
Asphyxiated said:
Heres what I did:

[tex] y=sin(x) [/tex]

[tex] y'=cos(x) [/tex]

[tex] y''=-sin(x) [/tex]

[tex] y^{(3)}= -cos(x) [/tex]

[tex] y^{(4)}= sin(x) [/tex]

and Trapezoidal Rule using y'' is:

[tex]|y''( \pi)|=0 [/tex]

and

[tex] |y''(0)|=0 [/tex]

and that follows the same for [tex] y^{(4)} [/tex] so M is 0 and thus the entire equation is 0 and Error = 0 but the book states that the error for the trapezoidal approximation is:

[tex] \frac { \pi^{3}}{48} \;\;\;\;\; or \;\;\;\; .65 [/tex]

and the Error for Simpson's Rule is:

[tex] \frac { \pi^{5}}{2880} \;\;\;\; or \;\;\;\; .1 [/tex]

I don't see how they got this... but I don't think the actual error rate is zero either because if it were then the trapezoidal and simpson approximation would be exactly equal, so where did I go wrong?
 

What is Simpson's Rule?

Simpson's Rule is a method for approximating the value of a definite integral by dividing the interval into subintervals and using quadratic polynomials to approximate the area under the curve. It is named after mathematician Thomas Simpson.

What is Trapezoidal Approximation?

Trapezoidal Approximation is a method for approximating the value of a definite integral by dividing the interval into subintervals and using trapezoids to approximate the area under the curve. It is a simpler version of Simpson's Rule.

What is the error rate for Simpson's Rule and Trapezoidal Approximation?

The error rate for Simpson's Rule is O(n^4), meaning the error decreases as the number of subintervals increases. The error rate for Trapezoidal Approximation is O(n^2), meaning the error decreases at a slower rate compared to Simpson's Rule.

When should I use Simpson's Rule instead of Trapezoidal Approximation?

Simpson's Rule should be used when a more accurate approximation is needed, as it has a faster convergence rate than Trapezoidal Approximation. It is also more suitable for functions with higher order derivatives.

How do I calculate the error in Simpson's Rule or Trapezoidal Approximation?

The error in Simpson's Rule can be calculated using the following formula: E = (b-a)^5*f^(4)(c)/180*n^4, where (b-a) is the width of the interval, f^(4)(c) is the fourth derivative of the function at some point c, and n is the number of subintervals. The error in Trapezoidal Approximation can be calculated using the formula: E = (b-a)^3*f^(2)(c)/12*n^2, where f^(2)(c) is the second derivative of the function at some point c.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
329
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
536
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
953
  • Calculus and Beyond Homework Help
Replies
3
Views
547
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
5
Views
670
Back
Top