Integration

Integration is the reverse process of differentiation, that is, an integral of a function f with respect to a variable x is any function g such that D(g,x) is equal to f. The package FunctionSpaceIntegration provides the top-level integration operation integrate, for integrating real-valued elementary functions. Unfortunately, antiderivatives of most functions cannot be expressed in terms of elementary functions. Given an elementary function to integrate, Axiom returns a formal integral as above only when it can prove that the integral is not elementary and not when it cannot determine the integral. In this rare case it prints a message that it cannot determine if an elementary integral exists. Similar functions may have antiderivatives that look quite different because the form of the antiderivative depends on the sign of a constant that appears in the function. If the integrand contains parameters, then there may be several possible antiderivatives, depending on the signs of expressions of the parameters. In this case Axiom returns a list of answers that cover all possible cases. Here you use the answer involving the square root of a when a>0 and the answer involving the square root of -a when a<0. If the parameters and the variables of integration can be complex numbers rather than real, then the notion of sign is not defined. In this case all the possible answers can be expressed as one complex function. To get that function, rather than a list of real functions, use complexIntegrate, which is provided by the package FunctionSpaceComplexIntegration. This operation is used for integrating complex-valued elementary functions. As with the real case, antiderivatives for most complex-valued functions cannot be expressed in terms of elementary functions. Sometimes integrate can involve symbolic algebraic numbers such as those returned by rootOf. To see how to work with these strange generated symbols (such as %%a0), see Using All Roots of a Polynomial. Definite integration is the process of computing the area between the x-axis and the curve of a function f(x). The fundamental theorem of calculus states that if f is continuous on an interval a..b and such that D(g,x) is equal to f, then the definite integral of f for x in the interval a..b is equal to g(b)-g(a). The package RationalFunctionDefiniteIntegration provides the top-level definite integration operation, integrate, for integrating real-valued rational functions. Axiom checks beforehand that the function you are integrating is defined on the interval a..b, and prints an error message if it finds that this is not the case, as in the following example:
 integrate(1/(x^2-2),x=1..2)

 Error detected within library code:
 Pole in path of integration
When parameters are present in the function, the function may or may not be defined on the interval of integration. If this is the case, Axiom issues a warning that a pole might lie in the path of integration, and does not compute the integral. If you know that you are using values of the parameter for which the function has no pole in the interval of integration, use the string "noPole" as a third argument to integrate. The value here is, of course, incorrect if sqrt(a) is between 1 and 2.