### The Maxima on-line user's manual

Algebra Calculator

#### Ratexpand

Function: ratexpand (<expr>) -- Option variable: ratexpand Expands <expr> by multiplying out products of sums and exponentiated sums, combining fractions over a common denominator, cancelling the greatest common divisor of the numerator and denominator, then splitting the numerator (if a sum) into its respective terms divided by the denominator.

The return value of `ratexpand` is a general expression, even if <expr> is a canonical rational expression (CRE).

The switch `ratexpand` if `true` will cause CRE expressions to be fully expanded when they are converted back to general form or displayed, while if it is `false` then they will be put into a recursive form. See also `ratsimp`.

When `ratdenomdivide` is `true`, `ratexpand` expands a ratio in which the numerator is a sum into a sum of ratios, all having a common denominator. Otherwise, `ratexpand` collapses a sum of ratios into a single ratio, the numerator of which is the sum of the numerators of each ratio.

When `keepfloat` is `true`, prevents floating point numbers from being rationalized when expressions which contain them are converted to canonical rational expression (CRE) form.

Examples:

```          (%i1) ratexpand ((2*x - 3*y)^3);
3         2       2        3
(%o1)          - 27 y  + 54 x y  - 36 x  y + 8 x
(%i2) expr: (x - 1)/(x + 1)^2 + 1/(x - 1);
x - 1       1
(%o2)                   -------- + -----
2   x - 1
(x + 1)
(%i3) expand (expr);
x              1           1
(%o3)          ------------ - ------------ + -----
2              2             x - 1
x  + 2 x + 1   x  + 2 x + 1
(%i4) ratexpand (expr);
2
2 x                 2
(%o4)           --------------- + ---------------
3    2            3    2
x  + x  - x - 1   x  + x  - x - 1```

```(%o1)                                true
(%i2) ```

### Related Examples

##### ratexpand

ratexpand(x*(y*(2*z^2...

Calculate

##### ratexpand-ratsimp

p1:(1+iz)/((1+2*R*C/T...

p1, ratsimp;

p1, ratexpand;

Calculate

##### ratexpand

ratexpand(((k1*(exp(-...

Calculate

##### ratexpand

ratexpand(x*(y*(2*z^2...

Calculate

##### ratexpand

ratexpand(q11*(a-b(q1...

Calculate

##### ratexpand-sqrt

a:1/sqrt(3)+sqrt(4);

ratexpand(1/sqrt(3)+...

Calculate

##### ratexpand

ratexpand(((k1*(exp(-...

Calculate

##### ratexpand

ratexpand(q11*(a-b(q1...

Calculate

##### ratexpand

ratexpand(x*(y*(2*z^2...

Calculate

##### ratexpand

ratexpand((x-2)*(x^2+...

Calculate