Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

and

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
add comment

Your Answer

 
discard

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.