Simpson's Rule/Trapezoidal Approximation - Error rate help

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 7K views
Asphyxiated
Messages
263
Reaction score
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
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?