I am trying to compute an integral but am getting two different answers using two near-identical methods. I wish to know why they differ.
f[x_] := x^2 + 1
g[x_] := 1/(2 π) 1/(x^2 + (1/4))
Simplify[
Assuming[λ ∈ Reals,
Integrate[(
f[x] g[x])/(λ + I x), {x, -∞, ∞},
PrincipalValue -> True
]
],
λ > 0
]
(* Answer: (5+2λ)/(2+4λ) if λ < 1/4*)
Assuming[λ > 0,
Integrate[
(f[x] g[x])/(λ + I x), {x, -∞, ∞},
PrincipalValue -> True
]
]
(* Answer: (2+λ)/(1+2λ) if λ <= 1/4*)
As shown in the code, the two answers are different. I think the latter answer is correct mathematically. However, based on the underlying physics from which this equation arose, the first answer is correct. (I need the integral to yield 2.5 as lambda goes to 0.) I would like to know what causes this mismatch.
Re[\[Lambda]] == 0
$\endgroup$(5 + 2*λ)/(2 + 4*λ)
and the second integral gives this same result if the assumption is changed to0 < λ <= 1/4
$\endgroup$