Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Rat Calculator

Rat

Function: rat (<expr>)

Function: rat (<expr>, <x_1>, ..., <x_n>) Converts <expr> to canonical rational expression (CRE) form by expanding and combining all terms over a common denominator and cancelling out the greatest common divisor of the numerator and denominator, as well as converting floating point numbers to rational numbers within a tolerance of ratepsilon. The variables are ordered according to the <x_1>, ..., <x_n>, if specified, as in ratvars.

rat does not generally simplify functions other than addition +, subtraction -, multiplication *, division /, and exponentiation to an integer power, whereas ratsimp does handle those cases. Note that atoms (numbers and variables) in CRE form are not the same as they are in the general form. For example, rat(x)- x yields rat(0) which has a different internal representation than 0.

When ratfac is true, rat yields a partially factored form for CRE. During rational operations the expression is maintained as fully factored as possible without an actual call to the factor package. This should always save space and may save some time in some computations. The numerator and denominator are still made relatively prime (e.g. rat ((x^2 - 1)^4/(x + 1)^2) yields (x - 1)^4 (x + 1)^2), but the factors within each part may not be relatively prime.

ratprint if false suppresses the printout of the message informing the user of the conversion of floating point numbers to rational numbers.

keepfloat if true prevents floating point numbers from being converted to rational numbers.

See also ratexpand and ratsimp.

     Examples:
          (%i1) ((x - 2*y)^4/(x^2 - 4*y^2)^2 + 1)*(y + a)*(2*y + x) /
                (4*y^2 + x^2);
                                                     4
                                            (x - 2 y)
                        (y + a) (2 y + x) (------------ + 1)
                                             2      2 2
                                           (x  - 4 y )
          (%o1)         ------------------------------------
                                        2    2
                                     4 y  + x
          (%i2) rat (%, y, a, x);
                                      2 a + 2 y
          (%o2)/R/                    ---------
                                       x + 2 y

There are also some inexact matches for rat. Try ?? rat to see them.

(%o1)                                true
(%i2) 

Rat Example

Related Examples

rat

eq1: (x-x1)^2+(y-y1)^...

eq2: (x-x2)^2+(y-y2)^...

eq3: rat(eq1-eq2,y,x);

Calculate

rat

ALGEBRAIC[TRUE];

teste:((x - 2*y)^4/(...

rat(teste,y,a,x);

Calculate

rat

eq1:x*2 + x;

rat(eq1);

Calculate

rat-resultant

f: x^3-(A+2)*x^2+B*x-A;

g: 2*x^2+B*x-A*(B+2*A...

r:resultant(f,g,x);

Calculate

rat

eq1: - Kiw * ((Ni-Y)*...

rat(eq1,Niw);

Calculate

rat

log2(x):=log(x)/log(2);

rat(log2(3));

Calculate

rat

n: 44;

rat((x-x^n)/(1-x)-n*x...

Calculate

rat

n: 100000;

rat((k+1)*n^k-n^(k+1)...

Calculate

rat-remainder-resultant

A:u^4+p*u^2+q*u+r;

B:v^2+b-u*(c*v^2+e);

C:v^4+k*v+m;

Calculate

rat

(x-0.5)*(2/L)*G*J/4*(...

rat(%o1);

Calculate