Atan2 doesn't symplify as expected.



With no declarations at all,  your example

atan2(2^(1/2)*omega^(1/2)+2*k,omega+2^(1/2)*k*omega^(1/2)+k^2-1)

 +atan2(-2^(1/2)*omega^(1/2)-2*k,omega+2^(1/2)*k*omega^(1/2)+k^2-1)


simplifies to zero for me in a fresh Maxima, both in Maxima
5.28.0-2/GCL/Windows and in Maxima 5.30.0/SBCL/OSX.  Adding assume(omega>0)
changes nothing.

Could you please let us know what version of Maxima you are using (as
reported by build_info() or bug_report()) and the *exact sequence of
commands* (including any declarations, global settings, etc.) you entered
which led that expression not to simplify to 0?

Otherwise all we can do is speculate.

                  -s


On Thu, Aug 1, 2013 at 4:56 PM, David Ronis <ronis at ronispc.chem.mcgill.ca>wrote:

> In maxima, if you evaluate
>
> atan2(y,x)+atan2(-y,x)
>
> you get zero as you should.  If you try something more complicated,
> like:
>
>  atan2(2^(1/2)*omega^(1/2)+2*k,omega+2^(1/2)*k*omega^(1/2)+k^2-1)
>  +atan2(-2^(1/2)*omega^(1/2)-2*k,omega+2^(1/2)*k*omega^(1/2)+k^2-1)
>
> where all variables are declared real and assumed to be positive,
>
> you don't get zero.  On the other hand, if I substitute z^2 for omega in
> the last expression, I get zero again.   It seems that maxima is having
> trouble with a possible sqrt branch issue and ignoring the assume(omega
> > 0 ).
>
> Thanks in advance.
>
> David
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>