RationalPolynomialSmallExponent
RationalPolynomialSmallExponent()
A Symbolica rational polynomial with variable powers limited to 255.
Methods
| Name | Description |
|---|---|
| apart | Compute the partial fraction decomposition in x. |
| gcd | Compute the greatest common divisor (GCD) of two rational polynomials. |
| get_var_list | Get the list of variables in the internal ordering of the polynomial. |
| parse | Parse a rational polynomial from a string. |
| to_expression | Convert the polynomial to an expression. |
| to_latex | Convert the rational polynomial into a LaTeX string. |
apart
RationalPolynomialSmallExponent.apart(x)
Compute the partial fraction decomposition in x.
Examples
>>> from symbolica import Expression
>>> x = Expression.symbol('x')
>>> p = Expression.parse('1/((x+y)*(x^2+x*y+1)(x+1))').to_rational_polynomial()
>>> for pp in p.apart(x):
>>> print(pp)gcd
RationalPolynomialSmallExponent.gcd(rhs)
Compute the greatest common divisor (GCD) of two rational polynomials.
get_var_list
RationalPolynomialSmallExponent.get_var_list()
Get the list of variables in the internal ordering of the polynomial.
parse
RationalPolynomialSmallExponent.parse(_cls, input, vars)
Parse a rational polynomial from a string. The list of all the variables must be provided.
If this requirements is too strict, use Expression.to_polynomial() instead.
Examples
>>> e = RationalPolynomialSmallExponent.parse('(3/4*x^2+y+y*4)/(1+x)', ['x', 'y'])Raises
| Type | Description |
|---|---|
| ValueError | If the input is not a valid Symbolica rational polynomial. |
to_expression
RationalPolynomialSmallExponent.to_expression()
Convert the polynomial to an expression.
Examples
>>> from symbolica import Expression
>>> e = Expression.parse('(x*y+2*x+x^2)/(x^7+y+1)')
>>> p = e.to_polynomial()
>>> print((e - p.to_expression()).expand())to_latex
RationalPolynomialSmallExponent.to_latex()
Convert the rational polynomial into a LaTeX string.