Maxima Function
integrate (expr, x)
integrate(expr,x,a,b)
Attempts to symbolically compute the integral of expr with respect to x.
integrate (expr, x)
is an indefinite integral,
while integrate (expr, x, a, b)
is a definite integral,
with limits of integration a and b.
The limits should not contain x, although integrate
does not enforce this restriction.
a need not be less than b.
If b is equal to a, integrate
returns zero.
See and related functions for numerical approximation of definite integrals. See for computation of residues (complex integration). See for an alternative means of computing indefinite integrals.
The integral (an expression free of integrate
) is returned if integrate
succeeds.
Otherwise the return value is
the noun form of the integral (the quoted operator 'integrate
)
or an expression containing one or more noun forms.
The noun form of integrate
is displayed with an integral sign.
In some circumstances it is useful to construct a noun form by hand,
by quoting integrate
with a single quote, e.g., 'integrate (expr, x)
.
For example, the integral may depend on some parameters which are not yet computed.
The noun may be applied to its arguments by ev (i, nouns)
where i is the noun form of interest.
integrate
handles definite integrals separately from indefinite,
and employs a range of heuristics to handle each case.
Special cases of definite integrals include limits of integration equal to
zero or infinity (inf
or minf
),
trigonometric functions with limits of integration equal to zero and %pi
or 2 %pi
,
rational functions,
integrals related to the definitions of the beta
and psi
functions,
and some logarithmic and trigonometric integrals.
Processing rational functions may include computation of residues.
If an applicable special case is not found,
an attempt will be made to compute the indefinite integral and evaluate it at the limits of integration.
This may include taking a limit as a limit of integration goes to infinity or negative infinity;
see also .
Special cases of indefinite integrals include trigonometric functions,
exponential and logarithmic functions,
and rational functions.
integrate
may also make use of a short table of elementary integrals.
integrate
may carry out a change of variable
if the integrand has the form f(g(x)) * diff(g(x), x)
.
integrate
attempts to find a subexpression g(x)
such that
the derivative of g(x)
divides the integrand.
This search may make use of derivatives defined by the gradef
function.
See also and .
If none of the preceding heuristics find the indefinite integral,
the Risch algorithm is executed.
The flag risch
may be set as an evflag
,
in a call to ev
or on the command line,
e.g., ev (integrate (expr, x), risch)
or integrate (expr, x), risch
.
If risch
is present, integrate
calls the risch
function
without attempting heuristics first. See also .
integrate
works only with functional relations represented explicitly with the f(x)
notation.
integrate
does not respect implicit dependencies established by the depends
function.
integrate
may need to know some property of a parameter in the integrand.
integrate
will first consult the assume
database,
and, if the variable of interest is not there,
integrate
will ask the user.
Depending on the question,
suitable responses are yes;
or no;
,
or pos;
, zero;
, or neg;
.
integrate
is not, by default, declared to be linear. See and .
integrate
attempts integration by parts only in a few special cases.
Examples:
Elementary indefinite and definite integrals.
Use of assume
and interactive query.
Change of variable. There are two changes of variable in this example:
one using a derivative established by gradef
,
and one using the derivation diff(r(x))
of an unspecified function r(x)
.
Return value contains the 'integrate
noun form.
In this example, Maxima can extract one factor of the denominator
of a rational function, but cannot factor the remainder or otherwise find its integral.
grind
shows the noun form 'integrate
in the result.
See also for more on integrals of rational functions.
Defining a function in terms of an integral.
The body of a function is not evaluated when the function is defined.
Thus the body of f_1
in this example contains the noun form of integrate
.
The quote-quote operator '@w'
causes the integral to be evaluated,
and the result becomes the body of f_2
.
(%i1) f_1 (a) := integrate (x^3, x, 1, a); 3 (%o1) f_1(a) := integrate(x , x, 1, a) (%i2) ev (f_1 (7), nouns); (%o2) 600 (%i3) /* Note parentheses around integrate(...) here */ f_2 (a) := ''(integrate (x^3, x, 1, a)); 4 a 1 (%o3) f_2(a) := -- - - 4 4 (%i4) f_2 (7); (%o4) 600