I'm evaluating the integral of a Lorentzian, which I know equals one. First I define the function and evaluate the integral in two slightly different ways. Surprisingly, I do not get the right answer when I do symbolic integration first.

g[x_] := (a/(2*\[Pi]))/((x - x0)^2 + (a/2)^2);

Integrate[g[x], {x, -Infinity, Infinity}] /. {x0 -> 10} /. {a -> 4}


Integrate[g[x] /. {x0 -> 10} /. {a -> 4}, {x, -Infinity, Infinity}]


What is the issue here?


1 Answer 1


Clearly It is a bug in Integrate.

g = (a/(2*\[Pi]))/((x - x0)^2 + (a/2)^2);
Integrate[g, {x, -Infinity, Infinity}]

Mathematica graphics

Now do the indefinite integration

   int0 = Integrate[g, x] 

Mathematica graphics

   % /. {x0 -> 10} /. {a -> 4}

Mathematica graphics

  (% /. x -> Infinity) - (% /. x -> -Infinity)
  (* 1 *)

I tried to do Full Trace to see if a clue might show up to tell one where and why, but hard to read. Wait and see what others say. But my vote is for a bug.

Fyi, Maple17 seems to do it ok both in definite and indefinite case here. Notice how the x0 does even show up in the definite integration. It cancels out ! Only a shows up.

Mathematica graphics


Mathematica graphics

It might be one of those cases where a branch cut went wrong problems.

  • $\begingroup$ I found a bug! :) $\endgroup$
    – cartonn
    Commented Nov 15, 2013 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.