Jump to content

Computing ∫ ln(x+a)ln(x+f+1)/(x+f) dx , where a, c, and f are complex-valued parameters

Featured Replies

Check out this fortran program that I wrote, lnln-pole-int, that computes

⌠ ln(x+a)ln(x+c)
⎮ ────────────── dx
⌡      x+f

for complex-valued parameters a, c, and f.

Prompted for an indefinite integral of this type, math software tools spit out an expression that will be invalid for some integral parameters. Prompted for a definite integral of this type, at least some math software tools fall back on numerical integration when a, c, or f are complex, probably because an algorithm for analytical evaluation is not widely available. I aim to contribute toward filling this void with the linked program.

One limitation that I know about is that it fails to compute integrals of the type

⌠ ln(x+a)ln(x+f+1)
⎮ ──────────────── dx
⌡       x+f

with f real and the integration bounds spanning f. Zeros in the numerator and denominator of this expression cancel as x->-f, so such integrals are well-defined. I plan to add support for them in the future. I'll also probably extend the program to treat

⌠ ln(bx+a)ln(ex+c)
⎮ ──────────────── dx
⌡       x+f

where b and e are again complex-valued parameters.


But, the first draft should be pretty good – comments or criticism much appreciated.

Complex logarithms are marvelous beasts, but they're sharp-toothed. They have something called "branch cuts", which come from "branch points", meaning loci where the function becomes discontinuous in a very non-trivial way, giving rise to so-called Riemann surfaces (the complex plane splitting into infinitely many copies of it, each for one prescription of the polar angle in the argument that the function accepts).

Trying to perform a definite integral involving a product of logs with branch points in different places on the complex plane would be hard enough. These integrals normally involve integration paths that need to be extended to closed loops involving infinity in order to be able to use Cauchy's theorem and thus make sense of them just numerically. You need to start with things like \( \int_{-\infty}^{\infty} \) or \( \int_{0}^{\infty} \) and then analitically continue (so-said) the path to go through infinity.

I shudder to think what kind of an ill-defined mess trying to propose them as functions (indefinite integrals) would lead us to. For starters, there are the best reasons to expect them to adopt infinitely many functional values.

Think about it: Numerical methods are really really advanced today. If you've found a mathematical object that resists analysis by using them, it's probably because of some fundamental theoretical reason.

I hope that was helpful. I'm sorry I can't help you with your Fortran.

  • Author

Your point about different choices of the branch producing different answers is well-taken. I should have mentioned that I started looking at the integral because I needed to compute

          Re(a)                Re(c)
⌠     1  ⌠             1      ⌠             1
⎮ dx ─── ⎮      dy─────────── ⎮      dz───────────
⌡    x+f ⌡        x+y+i*Im(a) ⌡        x+z+i*Im(c)

where the integration bounds have been dropped wherever doing so doesn't detract from my point. Obviously, ln( ) is only the anti-derivative of those z and y integrands at points off of the branch cut of ln. If the principal branch is used, the branch cut is never crossed by the relevant ln arguments, e.g., x+z+i*Im(c) . So, the integral above reduces to the one in my original post with ln( ) taken to be the principal branch.

On 11/3/2025 at 7:12 AM, brentfpage said:

Your point about different choices of the branch producing different answers is well-taken. I should have mentioned that I started looking at the integral because I needed to compute

          Re(a)                Re(c)
⌠     1  ⌠             1      ⌠             1
⎮ dx ─── ⎮      dy─────────── ⎮      dz───────────
⌡    x+f ⌡        x+y+i*Im(a) ⌡        x+z+i*Im(c)

where the integration bounds have been dropped wherever doing so doesn't detract from my point. Obviously, ln( ) is only the anti-derivative of those z and y integrands at points off of the branch cut of ln. If the principal branch is used, the branch cut is never crossed by the relevant ln arguments, e.g., x+z+i*Im(c) . So, the integral above reduces to the one in my original post with ln( ) taken to be the principal branch.

Thank you for adding more context. May I ask you what particular problem led you to this integral?

  • Author

 Thanks for the opportunity to clarify! I am trying to compute some terms in the so-called weak turbulence theory of plasma, specifically ones very roughly with the form

⌠             I(k′)         ⌠        δF(v₁)   ⌠            δF(v₂)
⎮ dk′ ───────────────────── ⎮ dv₁ ─────────── ⎮ dv₂ ────────────────────
⌡     k′ω(k)-kω(k′)-(k-k′)Ω ⌡     ω(k′)-k′*v₁ ⌡     ω(k)-ω(k′)-(k-k′)*v₂

where k and k' are wavenumbers, I(k') is a wave spectral density at wavenumber k', ω(k') is the (complex-valued) wave frequency at wavenumber k', v_1 and v_2 are velocities, δF is some derivative of a velocity distribution function F w.r.t. velocity, and Ω is the cyclotron frequency for the considered type of particle. I should mention that the integral above isn't found directly in the weak turbulence equations, but arises in the course of doing partial fraction expansions that make the velocity integrals computable.

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.