What factor does to unknown functions' arguments



It seems arbitrary that factor( f ( <expr> ) ) = factor( f( ratsimp(<expr>)
) ) , ratfac:true rather than either f(<expr>) or f(factor(<expr>)).

Why are you happier with factor(f ((x^2-1)/(x-1)) =>  f(x+1) ?  Most other
functions don't perform simplifications like this if they can't do anything
useful with f.  Compare rat, limit, partfrac, etc. etc.

            -s

On Thu, Aug 25, 2011 at 16:06, Richard Fateman <fateman at eecs.berkeley.edu>wrote:

>  On 8/25/2011 12:48 PM, Stavros Macrakis wrote:
>
> It ratsimps the argument then tries to factor.  If it fails to factor, it
> just returns the ratsimped version. Consider (x-1)/(x-1).  You factor it and
> get 1.
>
>  My example shows that this is not true.  factor( f(x-1/x) ) => f(
> (x^2-1)/x) and not f((x-1)*(x+1)/x).  It just sratsimp's with ratfac=T.  As
> for (x-1)/(x-1), the general simplifier simplifies that to 1.
>
>
> ok, try factor(f ((x^2-1)/(x-1));
>
> I am happier with f(x+1)  than leaving it untouched.
>
> or factor (    f(x^2-1)/(x-1))  *f(x+1)   ) ??
>
> There are lots of other things that you could return from factor.  e.g.
> factor(x^2+1) ->  (x-%i)*(x+%i)     as is done by gfactor.  But there are
> lots of algebraic extensions.
>
> as well as other transformations that one could guess at from context..
> e.g. trig..
>
> cos(2*x)^2
> trigreduce(%);
>
> factor(%) ???
>
>
>
> By the way, this is more general than just unknown functions as I said in
> my original mail.  Same thing happens with log or for that matter the
> exponent in mexpt, e.g. factor(2^(x^2-1)) => 2^(x^2-1), not 2^((x-1)*(x+1)).
>
>
>             -s
>
> On Thu, Aug 25, 2011 at 15:38, Richard Fateman <fateman at eecs.berkeley.edu>wrote:
>
>>   On 8/25/2011 11:55 AM, Stavros Macrakis wrote:
>>
>>  factor( f(x-1/x) ) => f( (x^2-1)/x)
>>
>>  That is, factor calls sratsimp (with ratfac=T) on the arguments of
>> unknown functions, even though it doesn't actually factor them.
>>
>>  This seems peculiar.  Either it should map over all the arguments of f,
>> giving f((x-1)*(x+1)/x), or it should leave them completely untouched,
>> returning f(x-1/x).
>>
>>  Is there any disagreement about this?
>>
>>               -s
>>
>>
>>  _______________________________________________
>> Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima
>>
>>  It ratsimps the argument then tries to factor.  If it fails to factor,
>> it just returns the ratsimped version.
>> Consider (x-1)/(x-1).  You factor it and get 1.
>>
>> That's my guess.
>> RJF
>>
>>
>
>