# Integral depends on choice of symbols

I am trying to perform integrals of the kind $\int dx\frac{x^2-q^2}{z-x+i\eta}$. Mathematica, however, gives back different results whenever I replace the parameter $z$ by $w$, for instance, as follows

Integrate[$\frac{x^2-q^2}{z-x+i \eta}$,$x$]//FullSimplify=$-\frac{1}{2}(x-z-i\eta)(x+3z+3i\eta)+(q^2-(z+i\eta)^2)\log{\left(-x+z+i\eta\right)}$ and

Integrate[$\frac{x^2-q^2}{w-x+i \eta}$,$x$]//FullSimplify=$\frac{1}{2}\left(-x\left(2w+x+2i\eta\right)+\left(q-w-i\eta\right)\left(q+w+i\eta\right)\left(2i\arctan{\left(\frac{\eta}{w-x}\right)}+\log{\left(\left(w-x\right)^2+\eta^2\right)}\right)\right)$

The results do not only have a different form, but taking the limit $\eta\rightarrow0$ after performing the integral yields different results. Note that the only difference between the integrals is the name of the parameter $z$. Can anyone tell me what's going on here and what the correct result would be. Thanks!

(Code)

Integrate[(x^2 - q^2)/(z - x + I η), x] // FullSimplify


-(1/2) (x - z - I η) (x + 3 z + 3 I η) + (q^2 - (z + I η)^2) Log[-x + z + I η]

Integrate[(x^2 - q^2)/(w - x + I η), x] // FullSimplify


1/2 (-x (2 w + x + 2 I η) + (q - w - I η) (q + w + I η) (2 I ArcTan[η/(w - x)] + Log[(w - x)^2 + η^2]))

• Is not it diverging in any case? – yarchik Aug 17 '16 at 17:10
• I was not able to reproduce your error. It's hard to tell what might be wrong since your code isn't inserted as valid Mathematica code. My suspicion is that you omitted the space between i and n in the denominator of the first form. – nben Aug 17 '16 at 17:11
• The imaginary part is added the the denominator so that it would not diverge. To make sure this doesn't happen, I also used the assumptions the all parameters are reals and positive(whereas the latter doesn't matter). – Richard van Dongen Aug 17 '16 at 17:21
• Hehe, my bad. First post on this site. I suppose you want to see the code like this: Integrate[(x^2 - q^2)/(z - x + I [Eta]), x] and Integrate[(x^2 - q^2)/(w - x + I [Eta]), x]. The space isn't omitted in any case. I just copy pasted the expression and changed the $z$ into a $w$. – Richard van Dongen Aug 17 '16 at 17:23
• @RichardvanDongen No problem! I've submitted an edit to your post (that should appear pending peer review) that demonstrates how to your insert code into a question like this – nben Aug 17 '16 at 18:08

\$Version

(*  "11.0.0 for Mac OS X x86 (64-bit) (July 28, 2016)"  *)

expr = (x^2 - q^2)/(z - x + I η);

i1 = Integrate [expr, x] // FullSimplify

(*  -(1/2) (x - z - I η) (x + 3 z +
3 I η) + (q^2 - (z + I η)^2) Log[-x + z + I η]  *)


Change of z to w

i2 = Integrate [expr /. z -> w, x] // FullSimplify

(*  1/2 (-x (2 w + x + 2 I η) + (q - w - I η) (q + w +
I η) (2 I ArcTan[η/(w - x)] + Log[(w - x)^2 + η^2]))  *)


Indefinite integrals can differ by an arbitrary (complex) constant of integration. The canonical order of the variables involved can affect the choice of this arbitrary constant. However, differentiation of either result returns the original expression.

expr == D[i1, x] == (D[i2, x] /. w -> z) // Simplify

(*  True  *)

• It is interesting (and unexpected, as far as I am concerned) that the results depends on the name of the variable whch fall into two classes Class 1: names starting with a..w. class 2: names starting with x,y,z (and also with greek letters). Class 1 gives ArcTan and Log, class 2 gives just Log. This seems to hold also for capital letters. – Dr. Wolfgang Hintze Aug 17 '16 at 22:35
• @Dr.WolfgangHintze - I don't understand your comment. I believe that the difference occurs because z follows x canonically whereas w precedes x canonically. – Bob Hanlon Aug 17 '16 at 22:36
• I think you are right. I have checked this with other integration variables.It even works if we write I z instead of z. – Dr. Wolfgang Hintze Aug 17 '16 at 22:42
• sorry, the editor does not allow me to address you like (at)Bob Hanlon – Dr. Wolfgang Hintze Aug 17 '16 at 22:43
• Thanks! Eventhough I do not fully understand why different constants would arise, this solves my question, since the constant will vanish when I make it a definite integral. – Richard van Dongen Aug 19 '16 at 21:20