Section14.1Approximating the Area Under a Function Using ApproximateInt
To use the ApproximateInt() command, we must load the Student[Calculus1] package. Packages are loaded using the with() command and it is typically a good idea to load any necessary packages at the top of your worksheet. Loading a package only needs to be done once per Maple worksheet, but needs to be run each time you open a new or previously closed document.
The function and interval must be specified. Other optional parameters may be included to change how the result is displayed and how the approximation is computed.
When using method=upper or method=lower, Maple approximates area using rectangles based off of the maximum or minimum value of the function in each subinterval, respectively. This can be useful to give upper and lower bounds on the true area bounded by the function and the horizontal axis.
Example14.2.Approximating Area using Left-hand and Right-hand Rules.
In this example, we will approximate the signed area between \(f(x) = 10 { e}^{-x}\) and the \(x\)-axis using left-hand and right-hand rectangles. These are two common methods that we learn when first calculating Riemann sums. We will see how Maple can give the approximate area using a specific number of subintervals (which Maple calls a partition).
We will start by using eight subintervals and approximate the area using left-hand and right-hand rectangles. The method needs to be specified as well as the number of partitions. Maple will give the exact value of this Riemann sum, which can be converted to decimal using the evalf() command.
Example14.3.Approximating the Area under \(x \sin(x)\).
In this example, we will approximate the signed area between \(f(x) = x \sin(x)\) and the \(x\)-axis using rectangle approximation. Unlike in the previous example, we will be using alternative methods for determining the height of the rectangle in each subinterval (or partition), such as upper, lower, and midpoint.
The method=upper option always uses the maximum value of \(f(x)\) in each subinterval for the height of each rectangle. Below is a plot of the rectangles as well as the approximation of area given by the method when using ten subintervals. As you can see, this method gives a very deliberate overestimate of the actual area bounded by this function and the \(x\)-axis.
Finally, the midpoint rule uses the value of the function at the midpoint in each subinterval as the height of each rectangle. Below is a plot of twenty rectangles using the midpoint rule.