Documentation Center

  • Trial Software
  • Product Updates


Intervals of real numbers

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


Dom::Interval(l, r)
Dom::Interval([l], r)
Dom::Interval(l, [r])
Dom::Interval([l], [r])
Dom::Interval([l, r])


Dom::Interval represents the set of all intervals of real numbers.

Dom::Interval(l, r) creates the interval of all real numbers between l and r. If a border is given as a list with l or r as the sole element, this border will be regarded as a closed border, otherwise the interval does not contain l and r.

A border can be any arithmetical expression that could represent a real number, e.g., sqrt(2*x) and a + I. Properties are ignored.

The domain Dom::Interval provides fundamental operations to combine intervals with intervals and other mathematical objects.

The return value can be either an interval of type Dom::Interval or the empty set of type DOM_SET, if the interval is empty.

Most mathematical operations are overloaded to work with intervals (such as sin). If f is a function of n real variables, its extension to intervals is defined to be . The return value of such an operation is in most cases an interval, a union of intervals, a Dom::ImageSet or a set. For example, the sine of an interval [a, b] is the interval {sin(x), x in [a, b]} that contains all sine values of the given interval. In general, you should expect the return value to be an interval larger than strictly necessary. Also note that, when using the same interval twice in one formula, the uses are regarded as independent, so interval1/interval1 does not return the interval [1, 1] as you might expect.

The functions overloaded in this way are:

Furthermore, an interval is a special type of set. This is reflected by Dom::Interval having the category Cat::Set. Among the methods inherited from Cat::Set, the following are especially important: intersect, minus and union.

An interval can be open or closed. If one border is given as a list with one element [x], then this element x is taken as border and the interval will be created as closed at this side. If the interval should be closed at both sides, one list with the both borders as arguments can be given.




Example 1

First create a closed interval between 0 and 1.

A:= Dom::Interval([0], [1])

Now another open interval between -1 and 1.

B:= Dom::Interval(-1, 1)

Intervals can be handled like other objects.

A + B, A - B, A*B, A/B

2*A, 1 - A, (A - 1)^2

Example 2

Standard functions are overloaded to work with intervals.

sin(B), float(sin(B))

Example 3

The next examples shows some technical methods to access and manipulate intervals.

Get the borders and open/closed information about intervals.

A:= Dom::Interval([0], [1]):
Dom::Interval::left(A), Dom::Interval::leftB(A)

Dom::Interval::isleftopen(A), Dom::Interval::subsleft(A, -1)



The left border. If given as a list of one element (the left border), the interval will be created as left closed.


The right border. If given as a list of one element (the right border), the interval will be created as right closed.



the unit element; it equals the one-point interval [1, 1].


the zero element; it equals the one-point interval [0, 0].


expand all

Mathematical Methods

_divide — Divide intervals

_divide(interval1, interval2)

_invert — Invert intervals


_negate — Negate intervals


contains — Containing an element

contains(interval, element)

max — Maximum of an interval

max(interval, …)

The maximum of intervals is the set of all possible results of the function max when applied to a sequence of arguments consisting of exactly one element of each interval.

min — Minimum of an interval

min(interval, …)

The minimum of intervals is defined analogously to their maximum.

new — Create an interval

new(left, right)

new([left], right)

new(left, [right])

new([left], [right])

Access Methods

isleftopen — Left open interval


iszero — Null interval


subs — Substitution in intervals

subs(Interval, equation, …)

subsleft — Substitute left border

subsleft(interval, left)

subsright — Substitute right border

subsright(interval, right)

subsvals — Substitute both borders

subsvals(interval, left, right)

Conversion Methods

convert — Converting objects to intervals


If the conversion fails, FAIL is returned.

Technical Methods

emptycheck — Check intervals


equal — Comparison of intervals

equal(interval, interval)

map — Apply functions to intervals

map(interval, function, <argument, …>)

mapBorders — Apply functions to the borders of an interval

mapBorders(interval, function, <argument, …>)

zip — Combine intervals

zip(interval, interval, function)


The operand of an object of Dom::Interval is an object of the domain property::IVnat, which realizes the basic interval arithmetic. This domain is not documented.

See Also

MuPAD Functions

Was this topic helpful?