Sponsored links: Algebra eBooks
 

Related

atom-evenp-subset

subset ({1, 2, 0.5, ...

subset ({1, 2, 7, 8,...

Calculate

atom-evenp-subset

subset ({1, 2, x, x +...

subset ({1, 2, 7, 10...

Calculate

atom

atom(1.1/2);

Calculate

atom

atom(3*x*(x+5));

Calculate

atom-subset

subset ({1,2,3}, atom);

Calculate

atom-evenp-subset

subset ({1, 2, x, x +...

subset ({1, 2, 7, 8,...

{1,2,3,x,x,x,6};

Calculate

atom-evenp-subset

subset ({149,193,140,...

subset ({1, 2, 7, 8,...

Calculate

atom-evenp-subset

subset ({1, 2, x, x +...

subset ({1, 2, 3, 4,...

Calculate

atom

atom(-5);

Calculate

atom

p;

atom (p);

Calculate

atom

Run Example
(%i1)_is_atom(expr):=block(	[lexpr,exprop],	lexpr: expand(expr),	if atom(lexpr)=true then (		return(false)	),	/* subscripted expression */	if subvarp(lexpr)=false then (		return(false)	),	exprop: op(lexpr),	if exprop#df_u or exprop#df_v then (		return(false)	),print(length(lexpr)),	/* 2 subscripts */	if length(lexpr)#2 then (		return(false)	),	/* first subscript is integer>
=0 */print(part(lexpr,1)),	if nonneginteger(part(lexpr,1))=false then (		return(false)	),	/* second subscript is integer>
=0 */	if nonneginteger(part(lexpr,2))=false then (		return(false)	),	return(true));
(%o1) _is_atom(expr) := block([lexpr, exprop], lexpr : expand(expr), 
if atom(lexpr) = true then return(false), 
if subvarp(lexpr) = false then return(false), exprop : op(lexpr), 
if (exprop # df_u) or (exprop # df_v) then return(false), 
print(length(lexpr)), if length(lexpr) # 2 then return(false), 
print(part(lexpr, 1)), if nonneginteger(part(lexpr, 1)) = false
 then return(false), if nonneginteger(part(lexpr, 2)) = false
 then return(false), return(true))
(%i2) _is_atom(a);
(%o2)                                false
(%i3) _is_atom(1);
(%o3)                                false
(%i4) _is_atom(sqrt(2));
(%o4)                                false
(%i5) _is_atom(1+sqrt(2));
(%o5)                                false
(%i6) _is_atom(a*b);
(%o6)                                false
(%i7) _is_atom(sin(a));
(%o7)                                false
(%i8) _is_atom(df_u);
(%o8)                                false
(%i9) _is_atom(df_v);
(%o9)                                false
(%i10) _is_atom(df_w);
(%o10)                               false
(%i11) _is_atom(df_u[1]);
(%o11)                               false
(%i12) _is_atom(df_u[1,2,3]);
(%o12)                               false
(%i13) _is_atom(df_u[1,0.5]);
(%o13)                               false
(%i14) _is_atom(df_u[-1,2]);
(%o14)                               false
(%i15) _is_atom(df_u[1,sin(1)]);
(%o15)                               false
(%i16) _is_atom(df_u[1,2]);
(%o16)                               false
(%i17) _is_atom(df_v[1,2]);
(%o17)                               false
(%i18) 
Run Example
1/(a*b), simp:true;
                                       1
(%o1)                                 ---
                                      a b
(%i2) 1/(a*b), simp:false;
                                       1
(%o2)                                 ---
                                      a b
(%i3) matchdeclare(a, atom);
(%o3)                                done
(%i4) matchdeclare(b, atom);
(%o4)                                done
(%i5) tellsimp(1/(a*b), simp:false, ((1/a)*(1/b)));
tellsimp: warning: putting rules on '+' or '*' is inefficient, and may not work.
(%o5)                         [*rule1, simptimes]
(%i6) tellsimpafter(1/(a*b), simp:false, ((1/a)*(1/b)));
(%o6)                     [*rule2, *rule1, simptimes]
(%i7) defrule(fraction, 1/(a*b),((1/a)*(1/b))), simp:false;
                                        1
(%o7)                       fraction : --- -> false
                                       a b
(%i8) 1/(a*b), simp:false;
                                       1
(%o8)                                 ---
                                      a b
(%i9) maxapplydepth:1;
(%o9)                                  1
(%i10) newfac;
(%o10)                              newfac
(%i11) fraction(1/(a*b));
                                    1   1
(%o11)                              - (---)
                                    1  a b
(%i12) factor(1/(a*b)), simp:false;
                                       1
(%o12)                                ---
                                      a b
(%i13) ratexpand:false;
(%o13)                               false
(%i14) expandwrt_denom:true;
(%o14)                               true
(%i15) 1/(a*b), fraction;
                                       1
(%o15)                                ---
                                      a b
(%i16) 
Run Example
subset ({1,2,3,4,5}, atom);
(%o1)                           {1, 2, 3, 4, 5}
(%i2)  subset ({4,5,6}, evenp);
(%o2)                               {4, 6}
(%i3) 

Related Help

Help for Atom