Application Center - Maplesoft

App Preview:

Classroom Tips and Techniques: Integration by Parts

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

Learn about Maple
Download Application




 

Classroom Tips and Techniques:

 

Integration by Parts in Maple

 

 

Robert J. Lopez

Emeritus Professor of Mathematics and Maple Fellow

Maplesoft

 

 

Introduction

NULL

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.

NULL

In the following illustrations, we will write the formula as

NULL

int(u, v) = uv-(int(v, u)) NULL

NULL

so that the factor u is be differentiated, and the companion factor, dv, is to be integrated.

NULL

Initialize

NULL

The following two integrals

 

Phi[1] := tan(x)*(Int(x*sin(x), x)); Phi[2] := Int(J[0](x)^6*cos(x), x)
``

and their sum

Phi[3] := Phi[1]+Phi[2]

tan(x)*(Int(x*sin(x), x))+Int(J[0](x)^6*cos(x), x)

 

will be used as the basis for the discussion of parts integration.

``

In the second integral the textbook notation J[0](x) 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.

 

interface(typesetting = extended); Typesetting:-EnableParseRule("BesselJ")

NULL

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

NULL

The Parts Command from the IntegrationTools Package

NULL

Table 1 makes four applications of the Parts  command from the IntegrationTools package.

NULL

IntegrationTools:-Parts(Phi[1], x)

tan(x)*(-x*cos(x)-(Int(-cos(x), x)))

IntegrationTools:-Parts(Phi[1] = cos(x), x)

tan(x)*(-x*cos(x)-(Int(-cos(x), x))) = cos(x)

IntegrationTools:-Parts(Phi[2], x)

x*(int(J[0](x)^6*cos(x)/x, x))-(Int(int(J[0](x)^6*cos(x)/x, x), x))

IntegrationTools:-Parts(Phi[3], x)

Error, (in IntegrationTools:-Parts) multiple integrals detected

Table 1   The Parts  command from the IntegrationTools package applied to the integrals in Table 1

NULL

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 integration-by-parts 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 Phi[1] in expression Phi[3]. 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 Phi[3] that is of Maple type `*`, that is, a product. The operands of Phi[3] are identified by applying the op  command, as in

 

op(Phi[3]) = tan(x)*(Int(x*sin(x), x)), Int(J[0](x)^6*cos(x), x)NULL

 

In the second method, Phi[3] 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 Phi[3] 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.

 

evalindets(Phi[3], `*`, IntegrationTools:-Parts, x)

tan(x)*(-x*cos(x)-(Int(-cos(x), x)))+Int(J[0](x)^6*cos(x), x)

IntegrationTools:-Parts(op(1, Phi[3]), x)+op(2, Phi[3])

tan(x)*(-x*cos(x)-(Int(-cos(x), x)))+Int(J[0](x)^6*cos(x), x)

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

NULL

Rule[parts] from the Student[Calculus1] Package

NULL

The Student[Calculus1] package contains code for single-stepping through problems in calculus.  Limits, derivatives, and integrals can be evaluated step-wise, with the user signaling to Maple the relevant rules to apply.  Unfortunately, the syntax for this single-stepping by rules is more complicated than the typical instructor would want to expose to a class of calculus students.

NULL

Fortunately, this functionality has been embedded in pop-up tools that apply the rules via buttons in point-and-click interfaces called Tutors.  Figure 3 (below) shows the Integration Methods  tutor applied to Phi[1]. 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

 

int(f, g) = f*g-(int(g, f))

NULL

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.

 

Student:-Calculus1:-Rule[parts, x, -cos(x)](Phi[1])

CALCULUS1OBJECT([1, [4], []], {x}) = tan(x)*(-x*cos(x)-(Int(-cos(x), x)))

Student:-Calculus1:-Rule[parts, x, -cos(x)](Phi[1] = cos(x))

Error, (in Student:-Calculus1:-Rule[parts, x, `+`(`-`(cos(x)))]) input expression does not have any incomplete calculus operations

Student:-Calculus1:-Rule[parts, x, -cos(x)](Phi[1]-cos(x))

CALCULUS1OBJECT([2, [4], []], {x}) = tan(x)*(-x*cos(x)-(Int(-cos(x), x)))-cos(x)

Student:-Calculus1:-Rule[parts, x, -cos(x)](Phi[3])

CALCULUS1OBJECT([3, [4], []], {x}) = tan(x)*(-x*cos(x)-(Int(-cos(x), x)))+Int(J[0](x)^6*cos(x), x)

Table 3    Rule[parts]  from the Student:-Calculus1 package applied to the integrals in Table 1

NULL

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.

NULL

Conclusion

NULL

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 u is inappropriate. But it need only be given u, not u and v.

NULL

In the didactic environment, Rule[parts]  will remain the best alternative, mainly because it requires the student to provide v as well as u, 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 "production-mode" the Parts  command would be the tool of choice.

NULL

NULL

NULL

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 non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL