## `polylib::makerat` -- convert expression into rational function over a suitable field

#### Introduction

`polylib::makerat``(a)` returns two polynomials f and g over some extension field of the rationals and a list of substitutions such that applying the substitutions to the rational function (f)/(g) gives `a`.

`polylib::makerat``(l)` does the same for every element of a list `l` of expressions such that the same extension field is chosen for all elements of the list.

#### Call(s)

`polylib::makerat(a)`
`polylib::makerat(l)`

#### Parameters

`a` | - | polynomial over `Expr` or arithmetical expression
`l` | - | list or set of polynomials over `Expr` or arithmetical expressions

#### Returns

`polylib::makerat` returns an expression sequence consisting of three operands:

- The first operand represents the numerator (or the list/set of numerators, respectively). It is a single polynomial if the call was `polylib::makerat``(a)`, otherwise it is a set or list of polynomials (the same type as the input). The polynomial(s) may have more indeterminates than the input. The coefficient ring is either `Expr` or a `Dom::AlgebraicExtension`; if it is `Expr`, the polynomial has only integer coefficients.
- The second operand represents the denominator (or the list/set of denominators, respectively). It is of the same type as the first operand.
- The third operand is a list of equations.

#### Related Functions

`rationalize`

#### Example 1

In the simplest case (integer polynomial), the numerator equals the input, the denominator equals 1, and no substitutions are necessary:

    >> polylib::makerat(x^2+3)

                              2
                        poly(x  + 3, [x]), poly(1, [x]), []

#### Example 2

Floating point numbers are considered transcendental:

    >> polylib::makerat(0.27*x)

                poly(x D1, [x, D1]), poly(1, [x, D1]), [D1 = 0.27]

#### Example 3

Radicals are replaced by elements of algebraic extensions:

    >> polylib::makerat(sqrt(2)/x)

          poly(D2, [x], Dom::AlgebraicExtension(Dom::Rational,

               2
             D2  - 2 = 0, D2)), poly(x, [x],

                                                      2
             Dom::AlgebraicExtension(Dom::Rational, D2  - 2 = 0, D2)),

                    1/2
             [D2 = 2   ]

#### Changes

- new function

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