next up previous
Next: Trapezoidal rule and Simpson's Up: Background Previous: Background

Integration in Maple

The Maple int command will handle most integrals that can be done analytically. Both definite and indefinite integrals can be done, as shown by the following examples.

  > int(x^2,x);

displaymath185

  > int(x^2,x=0..2);

displaymath186

  > int(sin(4*x),x);

displaymath187

  > int(x*(3*x^2+2)^(5/3),x);

displaymath188

Notice that Maple doesn't include a constant of integration for indefinite integrals.

Unfortunately, there are lots of integrals that can't be done analytically. (The ones that can be done tend to appear in calculus texts. The ones that can't be done often appear in real life.) When Maple can't do an integral, it simply returns it unevaluated. The example below show how to use the evalf command to get Maple to evaluate the integral numerically.

  > int(cos(x^3),x=0..1);

displaymath189

  > evalf(int(cos(x^3),x=0..1));

displaymath190

Maple uses a sophisticated numerical integration routine with automatic error control to evaluate definite integrals that it can't do analytically. In the next section, we introduce two simple numerical integration techniques that are widely used by engineers and scientists.


Sean O Anderson
Mon Nov 11 16:16:00 EST 1996