ratpow-pkg (Maxima 5.43.0 Manual)

Next: romberg-pkg, Previous: orthopoly-pkg, Up: Top [Contents][Index]

## 79 ratpow

The package `ratpow` provides functions that find the exponents of the denominator in a CRE polynomial. If the exponents in the denominator are needed instead `ratdenom` can be used to extract this denominator first. Returned coefficients are in CRE form except for numbers.

In order to get a list of vars in a CRE polynomial `showratvars` can be used.

For information about CREs see also `rat`, `ratdisrep` and `showratvars`.

Previous: Top, Up: Top [Contents][Index]

### 79.1 Functions and Variables for ratpow

Function: ratp_hipow (expr, x)

  Finds the highest power of the main variable in `ratnumer(expr)`

      (%i1) load("ratpow")$

      (%i2) ratp_hipow( x^(5/2) + x^2 , x);
      (%o2)                           2

      (%i3) ratp_hipow( x^(5/2) + x^2 , sqrt(x));
      (%o3)                           5

  Categories: Rational expressions Package ratpow

Function: ratp_lopow (expr, x)

  Finds the lowest power of the main variable in `ratnumer(expr)`

      (%i1) load("ratpow")$

      (%i2) ratp_lopow( x^5 + x^2 , x);
      (%o2)                           2

  The following example will return 0 since `1` equals `x^0`:

      (%i1) load("ratpow")$

      (%i2) ratp_lopow( x^5 + x^2 + 1, x);
      (%o2)                           0

  The CRE form of the following equation contains `sqrt(x)` and `x`. Since they are interpreted as independent variables `ratp_lopow` returns `0` in this case:

      (%i1) load("ratpow")$

      (%i2) g:sqrt(x)^5 + sqrt(x)^2;
                                   5/2
      (%o2)                       x    + x

      (%i3) showratvars(g);
                                    1/2
      (%o3)                       [x   , x]

      (%i4) ratp_lopow( g, x);
      (%o4)                           0

      (%i5) ratp_lopow( g, sqrt(x));
      (%o5)                           0

  Categories: Rational expressions Package ratpow

Function: ratp_coeffs (expr, x)

  Generates a list of powers and coefficients of the main variable `ratnumer(expr)`.

      (%i1) load("ratpow")$

      (%i2) ratp_coeffs( 4*x^3 + x + sqrt(x), x);
      (%o2)/R/         [[3, 4], [1, 1], [0, sqrt(x)]]

  Categories: Rational expressions Package ratpow

Function: ratp_dense_coeffs (expr, x)

  Generates a list of coefficients in `ratnumer(expr)`; returned coefficients are in CRE form except for numbers.

      (%i1) load("ratpow")$

      (%i2) ratp_dense_coeffs( 4*x^3 + x + sqrt(x), x);
      (%o2)/R/               [4, 0, 1, sqrt(x)]

  Categories: Rational expressions Package ratpow

Previous: Top, Up: Top [Contents][Index]