Application Center - Maplesoft

App Preview:

Calculus II: Lesson 10: Integration by Parts

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

Learn about Maple
Download Application


 

L10-intTechParts.mws

Calculus II

Lesson 10: Integration by Parts

Anti-differentiation by Parts

> restart;

The second main method of anti-differentiation we will study is anti-differentiation by parts . As discussed in class, this is summarised by the formula

Int(u*D(v),x) = u*v-Int(v*D(u),x) .

Maple has a command which will integrate by parts. It is called intparts , and it resides in the student package, which we will have to reload because the restart above cleared it from memory.

> with(student);

[D, Diff, Doubleint, Int, Limit, Lineint, Product, ...
[D, Diff, Doubleint, Int, Limit, Lineint, Product, ...

(Note that we suppressed the list of commands this time.) The intparts command has two arguments: the first is the expression to be anti-differentiated, and the second is the choice for u , the piece which is to be differentiated. We don't need to specify D(v) , because it must be everything else in the integrand.

As an example, let's find Int(x*exp(-2*x),x) . Hopefully, you can look at this example and see that we should choose u = x .

> p1 := Int(x*exp(-2*x),x);

p1 := Int(x*exp(-2*x),x)

> p2 := intparts(p1,x);

p2 := -1/2*x*exp(-2*x)-Int(-1/2*exp(-2*x),x)

> p3 := simplify(p2);

p3 := -1/2*x*exp(-2*x)+1/2*Int(exp(-2*x),x)

We still have an integral to do, but it is sufficiently simple that we can see how to evaluate it, and so we will allow Maple to do so:

> p4 := value(p3);

p4 := -1/2*x*exp(-2*x)-1/4*exp(-2*x)

> p1 = p4 + C;

Int(x*exp(-2*x),x) = -1/2*x*exp(-2*x)-1/4*exp(-2*x)...

Finally, check by differentiation:

> diff(p4,x);

x*exp(-2*x)

Differentiating p4 gives the function we started with, so p4 is an anti-derivative for this function.

There are some nice tricks you can do with the intparts command. For example, a standard use of the method of parts is to compute Int(ln(x),x) by writing it as Int(1*ln(x),x) and choosing u = ln(x) .

> p1 := Int(ln(x),x);

p1 := Int(ln(x),x)

> p2 := intparts(p1,ln(x));

p2 := ln(x)*x-Int(1,x)

> p3 := value(p2);

p3 := ln(x)*x-x

> p1 = p3 + C;

Int(ln(x),x) = ln(x)*x-x+C

Of course, we should check by differentiation:

> diff(p3,x);

ln(x)

>

Question 2

Use the method described above to find the following anti-derivatives. (All of them are taken from Exercises 7.1 of Stewart, and you should do them all---and others---with pencil and paper for homework.)

(a) Int(x*cos(x),x)

Solution.

> p1 := Int(x*cos(x),x);

p1 := Int(x*cos(x),x)

> p2 := intparts(p1,x);

p2 := x*sin(x)-Int(sin(x),x)

> p3 := value(p2);

p3 := x*sin(x)+cos(x)

> p1 = p3 + C;

Int(x*cos(x),x) = x*sin(x)+cos(x)+C

Check: (You did check each of your answers, didn't you?)

> diff(p3,x);

x*cos(x)

>

(b) Int(x*ln(x),x)

Solution.

> p1 := Int(x*ln(x), x);

p1 := Int(ln(x)*x,x)

> p2 := intparts(p1, ln(x));

p2 := 1/2*ln(x)*x^2-Int(1/2*x,x)

> p3 := simplify(p2);

p3 := 1/2*ln(x)*x^2-1/2*Int(x,x)

> p4 := value(p3);

p4 := 1/2*ln(x)*x^2-1/4*x^2

> p1 = p4 + C;

Int(ln(x)*x,x) = 1/2*ln(x)*x^2-1/4*x^2+C

Check:

> diff(p4,x);

ln(x)*x

>

(c) Int(x^2*sin(2*x),x)

Solution. It seems clear that we should differentiate the power of x . This will lower the power by 1, which will give us a simpler integral, but not yet one that we are allowed to evaluate. We will have to integrate by parts a second time.

> p1 := Int(x^2 * sin(2*x), x);

p1 := Int(x^2*sin(2*x),x)

> p2 := intparts(p1, x^2);

p2 := -1/2*x^2*cos(2*x)-Int(-x*cos(2*x),x)

> p3 := simplify(p2);

p3 := -1/2*x^2*cos(2*x)+Int(x*cos(2*x),x)

> p4 := intparts(p3, x);

p4 := -1/2*x^2*cos(2*x)+1/2*x*sin(2*x)-Int(1/2*sin(...

> p5 := simplify(p4);

p5 := -1/2*x^2*cos(2*x)+1/2*x*sin(2*x)-1/2*Int(sin(...

> p6 := value(p5);

p6 := -1/2*x^2*cos(2*x)+1/2*x*sin(2*x)+1/4*cos(2*x)...

> p1 = p6 + C;

Int(x^2*sin(2*x),x) = -1/2*x^2*cos(2*x)+1/2*x*sin(2...

Check:

> diff(p6,x);

x^2*sin(2*x)

>

(d) Int(x^2*exp(-x),x)

Solution. This is the same as part (c): we have to integrate by parts twice.

> p1 := Int(x^2 * exp(-x), x);

p1 := Int(x^2*exp(-x),x)

> p2 := intparts(p1, x^2);

p2 := -x^2*exp(-x)-Int(-2*x*exp(-x),x)

> p3 := simplify(p2);

p3 := -x^2*exp(-x)+2*Int(x*exp(-x),x)

> p4 := intparts(p3, x);

p4 := -x^2*exp(-x)-2*x*exp(-x)-2*Int(-exp(-x),x)

> p5 := simplify(p4);

p5 := -x^2*exp(-x)-2*x*exp(-x)+2*Int(exp(-x),x)

> p6 := value(p5);

p6 := -x^2*exp(-x)-2*x*exp(-x)-2*exp(-x)

> p1 = p6 + C;

Int(x^2*exp(-x),x) = -x^2*exp(-x)-2*x*exp(-x)-2*exp...

Check:

> diff(p6, x);

x^2*exp(-x)

>

>

Question 3

Find the following anti-derivatives. You will probably have to use a combination of both methods: substitution and parts.

(a) Int(x^3*exp(x^2),x)

Solution. Whenever you have an exponential function in an integral, it is a good idea to try substituting u for whatever function is in the exponent.

> p1 := Int(x^3 * exp(x^2), x);

p1 := Int(x^3*exp(x^2),x)

> p2 := changevar(u=x^2, p1, u);

p2 := Int(1/2*u*exp(u),u)

> p3 := simplify(p2);

p3 := 1/2*Int(u*exp(u),u)

> p4 := intparts(p3, u);

p4 := 1/2*u*exp(u)-1/2*Int(exp(u),u)

> p5 := value(p4);

p5 := 1/2*u*exp(u)-1/2*exp(u)

> p6 := subs(u=x^2, p5);

p6 := 1/2*x^2*exp(x^2)-1/2*exp(x^2)

> p1 = p6 + C;

Int(x^3*exp(x^2),x) = 1/2*x^2*exp(x^2)-1/2*exp(x^2)...

Check:

> diff(p6, x);

x^3*exp(x^2)

>

(b) Int(cos(x)*ln(sin(x)),x)

Solution.

> p1 := Int(cos(x)*ln(sin(x)), x);

p1 := Int(cos(x)*ln(sin(x)),x)

> p2 := changevar(u=sin(x), p1, u);

p2 := Int(ln(u),u)

We found this anti-derivative earlier on in the worksheet, so we might allow ourselves to evaluate it as it stands, but for practice (and because it is not in the list on p. 416), let's do it again.

> p3 := intparts(p2, ln(u));

p3 := ln(u)*u-Int(1,u)

> p4 := value(p3);

p4 := ln(u)*u-u

> p5 := subs(u=sin(x), p4);

p5 := ln(sin(x))*sin(x)-sin(x)

> p1 = p5 + C;

Int(cos(x)*ln(sin(x)),x) = ln(sin(x))*sin(x)-sin(x)...

Check:

> diff(p5, x);

cos(x)*ln(sin(x))