discont
-- discontinuities of a
functiondiscont(
f, x)
computes the set of all
discontinuities of the function f(x).
discont
(f, x = a..b)
computes the set of
all discontinuities of f(x) lying in the interval [a,
b].
discont(f, x)
discont(f, x, F)
discont(f, x = a..b)
discont(f, x = a..b, F)
f |
- | an arithmetical expression
representing a function in x |
x |
- | an identifier |
F |
- | either Dom::Real or Dom::Complex |
a, b |
- | interval boundaries: arithmetical expressions |
a set--see the help page for solve
for an overview of all types of
sets--or a symbolic discont
call.
discont
reacts to properties of free parameters both in
f
as well as in a
and b
.
discont
sometimes reacts to properties of
x
.
f
discont(
f, x, F)
returns a set of numbers
containing all discontinuities of f when f is
regarded as a function of x defined on F. Please
note that a real number that is a discontinuity of a complex function
need not be a discontinuity of the restriction of that function to the
set of real numbers: consider, for example, a function that has its
branch cut on the real axis, as in example 2 below.F
is omitted, then
F=Dom::Complex
is used as a default, i.e., f
is regarded as a function defined on the complex numbers, unless the
global assumption assume(Global, Type::Real)
has been
made, in which case F=Dom::Real
is the default.a..b
is given, the set of discontinuities
is intersected with the closed interval [a,b].discont
may contain numbers that
are not discontinuities of f. See example 6.discont
is unable to compute the discontinuities,
then a symbolic discont
call is returned; see
example 7.discont
can be extended to user-defined mathematical
functions via overloading. To this end,
embed the mathematical function in a function environment and assign the set of real
and complex discontinuities to its "realDiscont"
and
"complexDiscont"
slot, respectively; see solve
for an overview of the various
types of sets. See also example 7
below.The gamma
function has poles at all integers less or equal to zero. Hence x
-> gamma(x/2)
has poles at all even integers less or equal to
zero:
>> discont(gamma(x/2), x)
{ 2*X3 | X3 in Z_ } intersect ]-infinity, 0]
The logarithm has a branch cut on the negative real axis; hence it is not continuous there. However, its restriction to the real numbers is continuous at every point except zero:
>> discont(ln(x), x), discont(ln(x), x, Dom::Real)
]-infinity, 0], {0}
If a range is given, only the discontinuities in that range are returned.
>> discont(1/x/(x - 1), x = 0..1/2)
{0}
A range may have arbitrary arithmetical expressions as
boundaries. discont
does not implicitly assume that the
right boundary is greater or equal to the left boundary:
>> discont(1/x, x = a..b)
piecewise({0} if a <= 0 and 0 <= b, {} if (not a <= 0 or not 0 <= b))
As can be seen from the previous example,
discont
reacts to properties of free parameters (because
piecewise
does). The
result also depends on the properties of x
: it may omit
values that x
cannot take on anyway because of its
properties.
>> assume(x>0): discont(1/x, x)
{}
>> delete x:
Sometimes, discont
returns a proper
superset of the set of discontinuities:
>> discont(piecewise([x<>0, x*sin(1/x)], [x=0, 0]), x)
{0}
A symbolic discont
call is returned if the
system does not know how to determine the discontinuities of a given
function:
>> delete f: discont(f(x), x)
discont(f(x), x)
You can provide the necessary information by adding a
slot to f
. discont
takes care to handle
f
correctly also if it appears in a more complicated
expression:
>> f := funcenv(x->procname(x)): f::complexDiscont:={1}: discont(f(sin(x)), x=-4..34)
{ PI 5 PI 9 PI 13 PI 17 PI 21 PI } { --, ----, ----, -----, -----, ----- } { 2 2 2 2 2 2 }
We define a function that implements the logarithm to base 2. For simplicity, we let it always return the unevaluated function call. The logarithm has a branch cut on the negative real axis; its restriction to the reals is continuous everywhere except at zero:
>> binlog := funcenv(x -> procname(x)): binlog::realDiscont := {0}: binlog::complexDiscont := Dom::Interval(-infinity, [0]): discont(binlog(x), x=-2..2); discont(binlog(x), x=-2..2, Dom::Real)
[-2, 0] {0}