7

Background

After finding the exact value of the integral in my post, I start to investigate a similar integral $$I(a): =\int_{-\infty}^{\infty} \frac{\ln \left(x^2+ax+b\right)}{1+x^2} d x=\int_{-\infty}^{\infty} \frac{\ln \left[\left(x+\frac{a}{2}\right)^2+\left(b-\frac{a^2}{4}\right)\right] d x}{1+x^2}$$

where $b> \frac{a^2}{4}.$


By Contour integration along the upper semi-circle

Using the fact that $\ln \left(x^2+y^2\right)=2 \operatorname{Re}(\ln (x+y i))$ to reduce the $x^2$ to $x$ and making the branch point of $\ln$ below the real axis, we change the integral into

$$ $$ \begin{aligned} I(a) & =2 \operatorname{Re} \int_{-\infty}^{\infty} \frac{\ln \left(x+\frac{a}{2}+i \sqrt{b-\frac{a^2}{4}}\right)}{1+x^2} d x \\ & =2 \operatorname{Re}\left[2 \pi i \lim _{z \rightarrow i} \frac{\ln \left(z+\frac{a}{2}+i \sqrt{b-\frac{a^2}{4}}\right)}{z+i}\right] \\ & =2 \operatorname{Re}\left[2 \pi i \frac{\ln \left(i+\frac{a}{2}+i \sqrt{b-\frac{a^2}{4}}\right)}{2 i}\right] \\ & = \pi \ln \left(1+b+\sqrt{4 b^2-a^2}\right) \end{aligned}

For example,

$$ \begin{aligned}& \int_{-\infty}^{\infty} \frac{\ln \left(x^2+x+\frac{1}{2} \right)}{1+x^2} d x =\pi \ln \left(\frac{5}{2}\right) \\ & \int_{-\infty}^{\infty} \frac{\ln \left(x^2+x+1\right)}{1+x^2} d x =\pi \ln (2+\sqrt{3}) \end{aligned} $$

Do we have a simpler method for computing $$\int_{-\infty}^{\infty} \frac{\ln \left(x^2+ax+b\right)}{1+x^2} d x,$$ where $b> \frac{a^2}{4} $?

Lai
  • 20,421

3 Answers3

7

Consider, instead \begin{align} &\int_{-\infty}^{\infty} \frac{\ln (x^2+2x\sqrt b \sin \theta+b)}{x^2+1} \ d x\\ =& \int_{-\infty}^{\infty}\bigg(\ln (x^2+b)+ \int_0^{\theta}\frac{2x\sqrt b \cos t}{x^2+2x\sqrt b \sin t+b} dt\bigg) \frac{dx}{x^2+1}\\ =& \ 2\pi\ln(1+\sqrt b) -\int_0^{\theta}\frac{2\pi \sqrt b \sin t}{1+2\sqrt b \cos t+b} dt = \overset{}{\pi}\ln \left(1+b+2\sqrt b \cos\theta\right) \end{align} and then set $a=2\sqrt b \sin \theta$ to obtain \begin{align} &\int_{-\infty}^{\infty} \frac{\ln (x^2+ax+b)}{x^2+1} \ d x = \pi \ln \left(1+b+\sqrt{4 b-a^2}\right) \end{align}

Quanto
  • 97,352
  • Mr @Quanto, can you explain a bit on $…=\ 2\pi\ln(1+\sqrt b) -\int_0^{\theta}\frac{2\pi \sqrt b \sin t}{1+2\sqrt b \cos t+b} dt = \overset{}{\pi}\ln \left(1+b+2\sqrt b \cos\theta\right)$? – Lai Mar 01 '23 at 07:30
  • @Lai $\int_0^{\theta}\frac{-2\pi\sqrt b \sin t}{1+2\sqrt b \cos t+b} dt=\pi \ln(1+2\sqrt b\cos\theta+b)\bigg|_0^{\theta}=\pi\ln\frac{1+2\sqrt b\cos\theta+b}{(1+\sqrt b)^2} $ – Quanto Mar 01 '23 at 07:42
  • Sorry for misunderstanding! I understand the last step but do not understand this step:$\int_{-\infty}^{\infty}\bigg(\ln (x^2+b)+ \int_0^{\theta}\frac{2x\sqrt b \cos t}{x^2+2x\sqrt b \sin t+b} dt\bigg) \frac{dx}{x^2+1}\ ????= 2\pi\ln(1+\sqrt b) -\int_0^{\theta}\frac{2\pi \sqrt b \sin t}{1+2\sqrt b \cos t+b} dt$ – Lai Mar 01 '23 at 07:46
  • @Lai - perform partial fractionalization of $\frac x{(x^2+2x\sqrt b \sin t +b)(1+x^2)}$ and then integrate over $x$ – Quanto Mar 01 '23 at 07:51
  • Thank you very much. – Lai Mar 01 '23 at 10:28
2

Some thoughts: Can this trick work?

Let $c = \sqrt{b - a^2/4}$. Let $$I(c) := \int_{-\infty}^{\infty} \frac{\ln \left[\left(x+\frac{a}{2}\right)^2+c^2\right] }{1+x^2}\,\mathrm{d} x.$$

We have $$I'(c) = \int_{-\infty}^{\infty} \frac{2c}{(1+x^2)\left[\left(x+\frac{a}{2}\right)^2+c^2\right]}\,\mathrm{d} x = \frac{8(c + 1)\pi}{a^2 + 4c^2 + 8c + 4}. \tag{1}$$ (Note: The antiderivative is an elementary function. )

Clearly, $\pi\ln(a^2 + 4c^2 + 8c + 4)$ is an antiderivative of $\frac{8(c + 1)\pi}{a^2 + 4c^2 + 8c + 4}$.

Thus, we have $$\int_{-\infty}^{\infty} \frac{\ln \left[\left(x+\frac{a}{2}\right)^2+c^2\right] }{1+x^2}\,\mathrm{d} x = \pi\ln(a^2 + 4c^2 + 8c + 4) + C(a) \tag{2}$$ for some function $C(a)$.

River Li
  • 37,323
1

Here is another method of computing the integral in question. It might not be a "simpler" method as you are asking and the semicircular contour method in your post is great, but I'm just writing this post for fun and for me to learn a new thing or two.

Let the given integral be $I$. Let $\displaystyle f(z)=\frac{\log\left(z^{2}+az+b\right)}{z^{2}+1}.$ Its poles are $i$ and $-i$, and its branch points are $z_1 := \displaystyle-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}$ and $\displaystyle z_2 := -\frac{a}{2}-\frac{i\sqrt{4b-a^{2}}}{2}$. But consider $z_1$ instead of $z_2$ since $z_1$ is the one the contour will enclose. Define $\displaystyle \operatorname{arg}(z-z_1) \in \left(\operatorname{arg}\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right),\operatorname{arg}\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right) + 2\pi\right)$ and $\displaystyle \operatorname{arg}(z-z_2) \in \left(-\operatorname{arg}\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right) - 2\pi,-\operatorname{arg}\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right)\right)$.

Even though the branch point $z_1$ can be anywhere above the real axis, here is a visual of the contour with some fixed $a$ and $b$.

enter image description here

By Cauchy's Residue Theorem, we get

$$2\pi i\operatorname{Res}(f(z),z=i) = \left(\int_{-R}^{R} + \int_{\Gamma} + \int_{\lambda_1} + \int_{\gamma} + \int_{\lambda_2}\right)f(z)dz.$$

It can be proved that the integrals over $\Gamma$ and $\gamma$ go to $0$ as $R \to \infty$ and $r \to 0$ (where $r$ is the radius of the little circle). Maybe in the future, I'll write an addendum proving those two statements.

Let $\lambda_1$ be the line segment that travels from the large circular arc $\Gamma$ to the small circular arc $\gamma$, and let $\lambda_2$ be the line segment that travels in the opposite direction. As long as we don't have the case where $a=0$ and $b=1$, we can proceed with the following calculation, whether $z_1$ is in the first quadrant, second quadrant, or on the imaginary axis:

$$ \begin{align} & \lim_{\lambda_1 \to \Lambda}\int_{\lambda_1} f(z)dz + \lim_{\lambda_2 \to \Lambda}\int_{\lambda_2} f(z)dz \\ =& \lim_{\lambda_1 \to \Lambda}\int_{\lambda_1}\frac{dz}{1+z^2}\left(\log\left|z-z_{1}\right|+\log\left|z-z_{2}\right|+i\operatorname{arg}\left(z-z_{1}\right)+i\operatorname{arg}\left(z-z_{2}\right)\right) \\ &+\lim_{\lambda_2 \to \Lambda}\int_{\lambda_2}\frac{dz}{1+z^2}\left(\log\left|z-z_{1}\right|+\log\left|z-z_{2}\right|+i\operatorname{arg}\left(z-z_{1}\right)+i\operatorname{arg}\left(z-z_{2}\right)\right) \\ =& -\int_{\Lambda}\frac{dz}{1+z^2}\left(\log\left|z-z_{1}\right|+\log\left|z-z_{2}\right|+i\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2} + 2\pi\right)+i\operatorname{arg}\left(z-z_{2}\right)\right) \\ &+\int_{\Lambda}\frac{dz}{1+z^2}\left(\log\left|z-z_{1}\right|+\log\left|z-z_{2}\right|+i\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right)+i\operatorname{arg}\left(z-z_{2}\right)\right) \\ =& -2\pi i\int_{z_{1}}^{i\infty}\frac{dz}{1+z^{2}} \\ =& -2\pi i \Big[\arctan(z)\Big]_{z_1}^{i\infty} \\ =& -2\pi i\left(\frac{\pi}{2}-\arctan\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right)\right). \\ \end{align} $$

For the case where $a=0$ and $b=1$, we can refer to this answer.
Next, we can calculate the residue at the simple pole $i$ as follows:

$$2\pi i\operatorname{Res}(f(z),z=i) = 2\pi i \lim_{z\to i} \frac{\left(z-i\right)\log\left(z^{2}+az+b\right)}{\left(z-i\right)\left(z+i\right)} = \pi\log\left(b-1+ai\right).$$

Going back to the keyhole contour, we can take the appropriate limits to make the other contributions go to $0$ and solve for $I$ as follows:

$$ \begin{align} \pi\log\left(b-1+ai\right) &= I + 0 -2\pi i\left(\frac{\pi}{2}-\arctan\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right)\right) + 0 \\ I &= 2\pi i\left(\frac{\pi}{2}-\arctan\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right)\right) + \pi\log\left(b-1+ai\right). \\ \end{align} $$ Taking the real part on both sides yields $$ \begin{align} \Re I &= \Re 2\pi i\left(\frac{\pi}{2}-\arctan\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right)\right) + \Re\pi\log\left(b-1+ai\right) \\ &= -\Re 2\pi i\arctan\left(-\frac{a}{2}+\frac{i\sqrt{4b-a^{2}}}{2}\right) + \Re\pi\left(\log\left|b-1+ai\right|+i\operatorname{arg}\left(b-1+ai\right)\right) \\ &= \pi\ln\left(1+b+\sqrt{4b-a^{2}}\right) \end{align} $$ where from the second-to-last line to the last line, we make a huge leap of calculations.

Accelerator
  • 4,923