Int - Maple Help

int or Int

definite and indefinite integration

Calling Sequence

 int(expression, x) $\int \mathrm{expression}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$ Int(expression, x) ${\int }\mathrm{expression}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}x$ int(expression, x=a..b) ${\int }_{a}^{b}\mathrm{expression}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$ Int(expression, x=a..b) ${{\int }}_{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.

 • useunits=truefalse or useunits=list of unit specifications

Specifies whether to preprocess the arguments to make sure units are handled correctly. The default behavior is automatically detect units and handle them if detected. Specifying useunits=false can disable that handling if units should be treated as symbols. Specifying useunits=true can force handling in cases where the automatic detection fails, such as when the integrand is an operator that can return units.  Finally, this option can be used to specify the units of some or all of the variables involved in the integration useunits=[x::Unit(unit_1), y::Unit(unit_2)] for integrals of expressions and useunits=[Unit(unit_1), Unit(unit_2)] for integrals of operators.  The units specified this way will override the units detected automatically, but an error will be generated if the units are not consistent.

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 $\int 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 );
 $⌊{x}⌋{}{x}$ (1)
 > int( floor(t), t = 0..x ) assuming x > 0;
 $⌊{x}⌋{}{x}{+}\left(\left\{\begin{array}{cc}{-}\frac{⌊{x}⌋{}\left(⌊{x}⌋{+}{1}\right)}{{2}}& {1}{\le }⌊{x}⌋\\ {0}& {\mathrm{otherwise}}\end{array}\right\\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.
 • You can opt to enter a Cauchy principal value integral in typeset 2-D math, $\mathrm{PV}{\int }_{a}^{b}f\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}ⅆx$, by using command completion. For details, see Entering Commands in 2-D Math.

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

Basic Examples

 > $\mathrm{int}\left(\mathrm{sin}\left(x\right),x\right)$
 ${-}{\mathrm{cos}}{}\left({x}\right)$ (3)
 > $\mathrm{int}\left(\mathrm{sin}\left(x\right),x=0..\mathrm{\pi }\right)$
 ${2}$ (4)
 > $\mathrm{int}\left(\mathrm{sin},a..b\right)$
 ${\mathrm{cos}}{}\left({a}\right){-}{\mathrm{cos}}{}\left({b}\right)$ (5)
 > $\mathrm{int}\left(\frac{x}{{x}^{3}-1},x\right)$
 ${-}\frac{{\mathrm{ln}}{}\left({{x}}^{{2}}{+}{x}{+}{1}\right)}{{6}}{+}\frac{\sqrt{{3}}{}{\mathrm{arctan}}{}\left(\frac{\left({2}{}{x}{+}{1}\right){}\sqrt{{3}}}{{3}}\right)}{{3}}{+}\frac{{\mathrm{ln}}{}\left({x}{-}{1}\right)}{{3}}$ (6)
 > $\mathrm{int}\left(\mathrm{exp}\left(-{x}^{2}\right),x\right)$
 $\frac{\sqrt{{\mathrm{\pi }}}{}{\mathrm{erf}}{}\left({x}\right)}{{2}}$ (7)
 > $\mathrm{int}\left(\mathrm{exp}\left(-{x}^{2}\right)\mathrm{ln}\left(x\right),x=0..\mathrm{\infty }\right)$
 ${-}\frac{\sqrt{{\mathrm{\pi }}}{}{\mathrm{\gamma }}}{{4}}{-}\frac{\sqrt{{\mathrm{\pi }}}{}{\mathrm{ln}}{}\left({2}\right)}{{2}}$ (8)
 > $\mathrm{int}\left(\mathrm{exp}\left(-{x}^{2}\right)\mathrm{ln}\left(x\right),x\right)$
 ${\int }{{ⅇ}}^{{-}{{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{{\mathrm{ln}}{}\left({x}\right)}{{3}}{+}\frac{{1}}{{9}}\right){}{{x}}^{{3}}{+}{O}{}\left({{x}}^{{5}}\right)$ (10)
 > $\mathrm{int}\left(,x\right)$
 $\frac{{\mathrm{ln}}{}\left({x}\right){}{{x}}^{{2}}}{{2}}{-}\frac{{3}{}{{x}}^{{2}}}{{4}}{-}\frac{{{x}}^{{4}}{}{\mathrm{ln}}{}\left({x}\right)}{{12}}{+}\frac{{7}{}{{x}}^{{4}}}{{144}}{+}{\mathrm{O}}{}\left({{x}}^{{6}}\right)$ (11)
 > $\mathrm{int}\left(\mathrm{exp}\left(-{x}^{2}\right){\mathrm{ln}\left(x\right)}^{2},x=0..\mathrm{\infty }\right)$
 $\frac{{{\mathrm{\pi }}}^{{5}}{{2}}}}{{16}}{+}\frac{{{\mathrm{\gamma }}}^{{2}}{}\sqrt{{\mathrm{\pi }}}}{{8}}{+}\frac{{\mathrm{\gamma }}{}\sqrt{{\mathrm{\pi }}}{}{\mathrm{ln}}{}\left({2}\right)}{{2}}{+}\frac{\sqrt{{\mathrm{\pi }}}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}}{{2}}$ (12)

The inert version of the int function simply returns unevaluated.

 > $f≔7{x}^{3}+3{x}^{2}+5x:$
 > $\mathrm{Int}\left(f,x\right)$
 ${\int }\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

 > $\mathrm{Int}\left(x{y}^{2},\left[x=0..1,y=0..1\right]\right)$
 ${\mathrm{Int}}{}\left({x}{}{{y}}^{{2}}{,}\left[{x}{=}{0}{..}{1}{,}{y}{=}{0}{..}{1}\right]\right)$ (15)
 > $\mathrm{int}\left(x{y}^{2},x,y\right)$
 $\frac{{{x}}^{{2}}{}{{y}}^{{3}}}{{6}}$ (16)
 > $\mathrm{int}\left(x{y}^{2},\left[x=0..y,y=-2..2\right]\right)$
 $\frac{{32}}{{5}}$ (17)

Integrals with Units

 > $\mathrm{int}\left(\left({t}^{2}-1\mathrm{Unit}\left({s}^{2}\right)\right)\mathrm{Unit}\left(\frac{m}{{s}^{3}}\right),t=0..2\mathrm{Unit}\left(s\right)\right)$
 $\frac{{2}}{{3}}{}⟦{m}⟧$ (18)
 > $\mathrm{int}\left(\left({t}^{2}-1\mathrm{Unit}\left({h}^{2}\right)\right)\mathrm{Unit}\left(\frac{m}{{h}^{3}}\right),t=0..2\mathrm{Unit}\left(s\right),\mathrm{useunits}=\left[t::\mathrm{Unit}\left(h\right)\right]\right)$
 ${-}\frac{{9719999}}{{17496000000}}{}⟦{m}⟧$ (19)
 > $\mathrm{int}\left(\left({t}^{2}-1\mathrm{Unit}\left({s}^{2}\right)\right)\mathrm{Unit}\left(\frac{m}{{s}^{3}}\right),t=0..2\mathrm{Unit}\left(s\right),\mathrm{useunits}=\left[t::\mathrm{Unit}\left(\mathrm{meter}\right)\right]\right)$
 > $\mathrm{int}\left(t↦\left({t}^{2}-\mathrm{Unit}\left({h}^{2}\right)\right)\cdot \mathrm{Unit}\left(\frac{m}{{h}^{3}}\right),1.\mathrm{Unit}\left(s\right)..2.\mathrm{Unit}\left(s\right),\mathrm{numeric},\mathrm{useunits}=\left[\mathrm{Unit}\left(h\right)\right]\right)$
 ${-}{0.0002777777278}{}⟦{m}⟧$ (20)
 > $\mathrm{int}\left(\left({t}^{2}-1\mathrm{Unit}\left({h}^{2}\right)\right)\mathrm{Unit}\left(\frac{m}{{h}^{3}}\right),t=1\mathrm{Unit}\left(\mathrm{ft}\right)..2\mathrm{Unit}\left(m\right)\right)$

Turning off units processing can force a symbolic answer even when the units don't make sense.

 > $\mathrm{int}\left(\left({t}^{2}-1\mathrm{Unit}\left({h}^{2}\right)\right)\mathrm{Unit}\left(\frac{m}{{h}^{3}}\right),t=1\mathrm{Unit}\left(\mathrm{ft}\right)..2\mathrm{Unit}\left(m\right),\mathrm{useunits}=\mathrm{false}\right)$
 $\frac{{15569693659}}{{273375000000000000000}}{}⟦\frac{{{m}}^{{4}}}{{{s}}^{{3}}}⟧{-}\frac{{2119}}{{4500000}}{}⟦\frac{{{m}}^{{2}}}{{s}}⟧$ (21)

Other Options

 > $\mathrm{int}\left(\frac{1}{{\left(x+a\right)}^{2}},x=0..2,'\mathrm{continuous}'\right)$
 $\frac{{2}}{{a}{}\left({2}{+}{a}\right)}$ (22)
 > $\mathrm{int}\left(\frac{1}{{x}^{3}},x=-1..2,'\mathrm{CauchyPrincipalValue}'\right)$
 $\frac{{3}}{{8}}$ (23)
 > $\mathrm{int}\left(F\left(x\right)\mathrm{Heaviside}\left(x-1\right),x=-1..3\right)$
 ${{\int }}_{{1}}^{{3}}{F}{}\left({x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (24)

An Elliptic integral

 > $\mathrm{int}\left(\frac{1}{\mathrm{sqrt}\left(2{t}^{4}-3{t}^{2}-2\right)},t=2..3\right)$
 $\frac{\sqrt{{5}}{}{\mathrm{EllipticF}}{}\left(\frac{\sqrt{{7}}}{{3}}{,}\frac{\sqrt{{5}}}{{5}}\right)}{{5}}{-}\frac{\sqrt{{5}}{}{\mathrm{EllipticF}}{}\left(\frac{\sqrt{{2}}}{{2}}{,}\frac{\sqrt{{5}}}{{5}}\right)}{{5}}$ (25)

Integrating algebraic functions (only for RootOf notation)

 > $f≔\frac{\frac{{x}^{2}-1+3{\left(1+{x}^{2}\right)}^{\frac{1}{3}}}{{\left(1+{x}^{2}\right)}^{\frac{2}{3}}}x}{{\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}}}$ (26)
 > $f≔\mathrm{convert}\left(f,\mathrm{RootOf}\right):$
 > $g≔\mathrm{int}\left(f,x\right)$
 ${g}{≔}{-}\frac{{3}{}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{{x}}^{{2}}{-}{1}{,}{\mathrm{index}}{=}{1}\right)}{{2}{}\left({{x}}^{{2}}{+}{2}\right)}{+}\frac{{3}{}{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{3}}{-}{{x}}^{{2}}{-}{1}{,}{\mathrm{index}}{=}{1}\right)}^{{2}}}{{2}{}\left({{x}}^{{2}}{+}{2}\right)}{-}\frac{{\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)}{{2}}$ (27)
 > $\mathrm{evala}\left(\mathrm{diff}\left(g,x\right)-f\right)$
 ${0}$ (28)

Define a Maple operator using the unapply command.

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

Specify the 'AllSolutions' option.

 > $\mathrm{int}\left(\frac{1}{x},x=a..2\right)$
 ${{\int }}_{{a}}^{{2}}\frac{{1}}{{x}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (31)
 > $r≔\mathrm{int}\left(\frac{1}{x},x=a..2,'\mathrm{AllSolutions}'\right)$
 ${r}{≔}\left\{\begin{array}{cc}{\mathrm{undefined}}& {a}{<}{0}\\ {\mathrm{\infty }}& {a}{=}{0}\\ {-}{\mathrm{ln}}{}\left({a}\right){+}{\mathrm{ln}}{}\left({2}\right)& {0}{<}{a}\end{array}\right\$ (32)
 > $r\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{assuming}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}0
 ${-}{\mathrm{ln}}{}\left({a}\right){+}{\mathrm{ln}}{}\left({2}\right)$ (33)
 > $r\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{assuming}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}a<0$
 ${\mathrm{undefined}}$ (34)
 > $\mathrm{int}\left(\mathrm{abs}\left(\mathrm{sin}\left(x\right)\right),x=0..2\mathrm{\pi }m\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{assuming}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}m::'\mathrm{integer}'$
 ${{\int }}_{{0}}^{{2}{}{\mathrm{\pi }}{}{m}}\left|{\mathrm{sin}}{}\left({x}\right)\right|\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}$ (35)
 > $\mathrm{int}\left(\mathrm{abs}\left(\mathrm{sin}\left(x\right)\right),x=0..2\mathrm{\pi }m,'\mathrm{AllSolutions}'\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{assuming}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}m::'\mathrm{integer}'$
 ${4}{}{m}$ (36)
 > 

Compatibility

 • The int command was updated in Maple 2016; see Advanced Math Updates for Maple 2016.
 • The int or Int command was updated in Maple 2021.
 • The method option was updated in Maple 2021.