MCS 471 Computer Problem 3a: Numerical Integration using Maple's trapezoid and simpson functions

Due: Friday 20 April 1996

Revised: Monday 15 April 1996


Maple Computer Problem Appendix:

Use Maple for this assignment use both Maple's Student trapezoid and simpson functions with 20 subdivisions (21 points or nodes) each for the 3 test functions below (Octave does not have built-in Trapezoidal or Simpson's Rule). You must hand in a Maple worksheet that is well documented with comments and plots of integrand functions with the rest of Computer Problem 3.

Refer to the last item on the Class Maple Integration Page:

Find the integral of the following the CP3 three functions:
  1. f1(x) = x**5 - x**3 on (0,2).
      Remark 1: This is nice example with an exact answer.
      Remark 2: You must use the Maple functions with(student), trapezoid and simpson on this function with 20 subintervals (21 points) and the two below.
  2. f2(x) = {sqrt(x) if x > 0, else x**4} on (-1.,+1.).
      Remark 1: This is a nonsmooth example with piecewise definition.
      Remark 2: For Maple, use the Maple function "piecewise" given in the above Class Maple integration page, since if-then-else or procedure constructs lead to mysterious Maple errors.
  3. f3r(x) = {exp(-x^3)/sqrt(x+1.0e-5) if x > 0.1, else 10.-68.4*x} on (0,4).
      Remark 0: This function is slightly revised from CP=3 for int, since the both trapezoid and simpson result in a Division by Zero Error for the original f3(x) function, while int results in no problem. Remark 1: This is a nonsmooth nearly singular example with piecewise definition.
      Remark 2: For Maple, use the Maple function "piecewise" given in the above Class Maple integration page, since if-then-else or procedure constructs lead to mysterious Maple errors. Also, Maple "piecewise" works better, if at all, with the nearly singular part in the "FunctionIfTrue" argument, rather than the "FunctionElse" argument.



Web Source: http://www.math.uic.edu/~hanson/M471/mcs471cp3a.html

Email Comments or Questions to hanson@math.uic.edu

Click Here For Class HomePage