Calculus1 Integration - Maple Help

Calculus 1:  Integration

The Student[Calculus1] package contains two routines that can be used to both work with and visualize the concepts of approximating integrals and antiderivatives.  This worksheet demonstrates this functionality.

For further information about any command in the Calculus1 package, see the corresponding help page.  For a general overview, see Calculus1.

Getting Started

While any command in the package can be referred to using the long form, for example, Student[Calculus1][ApproximateInt],  it is easier, and often clearer, to load the package, and then use the short form command names.

 > $\mathrm{restart}$
 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{Calculus1}\right]\right):$

The following sections show how the routines work.

Approximating an Integral

The methods of approximating an integral are divided into two categories:

1.  Riemann sums, and

2.  Newton-Cotes methods.

Riemann sums approximate an integral by summing the areas of adjacent rectangles, where the height of the rectangle depends on the value of function in that interval.

Newton-Cotes methods assume knowledge of integration of polynomials. These methods interpolate the function on each subinterval, and integrate this interpolating polynomial.  The trapezoid rule approximates integrals using linear functions. Simpson's rule uses quadratic functions to approximate the expression.

 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0..20,\mathrm{method}=\mathrm{midpoint},\mathrm{output}=\mathrm{plot}\right)$
 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0..20,\mathrm{method}=\mathrm{simpson},\mathrm{output}=\mathrm{plot}\right)$

In every case, an animation, in which each frame shows a refinement of the previous partition, can be returned.

 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0..\frac{3\mathrm{π}}{2},\mathrm{output}=\mathrm{animation}\right)$

An interesting variation begins with a random partition, and at each step, chooses a refinement that randomly divides the largest subinterval.

 > $\mathrm{ApproximateInt}\left(\mathrm{sin}\left(x\right),x=0..4\mathrm{π},\mathrm{partition}=\mathrm{random}\left[2\right],\mathrm{subpartition}=\mathrm{width},\mathrm{refinement}=\mathrm{random},\mathrm{output}=\mathrm{animation},\mathrm{iterations}=50\right)$

When using this method with a partition, note how the total area appears to converge to a value and then jumps to another.

 > $\mathrm{ApproximateInt}\left(\frac{1}{{x}^{2}-2},x=-2..2,\mathrm{partition}=\mathrm{random}\left[2\right],\mathrm{subpartition}=\mathrm{width},\mathrm{refinement}=\mathrm{random},\mathrm{output}=\mathrm{animation},\mathrm{iterations}=50\right)$

You can also compute and visualize approximate integrals using the ApproximateIntTutor tutor.

 > $\mathrm{ApproximateIntTutor}\left(\right)$

Antiderivatives

Given a function $f\left(x\right)$, an antiderivative of $f\left(x\right)$ is any function $F\left(x\right)$ such that $\frac{ⅆ}{ⅆx}F\left(x\right)=f\left(x\right)$.  By this definition, if $F\left(x\right)$ is an antiderivative of $f\left(x\right)$, so is $F\left(x\right)+c$ for any constant $c$.
The routine AntiderivativePlot can plot a single antiderivative or a class of antiderivatives.

 > $\mathrm{AntiderivativePlot}\left({x}^{3}-2{x}^{2}-4x+2,x=-2..2\right)$
 > $\mathrm{AntiderivativePlot}\left({x}^{3}-2{x}^{2}-4x+2,x=-2..2,\mathrm{showclass}\right)$

You can also learn about antiderivative plots using the AntiderivativeTutor command.

 > $\mathrm{AntiderivativeTutor}\left(\right)$
 > 

Main: Visualization

Previous: Applications of Derivatives