]>
Book Contents Previous Section 1.11 Derivatives Next Section 1.13 Differential Equations Book Index

## 1.12 Integration

Axiom has extensive library facilities for integration. integration

The first example is the integration of a fraction with denominator that factors into a quadratic and a quartic irreducible polynomial. The usual partial fraction approach used by most other computer algebra systems either fails or introduces expensive unneeded algebraic numbers.

We use a factorization-free algorithm.

integrate((x**2+2*x+1)/((x+1)**6+1),x)

arctan(x 3+3 x 2+3 x+1)3

Type: Union(Expression Integer,...)

When real parameters are present, the form of the integral can depend on the signs of some expressions.

Rather than query the user or make sign assumptions, Axiom returns all possible answers.

integrate(1/(x**2 + a),x)

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

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

The integrate operation generally assumes that all parameters are real. The only exception is when the integrand has complex valued quantities.

If the parameter is complex instead of real, then the notion of sign is undefined and there is a unique answer. You can request this answer by ``prepending'' the word ``complex'' to the command name:

complexIntegrate(1/(x**2 + a),x)

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

Type: Expression Integer

The following two examples illustrate the limitations of table-based approaches. The two integrands are very similar, but the answer to one of them requires the addition of two new algebraic numbers.

This one is the easy one. The next one looks very similar but the answer is much more complicated.

integrate(x**3 / (a+b*x)**(1/3),x)

(120 b 3 x 3-135 a b 2 x 2+162 a 2 b x-243 a 3)b x+a 3 2 440 b 4

Type: Union(Expression Integer,...)

Only an algorithmic approach is guaranteed to find what new constants must be added in order to find a solution.

integrate(1 / (x**3 * (a+b*x)**(1/3)),x)

(-2 b 2 x 2 3 log(a 3 b x+a 3 2+a 3 2 b x+a 3+a)+4 b 2 x 2 3 log(a 3 2 b x+a 3-a)+12 b 2 x 2 arctan(2 3 a 3 2 b x+a 3+a 3 3 a)+(12 b x-9 a)3 a 3 b x+a 3 2)18 a 2 x 2 3 a 3

Type: Union(Expression Integer,...)

Some computer algebra systems use heuristics or table-driven approaches to integration. When these systems cannot determine the answer to an integration problem, they reply ``I don't know.'' Axiom uses an algorithm which is a decision procedure for integration. If Axiom returns the original integral that conclusively proves that an integral cannot be expressed in terms of elementary functions.

When Axiom returns an integral sign, it has proved that no answer exists as an elementary function.

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

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

Type: Union(Expression Integer,...)

Axiom can handle complicated mixed functions much beyond what you can find in tables.

Whenever possible, Axiom tries to express the answer using the functions present in the integrand.

integrate((sinh(1+sqrt(x+b))+2*sqrt(x+b)) / (sqrt(x+b) * (x + cosh(1+sqrt(x + b)))), x)

2 log(-2 cosh(x+b+1)-2 x sinh(x+b+1)-cosh(x+b+1))-2 x+b

Type: Union(Expression Integer,...)

A strong structure-checking algorithm in Axiom finds hidden algebraic relationships between functions.

integrate(tan(atan(x)/3),x)

(8 log(3 tan(arctan(x)3)2-1)-3 tan(arctan(x)3)2+18 x tan(arctan(x)3))18

Type: Union(Expression Integer,...)

The discovery of this algebraic relationship is necessary for correct integration of this function. Here are the details:

1. If x=tan t and g=tan(t/3) then the following algebraic relation is true: g 3-3 xg 2-3 g+x=0
2. Integrate g using this algebraic relation; this produces: (24 g 2-8)log(3 g 2-1)+(81 x 2+24)g 2+72 xg-27 x 2-16 54 g 2-18
3. Rationalize the denominator, producing: 8 log(3 g 2-1)-3 g 2+18 xg+16 18 Replace g by the initial definition g=tan(arctan(x)/3) to produce the final result.

This is an example of a mixed function where the algebraic layer is over the transcendental one.

integrate((x + 1) / (x*(x + log x) ** (3/2)), x)

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

Type: Union(Expression Integer,...)

While incomplete for non-elementary functions, Axiom can handle some of them.

integrate(exp(-x**2) * erf(x) / (erf(x)**3 - erf(x)**2 - erf(x) + 1),x)

(erf(x)-1)π log(erf(x)-1 erf(x)+1)-2 π 8 erf(x)-8

Type: Union(Expression Integer,...)

More examples of Axiom's integration capabilities are discussed in Section ugProblemIntegration .

Book Contents Previous Section 1.11 Derivatives Next Section 1.13 Differential Equations Book Index