I'm trying to use Wolfram Alpha to symbolically evaluate an integral, and I'm getting this:
integral A e^(-j sqrt(x^2+y^2)) cos(tan^(-1)(x, y)) dx = -(A e^(-j sqrt(x^2+y^2)))/j+constant
Since the purpose of the cos(tan^(-1)(x, y)) is to convert an otherwise directionless distance interaction into an x-vector, the result when integrated should still be sensitive to the sign of x. However, the result of the integration has rendered the sign of x meaningless.
Unfortunately I don't have a membership, so I can't see a breakdown of why exactly Wolfram Alpha thinks that this is the correct result.
Am I missing something, or have I stumbled across a bug?
Okay, it looks like the symbolic integration is perfectly fine as long as y is greater than 0, but freaks out otherwise. That explains the unexpected results when I tried to perform a numerical integration on the result. I can work with this, I just have to limit the integration range to positives and then double the result.
I've been working with matlab, so I'm used to atan2(y,x). It's easy to forget that that doesn't mix well with symbolic operations.
Bleh, that's right, odd functions (what I start with, maybe, sort of) integrate to even functions. I just need to rewrap my head around that, sorry for the waste of time.
The alternate form of cos(arctan(x,y)) was helpful to see, though.
I don't see any problem with the result.
In:= Cos[ArcTan[x, y]]
(* Out= x/Sqrt[x^2 + y^2]*)
So the result looks to be correct (do it by substitution t=x^2 + y^2, dt=2*x, so it reduces to Integrate[Exp[-j*Sqrt[t]]/Sqrt[t], t] up to multiplicative constants.
Maybe you had in mind to use Cos[ArcTan[y/x]]?