int or Int - Maple Programming Help

Home : Support : Online Help : Mathematics : Group Theory : Inert Functions : int/details

int or Int

definite and indefinite integration

Calling Sequence

 int(expression, x) $∫\mathrm{expression}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$ Int(expression, x) ${∫}\mathrm{expression}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x$ int(expression, x=a..b) ${∫}_{a}^{b}\mathrm{expression}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$ Int(expression, x=a..b) ${{∫}}_{a}^{b}\mathrm{expression}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x$ int(expression, [x, y]) int(expression, x=a..b, opt) int(expression, [x=a..b, y=c..d, ...], opt) Int(expression, x=a..b, opt) int(f, a..b, opt) int(f, [a..b, c..d, ...], opt) Int(f, a..b, opt)

Parameters

 expression - algebraic expression; integrand x,y - name; variable of integration a, b, c, d - endpoints of interval on which integral is taken f - operator; integrand opt - (optional) a sequence of one or more of the options listed below

Options

 • The following options, which are described in more detail in the sections below, apply to definite integrals only. Where indicated, some options take their default value from environment variables. An option has a default value of false if its corresponding environment variable is not set.
 • AllSolutions=truefalse

Specifies whether int considers all possible real values for any symbols in the limits of integration. The default value is taken from _EnvAllSolutions.

 • continuous=truefalse

Specifies whether int looks for discontinuities. The default value is taken from _EnvContinuous.

 • CauchyPrincipalValue=truefalse

Specifies whether a principal value integral is computed, that is, whether infinities are allowed to cancel in some cases. The default value is taken from _EnvCauchyPrincipalValue.

 • method=value

Specifies which internal integration routine(s) to use.  See int/methods for more details.

 • numeric=truefalse

Specifies whether numeric integration methods are used instead of symbolic methods.  If numeric=true is specified, other numeric integration options can be specified.  See evalf/Int for more details.

Basic Information

 • This help page contains complete information about the int and Int commands. For basic information, see the int help page.

Description

 • The int command computes an indefinite or definite integral of the expression expression with respect to the variable x. The name integrate is a synonym for int.
 • You can enter the command int using either the 1-D or 2-D calling sequence.  For instance, int(f,x) is equivalent to $∫f\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$.
 • Indefinite integration is performed if the second argument x is a name. Note that no constant of integration appears in the result. Definite integration is performed if the second argument is of the form x=a..b where a and b are the endpoints of the interval of integration.
 If a and b are finite complex numbers, the int routine computes the definite integral over the straight line from a to b.
 • If the integrand is specified as a Maple operator f, then the second argument must be a range a..b and not an equation, that is, a variable of integration must not be specified.
 • If Maple cannot find a closed form expression for the integral, the function call itself is returned.
 • The capitalized function name Int is the inert version of the int function, which simply returns unevaluated. It appears gray so that it is easily distinguished from a returned int calling sequence. In this form, expression can be a procedure, which can be integrated numerically.
 • For numerical integration, use the option numeric.  For more information on numerical integration, see evalf/Int.
 • If the second argument is a list, an iterated integration is performed on the variables or ranges in the order given. For definite integration, the list can be omitted and the ranges can be given as a sequence. For indefinite integration, the variables can be given as a sequence instead of a list if all variables appear in the expression being integrated. Otherwise, there may be confusion between variables and option names.

Handling Discontinuities

 • Note that the indefinite integral in Maple is defined up to a piecewise constant. Hence, the results returned by int may be discontinuous at some points. In many cases, you can ensure continuity by replacing an indefinite integration problem by the corresponding definite integral.
 > int( floor(x), x );
 ${\mathrm{floor}}{}\left({x}\right){}{x}$ (1)
 > int( floor(t), t = 0..x ) assuming x > 0;
 ${\mathrm{floor}}{}\left({x}\right){}{x}{+}\left({{}\begin{array}{cc}{-}\frac{{1}}{{2}}{}{{\mathrm{floor}}{}\left({x}\right)}^{{2}}{-}\frac{{1}}{{2}}{}{\mathrm{floor}}{}\left({x}\right)& {1}{\le }{\mathrm{floor}}{}\left({x}\right)\\ {0}& {\mathrm{otherwise}}\end{array}\right)$ (2)
 • For symbolic definite integration, two options control how discontinuities are handled.  By default, int checks for discontinuities, and computes the integral as a sum of independent definite integrals, each of which involves an integrand which has no discontinuities in the interior of the interval of integration.
 • The 'continuous' option instructs int not to look for discontinuities.
 • The 'CauchyPrincipalValue' option instructs int to consider the limits from the left and right at each interior discontinuity as a single limit (so that the independent variable approaches the discontinuity at the same rate from the right and the left).  This allows for positive and negative infinite limits to cancel.

Returning the Entire Set of Solutions

 • The 'AllSolutions' option, if set, forces int to return the entire set of solutions for the specified definite integral. This applies only to parameters in the endpoints of the interval, not to parameters in the integrand.
 Note: The results returned with the 'AllSolutions' option may not be valid for some non-real parameter values. The results are always valid for all real parameter values.

Notes

 • The Maple series function may be invoked on an unevaluated integral to compute a series expansion of the integral (when possible).
 • When int is applied to a series structure, the internal function int/series is invoked to compute the integral efficiently.

Examples

 > $∫\mathrm{sin}\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${-}{\mathrm{cos}}{}\left({x}\right)$ (3)
 > ${∫}_{0}^{\mathrm{π}}\mathrm{sin}\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${2}$ (4)
 > $\mathrm{int}\left(\mathrm{sin},a..b\right)$
 ${\mathrm{cos}}{}\left({a}\right){-}{\mathrm{cos}}{}\left({b}\right)$ (5)
 > $∫\frac{x}{{x}^{3}-1}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 $\frac{{1}}{{3}}{}{\mathrm{ln}}{}\left({x}{-}{1}\right){-}\frac{{1}}{{6}}{}{\mathrm{ln}}{}\left({{x}}^{{2}}{+}{x}{+}{1}\right){+}\frac{{1}}{{3}}{}\sqrt{{3}}{}{\mathrm{arctan}}{}\left(\frac{{1}}{{3}}{}\left({2}{}{x}{+}{1}\right){}\sqrt{{3}}\right)$ (6)
 > $∫{ⅇ}^{-{x}^{2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 $\frac{{1}}{{2}}{}\sqrt{{\mathrm{π}}}{}{\mathrm{erf}}{}\left({x}\right)$ (7)
 > ${∫}_{0}^{\mathrm{∞}}{ⅇ}^{-{x}^{2}}\mathrm{ln}\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${-}\frac{{1}}{{4}}{}\sqrt{{\mathrm{π}}}{}{\mathrm{γ}}{-}\frac{{1}}{{2}}{}\sqrt{{\mathrm{π}}}{}{\mathrm{ln}}{}\left({2}\right)$ (8)
 > $∫{ⅇ}^{-{x}^{2}}\mathrm{ln}\left(x\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${∫}{{ⅇ}}^{{-}{{x}}^{{2}}}{}{\mathrm{ln}}{}\left({x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (9)
 > $\mathrm{series}\left(,x=0,4\right)$
 $\left({\mathrm{ln}}{}\left({x}\right){-}{1}\right){}{x}{+}\left({-}\frac{{1}}{{3}}{}{\mathrm{ln}}{}\left({x}\right){+}\frac{{1}}{{9}}\right){}{{x}}^{{3}}{+}{\mathrm{O}}\left({{x}}^{{5}}\right)$ (10)
 > $∫\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 $\frac{{1}}{{2}}{}{\mathrm{ln}}{}\left({x}\right){}{{x}}^{{2}}{-}\frac{{3}}{{4}}{}{{x}}^{{2}}{-}\frac{{1}}{{12}}{}{{x}}^{{4}}{}{\mathrm{ln}}{}\left({x}\right){+}\frac{{7}}{{144}}{}{{x}}^{{4}}{+}{\mathrm{O}}{}\left({{x}}^{{6}}\right)$ (11)
 > ${∫}_{0}^{\mathrm{∞}}{ⅇ}^{-{x}^{2}}{\mathrm{ln}\left(x\right)}^{2}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 $\frac{{1}}{{16}}{}{{\mathrm{π}}}^{{5}{/}{2}}{+}\frac{{1}}{{8}}{}{{\mathrm{γ}}}^{{2}}{}\sqrt{{\mathrm{π}}}{+}\frac{{1}}{{2}}{}{\mathrm{γ}}{}{\mathrm{ln}}{}\left({2}\right){}\sqrt{{\mathrm{π}}}{+}\frac{{1}}{{2}}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{}\sqrt{{\mathrm{π}}}$ (12)

The inert version of the int function simply returns unevaluated.

 > $f≔7{x}^{3}+3{x}^{2}+5x:$
 > ${∫}f\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x$
 ${∫}\left({7}{}{{x}}^{{3}}{+}{3}{}{{x}}^{{2}}{+}{5}{}{x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (13)

Inert objects can be evaluated with the value command.

 > $\mathrm{value}\left(\right)$
 $\frac{{7}}{{4}}{}{{x}}^{{4}}{+}{{x}}^{{3}}{+}\frac{{5}}{{2}}{}{{x}}^{{2}}$ (14)

A double integral

 > ${{∫}}_{0}^{1}{{∫}}_{0}^{1}x{y}^{2}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x{ⅆ}y$
 ${{∫}}_{{0}}^{{1}}{{∫}}_{{0}}^{{1}}{x}{}{{y}}^{{2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{y}$ (15)
 > $\mathrm{int}\left(x{y}^{2},x,y\right)$
 $\frac{{1}}{{6}}{}{{x}}^{{2}}{}{{y}}^{{3}}$ (16)
 > ${∫}_{-2}^{2}{∫}_{0}^{y}x{y}^{2}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆxⅆy$
 $\frac{{32}}{{5}}$ (17)
 > $\mathrm{int}\left(\frac{1}{{\left(x+a\right)}^{2}},x=0..2,'\mathrm{continuous}'\right)$
 $\frac{{2}}{{a}{}\left({2}{+}{a}\right)}$ (18)
 > $\mathrm{int}\left(\frac{1}{{x}^{3}},x=-1..2,'\mathrm{CauchyPrincipalValue}'\right)$
 $\frac{{3}}{{8}}$ (19)
 > ${∫}_{-1}^{3}F\left(x\right)\mathrm{Heaviside}\left(x-1\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${{∫}}_{{1}}^{{3}}{F}{}\left({x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (20)

An Elliptic integral

 > ${∫}_{2}^{3}\frac{1}{\sqrt{2{t}^{4}-3{t}^{2}-2}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆt$
 $\frac{{1}}{{5}}{}\sqrt{{5}}{}{\mathrm{EllipticF}}{}\left(\frac{{1}}{{3}}{}\sqrt{{7}}{,}\frac{{1}}{{5}}{}\sqrt{{5}}\right){-}\frac{{1}}{{5}}{}\sqrt{{5}}{}{\mathrm{EllipticF}}{}\left(\frac{{1}}{{2}}{}\sqrt{{2}}{,}\frac{{1}}{{5}}{}\sqrt{{5}}\right)$ (21)

Integrating algebraic functions (only for RootOf notation)

 > $f≔\frac{\left({x}^{2}-1+3{\left(1+{x}^{2}\right)}^{\frac{1}{3}}\right)x}{{\left(1+{x}^{2}\right)}^{\frac{2}{3}}{\left({x}^{2}+2\right)}^{2}}$
 ${f}{≔}\frac{\left({{x}}^{{2}}{-}{1}{+}{3}{}{\left({{x}}^{{2}}{+}{1}\right)}^{{1}{/}{3}}\right){}{x}}{{\left({{x}}^{{2}}{+}{1}\right)}^{{2}{/}{3}}{}{\left({{x}}^{{2}}{+}{2}\right)}^{{2}}}$ (22)
 > $f≔\mathrm{convert}\left(f,\mathrm{RootOf}\right):$
 > $g≔∫f\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${g}{≔}{-}\frac{{3}}{{2}}{}\frac{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{{x}}^{{2}}{-}{1}{,}{\mathrm{index}}{=}{1}\right)}{{{x}}^{{2}}{+}{2}}{+}\frac{{3}}{{2}}{}\frac{{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{{x}}^{{2}}{-}{1}{,}{\mathrm{index}}{=}{1}\right)}^{{2}}}{{{x}}^{{2}}{+}{2}}{-}\frac{{1}}{{2}}{}{\mathrm{ln}}{}\left(\frac{{3}{}{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{{x}}^{{2}}{-}{1}{,}{\mathrm{index}}{=}{1}\right)}^{{2}}{+}{{x}}^{{2}}{+}{3}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{{x}}^{{2}}{-}{1}{,}{\mathrm{index}}{=}{1}\right){+}{2}}{{{x}}^{{2}}{+}{2}}\right)$ (23)
 > $\mathrm{evala}\left(\frac{\partial }{\partial x}g-f\right)$
 ${0}$ (24)

Define a Maple operator using the unapply command.

 > $f≔\mathrm{unapply}\left(x+y,x\right)$
 ${f}{≔}{x}{→}{x}{+}{y}$ (25)
 > $\mathrm{int}\left(f,4..5\right)$
 $\frac{{9}}{{2}}{+}{y}$ (26)

Specify the 'AllSolutions' option.

 > ${∫}_{a}^{2}\frac{1}{x}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$
 ${{∫}}_{{a}}^{{2}}\frac{{1}}{{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (27)
 > $r≔\mathrm{int}\left(\frac{1}{x},x=a..2,'\mathrm{AllSolutions}'\right)$
 ${r}{≔}{{}\begin{array}{cc}{\mathrm{undefined}}& {a}{<}{0}\\ {\mathrm{∞}}& {a}{=}{0}\\ {-}{\mathrm{ln}}{}\left({a}\right){+}{\mathrm{ln}}{}\left({2}\right)& {0}{<}{a}\end{array}$ (28)
 > $r\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}0
 ${-}{\mathrm{ln}}{}\left({a}\right){+}{\mathrm{ln}}{}\left({2}\right)$ (29)
 > $r\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}a<0$
 ${\mathrm{undefined}}$ (30)
 > ${∫}_{0}^{2\mathrm{π}m}\left|\mathrm{sin}\left(x\right)\right|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}m::\mathrm{integer}$
 ${{∫}}_{{0}}^{{2}{}{\mathrm{π}}{}{m}}\left|{\mathrm{sin}}{}\left({x}\right)\right|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (31)
 > $\mathrm{int}\left(\left|\mathrm{sin}\left(x\right)\right|,x=0..2\mathrm{π}m,'\mathrm{AllSolutions}'\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}m::\mathrm{integer}$
 ${4}{}{m}$ (32)
 >