# FunctionSpaceToUnivariatePowerSeries(R, FE, Expon, UPS, TRAN, UTS, TEXP, x)ΒΆ

fs2ups.spad line 1457 [edit on github]

R: Join(GcdDomain, Comparable, RetractableTo Integer, LinearlyExplicitOver Integer)

FE: Join(AlgebraicallyClosedField, TranscendentalFunctionCategory, Algebra Fraction Integer, FunctionSpace R) with

coerce: Expon -> %

Expon: Join(OrderedAbelianMonoid, OrderedRing)

UPS: Join(UnivariatePowerSeriesCategory(FE, Expon), Field, PowerSeriesCategory(FE, Expon, SingletonAsOrderedSet), TranscendentalFunctionCategory)

TRAN: PartialTranscendentalFunctions UPS

UTS: UnivariateTaylorSeriesCategory FE

TEXP: TaylorSeriesExpansion(FE, Expon, SingletonAsOrderedSet, UPS, UTS)

x: Symbol

This package converts expressions in some function space to power series in a variable `x`

with coefficients in that function space. The function exprToUPS converts expressions to power series whose coefficients do not contain the variable `x`

. The function exprToGenUPS converts functional expressions to power series whose coefficients may involve functions of `log(x)`

.

- exprToGenUPS: (FE, Boolean, Union(complex, real: two sides, real: left side, real: right side, just do it)) -> Union(%series: UPS, %problem: Record(func: String, prob: String))
`exprToGenUPS(fcn, posCheck?, atanFlag)`

converts the expression`fcn`

to a generalized power series. If`posCheck?`

is`true`

, log`'s`

of negative numbers are not allowed nor are`n`

th roots of negative numbers with`n`

even. If`posCheck?`

is`false`

, these are allowed.`atanFlag`

determines how the case`atan(f(x))`

, where`f(x)`

has a pole, will be treated. The possible values of`atanFlag`

are`"complex"`

,`"real: two sides"`

,`"real: left side"`

,`"real: right side"`

, and`"just do it"`

. If`atanFlag`

is`"complex"`

, then no series expansion will be computed because, viewed as a function of a complex variable,`atan(f(x))`

has an essential singularity. Otherwise, the sign of the leading coefficient of the series expansion of`f(x)`

determines the constant coefficient in the series expansion of`atan(f(x))`

. If this sign cannot be determined, a series expansion is computed only when`atanFlag`

is`"just do it"`

. When the leading term in the series expansion of`f(x)`

is of odd degree (or is a rational degree with odd numerator), then the constant coefficient in the series expansion of`atan(f(x))`

for values to the left differs from that for values to the right. If`atanFlag`

is`"real: two sides"`

, no series expansion will be computed. If`atanFlag`

is`"real: left side"`

the constant coefficient for values to the left will be used and if`atanFlag`

`"real: right side"`

the constant coefficient for values to the right will be used. If there is a problem in converting the function to a power series, we return a record containing the name of the function that caused the problem and a brief description of the problem. When expanding the expression into a series it is assumed that the series is centered at 0. For a series centered at a, the user should perform the substitution`x -> x + a`

before calling this function.

- exprToPS: (FE, Boolean, Union(complex, real: two sides, real: left side, real: right side, just do it), Boolean, FE) -> Union(%series: UPS, %problem: Record(func: String, prob: String))
`exprToPS(fcn, posCheck?, atanFlag, log_flag, log_val)`

is like exprToUPS, but if`log_flag`

is`true`

it replaces logarithms of expansion variable by`log_val`

- exprToPS: (FE, Boolean, Union(complex, real: two sides, real: left side, real: right side, just do it), Boolean, FE, FE -> Boolean, FE -> Boolean, FE -> Boolean) -> Union(%series: UPS, %problem: Record(func: String, prob: String))
exprToPS(

`fcn`

, posCheck?, atanFlag, log_flag, log_val, coef_chk, inv_chk, zero_chk) is like exprToPS(`fcn`

, posCheck?, atanFlag, log_flag, log_val), but fails if`coef_chk`

is`false`

for some coefficient of`fcn`

or if expansion process needs to invert element of`FE`

for which`inv_chk`

is`false`

- exprToUPS: (FE, Boolean, Union(complex, real: two sides, real: left side, real: right side, just do it)) -> Union(%series: UPS, %problem: Record(func: String, prob: String))
`exprToUPS(fcn, posCheck?, atanFlag)`

converts the expression`fcn`

to a power series. If`posCheck?`

is`true`

, log`'s`

of negative numbers are not allowed nor are`n`

th roots of negative numbers with`n`

even. If`posCheck?`

is`false`

, these are allowed.`atanFlag`

determines how the case`atan(f(x))`

, where`f(x)`

has a pole, will be treated. The possible values of`atanFlag`

are`"complex"`

,`"real: two sides"`

,`"real: left side"`

,`"real: right side"`

, and`"just do it"`

. If`atanFlag`

is`"complex"`

, then no series expansion will be computed because, viewed as a function of a complex variable,`atan(f(x))`

has an essential singularity. Otherwise, the sign of the leading coefficient of the series expansion of`f(x)`

determines the constant coefficient in the series expansion of`atan(f(x))`

. If this sign cannot be determined, a series expansion is computed only when`atanFlag`

is`"just do it"`

. When the leading term in the series expansion of`f(x)`

is of odd degree (or is a rational degree with odd numerator), then the constant coefficient in the series expansion of`atan(f(x))`

for values to the left differs from that for values to the right. If`atanFlag`

is`"real: two sides"`

, no series expansion will be computed. If`atanFlag`

is`"real: left side"`

the constant coefficient for values to the left will be used and if`atanFlag`

`"real: right side"`

the constant coefficient for values to the right will be used. If there is a problem in converting the function to a power series, a record containing the name of the function that caused the problem and a brief description of the problem is returned. When expanding the expression into a series it is assumed that the series is centered at 0. For a series centered at a, the user should perform the substitution`x -> x + a`

before calling this function.