INTEGRATION BY PARTS USING MAPLE
The command for doing integration by parts in Maple is intparts. This command is
in the student calculus library, and must be loaded using the with command:
> intparts(Int(x^5*sin(x^3),x),x^3);
Recall that when Maple does not recognize a command, or if Maple is unable to perform
a requested command for some other reason, the command is echoed as you typed it.
> with(student);
Now that the student calculus library is loaded, the command should work.
> intparts(Int(x^5*sin(x^3),x),x^3);
Two parameters are required by the intparts command. The first specifies the integral
to be evaluated. The second is an expression for the part of the integrand to be used as
u in the formula
> Int(u,v)=u*v-Int(v,u);
The first parameter needs to be an unevaluated integral, so the command Int, with a
capital I, is used instead of the command int, with a lower case i. It is also a good idea
to assign a name to the integral for reuse in later commands.
> int (x^3*sin(x),x);
> keep := Int(x^5*sin(x^3),x);
Now, it is simple to try different values of u to see which is the best choice.
> intparts(keep,x^5);
> intparts(keep,sin(x^3));
> mine := intparts(keep,x^3);
At this point, the last integral looks the most promising (simplest). You should be
able to see that a simple substitution (w = x^3) will complete the evaluation of the
integral. Once you see how to finish the integration, you can ask Maple to confirm
your observation by using the command value.
> value(mine);
Alternatively, if you would like to see the substitution, there is a changevar command
which will perform the change of variable for you. The changevar takes three parameters.
The first is an equation defining the change of variable, the second is the integral in which
you are making the change, and the third is the name of the new variable of integration.
Thus to make the change of variable w=x^3 in the integral which I saved as mine with
w as the new variable of integration, we do:
> changevar(w=x^3, mine, w);
> value(%);
The subs command can be used to make a substitution when no integral is involved.
> subs(w=x^3,%);
The changevar command will even change the limits for you when you apply it to a
definite integral.
> k := Int(x^2*sin(x^3),x=2..3);
> changevar(w=x^3,k,w);
Sometimes integration by parts has to be applied repeatedly to obtain a final answer.
You can use variables to store your partial results, or you can make use of the double
quote (") as we have done below:
> keep := Int(x^3*exp(x),x);
> intparts(keep,x^3);
> intparts(%,x^2);
>
> intparts(%,x);
>
> value(%);
>
See the list of commands following the execution of a with(student) command for the
names of other commands which are useful when doing integration. Use the help command
(a question mark (?) followed by the name of a command) to find out how to use a command.