Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
I found a bug! :) – cartonn Nov 15 '13 at 16:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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