Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Mathematics / Undergraduate Math / December 2006



Tip: Looking for answers? Try searching our database.

Derive error estimate for trapezoid and Simpson rule

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gunnar G - 31 Dec 2006 10:34 GMT
It seems to be  wellknown fact that the errors are
bounded by
m(b-a)^3 /6   and M(b-a)^5/90  (where |f''(x)|<= m  and |f''''(x)|<=M  for
all x in [a,b] ) for the trapezoid and the simpson rules but how do you
derive these results?

I have looked in the books I have, but it is never shown, just stated that
it can be shown.

Does anyone here know how to derive the error estimates?
David C. Ullrich - 31 Dec 2006 14:21 GMT
>It seems to be  wellknown fact that the errors are
>bounded by
[quoted text clipped - 6 lines]
>
>Does anyone here know how to derive the error estimates?

There should be a derivation in any book on numerical analysis.
It's not hard, using Taylor's Theorem.

Working it out just now, I found that the midpoint
rule, approximating int_a^b f(t) dt by

 (b-a) f((a+b)/2),

actually gives a smaller constant in the error than
the trapezoidal rule.

Let's assume that a = -b, to simplify the typing below.
Note that then b-a = 2b. Taylor's Theorem shows that

(*)  f(t) = f(0) + t f'(0) + R(t),

where

 |R(t)| <= m t^2/3.

So

 int_{-b}^b f(t) = 2b f(0) + int_{-b}^b R(t) dt
                 = (b-a) f(0) + int_{-b}^b R(t),

so the absolute value of the error in the midpoint
rule is

 |E_mid| <= int_{-b}^b m t^2/2 dt

          = m b^3/3 = m (b-a)^3/24.

Applying (*) with t = b and t = -b shows that the
difference between the midpoint rule and the
trapezoidal rule is

 b(f(b) + f(-b)) - 2b f(0) = b(R(b) + R(-b)),

so the absolute value of the difference is

 |mid - trap| <= bm(b^2/2 + b^2/2)
               = m b^3 = m (b-a)^3/8.

So the absolute value of the error in the trapezoidal
rule is

 |E_trap| <= m (b-a)^3/24 + m (b-a)^3/8 = m (b-a)^3/6.

You can use a similar argument to get an error estimate
for Simpson's Rule, with a constant slightly worse than
what you cite above:

(**) f(t) = f(0) + t f'(0) + t^2/2 f''(0) + R(t).

where now

 |R(t)| <= t^3/6 m_3,

where m_3 is the maximum of the third derivative.

So

 int_{-b}^b f = 2b f(0) + b^3/3 f''(0) + int R(t),

where

 int |R(t)| <= int_{-b}^b t^3/6 m_3 = b^4 m_3/12.

Now we don't want that f''(0) in the approximation
to the integral. Applying (**) with t = b and t = -b
and rearranging gives

 b^3/3 f''(0) = b(f(b) + f(-b))/3 - 2b/3 f(0)
                  + b/3 (R(b) + R(-b)),

so that

 2b f(0) + b^3/3 f''(0) = 4b/3 f(0) + b/3 (f(b)+f(-b))
             +  b/3 (R(b) + R(-b))

         = (b-a)/6 (4 f(0) + f(b) + f(a))
            +  b/3 (R(b) + R(-b)),

exactly the Simpson thing plus another error term.
The absolute value of the sum of the two error terms
is

  <= b^4 m_3 (1/12 + 1/9) = b^4/m_3 (7/36)
       
      = (b-1)^4 m_3 (7/288)

Of course 7/288 > 1/90.

On the other hand that's not the "right" error anyway!
According to http://en.wikipedia.org/wiki/Simpson's_rule
the error in Simpson's rule is actually bounded by a
constant times (b-a)^5, which is much better.
Oops, I just realized that you cited a bound in
terms of (b-a)^5 above...)

If I work through the above with a third-degree Taylor
polynoial in place of (**) I get an error of
(b-a)^5 m_4/560 (which is worse than the constant
at wikipedia, but better than the one you cite above),
where m_4 is the maximum of the fourth derivative.

         

************************

David C. Ullrich
Gunnar G - 31 Dec 2006 21:18 GMT
David C. Ullrich wrote a lot:

And I say, thank you, I will study it for the rest of this year.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.