For some reason Mathematica does not properly simplify this expression:
In[7]:= FullSimplify[ArcTan[-Re[x + z], y], (x | y | z) \[Element] Reals]
Out[7]= ArcTan[-Re[x + z], y]
Obviously, if x and z are real, then so is x+z, so Re[x + z] should be replaced by x + z.
Strangely enough, dropping any small part of the input fixes the problem, here are some examples.
No minus sign:
In[8]:= FullSimplify[ ArcTan[Re[x + z], y], (x | y | z) \[Element] Reals]
Out[8]= ArcTan[x + z, y]
No z:
In[9]:= FullSimplify[ArcTan[-Re[x], y], (x | y | z) \[Element] Reals]
Out[9]= ArcTan[-x, y]
No y:
In[10]:= FullSimplify[ArcTan[-Re[x + z]], (x | y | z) \[Element] Reals]
Out[10]= -ArcTan[x + z]
Of course I can just drop the Re function manually, but this is just a small fragment of the actual expression I'm trying to simplify, and I would like to avoid going though the whole expression looking for this specific pattern.
Anyone knows how to fix this? Is this a bug or what? (I'm using version 8.0.4.0)
FullSimplify[{-Re[x + z], 0}, (x|z) \[Element] Reals]. – celtschk Apr 11 '12 at 14:27Simplify[Re[x + z], Assumptions -> {x \[Element] Reals, y \[Element] Reals, z \[Element] Reals}]does give x+z so it has to do with ArcTan – b.gates.you.know.what Apr 11 '12 at 14:27ComplexExpanddoesn't drop it either. – Szabolcs Apr 11 '12 at 14:37ArcTanis redundant – Joe Apr 11 '12 at 14:44ArcTan, which takes into account which quadrant the point (x+z,y) is in. – Joe Apr 11 '12 at 14:47ArcTanand yet is not simplified. This clearly shows that the problem is not specifically withArcTanbut with any expression with two (and probably also more) arguments. It doesn't matter if the head of the expression isArcTan,forList. As soon as there are two arguments,-Re[x+z]is no longer simplified (also note that I completely removedyin my example). – celtschk Apr 11 '12 at 14:54FullSimplify[{-Re[x + z], 0}, x \[Element] Reals && z \[Element] Reals]and it doesn't get simplified either. To achieve maximal separation of assumptions, I even triedAssuming[x \[Element] Reals,Assuming[z \[Element] Reals,FullSimplify[{-Re[x + z], 0}]]], again no simplification happens. – celtschk Apr 11 '12 at 15:10ArcTanproblem arises due to the possibility of an indeterminate answer:Re[x/z]won't simplify further, either. Regardless, it is instructive to examine lots of simple cases at once, as inClearAll[x, y, z]; FullSimplify[#, (x | z) \[Element] Reals ] & /@ { Re[x + z], - Re[x + z], -y Re[x + z], -Re[x - z], -Re[x z], Re[x / z], -Re[ x z^2], Re[ ArcTan[x, z]], -Re[-Max[x, z]], -Re[Exp[x + z]], -Re[ Log[Exp[x + z]]], -Re[Exp[x]/Exp[z]]}– whuber Apr 11 '12 at 19:03ArcTanproblem at all. If you setArcTan[-1.0 Re[x + z], y]instead ofArcTan[- Re[x + z], y]it works fine. See my answer for a more throughout discussion. – Artes Apr 11 '12 at 19:23ArcTaneven in the absence of any multiplications by -1. Incidentally,ArcTan[-1.0 Re[x + z], y]does not correctly simplify for me: I'm still running version 8.0.0.0. Maybe we're witnessing some version differences? – whuber Apr 11 '12 at 22:278.0.4but I checked the results as well as in ver.7.0.1and haven't detected any problems withArcTan. – Artes Apr 11 '12 at 22:34