Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Compute Definite Integrals

For definite integration, the int command restricts the integration variable x to the given range of integration.

int(sin(ln(x)), x = 0..5)

If the int command determines that an integral does not converge, it returns the special value undefined:

int(exp(x*I), x = 1..infinity)

When the int command cannot compute an integral and also cannot prove that the integral does not converge, it returns an unresolved integral:

int(sin(cos(x)), x = 0..10)

For definite integrals, the int command restricts the integration to the specified interval. If you use the assume function to set properties on the integration variable, int temporarily overwrites these properties and integrates over the specified interval. To display warnings, set the value of intlib::printWarnings to TRUE:

intlib::printWarnings(TRUE):
assume(x > 0):
int(x, x = 1 .. 2);
int(x, x = -3 .. 1)
Warning: The assumption that 'x' has property '[1, 2]' instead of given property '(0, infinity)' is used for integration. [int]

Warning: The assumption that 'x' has property '[-3, 1]' instead of given property '(0, infinity)' is used for integration. [int]

After computing an integral, MuPAD® restores the assumptions set for integration variable. If you do not want the assumptions to affect further computations, use the unassume function:

unassume(x)

MuPAD also makes implicit assumptions on the specified interval. Suppose, you use the integration range as [a, b]. The system assumes that both a and b represent real numbers, and that a <= b unless you clearly specify otherwise. If you set the value of intlib::printWarnings to TRUE, MuPAD displays the warning about using implicit assumptions:

int(heaviside(x - a), x = a..b)
Warning: Cannot decide if 'a <= b' is true, will temporarily assume it is true. [int]

To avoid this implicit assumption, specify that a > b or a < b

int(heaviside(x - a), x = a..b) assuming a > b

int(heaviside(x - a), x = a..b) assuming a < b

For further computations, disable the warnings:

intlib::printWarnings(FALSE):
Was this topic helpful?