1

I have to evaluate the following integral for our numerical methods test: $$\int_0^\infty e^{-x}\ln(1+\sin^2x)\, \mathrm dx$$ I managed to evaluate it numerically, but for the second point I have the following requierment:

a) What is the true value of the integral.

I have tried to bring it to complex but I didn't get anywhere satisfactory and I also tried to use Feynman's method. I got this: $$ I(a) = \int_0^\infty e^{-ax}\ln(1+\sin^2x)\, \mathrm dx$$ After I derivate and integrate I get this: $$I(a) = Ce^{-a^2/2}$$

But I don't seem to be able to find any values for $a$ to nicely calculate $C$.

Also, I tried to play around in Mathematica, but I got nothing.

EDIT: My professor just wanted us to plug the equation into Mathematica and take the value it gives as "true" value. Thanks for the answers.

Tesla
  • 1,460
ac1643
  • 67
  • $$\lim_{a\to\infty} a^3 I(a)=\lim_{a\to\infty}\int_0^{\infty}e^{-y}a^2\ln\big(1+\sin^2(y/a)\big),dy=\int_0^{\infty}y^2e^{-y},dy=2$$ by DCT, so your formula for $I(a)$ is wrong. – metamorphy Jun 06 '19 at 21:38
  • @metamorphy. Could you clarify for me the last summation ? Using your numbers, I get (if not mistaken) $-0.140918$. I am interested because it converges extremely fast. Thanks. – Claude Leibovici Jun 08 '19 at 13:10
  • If you really can prove $I^\prime=-aC$, it'd be worth editing the proof into the question. I suspect some error will come to light. – J.G. Jun 08 '19 at 13:12
  • @ClaudeLeibovici: I've converted my comment into an "answer". – metamorphy Jun 08 '19 at 13:52
  • @metamorphy. Thanks for having done it ! – Claude Leibovici Jun 08 '19 at 14:25

3 Answers3

3

I don't see a closed-form evaluation. Still, for $a>0$ and $|r|<1$ one has $$I(a,r):=\int_{0}^{\infty} e^{-ax}\ln(1-2r\cos x+r^2)\,dx=-\sum_{n=1}^{\infty}\frac{r^n}{n}\frac{2a}{n^2+a^2}.$$ This is obtained from \begin{gather}\ln(1-2r\cos x+r^2)=\ln(1-re^{ix})(1-re^{-ix})\\=-\sum_{n=1}^{\infty}\frac{r^n}{n}(e^{inx}+e^{-inx})=-2\sum_{n=1}^{\infty}\frac{r^n}{n}\cos nx\end{gather} and $\displaystyle\int_{0}^{\infty}e^{-ax}\cos bx\,dx=\frac{a}{a^2+b^2}$ (termwise integration is clearly valid here).

The original integral is $$\int_{0}^{\infty}e^{-x}\ln(1+\sin^2 x)\,dx=\int_{0}^{\infty}e^{-x}\ln\frac{3-\cos 2x}{2}\,dx\\=\left.\frac{1}{2}\int_{0}^{\infty}e^{-x/2}\ln\frac{1-2r\cos x+r^2}{4r}\,dx\right|_{r=3-2\sqrt{2}}\\=2\ln\frac{1+\sqrt{2}}{2}+\frac{1}{2}I\Big(\frac{1}2{},3-2\sqrt{2}\Big)$$ with the numerical value of $0.30599373695284849278809525044503\cdots$

metamorphy
  • 43,591
  • Thanks again for you beautiful solution (and +1 for sure). Being ashamed by my poor solution, I worked the summation you gave and found a quite simple closed form for it. – Claude Leibovici Jun 09 '19 at 03:59
  • Do you think that something in that sprit could be done for $\int_0^\infty e^{-x}\ln(1+\sin^{2n}(x)), dx$. Even for $n=2$ would be interesting (at least to me). Thanks & cheers. – Claude Leibovici Jun 14 '19 at 10:06
  • @ClaudeLeibovici: One can factor $1+z^m$ and put $z=\sin^2 x$ as above. This turns $r^n$ into $\sum_{1\leqslant k\leqslant m}r_k^n$ which "stays simple" for $m\leqslant 3$ and "gets too complex" at $m=4$ (seems due to high degree of the underlying algebraic number...). (Yeah, I've tried it.) – metamorphy Jun 14 '19 at 12:38
  • Thank you ! Would you accept to look at https://math.stackexchange.com/questions/3262116/is-there-a-limit-for-this-complex-sequence I asked one hour ago ? Thanks & cheers. – Claude Leibovici Jun 14 '19 at 12:42
2

This not an answer.

As a try, I used the Taylor expansion of $\log(1+t)$ (which converges for $t=1$) and wrote $$\log(1+\sin^2(x))=\sum_{n=1}^\infty (-1)^{n+1}\frac{\sin^{2n}(x)} n$$ and, so, we face the problem of $$I_n=\int_0^\infty e^{-x} \sin^{2n}(x)\,dx=\frac{i \, (-1)^n\, n\, \Gamma \left(\frac{i}{2}-n\right)\, \Gamma (2 n)}{4^n\,\Gamma \left(n+1+\frac{i}{2}\right)}$$ making $$\int_0^\infty e^{-x}\log(1+\sin^2(x))\,dx=-i\sum_{n=1}^\infty \frac{ \Gamma \left(\frac{i}{2}-n\right)\, \Gamma (2 n)}{4^n\,\Gamma \left(n+1+\frac{i}{2}\right)}$$ Let $$a_n=-i\frac{ \Gamma \left(\frac{i}{2}-n\right)\, \Gamma (2 n)}{4^n\,\Gamma \left(n+1+\frac{i}{2}\right)}$$ which gives $$a_{n+1}=-\frac{2 n (2 n+1)}{4 n (n+2)+5}\,a_n \qquad \text{with} \qquad a_1=\frac 25$$ This makes the summation easy to compute but the convergence is quite slow as shown in the table below for the partial sums $$S_p=\sum_{n=1}^{10^p} a_n$$ $$\left( \begin{array}{cc} p & S_p \\ 0 & 0.4000000000 \\ 1 & 0.3002972944 \\ 2 & 0.3058023962 \\ 3 & 0.3059876518 \\ 4 & 0.3059935444 \\ 5 & 0.3059937309 \\ 6 & 0.3059937368 \end{array} \right)$$ while the "exact" value should be $0.3059937370$.

To give an idea about the numbers of terms to be added for a given number of significant figures, a quick-and-dirty regression gives $$\log_{10} \left(\left|a_{10^p}\right|\right) \sim -0.41-1.5 p$$

Edit

Looking at metamorphy's solution and at Mariusz Iwaniuk's answer, I feel a bit ridiculous with the so many terms I have been using here. In fact, the exact result can be obtained much faster using Euler's transformation.

Concerning the summation given in metamorphy's answer, it converges extremely fast. Considering the partial sums $$T_k=-4\sum_{n=1}^k \frac{ \left(3-2 \sqrt{2}\right)^n}{(4 n^2+1)n}$$ $$\left( \begin{array}{cc} k & T_k \\ 1 & -0.1372583002 \\ 2 & -0.1407215063 \\ 3 & -0.1409035111 \\ 4 & -0.1409168427 \\ 5 & -0.1409180203 \\ 6 & -0.1409181376 \\ 7 & -0.1409181503 \\ 8 & -0.1409181517 \\ 9 & -0.1409181519 \end{array} \right)$$ and, using a CAS, $$\sum_{n=1}^{\infty}\frac{r^n}{n}\frac{2a}{n^2+a^2}=-\frac{r^{-i a} B_r(1+i a,0)+r^{i a} B_r(1-i a,0)+2 \log (1-r)}{a}$$

Update

After Mariusz Iwaniuk's answer, I considered the case of $$J_k=\int_0^\infty e^{-x}\log(1+\sin^{2k}(x))\,dx$$ using the same procedure as above. The result for $k=1$ having been given, here are a few other (not simplified to show some patterns) $$J_2=\frac{24}{85} \, _5F_4\left(1,1,\frac{5}{4},\frac{6}{4},\frac{7}{4};\frac{3}{2}-\frac{i}{4},\frac {3}{2}+\frac{i}{4},2-\frac{i}{4},2+\frac{i}{4};-1\right)$$ $$J_3=\frac{144}{629} \, _7F_6\left(1,1,\frac{7}{6},\frac{8}{6},\frac{9}{6},\frac{10}{6},\frac{11}{6};\frac{4}{3}-\frac{i}{6},\frac{4}{3}+\frac{i}{6},\frac{5}{3}-\frac{i}{6},\frac{5}{3}+ \frac{i}{6},2-\frac{i}{6},2+\frac{i}{6};-1\right)$$ The next is already too long to fit in a line : so if will described as $$J_4=\frac{8064}{40885} \, _9F_8\left(1,1,\color{red}{\text{#}};\color{green}{\text{@}};-1\right)$$ where $$\color{red}{\text{#}}=\frac{9}{8},\frac{10}{8},\frac{11}{8},\frac{12}{8},\frac{13}{8},\frac{14}{8},\frac{15}{8}$$ $$\color{green}{\text{@}}=\frac{5}{4}-\frac{i}{8},\frac{5}{4}+\frac{i}{8},\frac{3}{2 }-\frac{i}{8},\frac{3}{2}+\frac{i}{8},\frac{7}{4}-\frac{i}{8},\frac{7}{4}+\frac{ i}{8},2-\frac{i}{8},2+\frac{i}{8}$$

1

This not an answer.

With CAS help: $$\int_0^\infty e^{-x}\ln(1+\sin^2x)\,dx=-i\sum_{n=1}^\infty \frac{ \Gamma \left(\frac{i}{2}-n\right)\, \Gamma (2 n)}{4^n\,\Gamma \left(n+1+\frac{i}{2}\right)}=\frac{2}{5} \, _3F_2\left(1,1,\frac{3}{2};2-\frac{i}{2},2+\frac{i}{2};-1\right)$$

where: $_3F_2$ is hypergeometric function.