### Related

##### args-length-listofvars-makelist-print-ratexpand

/* check denominator ...

alist: args(expr);

alistlen: length(alist);

Calculate

##### args-determinant-divide-expand-ident-matrix-mod-solve-transpose-triangularize

A: matrix([5,0,0,0],[...

B:determinant(A-t*ide...

C:expand(B);

Calculate

##### args-powerdisp-true

powerdisp:true;

"*"/* Die Koeffizient...

A: matrix( [4,1,1,1],...

Calculate

##### args-asin-atan2-block-cos-flatten-float-ident-length-make_random_state-makelist-matrix-set_random_state-sin-sqrt-subst-transpose

Rx(t) := matrix ([1, ...

Ry(t) := matrix ([cos...

Rz(t) := matrix ([cos...

Calculate

s2 : read_matrix (fi...

Calculate

##### args

u:(6*x+7)/(9*x+2);

args(u);

Calculate

##### args-divisors

s : divisors (12);

l : args (s);

l[5];

Calculate

##### args-cos-determinant-diff-ev-flatten-float-matrix-sin-sqrt-transpose

Rx(t) := matrix ([1, ...

Ry(t) := matrix ([cos...

Rz(t) := matrix ([cos...

Calculate

##### args-matrix-plot2d-substpart

sq:[[1,0],[2,0],[2,2]...

sq1:[[1,2,2,1,1],[0,0...

rm:matrix([.707,-.707...

Calculate

##### args-genmatrix-kill-powerdisp-transpose-true

""/* INNERBETRIEBLICH...

kill(all);

powerdisp:true;

Calculate

### args

Run Example
(%i1)rreduce (f, [1, 2, 3]);
(%o1)                            f(1, f(2, 3))
(%i2)  rreduce (f, [1, 2, 3, 4]);
(%o2)                         f(1, f(2, f(3, 4)))
(%i3)  rreduce (f, [1, 2, 3], 4);
(%o3)                         f(1, f(2, f(3, 4)))
(%i4)  rreduce ("^", args ({a, b, c, d}));
d
c
b
(%o4)                                a
(%i5)  rreduce ("/", args ({a, b, c, d}));
a c
(%o5)                                 ---
b d
(%i6)
Run Example
factorC(_f,_z):=block([s,n,m,fp,j],fp:1,/* This commented code was meant to use themore robust solver to_poly_solve, but I couldn't understand how to handle multiplicitiesss:args(to_poly_solve(_f,_z)),s:create_list(ss[k][1],k,1,length(ss)),*/s:solve(_f,_z),m:multiplicities,n:length(s),for j:1 thru n do  if lhs(s[j])#0  then fp:fp*(_z-(rhs(s[j])))^m[j], fp:fp*divide(_f,fp)[1],fp);
(%o1) factorC(_f, _z) := block([s, n, m, fp, j], fp : 1, s : solve(_f, _z),
m : multiplicities, n : length(s), for j thru n
m
j
do if lhs(s ) # 0 then fp : fp (_z - rhs(s ))  , fp : fp divide(_f, fp) , fp)
j                              j                            1
(%i2) partfracC(_f,_z):=block([d,fd],d:denom(_f),fd:factorC(d,_z),partfrac(1/fd,_z));
(%o2) partfracC(_f, _z) := block([d, fd], d : denom(_f), fd : factorC(d, _z),
1
partfrac(--, _z))
fd
(%i3) O:partfracC(1/(x^5-1)^4,x);
4 %i %pi           2 %i %pi             2 %i %pi
--------           --------           - --------
5                  5                    5
(%o3) (41992 %e         + 42160 %e         + 42076 %e
4 %i %pi                  4 %i %pi         2 %i %pi            4 %i %pi            4 %i %pi
- --------                  --------         --------          - --------            --------
5                         5                5                   5                   5
+ 41824 %e           + 42328)/((625 %e         - 625 %e         + 1875 %e           - 1875) (%e         x
- 1))
4 %i %pi          2 %i %pi            2 %i %pi            4 %i %pi
--------          --------          - --------          - --------
5                 5                   5                   5
+ (1082 %e         + 1018 %e         + 1114 %e           + 1114 %e
2 %i %pi           2 %i %pi           4 %i %pi
--------         - --------         - --------
5                  5                  5
+ 1082)/((- 1250 %e         + 625 %e           + 625 %e          )
4 %i %pi
--------
5           2
(%e         x - 1) )
4 %i %pi        2 %i %pi          2 %i %pi          4 %i %pi
--------        --------        - --------        - --------
5               5                 5                 5
28 %e         + 20 %e         + 12 %e           + 20 %e           + 20
+ ----------------------------------------------------------------------
2 %i %pi         4 %i %pi     4 %i %pi
- --------         --------     --------
5                5            5           3
(625 %e           - 625 %e        ) (%e         x - 1)
4 %i %pi         2 %i %pi           2 %i %pi           4 %i %pi
--------         --------         - --------         - --------
5                5                  5                  5
+ 1/((- 125 %e         - 125 %e         - 125 %e           - 125 %e
4 %i %pi                      4 %i %pi          2 %i %pi
--------                      --------          --------
5           4                 5                 5
+ 500) (%e         x - 1) ) - (- 1544 %e         - 1880 %e
2 %i %pi           4 %i %pi
- --------         - --------
5                  5
- 32 %e           - 368 %e           - 956)
4 %i %pi          2 %i %pi            2 %i %pi            4 %i %pi     2 %i %pi
--------          --------          - --------          - --------     --------
5                 5                   5                   5            5
/((- 4375 %e         - 6875 %e         + 6875 %e           + 4375 %e          ) (%e         x - 1))
4 %i %pi         2 %i %pi          2 %i %pi          4 %i %pi
--------         --------        - --------        - --------
5                5                 5                 5
+ (42 %e         + 170 %e         + 42 %e           - 54 %e           + 170)
4 %i %pi          2 %i %pi           2 %i %pi            4 %i %pi
--------          --------         - --------          - --------
5                 5                  5                   5
/((- 625 %e         + 1875 %e         - 625 %e           - 2500 %e           + 1875)
2 %i %pi
--------
5           2
(%e         x - 1) )
4 %i %pi       2 %i %pi          2 %i %pi         4 %i %pi
--------       --------        - --------       - --------
5              5                 5                5
- (4 %e         - 4 %e         - 12 %e           + 4 %e           - 12)
4 %i %pi           2 %i %pi           4 %i %pi           2 %i %pi
--------         - --------         - --------           --------
5                  5                  5                  5           3
/((625 %e         - 625 %e           + 625 %e           - 625) (%e         x - 1) )
2 %i %pi           4 %i %pi         2 %i %pi           2 %i %pi           4 %i %pi
- --------           --------         --------         - --------         - --------
5                  5                5                  5                  5
+ %e          /((- 125 %e         - 125 %e         + 500 %e           - 125 %e
2 %i %pi
--------
5           4
- 125) (%e         x - 1) )
4 %i %pi           2 %i %pi             2 %i %pi
--------           --------           - --------
5                  5                    5
- (41824 %e         + 42076 %e         + 42160 %e
4 %i %pi                  4 %i %pi         2 %i %pi            4 %i %pi
- --------                  --------         --------          - --------
5                         5                5                   5
+ 41992 %e           + 42328)/((625 %e         - 625 %e         + 1875 %e           - 1875) (x
4 %i %pi
--------
5
- %e        ))
4 %i %pi          2 %i %pi            2 %i %pi            4 %i %pi
--------          --------          - --------          - --------
5                 5                   5                   5
+ (1114 %e         + 1082 %e         + 1082 %e           + 1114 %e
2 %i %pi           2 %i %pi           4 %i %pi
--------         - --------         - --------
5                  5                  5
+ 1018)/((- 1250 %e         + 625 %e           + 625 %e          )
4 %i %pi
--------
5     2
(x - %e        ) )
4 %i %pi        2 %i %pi          2 %i %pi          4 %i %pi
--------        --------        - --------        - --------
5               5                 5                 5
20 %e         + 20 %e         + 20 %e           + 12 %e           + 28
- ----------------------------------------------------------------------
2 %i %pi         4 %i %pi         4 %i %pi
- --------         --------         --------
5                5                5     3
(625 %e           - 625 %e        ) (x - %e        )
4 %i %pi           4 %i %pi         2 %i %pi           2 %i %pi           4 %i %pi
- --------           --------         --------         - --------         - --------
5                  5                5                  5                  5
+ %e          /((- 125 %e         - 125 %e         - 125 %e           - 125 %e
4 %i %pi
--------
5     4
+ 500) (x - %e        ) )
4 %i %pi         2 %i %pi            2 %i %pi           4 %i %pi
--------         --------          - --------         - --------
5                5                   5                  5
- (32 %e         + 956 %e         + 1544 %e           + 368 %e
4 %i %pi          2 %i %pi            2 %i %pi            4 %i %pi
--------          --------          - --------          - --------
5                 5                   5                   5
+ 1880)/((- 4375 %e         - 6875 %e         + 6875 %e           + 4375 %e          ) (x
2 %i %pi
--------
5
- %e        ))
4 %i %pi        2 %i %pi          2 %i %pi           4 %i %pi
--------        --------        - --------         - --------
5               5                 5                  5
+ (170 %e         + 42 %e         + 42 %e           + 170 %e           - 54)
4 %i %pi          2 %i %pi           2 %i %pi            4 %i %pi
--------          --------         - --------          - --------
5                 5                  5                   5
/((- 625 %e         + 1875 %e         - 625 %e           - 2500 %e           + 1875)
2 %i %pi
--------
5     2
(x - %e        ) )
4 %i %pi        2 %i %pi         2 %i %pi         4 %i %pi
--------        --------       - --------       - --------
5               5                5                5
- (- 4 %e         + 12 %e         + 4 %e           - 4 %e           + 12)
4 %i %pi           2 %i %pi           4 %i %pi               2 %i %pi
--------         - --------         - --------               --------
5                  5                  5                      5     3
/((625 %e         - 625 %e           + 625 %e           - 625) (x - %e        ) )
4 %i %pi           4 %i %pi         2 %i %pi           2 %i %pi           4 %i %pi
- --------           --------         --------         - --------         - --------
5                  5                5                  5                  5
+ %e          /((- 125 %e         - 125 %e         + 500 %e           - 125 %e
2 %i %pi
--------
5     4
- 125) (x - %e        ) )
4 %i %pi         2 %i %pi           2 %i %pi          4 %i %pi
--------         --------         - --------        - --------
5                5                  5                 5
120 %e         + 120 %e         - 132 %e           + 36 %e           + 36
- -------------------------------------------------------------------------
4 %i %pi         2 %i %pi            2 %i %pi
--------         --------          - --------
5                5                   5
(625 %e         + 625 %e         - 1250 %e          ) (x - 1)
4 %i %pi        2 %i %pi          2 %i %pi         4 %i %pi
--------        --------        - --------       - --------
5               5                 5                5
36 %e         + 36 %e         - 60 %e           + 4 %e           + 4
+ --------------------------------------------------------------------
4 %i %pi         2 %i %pi            2 %i %pi
--------         --------          - --------
5                5                   5             2
(625 %e         + 625 %e         - 1250 %e          ) (x - 1)
4 %i %pi          4 %i %pi         2 %i %pi           2 %i %pi           4 %i %pi
--------          --------         --------         - --------         - --------
5                 5                5                  5                  5
- (8 %e        )/((500 %e         - 125 %e         - 125 %e           - 125 %e
4 %i %pi
--------
3         5
- 125) (x - 1) ) + %e
4 %i %pi         2 %i %pi           2 %i %pi           4 %i %pi
--------         --------         - --------         - --------
5                5                  5                  5
/((500 %e         - 125 %e         - 125 %e           - 125 %e           - 125)
4
(x - 1) )
(%i4) tex(O);
$${{41992\,e^{{{4\,i\,\pi}\over{5}}}+42160\,e^{{{2\,i\,\pi}\over{5}}} +42076\,e^ {- {{2\,i\,\pi}\over{5}} }+41824\,e^ {- {{4\,i\,\pi }\over{5}} }+42328}\over{\left(625\,e^{{{4\,i\,\pi}\over{5}}}-625\,e ^{{{2\,i\,\pi}\over{5}}}+1875\,e^ {- {{4\,i\,\pi}\over{5}} }-1875 \right)\,\left(e^{{{4\,i\,\pi}\over{5}}}\,x-1\right)}}+{{1082\,e^{{{ 4\,i\,\pi}\over{5}}}+1018\,e^{{{2\,i\,\pi}\over{5}}}+1114\,e^ {- {{2 \,i\,\pi}\over{5}} }+1114\,e^ {- {{4\,i\,\pi}\over{5}} }+1082}\over{ \left(-1250\,e^{{{2\,i\,\pi}\over{5}}}+625\,e^ {- {{2\,i\,\pi}\over{ 5}} }+625\,e^ {- {{4\,i\,\pi}\over{5}} }\right)\,\left(e^{{{4\,i\, \pi}\over{5}}}\,x-1\right)^2}}+{{28\,e^{{{4\,i\,\pi}\over{5}}}+20\,e ^{{{2\,i\,\pi}\over{5}}}+12\,e^ {- {{2\,i\,\pi}\over{5}} }+20\,e ^ {- {{4\,i\,\pi}\over{5}} }+20}\over{\left(625\,e^ {- {{2\,i\,\pi }\over{5}} }-625\,e^{{{4\,i\,\pi}\over{5}}}\right)\,\left(e^{{{4\,i \,\pi}\over{5}}}\,x-1\right)^3}}+{{1}\over{\left(-125\,e^{{{4\,i\, \pi}\over{5}}}-125\,e^{{{2\,i\,\pi}\over{5}}}-125\,e^ {- {{2\,i\,\pi }\over{5}} }-125\,e^ {- {{4\,i\,\pi}\over{5}} }+500\right)\,\left(e ^{{{4\,i\,\pi}\over{5}}}\,x-1\right)^4}}-{{-1544\,e^{{{4\,i\,\pi }\over{5}}}-1880\,e^{{{2\,i\,\pi}\over{5}}}-32\,e^ {- {{2\,i\,\pi }\over{5}} }-368\,e^ {- {{4\,i\,\pi}\over{5}} }-956}\over{\left(- 4375\,e^{{{4\,i\,\pi}\over{5}}}-6875\,e^{{{2\,i\,\pi}\over{5}}}+6875 \,e^ {- {{2\,i\,\pi}\over{5}} }+4375\,e^ {- {{4\,i\,\pi}\over{5}} } \right)\,\left(e^{{{2\,i\,\pi}\over{5}}}\,x-1\right)}}+{{42\,e^{{{4 \,i\,\pi}\over{5}}}+170\,e^{{{2\,i\,\pi}\over{5}}}+42\,e^ {- {{2\,i \,\pi}\over{5}} }-54\,e^ {- {{4\,i\,\pi}\over{5}} }+170}\over{\left( -625\,e^{{{4\,i\,\pi}\over{5}}}+1875\,e^{{{2\,i\,\pi}\over{5}}}-625 \,e^ {- {{2\,i\,\pi}\over{5}} }-2500\,e^ {- {{4\,i\,\pi}\over{5}} }+ 1875\right)\,\left(e^{{{2\,i\,\pi}\over{5}}}\,x-1\right)^2}}-{{4\,e ^{{{4\,i\,\pi}\over{5}}}-4\,e^{{{2\,i\,\pi}\over{5}}}-12\,e^ {- {{2 \,i\,\pi}\over{5}} }+4\,e^ {- {{4\,i\,\pi}\over{5}} }-12}\over{ \left(625\,e^{{{4\,i\,\pi}\over{5}}}-625\,e^ {- {{2\,i\,\pi}\over{5 }} }+625\,e^ {- {{4\,i\,\pi}\over{5}} }-625\right)\,\left(e^{{{2\,i \,\pi}\over{5}}}\,x-1\right)^3}}+{{e^ {- {{2\,i\,\pi}\over{5}} } }\over{\left(-125\,e^{{{4\,i\,\pi}\over{5}}}-125\,e^{{{2\,i\,\pi }\over{5}}}+500\,e^ {- {{2\,i\,\pi}\over{5}} }-125\,e^ {- {{4\,i\, \pi}\over{5}} }-125\right)\,\left(e^{{{2\,i\,\pi}\over{5}}}\,x-1 \right)^4}}-{{41824\,e^{{{4\,i\,\pi}\over{5}}}+42076\,e^{{{2\,i\,\pi }\over{5}}}+42160\,e^ {- {{2\,i\,\pi}\over{5}} }+41992\,e^ {- {{4\,i \,\pi}\over{5}} }+42328}\over{\left(625\,e^{{{4\,i\,\pi}\over{5}}}- 625\,e^{{{2\,i\,\pi}\over{5}}}+1875\,e^ {- {{4\,i\,\pi}\over{5}} }- 1875\right)\,\left(x-e^{{{4\,i\,\pi}\over{5}}}\right)}}+{{1114\,e^{ {{4\,i\,\pi}\over{5}}}+1082\,e^{{{2\,i\,\pi}\over{5}}}+1082\,e^ {- {{2\,i\,\pi}\over{5}} }+1114\,e^ {- {{4\,i\,\pi}\over{5}} }+1018 }\over{\left(-1250\,e^{{{2\,i\,\pi}\over{5}}}+625\,e^ {- {{2\,i\,\pi }\over{5}} }+625\,e^ {- {{4\,i\,\pi}\over{5}} }\right)\,\left(x-e^{ {{4\,i\,\pi}\over{5}}}\right)^2}}-{{20\,e^{{{4\,i\,\pi}\over{5}}}+20 \,e^{{{2\,i\,\pi}\over{5}}}+20\,e^ {- {{2\,i\,\pi}\over{5}} }+12\,e ^ {- {{4\,i\,\pi}\over{5}} }+28}\over{\left(625\,e^ {- {{2\,i\,\pi }\over{5}} }-625\,e^{{{4\,i\,\pi}\over{5}}}\right)\,\left(x-e^{{{4\, i\,\pi}\over{5}}}\right)^3}}+{{e^ {- {{4\,i\,\pi}\over{5}} }}\over{ \left(-125\,e^{{{4\,i\,\pi}\over{5}}}-125\,e^{{{2\,i\,\pi}\over{5}}} -125\,e^ {- {{2\,i\,\pi}\over{5}} }-125\,e^ {- {{4\,i\,\pi}\over{5}} }+500\right)\,\left(x-e^{{{4\,i\,\pi}\over{5}}}\right)^4}}-{{32\,e ^{{{4\,i\,\pi}\over{5}}}+956\,e^{{{2\,i\,\pi}\over{5}}}+1544\,e^ {- {{2\,i\,\pi}\over{5}} }+368\,e^ {- {{4\,i\,\pi}\over{5}} }+1880 }\over{\left(-4375\,e^{{{4\,i\,\pi}\over{5}}}-6875\,e^{{{2\,i\,\pi }\over{5}}}+6875\,e^ {- {{2\,i\,\pi}\over{5}} }+4375\,e^ {- {{4\,i\, \pi}\over{5}} }\right)\,\left(x-e^{{{2\,i\,\pi}\over{5}}}\right)}}+ {{170\,e^{{{4\,i\,\pi}\over{5}}}+42\,e^{{{2\,i\,\pi}\over{5}}}+42\,e ^ {- {{2\,i\,\pi}\over{5}} }+170\,e^ {- {{4\,i\,\pi}\over{5}} }-54 }\over{\left(-625\,e^{{{4\,i\,\pi}\over{5}}}+1875\,e^{{{2\,i\,\pi }\over{5}}}-625\,e^ {- {{2\,i\,\pi}\over{5}} }-2500\,e^ {- {{4\,i\, \pi}\over{5}} }+1875\right)\,\left(x-e^{{{2\,i\,\pi}\over{5}}} \right)^2}}-{{-4\,e^{{{4\,i\,\pi}\over{5}}}+12\,e^{{{2\,i\,\pi }\over{5}}}+4\,e^ {- {{2\,i\,\pi}\over{5}} }-4\,e^ {- {{4\,i\,\pi }\over{5}} }+12}\over{\left(625\,e^{{{4\,i\,\pi}\over{5}}}-625\,e ^ {- {{2\,i\,\pi}\over{5}} }+625\,e^ {- {{4\,i\,\pi}\over{5}} }-625 \right)\,\left(x-e^{{{2\,i\,\pi}\over{5}}}\right)^3}}+{{e^ {- {{4\,i \,\pi}\over{5}} }}\over{\left(-125\,e^{{{4\,i\,\pi}\over{5}}}-125\,e ^{{{2\,i\,\pi}\over{5}}}+500\,e^ {- {{2\,i\,\pi}\over{5}} }-125\,e ^ {- {{4\,i\,\pi}\over{5}} }-125\right)\,\left(x-e^{{{2\,i\,\pi }\over{5}}}\right)^4}}-{{120\,e^{{{4\,i\,\pi}\over{5}}}+120\,e^{{{2 \,i\,\pi}\over{5}}}-132\,e^ {- {{2\,i\,\pi}\over{5}} }+36\,e^ {- {{4 \,i\,\pi}\over{5}} }+36}\over{\left(625\,e^{{{4\,i\,\pi}\over{5}}}+ 625\,e^{{{2\,i\,\pi}\over{5}}}-1250\,e^ {- {{2\,i\,\pi}\over{5}} } \right)\,\left(x-1\right)}}+{{36\,e^{{{4\,i\,\pi}\over{5}}}+36\,e^{ {{2\,i\,\pi}\over{5}}}-60\,e^ {- {{2\,i\,\pi}\over{5}} }+4\,e^ {- {{ 4\,i\,\pi}\over{5}} }+4}\over{\left(625\,e^{{{4\,i\,\pi}\over{5}}}+ 625\,e^{{{2\,i\,\pi}\over{5}}}-1250\,e^ {- {{2\,i\,\pi}\over{5}} } \right)\,\left(x-1\right)^2}}-{{8\,e^{{{4\,i\,\pi}\over{5}}}}\over{ \left(500\,e^{{{4\,i\,\pi}\over{5}}}-125\,e^{{{2\,i\,\pi}\over{5}}}- 125\,e^ {- {{2\,i\,\pi}\over{5}} }-125\,e^ {- {{4\,i\,\pi}\over{5}} }-125\right)\,\left(x-1\right)^3}}+{{e^{{{4\,i\,\pi}\over{5}}} }\over{\left(500\,e^{{{4\,i\,\pi}\over{5}}}-125\,e^{{{2\,i\,\pi }\over{5}}}-125\,e^ {- {{2\,i\,\pi}\over{5}} }-125\,e^ {- {{4\,i\, \pi}\over{5}} }-125\right)\,\left(x-1\right)^4}}$$
(%o4)                                false
(%i5)
Run Example
_split_args(pe_expr):=block(	if mapatom(pe_expr)=true then return(["atom",[pe_expr]]),	return([op(pe_expr),args(pe_expr)]));
(%o1) _split_args(pe_expr) := block(if mapatom(pe_expr) = true
then return(["atom", [pe_expr]]), return([op(pe_expr), args(pe_expr)]))
(%i2) _split_args(%pi);
(%o2)                            [atom, [%pi]]
(%i3) _split_args(a*x);
(%o3)                             [*, [a, x]]
(%i4) _split_args(a+x);
(%o4)                             [+, [x, a]]
(%i5) _split_args(fct(x));
(%o5)                             [fct, [x]]
(%i6) _split_args(x!);
(%o6)                              [!, [x]]
(%i7) _split_args(x!!);
x
(%o7)                        [genfact, [x, -, 2]]
2
(%i8) _split_args(x^(1/2));
(%o8)                             [sqrt, [x]]
(%i9) _split_args(x^a);
(%o9)                             [^, [x, a]]
(%i10) _split_args(1/x);
(%o10)                            [/, [1, x]]
(%i11) _split_args(1/x^a);
a
(%o11)                           [/, [1, x ]]
(%i12) _split_args(-x);
(%o12)                             [-, [x]]
(%i13) _split_args([x,a]);
(%o13)                            [[, [x, a]]
(%i14) _split_args({x,a});
(%o14)                           [set, [a, x]]
(%i15)

Help for Args