Application Center - Maplesoft

# Classroom Tips and Techniques: Stepwise Solutions in Maple - Part 1

You can switch back to the summary page by clicking here.

Classroom Tips and Techniques: Stepwise Solutions in Maple - Part 1Robert J. LopezEmeritus Professor of Mathematics and Maple FellowMaplesoft

Introduction

Maple's powerful mathematical engine is primarily designed to provide the results of mathematical operations. But there are commands, Assistants, Tutors, and Task Templates that show stepwise calculations in algebra, calculus (single-variable, multivariable, vector), and linear algebra. In this article we discuss Maple's functionality for providing these stepwise solutions to mathematical problems in algebra and calculus (both of one and several variables). In our next article, we will continue with stepwise tools in linear algebra and vector calculus.

However, we hasten to point out that often, the underlying algorithms Maple uses are not the ones students see in their textbooks. For example, the standard calculus text contains a detailed section on methods of integration, a collection of manipulations designed to produce the antiderivatives of most of the elementary functions.  Maple, on the other hand, will use a number of other devices, including the Risch algorithm, to obtain these antiderivatives.

Because Maple "does" symbolic math, it is always possible to guide Maple through nearly any segment of mathematical calculations.  Thus, if Maple does not have a built-in tool for displaying a calculation stepwise, the calculation can always be reduced to its rudiments by simply directing Maple to take the required steps.

This worksheet is an updated version of an earlier article. It includes five new task templates that first appeared in Maple 14. The new task templates correlate a multiple integral with an image of the region the integral sweeps.

Stepwise Algebra

Solving Equations

Maple's solve and fsolve commands solve equations analytically and numerically, respectively. Stepwise solutions are provided by the Equation Manipulator, an Assistant that can be accessed either from the Tools menu, or from the Context Menu by choosing the option "Manipulate Equation."

Demonstrations of stepwise equation-solving can be viewed in the recorded webinar "Clickable Calculus: Precalculus, and Calculus of One and Several Variables."

Partial Fraction Decomposition

The indefinite integral of the function

requires the partial fraction decomposition

 (1)

which can also be obtained from the Context Menu under the Conversions option.  A stepwise decomposition is available via the Task Template in Table 1.

 Stepwise Partial Fraction Decomposition Write rational function here          Write the partial-fraction decomposition template in this box            ≡ *          To determine the constants, multiply both sides of the identity (*) by the denominator of the fraction on the left.                          ↓          =

Table 1   Stepwise partial fraction Task Template

The algebra for obtaining the equations that determine the coefficients is not unique.  This Task Template adopts one particular strategy for this, but there are other methods.

These algebraic steps can also be implemented directly in Maple, either with the appropriate commands, or even via the Context Menu, as we show in Table 2. The left-hand column in this table states the action to perform, and the right-hand column shows the effect of carrying out that instruction.  The initial identity

• Enter identity.
Press Enter key.

Move to Left

Left-hand Side

Simplify

Numerator

Collect≻

Coefficients≻

Solve

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)

 (8)

 (9)

• Using equation labels and the evaluation template from the Expression palette, transfer the values of the coefficients to the identity.

 (10)

Table 2   Stepwise partial-fractions by first principles via the Context Menu

Stepwise Calculus of a Single Variable

Differential Calculus

Limits

The Limit Methods tutor, shown in Table 3 as a screen-shot, will guide the evaluation of a limit. This tutor is available from the Tools menu, or from the Context Menu after the Student Calculus 1 package has been loaded.

 Table 3   The Limit Methods tutor applied to

The sequence of steps can be copied and pasted from the tutor, but that does not salvage the per-step annotations.  Closing the tutor only provides the final answer, not the intermediate steps. The greatest value in the tutor seems to be its use as an experimental platform for investigating how a limit might be calculated.

The annotated stepwise solution shown in Table 4 is available via the ShowSteps command, or better yet, from the Context Menu under the Solve≻Show Solution Steps option (after loading the Student Calculus 1 package with the Tools menu option: Load Package).

Table 4   Stepwise limit via the Solve≻Show Solution Steps option in the Context Menu

Derivatives

The Differentiation Methods tutor, shown in Table 5 as a screen-shot, will guide the differentiation process. This tutor is available from the Tools menu, or from the Context Menu after the Student Calculus 1 package has been loaded.

 Table 5   The Differentiation Methods tutor applied to

The sequence of steps can be copied and pasted from the tutor, but that does not salvage the per-step annotations.  Closing the tutor only provides the final answer, not the intermediate steps. The greatest value in the tutor seems to be its use as an experimental platform for investigating how a derivative might be evaluated.

The annotated stepwise solution shown in Table 6 is available via the ShowSteps command, or better yet, from the Context Menu under the Solve≻Show Solution Steps option (after loading the Student Calculus 1 package with the Tools menu option: Load Package).

Table 6   Stepwise differentiation via the Solve≻Show Solution Steps option in the Context Menu

Notice that the differentiation operator "d" is gray, not black. This indicates the inert form of the operator, obtained by applying the Context Menu: 2-D Math≻Convert To≻Inert Form to the operator in the Expression palette.

Tangent Line

It is a staple of the calculus course to find the equation of the line tangent to a curve at a given point.  Since this requires computing a derivative to obtain the slope of the tangent line, and a bit of algebra to simplify the point-slope form of the equation of the line, this calculation can certainly be implemented "from first principles" directly in Maple.  However, as shown in Table 7, there is the Tangent Line task template, which we have used to find, at , the line tangent to . Both the solution and the details of the calculation are provided by this task template.

Calculus - Differential≻Applications≻Tangent Line

 Tangent Line (Default value: )

Table 7   Equation of a tangent line by the Tangent Line task template

Normal Line

It is also a staple of the calculus course to find the equation of the line normal to a curve at a given point.  Since this requires computing a derivative to obtain the slope of the tangent line, and a bit of algebra to simplify the point-slope form of the equation of the line, this calculation can certainly be implemented "from first principles" directly in Maple.  However, as shown in Table 8, there is the Normal Line task template, which we have used to find, at , the line normal to . Both the solution and the details of the calculation are provided by this task template.

Calculus - Differential≻Applications≻Normal Line

 Normal Line (Default value: )

 Normal Line:

Table 8   Equation of a normal line by the Normal Line task template

Derivative by Definition

Table 9 contains the "Derivatives by Definition" task template.

Calculus - Differential≻Derivatives≻Derivatives by Definition

 Derivatives by Definition Enter the function and the value of for which is to be obtained.        (Default value: )

Table 9   The derivative of by definition, using the "Derivatives by Definition" task template

Difference (or Newton) Quotient

The difference (or Newton) quotient is the slope of the secant line, which, in the limit, becomes the slope of the tangent line.  In essence, this is the expression whose limit yields the derivative.  This calculation is captured by the Difference (or Newton) Quotient task template, as shown in Table 10.

Calculus - Differential≻Derivatives≻Difference (or Newton) Quotient

 The Difference (or Newton) Quotient Enter the function to be evaluated, the -coordinate of the point of tangency, , and , where is the  -coordinate of the point at which the secant line will be found.

Table 10   The difference quotient for

Clicking the "Launch Tutor" button in the task template will launch the Tangent (Newton Quotient) tutor that is shown in Table 11. This tutor could be accessed independently from the Tools≻Tutors menu.

 Table 11   The Tangent (Newton Quotient) tutor for

Implicit Differentiation

The implicit derivative of defined by the equation can be obtained with the Context Menu option "Differentiate Implicitly." It can be obtained stepwise with the task template in Table 12.

Calculus - Differential≻Derivatives≻Implicit Differentiation≻

 Implicit Differentiation Enter an equation in two variables: Dependent variable:       Independent variable: Implicit Derivative: Stepwise Calculation Make dependent variable explicit: Differentiate with respect to independent variable: Isolate Derivative: Make independent variable implicit:

Table 12   Stepwise implicit differentiation via task template

Clicking the "Stepwise" button will launch the Differentiation Methods tutor in which the derivative can be computed step-by-step.

Mean Value Theorem

The Mean Value theorem states that under suitable conditions, for some in the interval . In this form, the theorem relates to the linear (or tangent line) approximation.  If rearranged to

the theorem has a geometric interpretation: in the interval , there is a point where the tangent line is parallel to the secant line connecting with . This is well illustrated by the Mean Value Theorem tutor shown in Table 13, where the tutor is applied to the function on the interval .

 Table 13   Mean Value Theorem tutor applied to on

The graph in the tutor shows the geometry - the tangent line is parallel to the secant line. The value of is also determined to be , and the linear "approximation" is exact at this value because .

Table 14 contains a task template that might be a more convenient implementation of the Mean Value theorem calculations.

Calculus - Differential≻Theorems≻Mean Value Theorem

 Mean Value Theorem  Enter and an interval Computational Mode:

Table 14   Mean Value theorem via task template

The task template has two advantages: the value of can be obtained exactly, when possible; and the display of the linear approximation is easier to read.

Rolle's Theorem

Rolle's theorem states that under suitable conditions, when , there is in the interval where the tangent line is horizontal, that is, where . This theorem, used to prove the Mean Value theorem, is illustrated by the graph in Table 15, constructed with the RollesTheorem command in the Student Calculus 1 package.

Table 15   Rolle's theorem illustrated by the RollesTheorem command

The usage

returns the value of at which the horizontal tangent is found.

Table 16 contains a task template that might be a more convenient implementation of the Rolle's theorem calculations.

Calculus - Differential≻Theorems≻Rolle's Theorem

 Rolle's Theorem  Enter and an interval for which Computational Mode: Points where :

Table 16   Rolle's theorem via task template

Curve Analysis

In the era before the widespread availability of graphing hardware and software, a significant portion of a first calculus course was devoted to curve sketching. Surprisingly, few modern calculus texts deviate from this historic practice, in spite of the reasonable cost of graphing technology.

Maple has a Curve Analysis tutor that implements its FunctionChart (equivalently, FunctionPlot) command. In addition to drawing an annotated graph, the tutor provides much of the data upon which the traditional approach to curve sketching is based. Unfortunately, when the tutor is closed, only the graph is preserved.  Hence, the task template "Find Special Points on a Function" is a useful addition to the tutor.

Table 17 shows the tutor applied to the function on the interval .

 Table 17   The Curve Analysis tutor applied to

Clicking on the eight radio-buttons provides the raw data with which a graph could be sketched in the historic approach to this task.

Table 18 shows, for the function

some of this information being captured with a task template.

Calculus - Differential≻Graphical Analysis≻Find Special Points on a Function

 >

 (11)

 >

 (12)

 >

 (13)

 >

 (14)

 >

 (15)

 >

 (16)

 >

Table 18   The task template "Find Special Points on a Function" applied to

The graph in Table 17 shows that has three -intercepts in the interval , yet the Roots command did not find any zeros.  The following modification of the Roots command

yields the three -intercepts as floating-point numbers.  These values are the same as those computed via

Maple's solve command returns the exact solutions on the left in Table 19. Although these solutions contain , they are actually real, as can be seen from their equivalents shown on the right.

 Table 19   Exact zeros of the cubic function

Integral Calculus

Methods of Integration

The Integration Methods tutor, shown in Table 20 as a screen-shot, will guide the integration process. This tutor is available from the Tools menu, or from the Context Menu after the Student Calculus 1 package has been loaded.

 Table 20   The Integration Methods tutor applied to

The sequence of steps can be copied and pasted from the tutor, but that does not salvage the per-step annotations.  Closing the tutor only provides the final answer, not the intermediate steps. The greatest value in the tutor seems to be its use as an experimental platform for investigating how an integral might be evaluated.

The annotated stepwise solution shown in Table 21 is available via the ShowSteps command, or better yet, from the Context Menu under the Solve≻Show Solution Steps option (after loading the Student Calculus 1 package with the Tools menu option: Load Package).

Table 21   Stepwise integration via the Solve≻Show Solution Steps option in the Context Menu

The integral operator is not black, but gray, the inert form of the operator, obtained by applying the Context Menu: 2-D Math≻Convert To≻Inert Form to the operator in the Expression palette.

The change annotation in Table 8 includes the required change of variable, something that the tutor does not provide. Note too, that the procedure followed by Maple is not the only method of solution.  It is also possible to "factor out the 4" and set to obtain

Riemann Sums

The Riemann sum for finding the area bounded by and the -axis can be explored graphically and numerically by tutor; and analytically, by task template.

Table 22 shows the Riemann Sums tutor applied to this function.

 Table 22   Application of the Riemann Sums tutor to the function

By default, a midpoint sum is chosen, but we have elected to demonstrate the left sum. The graph shows the interval divided into equal subintervals, each one supporting a rectangle whose height is determined at the left edge of the subinterval. The area under curve is displayed, along with the approximate area, namely, the sum of the areas in the left-rectangles.

Table 23 shows via task template the analytic evaluation of the corresponding Riemann sum for , arbitrary, rectangles.

Calculus - Integral≻Integration≻Riemann Sums≻Left

The Left Riemann Sum

Enter :

 >

 (17)

Enter the interval :

 >

 (18)

Enter the value of :

 >

 (19)

The left Riemann sum:

 >

 (20)

Value of the Riemann sum:

 >

 (21)

 >

Table 23   Analytic approach to left Riemann sum for by task template

Of course, the analytic expression obtained for this left Riemann sum approaches as .

Numeric Integration

The Riemann Sums tutor is actually the Approximate Integration tutor. This one tutor can be used to explore Riemann sums, or different methods of numeric integration. Underlying this tutor is the ApproximateInt command from the Student Calculus1 package.

Table 24 shows the ApproximateInt command applied to the function , integrated by the trapezoid rule. The command can output a graph, a sum, the value of the sum, or an animation.

Table 24   The ApproximateInt command

Surface Area of a Surface of Revolution

The surface area of the surface of revolution formed when , is rotated about the -axis can be computed by means of the Surface of Revolution tutor, as shown in Table 25.

 Table 25  Surface of Revolution tutor used to obtain the surface area of a surface of revolution

In addition to the graph, this tutor displays the integral whose value is the required surface area, the exact value of the integral, and its floating-point equivalent. Clicking the "Frustums" radio button and then the "Display" button will show the surface approximated by segments (frustums) of cones. After these choices have been made, the display will include a Riemann-sum approximation corresponding to the discretization.

Volume of a Solid of Revolution

The volume of the solid of revolution formed when , is rotated about the -axis can be computed by means of the Volume of Revolution tutor, as shown in Table 26.

 Table 26   Volume of Revolution tutor used to obtain the volume of a solid of revolution.

In addition to the graph, this tutor displays the integral whose value is the required volume, the exact value of the integral, and its floating-point equivalent. For a horizontal axis of rotation, the "Disks" radio button is available; for a vertical axis, the "Shells" radio button is available. If "Disks" are selected, the solid is shown segmented into the chosen number of disks, and the display will include the corresponding Riemann sum. A similar statement can be made for shells, mutatis mutandis. In either event, the corresponding Riemann-sum approximation is provided.

Stepwise Calculus of Several Variables

The MultiInt Command

The MultiInt command of the Student Multivariate Calculus package will formulate and evaluate an iterated multiple integral.  One of its output options is a display of the steps involved in executing the calculation. Table 27 shows the use of this command to evaluate the volume of the region

Table 27   Volume of the region computed stepwise by the MultiInt command

The first line of the output is the unevaluated integral; and the last, the value of the integral. The second line shows the outer integral after the inner integral has been evaluated as far as the antiderivative with respect to .  For this antiderivative, has been held fixed. The antiderivative must be evaluated at the limits in the inner integral. The third line shows the outer integral completely in . The fourth line is the antiderivative with respect to that must be evaluated at the limits in the outer integral.  The final value is in the last line.

This integration tool is available as the task template in Table 28.

Calculus - Multivariate≻Integration≻Multiple Integration≻Cartesian 2-D

Iterated Double Integral in Cartesian Coordinates

Integrand:

 >

 (22)

Region:

 >

 (23)

 >

 (24)

 >

 (25)

 >

 (26)

Inert integral:

 >

 (27)

Value:

 >

 (28)

Stepwise Evaluation:

 >

 (29)

 >

Visualizing Regions of Integration

Cartesian Coordinates: 2D

 Integrate over the plane region bounded by the curves and .

The task template in Table 29 provides a solution. The location of the task template is given at the top of the table.

Calculus - Multivariate≻Integration≻Visualizing Regions of Integration≻Cartesian 2-D

Evaluate and Graph

Area Element

,

Value of Integral

 Bounding Curves "Volume"

Table 29   Task template for an iterated double integral in Cartesian coordinates

After selecting the order of integration (here, ), and entering the relevant data, the graph of the left shows that the inner (or first) integral is in the -direction. The graph of the left shows the region whose "volume" is computed if the function is interpreted as defining a surface .

Cartesian Coordinates: 3D

 Compute the first-octant volume bounded by the cylinder and the plane .

The region whose volume is to be computed is the scrap cut off from a piece of quarter-round molding when its left end is mitered at a angle prior to fitting it into an inside corner.  The task template in Table 30 provides an image of this region.

Calculus - Multivariate≻Integration≻Visualizing Regions of Integration≻Cartesian 3-D

Evaluate and Graph

Volume Element

, where

Table 30   Task template for an iterated triple integral in Cartesian coordinates

A common order for an iterated triple integral in Cartesian coordinates is . Surprisingly, the order used in Table 30 results in an iterated integral for which the upper bound in both the first and second integral is the same! The visual feedback from the graph in Table 30 suggests that the region has been correctly swept by writing the integral as shown.

Polar Coordinates

 Compute the area inside the lima?on .

The task template in Table 31 provides a solution. The location of the task template is given at the top of the table.

Calculus - Multivariate≻Integration≻Visualizing Regions of Integration≻Polar

Evaluate and Graph

Area Element

,

Value of Integral

 Bounding Curves "Volume"

Table 31   Task template for an iterated double integral in polar coordinates

The graph on the left is an animation, showing how the radius varies with angle. The graph on the right shows the volume computed when the integrand is . The number computed by the integral is then the requisite area.

Cylindrical Coordinates

 Use cylindrical coordinates to calculuate the volume of the solid cut from a unit sphere by a cone whose vertex is at the center of the sphere, and whose generator makes a angle with the axis of symmetry of the cone.

The task template in Table 32 provides a solution. The location of the task template is given at the top of the table.

Calculus - Multivariate≻Integration≻Visualizing Regions of Integration≻Cylindrical

Evaluate and Graph

 Volume Element

, where

Table 32   Task template for an iterated triple integral in cylindrical coordinates

As long as the integration in the -direction precedes the integration in the -direction, the volume can be computed with a single triple integral.

Spherical Coordinates

 Use spherical coordinates to calculate the volume of the solid cut from a unit sphere by a cone whose vertex is at the center of the sphere, and whose generator makes a angle with the axis of symmetry of the cone.

The task template in Table 33 provides a solution. The location of the task template is given at the top of the table.

Calculus - Multivariate≻Integration≻Visualizing Regions of Integration≻Spherical

Evaluate and Graph

 Volume Element

, where

Table 33   Task template for an iterated triple integral in spherical coordinates

Critical Points and the Second-Derivative Test

A common task in the first multivariate calculus course is the determination and classification of critical points of a multivariate function.  Table 34 addresses this with a task template.

Tools≻Tasks≻Browse: Multivariate Calculus≻Critical Points & Second Derivative Test

Critical Points and the Second Derivative Test

Objective Function

 >

 (30)

List of Independent Variables

 >

 (31)

Equations

 >

 (32)

Critical Points

 >

 (33)

Second Derivative Test

 >

 (34)

Hessians and their Eigenvalues

 >

 (35)

 >

Table 34   Finding and classifying critical points for a multivariate function

The given function has two critical points, both found with the Solve command. However, the format of the solution is not "points" so the output has to put into the form of a list of lists. The second-derivative test is applied to each point. The origin cannot be classified by this test, so nothing is said about it by the test.  The other point is found to be a saddle point. In the final "row" of the template, the Hessian matrix (the matrix of second derivatives) and its eigenvalues is given for each point. Since the Hessian is symmetric, the signs of its eigenvalues suffice to determine if the matrix is positive or negative definite, or even indefinite.  At the origin, the Hessian has a zero eigenvalue, and is singular.  That is why the origin cannot be classified by the second-derivative test.  The eigenvalues at the other point are of opposite sign, so the Hessian there is indefinite.  That's why the second point is a saddle.

Center of Mass

The Student Precalculus package contains a CenterOfMass command that will determine the center of mass of a discrete distribution of masses in . The Student Multivariate Calculus package contains a CenterOfMass command that will determine the center of mass of a continuous distribution of mass in or , using Cartesian, polar, spherical, or cylindrical coordinates. In each case, this command writes the expressions for the coordinates of the center of mass, then evaluates the integrals expressing the appropriate moments and total mass. In (Cartesian and polar), the CenterOfMass command can draw a graph of the density function over the planar region on which it is defined. All of the continuous cases are implemented in task templates.

Cartesian 2-D

To find the center of mass of the planar region

whose density is , use the task template in Table 35.

Tools≻Tasks≻Browse: Multivariate Calculus≻Center of Mass≻Cartesian 2-D

Center of Mass for Planar Region in Cartesian Coordinates

Density:

 >

 (36)

Region:

 >

 (37)

 >

 (38)

 >

 (39)

 >

 (40)

MomentsMass:

Inert Integral -

 >

 (41)

Explicit values for and

 >

 (42)

Plot:

 >

 >

Table 35   Center of mass of a planar region in Cartesian coordinates

The red region in the graph is the planar region whose center of mass is located at the green dot, whereas the blue surface is a graph of the density function .

Polar

To find the center of mass of the planar region

whose density is , use the task template in Table 36.

Center of Mass for Planar Region in Polar Coordinates

Density:

 >

 (43)

Region:

 >

 (44)

 >

 (45)

 >

 (46)

 >

 (47)

MomentsMass:

Inert Integral -

 >

 (48)

Explicit values for and

 >

 (49)

Plot:

 >

 >

Table 36   Center of mass of a planar region in polar coordinates

The red region in the graph is the planar region whose center of mass is located at the green dot, whereas the blue surface is a graph of the density function .

Cartesian 3-D

To find the center of mass of the region

whose density is , use the task template in Table 37.

Tools≻Tasks≻Browse: Multivariate Calculus≻Center of Mass≻Cartesian 3-D

Center of Mass for 3D Region in Cartesian Coordinates

Density:

 >

 (50)

Region:

 >

 (51)

 >

 (52)

 >

 (53)

 >

 (54)

 >

 (55)

 >

 (56)

MomentsMass:

Inert Integral -

 >

 (57)

Explicit values for , , and

 >

 (58)

 >

Table 37   Center of mass of a spatial region in Cartesian coordinates

The task template fixes the order of integration, but the CenterOfMass command will accept any of the other five possible orders for integration over a region in .

Cylindrical

To find the center of mass of the region

whose density is , use the task template in Table 38.

Center of Mass for 3D Region in Cylindrical Coordinates

Density:

 >

 (59)

Region:

 >

 (60)

 >

 (61)

 >

 (62)

 >

 (63)

 >

 (64)

 >

 (65)

Moments ? Mass:Inert Integral -

 >

 (66)

Explicit values for , , and , the center of mass given in cylindrical coordinates:

 >

 (67)

 >

Table 38   Center of mass of a spatial region in cylindrical coordinates

Spherical

To find the center of mass of the region

whose density is , use the task template in Table 39.

Center of Mass for 3D Region in Spherical Coordinates

( is the colatitude, measured down from the -axis)

Density:

 >

 (68)

Region:

 >

 (69)

 >

 (70)

 >

 (71)

 >

 (72)

 >

 (73)

 >

 (74)

Moments ? Mass:Inert Integral -

 >

 (75)

Explicit values for , and , the center of mass given in spherical coordinates:

 >

 (76)

 >

Table 39   Center of mass of a spatial region in spherical coordinates

Legal Notice: ? Maplesoft, a division of Waterloo Maple Inc. 2010. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.