What factor does to unknown functions' arguments



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 <mailto: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 list
>>     Maxima at math.utexas.edu  <mailto:Maxima at math.utexas.edu>
>>     http://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
>
>