I am trying to integrate an equation that requires an angle term calculated using ArcTan[x,y]. A number of issues have been mentioned about ArcTan in some of the older questions (Link here) and I wanted the ArcTan function to give out 0 as an output when I give ArcTan[0,0] as an input.
I have defined my ArcTan function as:
myArcTan[x_,y_] := Which[x > 0 || y > 0 || x < 0 || y < 0 , ArcTan[x, y],
x == 0 && y == 0, 0];
Question1: Is myArcTan correctly defined for what I am trying to do?.
When I use myArcTan as one of the terms in the indefinite integral given below, I get a different answer than when using ArcTan. Definite integral, however, gives the same result for both the cases:
Integral1 = Integrate[myArcTan[x, y], y, x]
Integral1 /. {x -> 1, y -> 0}
Out[2]= 1/4
Integral2 = Integrate[ArcTan[x, y], y, x]
Integral2 /. {x -> 1, y -> 0}
Out[4]= 0
Integrate[myArcTan[x, y], {y, -1, 1}, {x, -1, 1}]
Out[5]= 0
Integrate[ArcTan[x, y], {y, -1, 1}, {x, -1, 1}]
Out[6]= 0
Question 2: One of the answers given in the older question (Link here) uses Arg[x + i y] but an indefinite integral using Arg does not evaluate. Only a numerical approximation using NIntegrate works on it. Why is this so?, can one do an indefinite integral using Arg?.
ArcTan[0,0]being undefined and my implementation of it (myArcTan). – dykes Apr 11 '18 at 18:40myArcTanlooks correct to me other than theArcTan[0,0]value which is undefined in Wikipedia and0by my definition. – dykes Apr 11 '18 at 23:13Piecewise[]:Piecewise[{{ArcTan[x, y], x != 0 || y != 0}}, 0]– J. M.'s missing motivation Apr 12 '18 at 13:01