Truncated Puiseux series expansions
MuPAD® notebooks are not recommended. 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.
Series::Puiseux(f
,x
, <order
>, <dir
>) Series::Puiseux(f
,x = x_{0}
, <order
>, <dir
>)
Series::Puiseux
is a domain for truncated
series expansions. Elements of this domain represent initial segments
of Taylor, Laurent, or Puiseux series expansions, as well as slightly
more general types of series expansions.
The system function series
is
the main application of this domain. It tries to compute a Taylor,
Laurent, or Puiseux series or a more general series expansion of a
given arithmetical expression, and the result is returned as an element
of Series::Puiseux
or, possibly, of the more general
domain Series::gseries
.
There is usually no need for you to explicitly create elements
of this domain. The methods described on this help page apply if you
want to process a result returned by series
further.
Note:
If you create elements explicitly as described above, then any
special mathematical function, such as 
Use the type specifier Type::Series
to
determine for an element of this domain, which kind of series expansion
it is.
The function is sensitive to the global variable ORDER
,
which determines the default number of terms of the expansion.
You can create objects of Series::Puiseux
in
various ways. The standard method is to use the constructor. The second
argument specifies the series variable and the expansion point, with
default 0 if omitted:
Series::Puiseux(x/(1  x), x); Series::Puiseux(x/(1  x), x = 2); Series::Puiseux(x/(1  x), x = complexInfinity);
The third argument, if present, specifies the desired number
of terms. If it is omitted, the value of the environment variable ORDER
is
used:
Series::Puiseux(x/(1  x), x = 2, 4); ORDER := 2: Series::Puiseux(x/(1  x), x); delete ORDER:
The methods const
, one
,
and zero
provide shortcuts for creating series
expansions with only a constant term or no nonzero term at all. Specifying
the order of the error term is mandatory:
Series::Puiseux::const(PI, x, 4); Series::Puiseux::one(x = 2, 3); Series::Puiseux::zero(x = 0, 3/2); Series::Puiseux::zero(x = complexInfinity, 5);
Note that, e.g., O(x^(3/2))
is not an element
of Series::Puiseux
, but can be converted by the
constructor:
f := O(x^(3/2)); g := Series::Puiseux(f, x); domtype(f), domtype(g)
Both the constructor Series::Puiseux
and
the method const
regard special mathematical functions,
such as exp
or sin
, as coefficients:
Series::Puiseux(sin(x)/(1  x), x, 4); Series::Puiseux::const(cos(x), x = 1, 3);
Use the system function series
if you want to have special functions
expanded as well:
series(sin(x)/(1  x), x, 4);
The constructor returns FAIL
, if it cannot
convert the input into an element of Series::Puiseux
.
Then series
may
be able to produce a more general expansion:
delete a: Series::Puiseux(x^a/(1  x), x); f := series(x^a/(1  x), x); domtype(f);
The method create
is a purely syntactical
constructor, where the operands are specified explicitly. The sixth
and seventh arguments are optional and default to 0 and Undirected
,
respectively:
Series::Puiseux::create(3, 1, 5, [1/2, 5], x) = Series::Puiseux::create(3, 1, 5, [1/2, 5], x, 0, Undirected)
Series::Puiseux::create(1, 2, 1, [ln(x), 0, 3], x, complexInfinity);
We demonstrate the internal structure of objects of type Series::Puiseux
:
f := series(exp(x), x = 1); g := series(sin(sqrt(1/x)), x = infinity); h := series(sin(sqrt(x))/x, x = 0)
op(f); op(g); op(h)
The series f
and g
are
of type 0, while h
is
of type 1
:
op(f, 1), op(g, 1), op(h, 1)
The branching order of f
is 1,
and the branching order of both g
and h
is 2:
op(f, 2), op(g, 2), op(h, 2)
The third and the fourth operand determine the order of the leading term and the error term, respectively:
ldegree(f) = op(f, 3)/op(f, 2), ldegree(g) = op(g, 3)/op(g, 2), ldegree(h) = op(h, 3)/op(h, 2); Series::Puiseux::order(f) = op(f, 4)/op(f, 2), Series::Puiseux::order(g) = op(g, 4)/op(g, 2), Series::Puiseux::order(h) = op(h, 4)/op(h, 2);
For series expansions of type 0, the fifth operand contains the coefficients of the expansion:
op(f, 5) = [coeff(f)]; op(g, 5) = [coeff(g)];
However, h
is an expansion of type 1,
and then the fifth operand stores the summands:
op(h, 5); [coeff(h)];
The sixth operand contains the series variable and the expansion point:
op(f, 6), Series::Puiseux::indet(f), Series::Puiseux::point(f); op(g, 6), Series::Puiseux::indet(g), Series::Puiseux::point(g); op(h, 6), Series::Puiseux::indet(h), Series::Puiseux::point(h);
The expansions f
and h
are
undirected, while g
is a directed expansion from
the left along the real line to the positive infinity:
op(f, 7) = Series::Puiseux::direction(f), op(g, 7) = Series::Puiseux::direction(g), op(h, 7) = Series::Puiseux::direction(h);
Note:
Since the internal structure may be subject to changes, accessing
the operands of and element of 
Around branch points, the series expansions of type 1 can approximate a function in a wider range than those of type 0:
f := x > arcsin(x + 1): g := series(f(x), x, 2); h := series(f(x), x, 2, Right);
The expansion g
, of type 1,
approximates f
well in an open disc centered at
the origin. However, the expansion h
, of type 0,
was requested for positive real values of x
only,
and in fact it does not approximate f
on the negative
real axis and in the upper half plane:
op(g); op(h);
DIGITS := 4: [f(0.01), f(0.01*I), f(0.01), f(0.01*I)]; map([g(0.01), g(0.01*I), g(0.01), g(0.01*I)], float); map([h(0.01), h(0.01*I), h(0.01), h(0.01*I)], float); delete DIGITS:
The method convert01
converts a series expansion
of type 0 into one of type 1:
h1 := Series::Puiseux::convert01(h); op(h1);
The reverse conversion, using the method convert10
,
is in not always possible:
op(Series::Puiseux::convert10(h1)); op(Series::Puiseux::convert10(g));
You can enforce a conversion by using properties:
assume(x > 0): op(Series::Puiseux::convert10(g)); unassume(x):
Despite the name, elements of Series::Puiseux
may
contain coefficient functions depending on the series variable:
f := series(psi(x), x = infinity, 4); domtype(f), coeff(f, 0)
With respect to differentiation, integration, and composition, such expansions behave like functions of the series variable and not like formal series:
diff(f, x) = series(diff(psi(x), x), x = infinity, 4)
int(f, x) = series(int(psi(x), x), x = infinity, 4)
f @ series(2*x, x = infinity) = series(psi(2*x), x = infinity, 4)
The basic arithmetical operations are implemented for elements
of Series::Puiseux
:
f := series(exp(x), x, 4); g := series(sqrt(x)/(1  x), x, 4); h := series(cot(x), x, 4);
f + g + h; _plus(f, g, h)
f  h = _subtract(f, h); g = _negate(g);
f*g*h; _mult(f, g, h)
f/g = _divide(f, g); 1/h = _invert(h);
Operands that are not of type Series::Puiseux
are
implicitly converted into series expansions with the same expansion
point via the constructor before the arithmetical operation is performed:
f  1  x; h * (sin(x) + x);
An error occurs when the expansion points differ or the directions of expansion are incompatible:
f := series(arccot(x), x = 0, Left); g := series(sqrt(sin(x)), x = 0, Right); f + g
Error: Inconsistent direction. [Series::Puiseux::plus]
h := series(1/x, x = 2, 4); f * h
Error: Both series must use the same variables and expansion points. [Series::Puiseux::mult]
If the directions are compatible, then the direction of the result specifies the minimal range where all operands are defined:
s := series(tanh(x), x, Real);
f + s; Series::Puiseux::direction(%)
The method scalmult
implements multiplication
by a constant or a single term:
f := series(1 + 2*x^3, x); Series::Puiseux::scalmult(f, 5) = 5*f; Series::Puiseux::scalmult(f, 5, 3) = 5*x^3*f;
g := series(1 + 2*x^3, x = 2, 3); Series::Puiseux::scalmult(g, 1, 3) = (x  2)^3*g
h := series(1 + 2*x^3, x = complexInfinity); Series::Puiseux::scalmult(h, 1, 1/2) = x^(1/2)*h
Exponentiation is implemented for integral and rational exponents:
f := series(exp(x), x, 3); f^2 = _power(f, 2); f^(1/3) = _power(f, 1/3)
Exponents are allowed to be nonrational, if the series expansion starts with a constant summand independent of the series variable:
f^I = series(exp(I*x), x, 3);
g := series(sin(x), x); g^I
Error: The exponent must be a rational number. [Series::Puiseux::_power]
If the exponent contains the series variable, then an error occurs:
f^x
Error: The exponent must not contain the series variable. [Series::Puiseux::_power]
For undirected expansions and rational exponents that are not integral, the result has type 1 in general:
g^(1/2); op(%, 1);
The result simplifies when you specify one of the directions Left
or Right
:
g := series(sin(x), x, Left): g^(1/2); op(%, 1);
g := series(sin(x), x, Right): g^(1/2);
Functional composition of elements of Series::Puiseux
is
implemented by the method _fconcat
:
f := series(ln(x), x = 1, 4); g := series(cos(y), y = 0); f@g = _fconcat(f, g); series(ln(cos(y)), y = 0, 4);
If the left argument is not of type Series::Puiseux
,
it is implicitly expanded around the limit point of the right argument
before the composition:
f := series(sin(x), x = 0); sqrt(y) @ f = Series::Puiseux(sqrt(y), y) @ f;
If the right argument is not of type Series::Puiseux
,
it is implicitly expanded around the origin via the constructor before
the composition:
f @ sqrt(y) = f @ Series::Puiseux(sqrt(y), y)
This may not work if the argument to be converted contains special
mathematical functions, but you can explicitly expand it into a series
via series
in
this case:
f @ tan(y)
f @ series(tan(y), y = 0)
Mathematically, the composition of series expansions is not defined if the limit point of the right argument is not the expansion point of the left argument:
g := series(y^2  1, y = 0); f @ g
f @ (y^2  1)
f @ series(y^2  1, y = 1, 4)
The method revert
computes the inverse of
a truncated series expansion with respect to composition. The expansion
point of the inverse is the limit point of the input and vice versa:
f := series(ln(x), x = 1, 4); revert(f) = series(exp(x), x = 0, 5)
f := series(cot(x), x = 0); revert(f) = series(arccot(x), x = complexInfinity);
f @ revert(f), revert(f) @ f
If the series variable occurs in the coefficients or the type flag is 1, an error occurs:
f := series(ln(sin(x)), x); g := series(arcsin(x + 1), x, 2);
revert(f)
Error: Cannot compute the functional inverse. [Series::Puiseux::revert]
revert(g)
Error: Cannot compute the functional inverse. [Series::Puiseux::revert]
The methods diff
and int
implement
termbyterm differentiation and integration:
f := series(ln(x), x = 1, 4); g := diff(f, x); series(1/x, x = 1, 4); int(g, x);
If you specify a range of integration, then the result is an arithmetical expression plus a symbolic definite integral of the Oterm:
int(f, x = 1..2);
Most special mathematical functions are overloaded for Series::Puiseux
:
f := series(x/(1  x), x, 4); exp(f) = series(exp(x/(1  x)), x, 4); ln(f) = series(ln(x/(1  x)), x, 4);
If the system is unable to compute the composition, it returns a symbolic function call with evaluated arguments:
delete g: g(f)
exp(series(x + 1/x, x = infinity, 5))
In this case, you can try series
to compute the composition:
series(exp(x + 1/x), x = infinity, 5)
The system functions Re
, Im
,
and conjugate
work for all real series expansions:
f := series(exp(I*x), x, Real); Re(f) = series(cos(x), x, Real); Im(f) = series(sin(x), x, Real) + O(x^6); conjugate(f) = series(exp(I*x), x, Real);
Except in trivial cases, a symbolic function call is returned for an undirected expansion:
Re(series(PI, x)); Re(series(exp(I*x), x));
The method contfrac
converts a series expansion
into a continued fraction:
f := series(exp(x), x, 10); contfrac(f);
g := series(tan(x), x = PI, 10); contfrac(g);
If the coefficients of a series expansion depend on the series variable, then so do the coefficients of the corresponding continued fraction:
h := series(ln(x + 1/x), x = infinity); contfrac(h)
For series expansions around the origin, the method laplace
,
overloading laplace
, computes the Laplace transform
term by term, if the second argument is the series variable. The result
is a series expansion around infinity:
delete s: f := series(exp(x), x); g := laplace(f, x, s); series(laplace(exp(x), x, s), s = infinity);
Similarly, the method ilaplace
computes the
inverse Laplace transform term by term for series expansions around
infinity, if the second argument is the series variable. The result
is a series expansion around 0:
ilaplace(g, s, x)
The Laplace transform and the inverse Laplace transform, respectively, of a series do not make sense for expansion points other than 0 or infinity, respectively, and in these cases a symbolic function call is returned:
laplace(series(ln(x), x = 1, 2), x, s);
If the second argument is not the series variable, then the coefficients are transformed:
h := series(sin(x*y), x = 1, 2); laplace(h, y, s);
When called with one argument, the method coeff
returns
the sequence of all coefficients of a series expansion:
f := series(tan(x), x); coeff(f)
g := series(1/(x  1)^2, x = infinity); coeff(g)
When called with two arguments, coeff
returns
an individual coefficient:
coeff(f, 1), coeff(f, 1), coeff(f, 2), coeff(f, 13/2);
If the second argument exceeds the order of the error term, coeff
returns FAIL
:
coeff(f, 10)
When the expansion point is complexInfinity
, coeff(s,
n)
returns the coefficient of
,
where x
is the series variable of s
:
coeff(g, 2), coeff(g, 3), coeff(g, 15/2)
Specifying the series variable as second or third argument, respectively, is optional:
coeff(f) = coeff(f, x); coeff(f, 3) = coeff(f, x, 3)
For series expansions of type 1, the "coefficients" in general involve the series variable:
h := series(sin(sqrt(x)), x); coeff(h); coeff(h, 3/2);
The method ldegree
returns the order of the
leading term of a series expansion. When the expansion point is complexInfinity
and
the leading term is
,
then this is n:
f := series(x*sin(sqrt(x)), x); g := series(cot(x), x = PI); h := series(2*arccot(x), x = infinity);
ldegree(f), ldegree(g), ldegree(h)
The method lcoeff
returns the coefficient
of the leading term. For an expansion of type 1,
it generally involves the series variable:
lcoeff(f), lcoeff(g), lcoeff(h)
The method lterm
returns the leading term
itself:
lterm(f), lterm(g), lterm(h)
Finally, the method lmonomial
returns the
whole summand:
lmonomial(f) = lcoeff(f)*lterm(f); lmonomial(g) = lcoeff(g)*lterm(g); lmonomial(h) = lcoeff(h)*lterm(h);
If the series expansion consists only of an Oterm,
all four methods return FAIL
:
s := Series::Puiseux::zero(x, 6); ldegree(s), lcoeff(s), lterm(s), lmonomial(s)
The methods nthcoeff
, nthmonomial
,
and nthterm
return the nth
nonzero coefficient, monomial, or term, respectively, of a series
expansion. In contrast to polynomials, they count from the term of
lowest order on, i.e., the ordering is ascending by exponent for finite
expansion points and descending by exponent when the expansion point
is complexInfinity
:
f := series(x*sin(sqrt(x)), x); g := series(cot(x), x = PI); h := series(2*arccot(x), x = infinity);
nthcoeff(f, 1) = lcoeff(f); nthmonomial(g, 1) = lmonomial(g); nthterm(h, 1) = lterm(h);
nthcoeff(f, 3), nthmonomial(f, 3), nthterm(f, 3); nthcoeff(g, 3), nthmonomial(g, 3), nthterm(g, 3); nthcoeff(h, 3), nthmonomial(h, 3), nthterm(h, 3);
If the second argument is not positive or exceeds the number
of nonzero summands, all three methods return FAIL
:
nthcoeff(f, 4), nthterm(g, 0), nthmonomial(h, 4)
We illustrate the difference between the ordering of terms in
polynomials and series expansions. The ordering of the terms in a
polynomial agrees with the ordering of the terms in a series expansion
with expansion point complexInfinity
:
f := poly(2*(x^2 + x)^3); g := series(f, x = complexInfinity); [lcoeff(f), lmonomial(f), lterm(f)]; [lcoeff(g), lmonomial(g), lterm(g)];
[nthcoeff(f, 2), nthmonomial(f, 3), nthterm(f, 4)]; [nthcoeff(g, 2), nthmonomial(g, 3), nthterm(g, 4)];
For finite expansion points, however, the ordering of the terms in a series expansion is the reverse of the ordering of the terms in the corresponding polynomial:
h := series(f, x = 0); [lcoeff(h), lmonomial(h), lterm(h)]; [nthcoeff(h, 2), nthmonomial(h, 3), nthterm(h, 4)];
The method iszero
checks whether a series
expansion has no nonzero summands apart from the Oterm:
f := series(exp(x), x); g := Series::Puiseux(0, x = 2, 4); iszero(f), iszero(g)
The methods convert
tries to convert an arbitrary
object into an element of Series::Puiseux
. If the
input does not suggest an expansion point, convert
uses
the origin:
f := asympt(1/(x + 1), x = infinity); g := sin(x)/(1  x); h := poly((x + 1)^10); u := O((x  1)^3, x = 1);
domtype(f), domtype(g), domtype(h), domtype(u)
F := Series::Puiseux::convert(f); G := Series::Puiseux::convert(g); H := Series::Puiseux::convert(h); U := Series::Puiseux::convert(u);
convert
returns FAIL
,
if it is unable to convert the input, e.g., because the input contains
no or more than one indeterminate:
Series::Puiseux::convert(sin(1)), Series::Puiseux::convert([1, y, 3])
The method convert_to
tries to convert an
element of Series::Puiseux
into a specified type:
Series::Puiseux::convert_to(F, Series::gseries); Series::Puiseux::convert_to(F, contfrac); Series::Puiseux::convert_to(G, DOM_EXPR); Series::Puiseux::convert_to(H, DOM_POLY); Series::Puiseux::convert_to(H, O); Series::Puiseux::convert_to(U, O);
convert_to
returns FAIL
,
if it is unable to perform the requested conversion:
Series::Puiseux::convert_to(F, O), Series::Puiseux::convert_to(F, DOM_LIST)
The method expr
converts an element of Series::Puiseux
into
an arithmetical expression, discarding the Oterm.
In general, the ordering of the summands is not preserved:
f := series(exp(x*y), x); g := series(ln(x), x = 1, 3);
expr(f); expr(g);
The method float
applies the system function float
to all coefficients:
float(f); float(g);
The methods combine
, expand
,
and normal
apply the corresponding system functions
to all coefficients:
delete a, y: f := series(y/(x + y^a), x, 4); g := combine(f); expand(g);
For efficiency reasons, the arithmetical methods of Series::Puiseux
usually
do not perform any symbolic simplifications. Use expand
or normal
to
simplify the results:
h := series(exp(x), x, 4)^a; expand(h); normal(h);
u := series(arctanh(x + y), x, 4); normal(u);
Besides normalizing the coefficients, the method normal
also
removes leading and trailing zeroes from the coefficient list:
v := Series::Puiseux::create(1, 3, 10, [0, 1/2, 0, 5, 0, 0], x, 2); coeff(v); normal(v); coeff(%);
The method map
applies a given function to
all coefficients. E.g., the system function factor
is not overloaded for Series::Puiseux
,
but you can use map
to express all coefficients
in factored form:
map(u, factor);
In the next example, we use map
to multiply
all coefficients of a series expansion by a constant:
w := series(exp(x), x, 3); map(w, _mult, PI) = PI*w
For series expansions of type 1, map
applies
the function to all nonzero coefficients as returned by coeff
:
z := series(sin(sqrt(x)), x); coeff(z); map(z, cos);
Three different methods can be used to substitute for the series
variable: _fconcat
, func_call
,
and subs
. Suppose f
is an element
of Series::Puiseux
and we want to substitute an
expression t
for the series variable x
.
Then _fconcat
converts t
into
a series expansion around the origin via the constructor, computes
the functional composition, and returns the result as an element of Series::Puiseux
:
f := series(exp(x), x = 0, 5); Series::Puiseux::_fconcat(f, y) = f @ y; f @ (y^2 + y);
The composition may fail if the limit point of t
around
the origin differs from the expansion point of f
or
if t
contains special mathematical functions:
f @ (y + 1);
f @ sin(y);
Moreover, the composition does not work if the expression t
is
constant or contains more than one indeterminate:
f @ PI;
Error: Cannot compute composition. [Series::Puiseux::_fconcat]
f @ (x + y);
Error: Cannot compute composition. [Series::Puiseux::_fconcat]
You can enforce the composition by explicitly converting t
into
a series:
f @ series(y + 1, y = 1); f @ series(sin(y), y = 0); f @ series(x + y, x = y);
Substitution with func_call
always works.
It discards the error term, t
is substituted literally,
and the result is an expression and not an object of type Series::Puiseux
:
f(5) = Series::Puiseux::func_call(f, 5); f(y) = Series::Puiseux::func_call(f, y);
f(y^2 + y); f(y + 1); f(sin(y)); f(PI); f(x + y);
Finally, if subs
is used to substitute for
the series variable, only very special substitutions are allowed (see
the description of subs
above for more details).
Then a change of variable is performed, and the result is again of
type Series::Puiseux
:
subs(f, x = y^2 + y)
Error: Invalid substitution. [Series::Puiseux::subs]
subs(f, x = y + 1)
subs(f, x = sin(y))
Error: Invalid substitution. [Series::Puiseux::subs]
subs(f, x = PI)
Error: The substitution is invalid. Exactly one indeterminate is expected. [Series::Puiseux::subs]
subs(f, x = x + y)
Error: The substitution is invalid. Exactly one indeterminate is expected. [Series::Puiseux::subs]
All three methods can handle the case where the series variable occurs in the coefficients:
s := series(ln(x^2 + x), x); s @ (2*y); s(2*y); subs(s, x = 2*y);
Of course, subs
can also be used to substitute
for other objects than the series variable in the coefficients and
in the expansion point:
g := series(cos(x + y), x, 4); h := series(1/x, x = y, 4);
subs(g, y = PI) = series(cos(x + PI), x, 4); subs(h, y = 2) = series(1/x, x = 2, 4);
Even simultaneous substitutions are possible in the coefficients:
subs(g, [hold(sin) = cos, hold(cos) = sin, y = 2])
An error occurs, if the right hand side contains the series variable:
subs(h, y = x)
Error: The substitution is invalid. The right side must not contain the series variable. [Series::Puiseux::subs]
The method has
checks, whether an object
occurs syntactically in the coefficients, the series variable, the
expansion point, or the direction of an element of Series::Puiseux
:
f := series(sin(x + 2*y), x = PI, 2); has(f, x), has(f, y), has(f, PI), has(f, 2), has(f, Undirected); has(f, hold(sin)), has(f, 3), has(f, sin(2*y)), has(f, x  PI);
The last call returns FALSE
since the expression x
 PI
occurs only in the screen output, but not in the internal
representation of f
.
g := series(sign(x), x, Right); has(g, Right), has(g, Undirected);
The method truncate
discards summands up
to the given order:
f := series(x*sin(sqrt(x)), x); Series::Puiseux::truncate(f, 10); Series::Puiseux::truncate(f, 9/2); Series::Puiseux::truncate(f, 7/2); Series::Puiseux::truncate(f, 3); Series::Puiseux::truncate(f, 3/2); Series::Puiseux::truncate(f, 1);

An arithmetical
expression representing a function in 

An identifier 

The expansion point: an arithmetical expression. If not specified, the default expansion point 0 is used. 

The number of terms to be computed: a nonnegative integer. The
default order is given by the environment variable 

Either 
an object of domain type Series::Puiseux
,
or the value FAIL
, if the f
cannot
be converted, e.g., if powers with nonrational exponents occur in f
.
Calling an element of Series::Puiseux
as
a function discards the error term and substitutes the first argument
for the series variable. See the description of the method "func_call"
and Example 22.
Series::Puiseux
implements the basic arithmetic
of truncated series expansions. Use the ordinary arithmetical operators +,
, *, /, ^
, and @
for composition.
The arithmetical methods of Series::Puiseux
usually
do not perform any symbolic simplifications. Use combine
, expand
,
or normal
to request such simplifications explicitly.
See Example 5 and Example 21.
Special mathematical functions, such as exp
or sin
, are overloaded for elements of Series::Puiseux
;
cf. Example 10.
The system functions coeff
, lcoeff
, nthcoeff
, ldegree
, lmonomial
, nthmonomial
, lterm
, and nthterm
work on truncated
series expansions. Note that in contrast to polynomials, coefficients,
monomials, and terms are counted from the term of lowest order term
on. Cf. Example 17.
Use the function expr
to
convert a series expansion to an arithmetical expression (as an element
of a kernel domain).
A series of the domain type Series::Puiseux
has
the following seven operands:
a type flagt ∈ {0, 1},
the branching orderb, a positive integer,
an integer v such that is the order of the leading term,
an integer e ≥ v such that is the order of the error term,
a list of coefficients l_{1}, …, l_{n},
the series variablex and
the expansion pointx_{0} in
form of an equation x = x_{0};
the expansion point x_{0} may
be complexInfinity
as
well,
a direction, Undirected
, Real
, Left
,
or Right
.
The type flag distinguishes between two different internal representations.
If t = 0, then the operands above represent the truncated series expansion
.
If the expansion point x_{0} is complexInfinity
,
then the operands represent the truncated expansion
.
A summand (or , respectively) is called a monomial of the expansion,
the power (or , respectively) is called a term,
l_{i} is the corresponding coefficient, and
the exponent is the order of the corresponding term or monomial.
If t = 1, then the operands above represent the expansion
.
In this case, the powers of x  x_{0} are
explicitly stored in the list, and l_{i} contains
only terms of growth order
.
The corresponding expansion for x0 = complexInfinity
is
,
and l_{i} contains only terms of growth order .
The notions term and order are the same as for t = 0, a summand l_{i} is called a monomial, and the corresponding coefficient is
(or
,
respectively).
The latter type of representation serves for correct expansions
around branch points. For example, if we want to expand
around x =
0, then the truncated Puiseux series
does
not approximate f(x) in
the lower half of the complex plane. With t =
1, the expansion
,
which approximates f(x) also
in the lower part of the complex plane near the origin, can be represented
as an object of domain type Series::Puiseux
.
The direction d has
the same meaning as the parameter dir
of the constructor.
If d = Undirected,
the operands above represent an expansion valid in some neighborhood
of the expansion point in the complex plane. Usually, this is an open
disc centered at x0
. If d ≠ Undirected and x_{0} represents
a real number, this means that the expansion is valid for real values
of x only.
If d = Left or d = Right,
then the expansion is valid for x < x_{0} or x > x_{0},
respectively.
In the case x_0 = complexInfinity
, and if d = Undirected,
we have an expansion valid in the neighborhood of the north pole of
the Riemann sphere, i.e., for all
of
sufficiently large absolute value. If d = Left,
we have an expansion around the positive real infinity valid for sufficiently
large real values of x.
Similarly, if d = Right,
we have an expansion around the negative real infinity valid for sufficiently
large negative real values of x.
Finally, if d = Real,
the expansion is valid both around infinity and
around  ∞.
Cf. Example 2.
Typically, objects of type Series::Puiseux
are
generated by calls to series
or taylor
.