> restart;  with(student):
 

The methods and commands in this tutorial are not strictly necessary, because Maple uses them behind the scenes when they are needed. But they can help you learn about the integration techniques we are covering without the need to do lots of algebra.  

Integration by parts 

There is no elementary technique for this integral. 

> Int( ln(x), x );
 

Int(ln(x), x) 

Applying parts, however, makes it easy. 

> intparts( %, ln(x) );
 

ln(x)*x-Int(1, x) 

> value(%);
 

ln(x)*x-x 

You can get some nice "reduction formulas" this way. 

> Int( x^n*sin(x), x );
 

Int(x^n*sin(x), x) 

> intparts( %, x^n );
 

-x^n*cos(x)-Int(-x^n*n*cos(x)/x, x) 

> simplify(%);
 

-x^n*cos(x)+n*Int(x^(n-1)*cos(x), x) 

 

Substitutions 

> Int( sqrt(4-x^2)/x^2, x=1..2 );
 

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

> changevar( x=2*sin(theta), %, theta );
 

Int(1/2*(4-4*sin(theta)^2)^(1/2)*cos(theta)/sin(theta)^2, theta = 1/6*Pi .. 1/2*Pi) 

> simplify(%);
 

Int(cos(theta)^2/sin(theta)^2, theta = 1/6*Pi .. 1/2*Pi) 

> value(%);
 

3^(1/2)-1/3*Pi 

 

Partial fractions 

In class we only cover distinct linear factors, but there are partial fraction expressions for all possible kinds of rational functions. Maple will also do long division if the degree of the numerator is greater than that of the denominator. 

> r:= (x^4-2*x+1) / (2*x^3 + 3*x^2 -2*x );
 

(x^4-2*x+1)/(2*x^3+3*x^2-2*x) 

> convert(r,parfrac);
 

1/2*x-3/4-1/2/x+21/10/(x+2)+1/20/(2*x-1) 

> int(%,x);
 

1/4*x^2-3/4*x-1/2*ln(x)+21/10*ln(x+2)+1/40*ln(2*x-1) 

Here is what happens with repeated linear factors in the denominator. 

> r:= x^2 / ( (x-1)^3*(x+2) );
 

x^2/((x-1)^3*(x+2)) 

> convert(r,parfrac);
 

1/3/(x-1)^3-4/27/(x+2)+5/9/(x-1)^2+4/27/(x-1) 

And here is an irreducible quadratic factor. 

> r:= 1 / ( (x^2+1)*(x-2) );
 

1/((x^2+1)*(x-2)) 

> convert(r,parfrac);
 

1/5*(-x-2)/(x^2+1)+1/5/(x-2) 

>
 

 

Improper integrals 

You can evaluate improper integrals by the definition. But you may have to be very explicit about assumptions on certain values and one-sided limits. 

> plot( ln(x), x=0..1 );
 

Plot 

> Int( ln(x), x=a..1 );
 

Int(ln(x), x = a .. 1) 

> value(%);
 

-a*ln(a)+a-1 

> limit( %, a=0, right);
 

-1 

> Int( sec(x), x=0..a );
 

Int(sec(x), x = 0 .. a) 

> value(%) assuming a>0 and a<Pi/2;
 

ln(1+sin(a))-ln(cos(a)) 

> limit( %, a=Pi/2, left );
 

infinity 

In many cases Maple will handle improper integrals automatically and tell you if the integral is not possible. 

> Int( 1/(x-2), x=1..3 );
 

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

> value(%);
 

undefined 

> Int( ln(x)/x^2, x=1..infinity );
 

Int(ln(x)/x^2, x = 1 .. infinity) 

> value(%);
 

1 

>