# Integral of Lorentzian yields different results depending on when parameter assigments are made

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}


Undefined

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


1

What is the issue here?

-

Clearly It is a bug in Integrate.

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


Now do the indefinite integration

   int0 = Integrate[g, x]


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


  (% /. 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.

and

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

-
I found a bug! :) –  cartonn Nov 15 '13 at 16:53