Classroom Tips and Techniques:
Integration by Parts in Maple
Robert J. Lopez
Emeritus Professor of Mathematics and Maple Fellow
Maplesoft

Introduction


Maple implements "integration by parts" with two different commands. One was designed in a pedagogical setting, and the other, for a "production" setting.
In this article, we compare the functionalities of the two commands,
Parts
(in IntegrationTools)as a "production" tool, and
Rule[parts]
(in Student:Calculus1) as a didactic command.
In the following illustrations, we will write the formula as
so that the factor is be differentiated, and the companion factor, , is to be integrated.


Initialize


The following two integrals
and their sum
will be used as the basis for the discussion of parts integration.
In the second integral the textbook notation stands for a Bessel function of order zero. Maple knows this function as "BesselJ" but the following modifications to Maple allow the textbook notation to be understood.
Alternatively, the interactive Rules Assistant accessed from the View menu can be used, provided extended typesetting has been implemented.


Figure 1 Rules Assistant in default state

Figure 2 Rules Assistant after parse rule enabled





The Parts Command from the IntegrationTools Package


Table 1 makes four applications of the
Parts
command from the IntegrationTools package.
Table 1 immediately reveals that only the term taken as u need be provided. The command then extracts dv and provides v. The table also reveals that the
Parts
command is not deterred by a multiplicative factor in front of the integral. It also reveals that the command applies both to an expression as well as an equation. However, it further shows that if an inappropriate choice of u is made, a formal antiderivative representing v is devised, and the integrationbyparts formula is applied. Finally, the table reveals that if an expression contains more than one integral, an error results. The user must find a way to impose the command on just one integral in the expression.
Table 2 lists several ways that the
Parts
command could be applied just to in expression . Each requires that the integral to which
Parts
is to be applied can be singled out by some distinguishing feature. In the first method, the
evalindets
command is used to place the
Parts
command onto the operand of that is of Maple type `*`, that is, a product. The operands of are identified by applying the
op
command, as in
=
In the second method, is decomposed by the alternate usage of the
op
command, the Parts command is applied to the relevant integral (the first operand), and the transformed reconstructed by adding back the second operant. Of course, this approach can be tedious, but that might be preferable to grappling with the mysteries of Maple types.


Table 2 Applying
Parts
to a particular integral in a sum of integrals





Rule[parts] from the Student[Calculus1] Package


The Student[Calculus1] package contains code for singlestepping through problems in calculus. Limits, derivatives, and integrals can be evaluated stepwise, with the user signaling to Maple the relevant rules to apply. Unfortunately, the syntax for this singlestepping by rules is more complicated than the typical instructor would want to expose to a class of calculus students.
Fortunately, this functionality has been embedded in popup tools that apply the rules via buttons in pointandclick interfaces called Tutors. Figure 3 (below) shows the
Integration Methods
tutor applied to . The first button to be pressed is the "Parts" button, which then launches the dialog in which both u and v are to be entered. Note that here, Maple uses the paradigm

Figure 3 Stepwise integration by parts via the
Integration Methods
tutor



In Table 3, the
Rule[parts]
command is applied to the integrals examined in Table 1.
Unlike the
Parts
command,
Rule[parts]
requires the user to provide both u and v (not dv). But like the
Parts
command in the IntegrationTools package,
Rule[parts]
is not hampered by a multiplier in front of the integral. However, unlike the
Parts
command, it is indeed impeded by an equation. It must act on an expression only. Finally,
Rule[parts]
acts intelligently on an expression containing more than one integral.


Conclusion


The
Parts
command in the IntegrationTools package maps across equations, but not across expressions containing more than one integral. Also, it acts formally on an integral for which the supplied is inappropriate. But it need only be given u, not u and v.
In the didactic environment,
Rule[parts]
will remain the best alternative, mainly because it requires the student to provide as well as , and behaves nicely in an equation and in the presence of more than one integral. Despite its shortcoming in an expression containing more than one integral, in a "productionmode" the
Parts
command would be the tool of choice.

Legal Notice: © Maplesoft, a division of Waterloo Maple Inc. 2017. 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 noncommercial, nonprofit use only. Contact Maplesoft for permission if you wish to use this application in forprofit activities.
