# Answer ComplexInfinity for a clearly convergent integral

I want to compute the following integral:

Integrate[-(λ/π) (1 - (wn - w)^2 / Ω0^2 Log[1 + Ω0^2/(wn - w)^2] +
Ω0^2/(2 (wn + w)^2)) ϕ/(w^2 + ρ^2),
{w, Ω, Infinity},
Assumptions -> {λ > 0, wn > 0, Ω0 > 0, ϕ > 0, ρ > 0, Ω > wn}]


$$- \int \limits_\Omega^\infty \mathrm{d} \omega \frac{\lambda}{\pi} \left[ 1 - \frac{(\omega_n - \omega)^2}{\Omega_0^2} \log \left( 1 + \frac{\Omega_0^2}{(\omega_n - \omega)^2} \right) + \frac{\Omega_0^2}{2 (\omega_n + \omega)^2} \right] \frac{\phi}{\omega^2 + \rho^2}$$

The answer, after several minutes, is ComplexInfinity. Why is that so? The first function in the bracket (1-...log(...)) is very similar to a Lorentzian with width Omega0, it's asymptotics is 1/w^2. The second function is just asymptotic version of the first, while wn, Omega >> Omega0 taking into an account. Last part is just multiplicative Lorentzian factor with a width rho, which is positive (in assumptions). So this function is 1) bounded 2) asymptotic o(1/w^4). Why is the answer ComplexInfinity?

Bonus: is this integral doable analytically? If yes, how do I force Mathematica to show the result? If not, what should I do to get answer when I'm interested in this setup: 0 < wn < Omega, Omega >> Omega0, that log part is actually quite important, as the integral goes through full shape of the function (remember, 0 < wn < Omega, so integral catches all details of that function)

Bonus2: someone edited one of my previous questions so that symbols like π, etc appeared as they should: π. How did he do that? :O

• Do you have good reason to believe that this integral can be done analytically? If not, then set values for your parameters and try NIntegrate instead. Commented Mar 17, 2017 at 20:25
• I need it analytically. Commented Mar 17, 2017 at 20:29

Mathematica knows how to do the indefinite integral analytically.

indefInt = Integrate[-(λ/π) (1 - (wn - w)^2 / Ω0^2 Log[1 + Ω0^2/(wn - w)^2] +
Ω0^2/(2 (wn + w)^2)) ϕ/(w^2 + ρ^2)]


Then you can take the result, and insert the limits following the fundamental theorem.

But, Mathematica fails to produce a finite upper limit with Limit[indefInt, w->∞]. Therefore, use

ser = Normal[Series[indefInt, {w, ∞, 0}]]


Unfortunately, the leading term still contains Log[1/w], and (Log[1/w])^2. In this case, you need take the limit more carefully.

Apply the transformation Log[1/w] -> -L, and construct the series for large L:

ser2 = Series[ser/.Log[1/w] -> -L, {L, ∞, 0}]


Unfortunately, the output is of the form $(\text{stuff})L + (\text{const}) + \mathcal{O}(L^{-1})$. Fortunately, however, the $(\text{stuff})$ vanishes under your conditions, so the limiting value is given by $(\text{const})$, which you can extract by copy and pasting from output of Series:

upperlimit = 1/(2 π) λ ϕ * (-((π (2 wn^4 + 2 ρ^4 - ρ^2 Ω0^2 + wn^2 (4 ρ^2 + Ω0^2)))/(2 ρ (wn^2 + ρ^2)^2)) + 1/Ω0^2 (-((I (wn - I ρ)^2 (π^2 + 3 Log[wn - I ρ]^2 + 12 Log[wn - I ρ] Log[-(1/(-wn + I ρ))] + 12 Log[-(1/(-wn + I ρ))]^2))/(3 ρ)) + (I (wn + I ρ)^2 (π^2 + 3 Log[wn + I ρ]^2))/(3 ρ) + (I (wn - I ρ)^2 (π^2 + 3 Log[wn - I (ρ - Ω0)]^2 + 12 Log[wn - I (ρ - Ω0)] Log[-(1/(-wn + I (ρ - Ω0)))] + 12 Log[-(1/(-wn + I (ρ - Ω0)))]^2))/(6 ρ) - (I (wn + I ρ)^2 (π^2 + 3 Log[wn + I (ρ - Ω0)]^2))/(6 ρ) + (I (wn - I ρ)^2 (π^2 + 3 Log[wn - I (ρ + Ω0)]^2 + 12 Log[wn - I (ρ + Ω0)] Log[-(1/(-wn + I (ρ + Ω0)))] + 12 Log[-(1/(-wn + I (ρ + Ω0)))]^2))/(6 ρ) - (I (wn + I ρ)^2 (π^2 + 3 Log[wn + I (ρ + Ω0)]^2))/(6 ρ)))


The lower limit is just lowerlimit = indefInt/.w->Ω. And so the value of your definite integral is

upperlimit - lowerlimit


I hope that helps.

• This is nice. When I run Simplify with my assumptions on (stuff), I get zero. Which is nice, but when I run Simplify for just Floor[Arg[-wn/(wn-i rho)]/2pi], I don't get -1 as expected, but I get Cases. That's why I am confused that Mathematica Simplifies that horrible (stuff) to zero right away. Thank you, although quite messy, it gets job done in a clear, feasible way! Commented Mar 18, 2017 at 17:30