Simpliyfying the argument of a complex expression



On Wed, 19 Jan 2011 16:47:52 -0500, Stavros Macrakis
<macrakis at alum.mit.edu> wrote:
> Well, the principal value of carg(exp(%i*x)) is actually not x, but
> mod(x+%pi,2*%pi)-%pi.
> 
> I do wish sometimes we had a 'sloppy' mode (the opposite of pedantic
> mode), which did things like atan(tan(x)) => x -- but of course you
> have to be very careful with such things.
> 
> Ideally, assume(x>0,x<%pi/2) would allow atan2(sin(x),cos(x)) and
> atan(sin(x)/cos(x)) to simplify to x, but unfortunately Maxima's
> simplifier isn't smart enough to do that; it's not even smart enough
> to know that with those assumptions, sin(x) > 0 and cos(x) > 0.
> 
> The best I can do is something like this:
> 
> expr: carg(expr(%i*x))$
> assume(x>0,x<%pi/2)$
> trigreduce( subst(lambda([a,b],atan(a/b)),atan2,expr) );
> 
> Maybe that helps?
> 
>               -s
> 
> On Wed, Jan 19, 2011 at 04:21, Wilhelm Haager
> <wilhelm.haager at htlstp.ac.at> wrote:
>> Hi,
>>
>> Is there a possibility to cause Maxima simplyfying (or evaluating) an
>> expression like
>> "carg(exp(%i*x))" to "x" (and not just to "atan2(sin(x),cos(x))")?
>>
>> Thanks in advance,
>> Wilhelm Haager
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>

Tanks a lot, Stavros; that's exactly what I've been looking for.
It is a very interesting application of "subst";
I have not considered, that it is applicable on funcion names too.

Btw: As a technician, I am more interested in 'pragmatic' solutions
than in 
'pedantic' mathematical exactness. Furthemore, in my case of the
transfer function
of a time delay system, I think, that simplification actually IS the
correct solution
(which can exceed 2*%pi and attain arbitrarily high values).

Regards
Wilhelm Haager