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

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

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

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

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

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

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