# How can I integrate $\int\frac{\ln(1+xy)}{1+x^2} dx$?

$$\int\frac{\ln(1+xy)}{1+x^2} dx$$

Give me some idea how to solve to solve this. Is it possible to use some complex analysis to solve this. Or some nice substitution will work?

-
Is y a constant? –  iostream007 Jun 2 '13 at 12:08
What is the integration interval? –  Ron Gordon Jun 2 '13 at 13:30

As is, the integral is pretty hard. We can work with its derivative with respect to $y$, however. If the integral is $f(y)$, then, assuming the integration interval is $x \in [0,\infty)$:

$$f'(y) = \int_0^{\infty} dx \frac{x}{(1+x y)(1+x^2)}$$

We can evaluate this integral using residue theory, with a keyhole contour $C$ about the positive real axis, for the following integral:

$$\oint_C dz \frac{z \log{z}}{(1+z y)(1+z^2)}$$

This integral consists of four pieces:

$$\int_{\epsilon}^R dx \frac{x \log{x}}{(1+x y)(1+x^2)}+ i R \int_0^{2 \pi} d\phi \, e^{i \phi} \frac{R e^{i \phi} (\log{R} + i \phi)}{(1+R y e^{i \phi})(1+R^2 e^{i 2 \phi})} + \\ \int_R^{\epsilon} dx \frac{x (\log{x} + i 2 \pi)}{(1+x y)(1+x^2)}+i \epsilon \int_{2 \pi}^0 d\phi \, e^{i \phi} \frac{\epsilon e^{i \phi} (\log{\epsilon} + i \phi)}{(1+ \epsilon y e^{i \phi})(1+\epsilon^2 e^{i 2 \pi})}$$

As $R \to \infty$ and $\epsilon \to 0$, the second integral vanishes as $\log{R}/R$ and the fourth integral vanishes as $\epsilon^2 \log{\epsilon}$. The contour integral is then

$$-i 2 \pi \int_0^{\infty} dx \frac{x}{(1+x y)(1+x^2)}$$

The contour integral is also equal to $i 2 \pi$ times the sum of the residues of three poles $z=\pm i$ and $z=-1/y$ of the integrand. Use the fact that, for a function $g(z)=p(z)/q(z)$, the residue of $g$ at a pole $z_0$ is $p(z_0)/q'(z_0)$ and compute the sum of the residues. Note that the factor of $i 2 \pi$ in front of the integral we seek cancels out the $i 2 \pi$ in front of the sum of the residues. Thus, the integral we seek is the negative of the sum of the residues. Thus

\begin{align}\int_0^{\infty} dx \frac{x}{(1+x y)(1+x^2)} &= -\underbrace{\frac{i \cdot (i \pi/2)}{(1+i y)(2 i)}}_{\text{Residue at }z=i}-\underbrace{\frac{-i \cdot (i 3 \pi/2)}{(1-i y)(-2 i)}}_{\text{Residue at }z=-i}-\underbrace{\frac{1}{y} \frac{(-1/y) (-\log{y}+i \pi)}{1+1/y^2}}_{\text{Residue at }z=-1/y}\\ &= -\frac{\log{y}}{1+y^2} + \frac{i \pi}{1+y^2} - \frac{i \pi}{4} \left [\frac{1}{1+i y}+\frac{3}{1-i y} \right ] \\ &= \frac{(\pi/2)y - \log{y}}{1+y^2}\end{align}

Thus

$$f'(y) = \frac{(\pi/2)y - \log{y}}{1+y^2}$$ $$f(0) = 0$$

The sought-after integral is then

$$f(y) = \int_0^{\infty} dx \frac{\log{(1+x y)}}{1+x^2} = \frac{\pi}{4} \log{(1+y^2)} + \tanh{y}\, \log{y} - \frac{y}{4} \Phi(y^2,2,1/2)$$

where $\Phi$ is the Lerch phi transcendant

$$\Phi(z,s,a) = \sum_{k=0}^{\infty} \frac{z^k}{(k+a)^s}$$

-