COLC: factorize a symbolic fraction (returns a symbolic).
Factorization may be incomplete, but is squarefree and all first
order factors are detected.
LNCOLC: collect logarithms, e.g.
LNCOLC returns
SOLV: tries to isolate a variable name at
stack level 1 in the symbolic expression located at level 2.
Returns the variable name at level 2
and a list of solutions at level 1. Examples:
'X^4-1' X SOLV returns { 1 -1 'i' '-i' } at level 1
(and X at level 2)
'2*SIN(X)^2-3*SIN(X)+1' X SOLV returns
{ '-(12*pi*n2+-5*pi)/6' '(12*pi*n2+pi)/6'
'-(4*pi*n2+-pi)/2' '(4*pi*n1+pi)/2' }
where n1 and n2 represent integers.
SOLV will be successful if the symbolic expression
is a polynomial of a function of the variable or a product of
polynomials. Otherwise it will fail. Hence, it may be useful to
rewrite the symbolic expression using
LNCOLC or/and COLC before calling SOLV. Example:
'LN(X-1)+LN(X+2)=2' X SOLV doesn't work
'LN(X-1)+LN(X+2)=2' LNCOLC X SOLV works
FSIGN: returns the sign of a monovariate rational fraction
as a list of signs + or - separated by roots or poles of the rational
fraction, starting from '(X^2-1)/(X^3-7*X^2+16*X-2)' FSIGN
'X': { - -1 + 1 - 2 - 3 + }
FROOTS: given an object as input, outputs the list of var (stack
level 3), the list polynomial (2), and the list of root/multiplicity (1)
(each root is followed by its multiplicity). Examples:
* 'X^3-6*X^2+11*X-6'
-> 3: { X }, 2:'X^3-6*X^2+11*X-6' , 1: { 2 1 3 1 1 1 }
* '1/X^2' -> 3: { X }, 2: '1/X^2', 1: { 0 -2 }
* 'X^2+2*X*Y+Y^2' ->
3: { X Y }, 2: 'X^2+2*X*Y+Y^2', 1: { '-Y' 2 }
For a symbolic, FROOTS factorizes with respect to the variable contained
in VX, or if the symbolic is independant of VX with respect
to the first variable of LVAR applied to the symbolic.
(For the SX version only):
If stack 1 is a real integer, FROOTS computes the roots of a
list polynomial with numeric coefficient using Bairstow method (real
coefficients) or Laguerre method (complex coefficients).
During iterations, you can modify some parameters:
E*10: (
E/10: divides the test value/10, for accurate precision
(use this after you have found all multiple roots)
RAND: reset current iteration (restart with random initial value)
STOP abort iteration (for the next one or two roots)
{ 1 -21 183 -847 2196 -3024 1728 }
1E-4
3
FROOTS
-> approximatively { 3 3 3 4 4 4 }
The result is bad since 3 and 4 are multiple roots.
FACTO: same stack as FROOTS but returns a list of
"prime" factors instead of roots. Example:
* 'X^3-6*X^2+11*X-6'
-> 3: { X }, 2: 'X^3-6*X^2+11*X-6', 1: { '(X-2)' 1 '(X-3)' 1 '(X-1)' 1 }
* 21 -> 3: { }, 2: 21, 1: { 3 1 7 1 }
FCOEF: input is a list of roots/multiplicity, output is a
fraction or polynomial with leading coefficient 1 having this roots
(and poles). Example:
{ 1 1 2 1 3 1 } -> '(X-3)*(X-2)*(X-1)'
{ A -1 2 1 } -> '(X-2)/(X-A)'