next up previous
Next: Exercises Up: Background Previous: Rectangular approximations

Integration using 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);

displaymath281

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

displaymath282

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

displaymath283

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

displaymath284

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);

displaymath285

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

displaymath286

Maple uses a sophisticated numerical integration routine with automatic error control to evaluate definite integrals that it can't do analytically.



Roxanne Tisch
Thu Mar 27 08:41:19 EST 1997