(C) Copyright 1994 D.C.M. Burbulla and  C.T.J. Dodson
       Notebook to support the book
     Self-Tutor for Computer  Calculus

Using Mathematica 2

by
     D. C. M. Burbulla and C. T. J. Dodson, University of Toronto
 Published by:    
    Prentice-Hall Canada  (English)   ISBN 0130152803     and 
     Prentice-Hall Japan  (Japanese) ISBN4-8101-8558-3 C3055 P2880E

Techniques of Integration

The basic techniques of integration are  algebraic manipulation, substitution or  
change of variable, parts, and the method of partial fractions. To help you practice 
these methods with  Mathematica, four functions have been defined for you in the 
package for this chapter. They are: parts, transform, inversesub, and completesquare.

Chap12.m

inversesub/: inversesub[integrand_, x_, z_, substitution_] :=
      {newintegrand = 
      (integrand /. x -> substitution)*D[substitution, z],
       Solve[x == substitution, z]}

parts/: parts[integrand_, x_, u_, substitution_] :=
        {newintegrand = 
	Integrate[integrand/substitution, x]*
	D[substitution, x], u -> substitution, 
	v -> Integrate[integrand/substitution, x]}
	
transform/: transform[integrand_, x_, u_, substitution_] := 
            {newintegrand = integrand/D[substitution, x] 
            /. substitution -> u,
	    u == substitution}

completesquare/: completesquare[quadratic_, x_] := 
        (one = Coefficient[quadratic, x^2];
		 two = Coefficient[quadratic, x];
		 three = quadratic /. x -> 0;
		 one*(x + two/(2*one))^2 + 
		 one*((4*one*three-two^2)/(4*one^2)))

See how transform helps prepare  the integration of x^2 sin(x^3), using the
substitution u = x^3:

transform[x^2 Sin[x^3], x, u, x^3]

Integrate[newintegrand, u]

% /. u -> x^3

What about x (x+3)^(1/2):

transform[x Sqrt[x + 3], x, u, x + 3]

newintegrand /. x -> u - 3

Expand[%]

Integrate[%, u]

% /. u -> x + 3

Another approach to the  second integral is to use what is sometimes referred to 
as an inverse substituion; we have a function for this:

inversesub[x Sqrt[x + 3], x, z, z^2 - 3]

PowerExpand[newintegrand] // Expand

Integrate[%, z]

% /. z -> Sqrt[x + 3]