Series::Puiseux -- the
domain of finite series expansions
IntroductionSeries::Puiseux is a domain for finite series
expansions. Elements of this domain represent initial segments of
either Taylor, Laurent or Puiseux series expansions.
Detailsseries is the main application of
this domain. It tries to compute a Taylor, Laurent, or Puiseux series
of a given arithmetical expression, and the result is returned as an
element of Series::Puiseux.
There may be no need for you to explicitely create elements of this
domain, but to work with the results of series.
Cf. the help page of series for a detailed description and
examples of how to work with elements of the domain
Series::Puiseux.
Type::Series to determine for an
element of this domain, which kind of series expansion it is.The coefficients are allowed to depend on the variable of the series expansion, for example, logarithmic terms in the series variable may appear as coefficients. Be aware that this is no Puiseux series in the mathematical sense. Cf. example 1.
A series of the domain type Series::Puiseux consists
has operands:
The series looks as follows: sum_i=0..e-v-1 l_ix^(v+i)/b + O(x^e/b).
Related
DomainsSeries::Puiseux implements basic arithmetic of series
expansions. Use the ordinary arithmetical operators +, -, *,
/,^ and @ for composition.
The system functions nthcoeff, coeff, nthterm, lterm, nthmonomial and lmonomial as well as ldegree work on series
expansions. Note that in contrast to polynomials, terms, coefficients
and monomials we counted from the order term on. Cf. example 11.
Use the function expr
to convert a series expansion to an arithmetical expression (as an
element of a kernel domain).
Evaluating an object of type Series::Puiseux returns
itself.
Calling an element of Series::Puiseux as a function
yields the object itself, regardless of the arguments. The arguments
are not evaluated.
_divide(any s, Puiseux t)new and series. Then it computes the quotient
s/t of series expansions and returns the result as an
element of Series::Puiseux._divide for series expansions, i.e.,
you may use it in the form s/t. Cf. example 3._mult(s, t)new and series. Then it computes the product
s*t*... of series expansions and returns the result as an
element of Series::Puiseux._mult for series expansions, i.e., you
may use it in the form s*t*.... Cf. example 3._plus(Puiseux s, any
t...)new and series. Then it computes the sum
s+t+... of series expansions and returns the result as an
element of Series::Puiseux._plus for series expansions, i.e., you
may use it in the form s+t+.... Cf. example 3.Series::Puiseux::scalmult(Puiseux s, any a, rational k )Series::Puiseux. Cf. example 6.Series::Puiseux::indet(Puiseux
s)s. Cf. example 10.nthmonomial(Puiseux s, positive integer n)n-th nonzero monomial of s,
counted from the lowest order monomial on (see ``Operands'' for the
definition of ``monomial'').nthmonomial. Cf. example 9.Series::Puiseux::order(Puiseux
s)s. Cf.
example 10.Series::Puiseux::point(Puiseux
s)s. Cf. example 10.Series::Puiseux::create(any bo, any v, any ord, list
l,
identifier x, any
x0)bo,
valuation v and order ord in x
at point x0. The coefficients are in the list
l.expand(Puiseux s)s.expand.Series::Puiseux::new(any s, identifier x, positive integer
n)s of order
n with respect to the variable x. The point
of expansion is the origin. Cf. example 15.
Example
1
>> f := series(psi(x), x = infinity);
coeff(f, 0)
1 1 1 / 1 \
ln(x) - --- - ----- + ------ + O| -- |
2 x 2 4 | 5 |
12 x 120 x \ x /
ln(x)
Example
2
>> f := series(1 + 2*x^3, x);
diff(f, x);
int(f, x)
3 6
1 + 2 x + O(x )
2 5
6 x + O(x )
4
x 7
x + -- + O(x )
2
>> g := series(1 + 2*x^(3/2), x);
diff(g, x);
int(g, x)
3/2 6
1 + 2 x + O(x )
1/2 5
3 x + O(x )
5/2
4 x 7
x + ------ + O(x )
5
>> h := series(1 + 2*x, x = 2);
diff(h, x);
int(h, x)
6
5 + (2 x - 4) + O((x - 2) )
5
2 + O((x - 2) )
2 7
6 + (5 x - 10) + (x - 2) + O((x - 2) )
Example
3
>> f := series(1 + 2*x^3, x, 4);
g := series(1 + 2*x^(3/2), x, 4);
h := series(1 + 2*x, x = 2, 4)
3 4
1 + 2 x + O(x )
3/2 4
1 + 2 x + O(x )
4
5 + (2 x - 4) + O((x - 2) )
>> f + g + h;
_plus(f, g, h)
3/2 3 4
7 + 2 x + 2 x + 2 x + O(x )
3/2 3 4
7 + 2 x + 2 x + 2 x + O(x )
>> f - g;
_subtract(f, g);
g - h;
_subtract(g, h)
3/2 3 4
- 2 x + 2 x + O(x )
3/2 3 4
- 2 x + 2 x + O(x )
3/2 4
- 4 - 2 x + 2 x + O(x )
3/2 4
- 4 - 2 x + 2 x + O(x )
>> f*g*h;
_mult(f, g, h)
3/2 5/2 3 4
5 + 2 x + 10 x + 4 x + 10 x + O(x )
3/2 5/2 3 4
5 + 2 x + 10 x + 4 x + 10 x + O(x )
>> f/g;
_divide(f, g);
g/h;
_divide(g, h)
3/2 3 4
1 - 2 x + 6 x + O(x )
3/2 3 4
1 - 2 x + 6 x + O(x )
3/2 2 5/2 3 7/2
2 x 2 x 4 x 4 x 8 x 8 x 4
1/5 - --- + ------ + ---- - ------ - ---- + ------ + O(x )
25 5 125 25 625 125
3/2 2 5/2 3 7/2
2 x 2 x 4 x 4 x 8 x 8 x 4
1/5 - --- + ------ + ---- - ------ - ---- + ------ + O(x )
25 5 125 25 625 125
Example
4
>> f := series(1 + 2*x^3, x, 10);
g := series(y^2, y, 10);
f@g = _fconcat(f, g)
3 10
1 + 2 x + O(x )
2 10
y + O(y )
6 10 6 10
1 + 2 y + O(y ) = 1 + 2 y + O(y )
>> f := series(1 + 2*x^(3/2), x, 10);
g := series(y^2, y, 10);
f@g = _fconcat(f, g)
3/2 10
1 + 2 x + O(x )
2 10
y + O(y )
3 9 3 9
1 + 2 y + O(y ) = 1 + 2 y + O(y )
>> f := series(1 + 2*x^3, x = 2);
g := series(y^2, y, 10);
f@g = _fconcat(f, g)
2 3 6
17 + (24 x - 48) + 12 (x - 2) + 2 (x - 2) + O((x - 2) )
2 10
y + O(y )
Error: invalid composition [Series::Puiseux::_fconcat]
We now consider the procedure revert. Let f be a series
expansion where the constant term is zero.
>> f := series(5*x + 2*x^3, x);
g := revert(f);
f@g
3 6
5 x + 2 x + O(x )
3 5
x 2 x 12 x 6
- - ---- + ----- + O(x )
5 625 78125
6
x + O(x )
Otherwise the expansion point is the constant term.
>> f := series(1 + x + 2*x^3, x);
g := revert(f);
f@g
3 6
1 + x + 2 x + O(x )
3 5 6
(x - 1) - 2 (x - 1) + 12 (x - 1) + O((x - 1) )
6
1 + (x - 1) + O((x - 1) )
Example
5
>> f := series(1 + 2*x^3, x);
f^2 = _power(f, 2);
f^(1/3) = _power(f, 1/3)
3 6
1 + 2 x + O(x )
3 6 3 6
1 + 4 x + O(x ) = 1 + 4 x + O(x )
3 3
2 x 6 2 x 6
1 + ---- + O(x ) = 1 + ---- + O(x )
3 3
>> f := series(1 + 2*x^(3/2), x);
f^2 = _power(f, 2);
f^(1/3) = _power(f, 1/3)
3/2 6
1 + 2 x + O(x )
3/2 3 6 3/2 3 6
1 + 4 x + 4 x + O(x ) = 1 + 4 x + 4 x + O(x )
3/2 3 9/2
2 x 4 x 40 x 6
1 + ------ - ---- + ------- + O(x ) =
3 9 81
3/2 3 9/2
2 x 4 x 40 x 6
1 + ------ - ---- + ------- + O(x )
3 9 81
Example
6
>> f := series(1 + 2*x^3, x);
Series::Puiseux::scalmult(f, 5, 3) = 5*x^3*f
3 6
1 + 2 x + O(x )
3 6 9 3 6 9
5 x + 10 x + O(x ) = 5 x + 10 x + O(x )
>> f := series(1 + 2*x^3, x);
Series::Puiseux::scalmult(f, 5) = 5*x^(0)*f
3 6
1 + 2 x + O(x )
3 6 3 6
5 + 10 x + O(x ) = 5 + 10 x + O(x )
Example
7
>> f := series(5*x + 2*x^3, x);
coeff(f) = (coeff(f, 1), coeff(f, 2), coeff(f, 3))
3 6
5 x + 2 x + O(x )
(5, 0, 2) = (5, 0, 2)
Example
8
>> f := series(5*x + 2*x^3, x);
iszero(f);
g := series(0, x);
iszero(g)
3 6
5 x + 2 x + O(x )
FALSE
6
O(x )
TRUE
Example
9
>> f := series(5*x + 2*x^3, x);
nthcoeff(f, 1), nthcoeff(f, 2);
lcoeff(f), lmonomial(f), lterm(f)
3 6
5 x + 2 x + O(x )
5, 2
5, 5 x, x
>> nthmonomial(f, 1), nthmonomial(f, 2);
nthterm(f, 1), nthterm(f, 2)
3
5 x, 2 x
3
x, x
Example
10
>> f := series(5*x + 2*x^3, x);
ldegree(f),
Series::Puiseux::order(f),
Series::Puiseux::indet(f),
Series::Puiseux::point(f)
3 6
5 x + 2 x + O(x )
1, 6, x, 0
>> g := series(5*x + 2*x^3, x = 3);
ldegree(g),
Series::Puiseux::order(g),
Series::Puiseux::indet(g),
Series::Puiseux::point(g)
2 3 6
69 + (59 x - 177) + 18 (x - 3) + 2 (x - 3) + O((x - 3) )
0, 6, x, 3
Example
11Consider the series expansion f:=5*x+2*x^3+O(x^6) of the polynomial g:=5*x+2*x^3.
>> f := series(5*x + 2*x^3, x); g := 5*x + 2*x^3
3 6
5 x + 2 x + O(x )
3
5 x + 2 x
We have several access functions for series expansions overloading system functions for polynomials:
>> coeff(f, 1), coeff(g, 1);
ldegree(f), ldegree(g)
5, 5
1, 1
Note, however, that the n-th term of a series expansion and the n-th term of a polynomial are different. For example, for polynomials, the leading monomial is the nonzero monomial with the highest degree, while for series expansions it is the nonzero monomial with the lowest degree.
>> lcoeff(f), lcoeff(g);
nthmonomial(f, 1), nthmonomial(g, 1);
lmonomial(f), lmonomial(g);
lterm(f), lterm(g);
nthterm(f, 1), nthterm(g, 1)
5, 2
3
5 x, 2 x
3
5 x, 2 x
3
x, x
3
x, x
Example
12
>> f := series(1 + 2*x^3, x)
3 6
1 + 2 x + O(x )
>> expr(f);
float(f)
3
2 x + 1
3 6
1.0 + 2.0 x + O(x )
>> has(f, x);
has(f, y)
TRUE
FALSE
Example
13
>> f := series(1 + 2*x^3, x);
Series::Puiseux::func_call(f, 3) = f(3);
Series::Puiseux::func_call(f, y + 1) = f(y + 1)
3 6
1 + 2 x + O(x )
55 = 55
3 3
2 (y + 1) + 1 = 2 (y + 1) + 1
Example
14
>> f := series(1 + 2*x^3, x);
map(f, sin)
3 6
1 + 2 x + O(x )
3 6
sin(1) + x sin(2) + O(x )
Example
15
>> f := series(2*x^3, x);
Series::Puiseux::new(2*x^3, x, 6);
Series::Puiseux::create(1, 0, 6, [0, 0, 0, 2, 0, 0], x, 0)
3 6
2 x + O(x )
3 9
2 x + O(x )
3 6
2 x + O(x )
>> f := series(sin(x), x) <> Series::Puiseux::new(sin(x), x, 6)
3 5
x x 6 6
x - -- + --- + O(x ) <> sin(x) + O(x )
6 120
Example
16
>> f := series(1 + 2*x^3, x):
print(f):
3 6
1 + 2 x + O(x )
Example
17
>> f := series(1 + 2*x^3, x);
subs(f, x = a);
subs(f, x = y + 1)
3 6
1 + 2 x + O(x )
3 6
1 + 2 a + O(a )
2 3 6
3 + 6 y + 6 y + 2 y + O(y )