MATH 132 -- Calculus for Physical and Life Science 2 

Approximate Integration in Maple 

February 13, 2008 

 

Let's consider the definite integral  Typesetting:-mrow(Typesetting:-msubsup(Typesetting:-mo(This is one where we can 

find a symbolic indefinite integral to apply the Evaluation Theorem.  Here's the 

way it's done with Maple (the form is different from, though equivalent to, 

what our tables would say). 

 

> Typesetting:-mrow(Typesetting:-mi(
 

`+`(`*`(`/`(1, 2), `*`(x, `*`(`^`(`+`(1, `*`(`^`(x, 2))), `/`(1, 2))))), `*`(`/`(1, 2), `*`(arcsinh(x)))) (1)
 

 

The definite integral, in exact form (val) and then in a decimal approximation (ExactValue): 

 

> Typesetting:-mrow(Typesetting:-mi(
 

`+`(`-`(`*`(`/`(1, 2), `*`(`^`(2, `/`(1, 2))))), `-`(`*`(`/`(1, 2), `*`(ln(`+`(1, `*`(`^`(2, `/`(1, 2)))))))), `*`(`^`(5, `/`(1, 2))), `-`(`*`(`/`(1, 2), `*`(ln(`+`(`-`(2), `*`(`^`(5, `/`(1, 2))))))))... (2)
 

> Typesetting:-mrow(Typesetting:-mi(
 

1.810092142 (3)
 

 

Now we compute some approximations using the Left, Right, and Midpoint Riemann  

sums, the Trapezoidal rule, and Simpson's Rule, together with the error (the difference 

ExactValue - ApproximateValue) for each method: 

 

> Typesetting:-mrow(Typesetting:-mi(
 

> Typesetting:-mrow(Typesetting:-mi(
 

1.708333674 (4)
 

> Typesetting:-mrow(Typesetting:-mi(
 

0.81561981e-1 (5)
 

> Typesetting:-mrow(Typesetting:-mi(
 

1.913797277 (6)
 

> Typesetting:-mrow(Typesetting:-mi(
 

-0.82808902e-1 (7)
 

> Typesetting:-mrow(Typesetting:-mi(
 

1.809606332 (8)
 

> Typesetting:-mrow(Typesetting:-mi(
 

0.311381e-3 (9)
 

> Typesetting:-mrow(Typesetting:-mi(
 

1.811065475 (10)
 

> Typesetting:-mrow(Typesetting:-mi(
 

-0.623461e-3 (11)
 

 

> Typesetting:-mrow(Typesetting:-mi(
 

1.810092713 (12)
 

> Typesetting:-mrow(Typesetting:-mi(
 

-0.571e-6 (13)
 

>
 

Some questions about what we are seeing here: 

 

Typesetting:-mrow(Typesetting:-mo( Which of the estimates are underestimates?  And how can you tell? 

   2.   Which of the estimates are overestimates?  How can you tell? 

   3.   Which method is "better" here -- Trapezoidal Rule or Midpoint Riemann Sum?  

   4.   Which is the "best" method overall?   

 

Note that the weighted average  

> Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mn(
 

1.810092713 (14)
 

gives the same value as Simpson's Rule (!?)  Is this a coincidence?