Computing the integral $\int_0^{\infty} e^{-\phi^2+\phi}\cdot \phi^{2} \ln(1-2x\cos\phi+x^2)\, d\phi.$

Integrate $$\int_0^{\infty} e^{-\phi^2+\phi}\cdot \phi^{2} \ln(1-2x\cos\phi+x^2) \, d\phi.$$ Something that may help $(1-2x\cos\phi+x^2)=(1-xe^{i\phi})(1-xe^{-i\phi})$. And using the series expansion $$\ln(1-z)=-\sum_{n=1}^\infty \frac{z^n}{n}$$ where $|z=xe^{\pm i\phi}| \leq 1$. The series is absolutely and uniformly convergent. Any method is okay.

• What contest is this from? Commented Feb 26, 2014 at 23:50
• Personally, this integral value can not be presented as elementary form. So numerical method would be introduced in this question.
– Lion
Commented Feb 27, 2014 at 2:22
• @RonGordon bulgarian math team question at sofia university Commented Feb 27, 2014 at 3:13
• This may or may not be useful, but for $|x| <1$, the integral can be expressed as $$-2e^{1/4} \sum_{k=1}^{\infty} \frac{x^{k}}{k} \int_{0}^{2 \pi} \phi^{2} e^{-(\phi-1/2)^2} \cos(k \phi) \ d \phi$$ Are you sure the upper limit should be $2 \pi$ and not $\infty$? Commented Mar 1, 2014 at 22:33
• Using $(7.7.3)$, the integral is $$- {\mathop{\rm Re}\nolimits} \sum\limits_{n = 1}^\infty {\frac{{x^n }}{n}\int_0^{ + \infty } {{\rm e}^{ - \phi ^2 + (1 + {\rm i}n)\phi } \phi ^2 {\rm d}\phi } } = \frac{1}{4}{\mathop{\rm Re}\nolimits} \sum\limits_{n = 1}^\infty {\frac{{x^n }}{n}\left[ {\frac{{{\rm d}^2 }}{{{\rm d}z^2 }}\left( {\frac{{\sqrt \pi }}{2}{\rm e}^{ - z^2 } + {\rm i}F(z)} \right)} \right]_{z = \frac{{n - {\rm i}}}{2}} } .$$
– Gary
Commented Jul 11 at 7:07

I suppose that a trick would be to use $$\log \left(1-2 x \cos (\phi)+x^2\right)=\sum_{n=1}^\infty \frac{ \cos (n \phi )}{n}\, x^n$$ Using Euler representation of the cosine function $$J_n=\Re\Big(\int_0^\infty \phi ^2 e^{ -\phi ^2+(1+in)\phi }\,d\phi\Big)$$ A couple of integration by parts to face the error function and therefore $$J_n$$ is the real part of $$\frac{1}{8} \left(\sqrt{\pi } e^{-\frac{1}{4} (n-i)^2} (n^2-2 i n-3) \left(\text{erfc}\left(\frac{1+i n}{2}\right)-2\right)+2 i n+2\right)$$

Converting to decimals, the summand seems to converge quite fast $$\left( \begin{array}{cc} n & \large\frac {J_n} n \\ 1 & 2.6447612\times 10^{-01} \\ 10 & 7.2147066\times 10^{-05} \\ 100 & 6.0100173\times 10^{-10} \\ 1000 & 6.0001000\times 10^{-15} \\ 10000 & 6.0000010\times 10^{-20} \\ \end{array} \right)$$

Restatement of the problem.

Firstly, the logarithm can be split thanks to the given factorization, namely $$(1 - 2x\cos\phi + x^2) = (1-xe^{i\phi})(1-xe^{-i\phi})$$. Secondly, the factor $$\phi^2$$ can be handled by introducing a new parameter $$t$$ inside the gaussian and differentiating with respect to the latter. In consequence, our problem comes down to the computation of the quantity
$$f_\pm(x,t) := \int_0^\infty e^{-\phi^2-t\phi}\ln(1-xe^{\pm i\phi}) \,\mathrm{d}\phi,$$ in such a way that the final result will be given by the following expression : $$\int_0^\infty \phi^2e^{-\phi^2+\phi}\ln(1-2x\cos\phi+x^2) \,\mathrm{d}\phi = \left.\frac{\mathrm{d}^2}{\mathrm{d}t^2}\right|_{t=-1} \left(f_+(x,t) + f_-(x,t)\right)$$

Main computation.

When $$|x| < 1$$. One can indeed take advantage of the Taylor series of the logarithm when $$|x| < 1$$. One gets : \begin{align} f_\pm(x,t) = \int_0^\infty e^{-\phi^2-t\phi} \left(\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k} (xe^{\pm i\phi})^k\right) \,\mathrm{d}\phi = -\sum_{k=1}^\infty \frac{(-x)^k}{k} \int_0^\infty e^{-\phi^2-(t\mp ik)\phi} \,\mathrm{d}\phi \end{align} The last integral corresponds to the Laplace transform of gaussian function evaluated at $$s = t \mp ik$$, i.e. $$\mathscr{L}[e^{-t^2}](s) = \frac{\sqrt{\pi}}{2} e^{-\frac{s^2}{4}} \operatorname{erfc}\left(\frac{s}{2}\right)$$, hence formally $$f_\pm(x,t) = -\frac{\sqrt{\pi}}{2} \sum_{k=1}^\infty \frac{(-x)^k}{k} e^{-(t \mp ik)^2/4} \operatorname{erfc}\left(\frac{(t \mp ik)}{2}\right),$$ where $$\operatorname{erfc}$$ is the complementary error function. I doubt a simplified closed form exists, unfortunately.

When $$|x¦ > 1$$. The same kind of manipulations can be carried with the help of another factorization, namely $$(1 - 2x\cos\phi + x^2) = (x-e^{i\phi})(x-e^{-i\phi})$$. Then, defining a similar expression $$g_\pm(x,t) := \int_0^\infty e^{-\phi^2-t\phi}\ln(x-e^{\pm i\phi}) \,\mathrm{d}\phi,$$ one has : $$g_\pm(x,t) = \int_0^\infty e^{-\phi^2-t\phi} \left(\ln x + \ln\left(1 - \frac{e^{\pm i\phi}}{x}\right)\right) \,\mathrm{d}\phi.$$ The first term is a mere gaussian integral, while the second term can be treated with the same expansion as before.

Alternative approach.

Alternatively, we may work with the derivative of the function $$g$$ defined above with respect to $$x$$, i.e. $$h_\pm(x,t) := \partial_xg_\pm(x,t) = \int_0^\infty \frac{e^{-\phi^2-t\phi}}{x-e^{\pm i\phi}} \,\mathrm{d}\phi$$ in such a way that $$g_\pm$$ will be recovered by integration together with the initial condition $$g_\pm(0,t) = 0$$. In fact, this form allows to work with the geometric series instead, even if it doesn't change much at the end. However, it suggests to tackle the problem with a contour integration over the complex plane, since the integrand possesses first-order poles at $$\phi_n = \mp i\ln x$$, even if I haven't tried to follow this path.