]>
Book Contents Previous Section 8.7 Laplace Transforms Next Section 8.9 Working with Power Series Book Index

## 8.8 Integration

Integration is the reverse process of differentiation, that is, integration 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 integrate FunctionSpaceIntegration, for integrating real-valued elementary functions. FunctionSpaceIntegration

integrate(cosh(a*x)*sinh(a*x), x)

sinh(a x)2+cosh(a x)2 4 a

Type: Union(Expression Integer,...)

Unfortunately, antiderivatives of most functions cannot be expressed in terms of elementary functions.

integrate(log(1 + sqrt(a * x + b)) / x, x)

∫x log(b+%M a+1)%M d%M

Type: Union(Expression Integer,...)

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 antiderivative that look quite different because the form of the antiderivative depends on the sign of a constant that appears in the function.

integrate(1/(x**2 - 2),x)

log((x 2+2)2-4 x x 2-2)2 2

Type: Union(Expression Integer,...)
integrate(1/(x**2 + 2),x)

arctan(x 2 2)2

Type: Union(Expression Integer,...)

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 the possible cases. Here you use the answer involving the square root of a when a>0 and integration:result as list of real functions the answer involving the square root of -a when a<0.

integrate(x**2 / (x**4 - a**2), x)

[log((x 2+a)a-2 a x x 2-a)+2 arctan(x a a)4 a,log((x 2-a)-a+2 a x x 2+a)-2 arctan(x-a a)4-a]

Type: Union(List Expression Integer,...)

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 complexIntegrate FunctionSpaceComplexIntegration, which is provided by the package integration:result as a complex functions FunctionSpaceComplexIntegration. FunctionSpaceComplexIntegration

This operation is used for integrating complex-valued elementary functions.

complexIntegrate(x**2 / (x**4 - a**2), x)

(4 a log(x-4 a+2 a-4 a)--4 a log(x 4 a+2 a 4 a)+-4 a log(x 4 a-2 a 4 a)-4 a log(x-4 a-2 a-4 a))2-4 a 4 a

Type: Expression Integer

As with the real case, antiderivatives for most complex-valued functions cannot be expressed in terms of elementary functions.

complexIntegrate(log(1 + sqrt(a * x + b)) / x, x)

∫x log(b+%M a+1)%M d%M

Type: Expression Integer

Sometimes integrate can involve symbolic algebraic numbers such as those returned by rootOf rootOf Expression. To see how to work with these strange generated symbols (such as %%a0), see ugxProblemSymRootAll .

Definite integration is the process of computing the area between integration:definite 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 if there exists a function g that is differentiable on 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 integrate RationalFunctionDefiniteIntegration, for integrating real-valued rational functions.

integrate((x**4 - 3*x**2 + 6)/(x**6-5*x**4+5*x**2+4), x = 1..2)

2 arctan(8)+2 arctan(5)+2 arctan(2)+2 arctan(1 2)-π 2

Type: Union(f1: OrderedCompletion Expression Integer,...)

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 case, as in the following example:

integrate(1/(x**2-2), x = 1..2)
>> Error detected within library code:
Pole in path of integration
You are being returned to the top level
of the interpreter.

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.

integrate(1/(x**2-a), x = 1..2)

potentialPole

Type: Union(pole: potentialPole,...)

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 integrate RationalFunctionDefiniteIntegration:

The value here is, of course, incorrect if sqrt(a) is between 1 and 2.

integrate(1/(x**2-a), x = 1..2, "noPole")

(-log((-4 a 2-4 a)a+a 3+6 a 2+a a 2-2 a+1)+log((-8 a 2-32 a)a+a 3+24 a 2+16 a a 2-8 a+16)-arctan(2-a a)+arctan(-a a)-a)4 a

Type: Union(f2: List OrderedCompletion Expression Integer,...)
Book Contents Previous Section 8.7 Laplace Transforms Next Section 8.9 Working with Power Series Book Index