## `Series::gseries` -- the domain of generalized series expansions

#### Introduction

`Series::gseries` is the domain of series expansions generalizing Taylor, Laurent and Puiseux expansions.

#### Creating Elements

`Series::gseries(f, x <, order>)`
`Series::gseries(f, x = a <, order>)`
`Series::gseries(f, x = a <, order> <, Right>)`
`Series::gseries(f, x = a <, order> <, Left>)`

#### Parameters

`f` | - | an arithmetical expression
`x` | - | the series variable: an identifier
`a` | - | the expansion point: an arithmetical expression or +/-`infinity`
`order` | - | the truncation order: a nonnegative integer

#### Options

`Left` | - | compute a series expansion that is valid for real x smaller than a.
`Right` | - | compute a series expansion that is valid for real x larger than a (the default case).

#### Returns

an object of domain type `Series::gseries`, or the value `FAIL`.

#### Side Effects

The function is sensitive to the global variable `ORDER`, which determines the default number of terms of the expansion.

#### Details

- The call `Series::gseries``(f, x)` computes a series expansion at x = 0+.
- The system functions `series` and `asympt` are the main application of this domain. The latter function only returns elements of this domain, whereas `series` could return an element of `Series::gseries` in cases, where a Puiseux series expansion does not exist.

  There may be no need to explicitely create elements of this domain, but to work with the results of the mentioned system functions.

- See the help page of the system function `asympt` for a detailed description of the parameters and examples for working with elements of the domain `Series::gseries`.
- Note that elements of `Series::gseries` only represents directional (real) series expansions.

#### Operands

A series of the domain type `Series::gseries` consists of three operands:

1. A list of sublists [ci, fi] of length 2. Each sublist represents a monomial ci*fi of the series expansion, where the ci are the coefficients and fi the terms of `s`.
2. The order term of the form O(g(x)), possibly the integer 0, if the expansion is exact.
3. An arithmetical expression e(x) depending of the series variable x such that e(x) -> infinity for x -> a+.

#### Related Domains

`Series::Puiseux`

#### Important Operations

`Series::gseries` implements addition and multiplication of generalized series expansions. Use the ordinary arithmetical operators `+` and `*`.

The system functions `coeff`, `nthterm`, `lterm`, `nthmonomial` and `lmonomial` as well as `ldegree` work on generalized series expansions.

Use the function `expr` to convert a generalized series expansion into an arithmetical expression (as an element of a kernel domain).

#### Result of Evaluation

Evaluating an object of type `Series::gseries` returns itself.

#### Function Call

Calling an element of `Series::gseries` as a function yields the object itself, regardless of the arguments. The arguments are not evaluated.

#### Method _mult: multiply series expansions

- `_mult(gseries s, any t...)`
- - Computes the product s*t*... of series expansions and returns the result as an element of `Series::gseries`.

    If the product cannot be computed, then `FAIL` is returned.

  - Each argument of this method, which is not of the domain type `Series::gseries`, is converted into such an element, i.e., a generalized series expansion is computed. If this fails, then `FAIL` is returned.
  - This method overloads the function `_mult` for elements of `Series::gseries`, i.e., one may use it in the form `s*t*...`, or in functional notation: `_mult(s, t...)`.

#### Method _plus: add series expansions

- `_plus(gseries s, any t...)`
- - Computes the sum s + t + ... of series expansions and return the result as an element of `Series::gseries`.

    If the sum cannot be computed, then `FAIL` is returned.

  - Each argument of this method, which is not of the domain type `Series::gseries`, is converted into such an element, i.e., a generalized series expansion is computed. If this fails, then `FAIL` is returned.
  - This method overloads the function `_plus` for elements of `Series::gseries`, i.e., one may use it in the form `s+t+ ...`, or in functional notation: `_plus(s, t...)`.

#### Method _power: the integer power of a series expansions

- `_power(gseries s, integer n)`
- - Computes the nth power of `s`, if `n` is a non-negative integer. Otherwise `FAIL` is returned.
  - If `n` is not an integer, then `FAIL` is returned.
  - This method overloads the function `_power` for elements of `Series::gseries`, i.e., one may use it in the form `s^n`, or in functional notation: `_power(s, n)`.

#### Method coeff: extract coefficients

- `coeff(gseries s <, positive integer n>)`
- - Returns a sequence of all coefficients of `s`, or the `n`th coefficient respectively.
  - This method overloads the function `coeff` for elements of `Series::gseries`, i.e., one may use it in the form `coeff(s <, n>)`.

#### Method iszero: test on zero

- `iszero(gseries s)`
- - Returns `TRUE` if `s` is exact (i.e., the second operand is the integer 0) and equal to zero, otherwise `FALSE`.
  - This method overloads the function `iszero` for elements of `Series::gseries`, i.e., one may use it in the form `iszero(s)`.

#### Method lcoeff: the leading coefficient

- `lcoeff(gseries s)`
- - Returns the first (or leading) coefficient of `s` (see ``Operands'' for the definition of the term ``coefficient'').
  - This method overloads the function `lcoeff` for elements of `Series::gseries`, i.e., one may use it in the form `lcoeff(s)`.

#### Method ldegree: the leading degree

- `ldegree(gseries s)`
- - Returns the leading degree of `s`, or the value `FAIL`, if the leading degree cannot be determined.
  - This method overloads the function `ldegree` for elements of `Series::gseries`, i.e., one may use it in the form `ldegree(s)`.

#### Method lmonomial: the leading monomial

- `lmonomial(gseries s)`
- - Returns the first (or leading) monomial of `s` (see ``Operands'' for the definition of the term ``monomial'').
  - This method overloads the function `lmonomial` for elements of `Series::gseries`, i.e., one may use it in the form `lmonomial(s)`.

#### Method lterm: the leading term

- `lterm(gseries s)`
- - Returns the first (or leading) term of `s` (see ``Operands'' for the definition of ``term'').
  - This method overloads the function `lterm` for elements of `Series::gseries`, i.e., one may use it in the form `lterm(s)`.

#### Method nthmonomial: extract monomials

- `nthmonomial(gseries s, positive integer n)`
- - Returns the `n`th monomial of `s` (see ``Operands'' for the definition of the term ``monomial'').
  - This method overloads the function `nthmonomial` for elements of `Series::gseries`, i.e., one may use it in the form `nthmonomial(s, n)`.

#### Method nthterm: extract terms

- `nthterm(gseries s, positive integer n)`
- - Returns the `n`th term of `s` (see ``Operands'' for the definition of ``term'').
  - This method overloads the function `nthterm` for elements of `Series::gseries`, i.e., one may use it in the form `nthterm(s, n)`.

#### Method map: map a function to coefficients

- `map(gseries s, function func...)`
- - Maps the function `func` to the coefficients of `s`.
  - This method overloads the function `map` for elements of `Series::gseries`, i.e., one may use it in the form `map(s, func...)`.

#### Method subs: substitute subexpressions of monomials

- `subs(gseries s, equation x = a...)`
- - Substitute subexpressions of the monomials of the series `s`. See the system function `subs` for a detailed description of the parameters.
  - This method overloads the function `subs` for elements of `Series::gseries`, i.e., one may use it in the form `subs(s, x = a...)`.

#### Method subsex: substitute subexpressions of monomials (extended)

- `subsex(gseries s, equation x = a...)`
- - Substitute subexpressions of the monomials of the series `s`. See the system function `subsex` for a detailed description of the parameters.
  - This method overloads the function `subsex` for elements of `Series::gseries`, i.e., one may use it in the form `subsex(s, x = a...)`.

#### Method convert: convert an object into a generalized series expansion

- `convert(any x)`
- - If `x` is an element of the domain type `Series::Puiseux`, then `x` is converted into an element of `Series::gseries`.

    Otherwise, `FAIL` is returned.

#### Method convert_to: convert a generalized series expansion into other domains

- `convert_to(gseries s, any T)`
- - Tries to convert `s` into an element of domain type `T`, or, if `T` is not a domain, to the domain type of `T`.

    `FAIL` is returned, if a conversion cannot be performed, or is not supported.

  - `T` might be the domain `DOM_POLY`, where the sum of monomials is considered as a polynomial in the indeterminates of the third operand of `s`.

    If `T` is the domain `DOM_EXPR`, then the conversion is the same as implemented by the method `"expr"` (see below).

  - Use the function `expr` to convert `s` into an object of a kernel domain.

#### Method create: create simple and fast a generalized series expansion

- `create(list list, expression orderTerm, equation x = a)`
- - Creates a new element of the domain `Series::gseries`.

    `list` must be a list of sublists [ci,fi] of length 2, the monomials ci*fi of the series expansion.

    `orderTerm` is the order term of the form O(g(x)), or the integer 0 if the expansion is exact.

  - This method should be used with caution, because no argument checking is performed. It is supposed to be used to create, not to compute elements of `Series::gseries`.

#### Method expr: convert a generalized series expansion into an element of a kernel domain

- `expr(gseries s)`
- - Returns the sum of monomials of `s` without the order term.

#### Method print: pretty-print routine

- `print(gseries s)`
- - This method is used from the system function `print` for printing elements of `Series::gseries` to the screen.

#### Method TeX: LaTeX formatting

- `TeX(gseries s)`
- - Returns a LaTeX-formatted string for `s`.
  - This method is called from the system function `generate::TeX`.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000