Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: #### 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(a*b+b*c+c*d...

Calculate

##### ratexpand

p : 5*(x+1)*(x+2)*(x+...

ratexpand((p/5)/(x^3));

p2(x) := (x+1)*(x+2)*...

Calculate

##### ratexpand

ratexpand((x+1)^2);

Calculate

##### ratexpand

ratexpand ((-D*x^3+(-...

Calculate

##### ratexpand

p : 5*(x+1)*(x+2)*(x+...

ratexpand((p/5)/(x^3));

p2(x) := (x+1)*(x+2)*...

Calculate

eq1:x(1 + x);

ratexpand(eq1);

Calculate

##### ratexpand

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

Calculate

##### ratexpand

p : (x+3)*(x-6) + 20;

ratexpand(p);

Calculate

##### ratexpand

ratexpand(N=(k*s^T*z^...

Calculate

##### ratexpand

f: (x+y+z)^5;

ratexpand(f,x);

Calculate 