Integration Utilities

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


Use only in the MuPAD Notebook Interface. This functionality does not run in MATLAB.

This library contains functions for manipulating and solving integrals. Currently there are only described interfaces for the well-known integration methods change of variables and integration by parts. In addition, a function for integrating over arbitrary subsets of the real numbers exists. In future versions more interfaces will be added.

First steps

Integration is the process inverse to differentiation. Any function F in the variable x with is an integral of f:

f := cos(x)*exp(sin(x))

F := int(f,x)


No constant is added to the integral or, in other words, a special integration constant is chosen automatically. With MuPAD® it is possible to determine integrals of elementary functions, of many special functions and, with some restrictions, of algebraic functions:






It is also possible to compute definite and multiple integrals:

int(exp(-x^2)*ln(x)^2, x=0..infinity)

int(sin(x)*dirac(x+2)-heaviside(x+3)/x, x=1..4)

int(int(int(1, z=0..c*(1-x/a-y/b)), y=0..b*(1-x/a)), x=0..a)

Integration by parts and by change of variables

Typical applications for the rule of integration by parts

are integrals of the form where p(x) is polynomial. Thereby one has to use the rule in the way that the polynomial is differentiated. Thus one has to choose .


In particular with the guess it is possible to compute a lot of the well-known standard integrals, like e.g. .


In order to determine the remaining integral one may use the method change of variable

with g(x) = 1 - x2.

F:=intlib::changevar(hold(int)(x/sqrt(1-x^2),x), t=1-x^2)

Via backsubstition into the solved integral F one gets the requested result.

hold(int)(arcsin(x),x) = x*arcsin(x)-subs(eval(F),t=1-x^2)

Applying change of variable with the integrator is problematic, since it may occur that the integrator will never terminate. For that reason this rule is used within the integrator only on certain secure places. On the other hand, this may also lead to the fact that some integrals cannot be solved directly.

f:= sqrt(x)*sqrt(1+sqrt(x)): 

eval(intlib::changevar(hold(int)(f,x),t=sqrt(x))) | t=sqrt(x)