4

I was trying to evaluate the following integral, and wanted a solution verification. If I did something wrong please explain why it was wrong and how it can be fixed!

Here is my method:

$$I:=\int_{0}^{\frac{\pi}{2}}\log(a+\sin(x))\,dx$$

$$=\int_{0}^{\frac{\pi}{2}}\log(a+\cos(x))\,dx$$

Use:

$$\cos(x)\equiv 2\cos^2(\frac{x}{2})-1$$

And define:

$$c:=a-1$$

So

$$I=\int_{0}^{\frac{\pi}{2}}\log(c+2\cos^2(\frac{x}{2}))\,dx$$

Let

$$\frac{x}{2}\longrightarrow{x}$$

$$I=2\int_{0}^{\frac{\pi}{4}}\log(c+2\cos^2(x))\,dx$$

$$=2\int_{0}^{\frac{\pi}{4}}\log(c\sec^2(x)+2)\,dx+4\int_{0}^{\frac{\pi}{4}}\log(\cos(x))\,dx$$

The second integral is evaluated by my post:

Solving integrals through “integral systems.”

For the first, let:

$$\tan(x)\longrightarrow{x}$$

$$I=2G-\pi\log(2)+2\int_{0}^{1}\frac{\log(c(x^2+1)+2)}{x^2+1}\,dx$$

$$I=2G-\pi\log(2)+2J$$

$$J=J(c):=\int_{0}^{1}\frac{\log(c(x^2+1)+2)}{x^2+1}\,dx$$

Now we perform Feynman’s technique on $J(c)$.

$$J’(c)=\int_{0}^{1}\frac{1}{cx^2+c+2}\,dx$$

$$J’(c)=\frac{\tan^{-1}\sqrt{\frac{c}{2+c}}}{\sqrt{c(2+c)}}$$

$$J(c)=J(c)-J(0)+\frac{\pi}{4}\log(2)=\frac{\pi}{4}\log(2)+\int_{0}^{c}J’(x)\,dx$$

$$J=\frac{\pi}{4}\log(2)+\int_{0}^{c}\frac{\tan^{-1}\sqrt{\frac{x}{2+x}}}{\sqrt{x(2+x)}}\,dx$$

Let:

$$\sqrt{\frac{x}{2+x}}\longrightarrow{x}$$

$$J=\frac{\pi}{4}\log(2)+2\int_{0}^{\sqrt{\frac{a-1}{a+1}}}\frac{\tan^{-1}(x)}{1-x^2}\,dx$$

By another one of my posts:

A generalized integral. $\int_{0}^{t}\frac{\arctan(x)}{1-x^2}\,dx$

And with mulch simplification we arrive at:

$$I=\frac{\pi}{2}\cosh^{-1}(a)-\frac{\pi}{2}\log(2)+2Ti_2(a-\sqrt{a^2-1})$$

Where in my computations, $G$ denotes Catalans constant, and $Ti_2(x)$ denotes the inverse tangent integral.

Person
  • 1,113
  • Are you assuming $a \geq 0$? – Accelerator Jul 30 '23 at 06:59
  • 1
    You might want to edit your question to be even more clear that you're looking for a solution verification, and not alternate ways to compute the integral (unless the alternate methods are helpful to you) because you have two answers, none of which actually answer your stated question. – Christian E. Ramirez Jul 31 '23 at 03:15
  • See also https://math.stackexchange.com/q/4686055/1174256 – Zima Aug 04 '23 at 17:38

3 Answers3

5

Your work seems correct to me. I actually like your approach a lot. You may however want to define exactly what $a$ is. Here is another solution using my favorite methods.

$$\begin{align*}I(a)&=\int_{0}^{\pi/2}\log(a+\sin(x))\ dx \\&=\int_{0}^{\pi/2}\log(a)+\log\left(1+\frac{\sin(x)}{a}\right)\ dx \\&=\frac{\pi\log(a)}{2}+\underbrace{\int_{0}^{\pi/2}\log\left(1+\frac{\sin(x)}{a}\right)\ dx}_{J(a)}\end{align*}$$ Expanding the logarithm by it's power series, $$J(a)=\int_0^{\pi/2}\sum_{n=1}^\infty\frac{(-1)^{n+1}}{n}\frac{\sin^n(x)}{a^n}\ dx=\sum_{n=1}^\infty\frac{(-1)^{n+1}}{na^n}\int_0^{\pi/2}\sin^{n}(x)\ dx$$ by the integral representation of the Beta function, $$\sum_{n=1}^\infty\frac{(-1)^{n+1}}{na^n}\int_0^{\pi/2}\sin^{n}(x)\ dx=\frac{1}{2}\sum_{n=1}^\infty\frac{(-1)^{n+1}}{na^n}B\left(\frac{n+1}{2},\frac{1}{2}\right)$$ which in terms of the Gamma function, $$\begin{align*}\frac{1}{2}\sum_{n=1}^\infty\frac{(-1)^{n+1}}{na^n}B\left(n+\frac{1}{2},\frac{1}{2}\right)&=\frac{1}{2}\sum_{n=1}^\infty\frac{(-1)^{n+1}}{na^n}\frac{\Gamma\left(\frac{n+1}{2}\right)\Gamma\left(\frac{1}{2}\right)}{\Gamma\left(\frac{n}{2}+1\right)} \\ &=\frac{\sqrt\pi}{2}\sum_{n=1}^\infty\frac{(-1)^{n+1}}{na^n}\frac{\Gamma\left(\frac{n+1}{2}\right)}{\Gamma\left(\frac{n}{2}+1\right)}\end{align*}$$ then by the relation, $$\frac{\Gamma\left(\frac{n+1}{2}\right)}{\Gamma\left(\frac{n}{2}+1\right)}=\frac{\sqrt\pi}{2^n}\binom{n}{n/2}$$ we have our series, $$J(a)=-\frac{\pi}{2}\sum_{n=1}^\infty\binom{n}{n/2}\frac{(-1)^{n}}{n(2a)^n}$$ which is evaluated here (credits to @ClaudeLeibovici) and offers closed forms in terms of dilogarithms and hyperbolic functions, but it is not pretty.

Instead if you allow the ${}_3F_2$ Hypergeometric function the integral is, $$I(a)=-\frac{\pi}{2}\log\left(2\left(a-\sqrt{a^2-1}\right)\right)+\frac{1}{a}{}_3F_2\left(\frac{1}{2},1,1;\frac{3}{2},\frac{3}{2};\frac{1}{a^2}\right).$$

bob
  • 2,167
3

Define the function $\mathcal{I}:\mathbb{R}_{\ge0}\rightarrow\mathbb{R}$ via the definite integral

$$\mathcal{I}{\left(a\right)}:=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\ln{\left(a+\sin{\left(\varphi\right)}\right)}.$$

The $a\ge1$ case has already been addressed elsewhere, so this answer will just consider the $0<a<1$ case.


Given $a\in(0,1)$ and setting $\arcsin{\left(a\right)}=:\alpha\in\left(0,\frac{\pi}{2}\right)$, we find

$$\begin{align} \mathcal{I}{\left(a\right)} &=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\ln{\left(a+\sin{\left(\varphi\right)}\right)}\\ &=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\ln{\left(\sin{\left(\alpha\right)}+\sin{\left(\varphi\right)}\right)}\\ &=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\ln{\left(2\sin{\left(\frac{\alpha+\varphi}{2}\right)}\cos{\left(\frac{\alpha-\varphi}{2}\right)}\right)}\\ &=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\left[-\ln{\left(2\right)}+\ln{\left(2\sin{\left(\frac{\alpha+\varphi}{2}\right)}\right)}+\ln{\left(2\cos{\left(\frac{\alpha-\varphi}{2}\right)}\right)}\right]\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\ln{\left(2\sin{\left(\frac{\varphi+\alpha}{2}\right)}\right)}+\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\ln{\left(2\cos{\left(\frac{\varphi-\alpha}{2}\right)}\right)}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\int_{\alpha}^{\frac{\pi}{2}+\alpha}\mathrm{d}\vartheta\,\ln{\left(2\sin{\left(\frac{\vartheta}{2}\right)}\right)};~~~\small{\left[\varphi=\vartheta-\alpha\right]}\\ &~~~~~+\int_{-\alpha}^{\frac{\pi}{2}-\alpha}\mathrm{d}\omega\,\ln{\left(2\cos{\left(\frac{\omega}{2}\right)}\right)};~~~\small{\left[\varphi=\omega+\alpha\right]}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\int_{\alpha}^{\frac{\pi}{2}+\alpha}\mathrm{d}\vartheta\,\ln{\left(2\sin{\left(\frac{\vartheta}{2}\right)}\right)}\\ &~~~~~+\int_{\frac{\pi}{2}+\alpha}^{\pi+\alpha}\mathrm{d}\vartheta\,\ln{\left(2\sin{\left(\frac{\vartheta}{2}\right)}\right)};~~~\small{\left[\omega=\pi-\vartheta\right]}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\int_{\alpha}^{\pi+\alpha}\mathrm{d}\vartheta\,\ln{\left(2\sin{\left(\frac{\vartheta}{2}\right)}\right)}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\operatorname{Cl}_{2}{\left(\alpha\right)}-\operatorname{Cl}_{2}{\left(\pi+\alpha\right)},\\ \end{align}$$

where the Clausen function is given by the integral

$$\operatorname{Cl}_{2}{\left(\theta\right)}=-\int_{0}^{\theta}\mathrm{d}\varphi\,\ln{\left|2\sin{\left(\frac{\varphi}{2}\right)}\right|};~~~\small{\theta\in\mathbb{R}}.$$

Basic properties of the Clausen function include:

$$\operatorname{Cl}_{2}{\left(m\pi\right)}=0;~~~\small{m\in\mathbb{Z}},$$

$$\operatorname{Cl}_{2}{\left(-\theta\right)}=-\operatorname{Cl}_{2}{\left(\theta\right)};~~~\small{\theta\in\mathbb{R}},$$

$$\operatorname{Cl}_{2}{\left(\theta+2m\pi\right)}=\operatorname{Cl}_{2}{\left(\theta\right)};~~~\small{m\in\mathbb{Z}\land\theta\in\mathbb{R}}.$$


Recall the definition of the so-called inverse tangent integral function:

$$\operatorname{Ti}_{2}{\left(x\right)}:=\int_{0}^{x}\mathrm{d}t\,\frac{\arctan{\left(t\right)}}{t};~~~\small{x\in\mathbb{R}}.$$

For $\theta\in\left(0,\frac{\pi}{2}\right)$, the inverse tangent integral $\operatorname{Ti}_{2}{\left(\tan{\left(\theta\right)}\right)}$ has the following closed form in terms of Clausen functions:

$$\begin{align} \operatorname{Ti}_{2}{\left(\tan{\left(\theta\right)}\right)} &=\int_{0}^{\tan{\left(\theta\right)}}\mathrm{d}t\,\frac{\arctan{\left(t\right)}}{t}\\ &=\int_{0}^{\theta}\mathrm{d}\vartheta\,\frac{\vartheta\sec^{2}{\left(\vartheta\right)}}{\tan{\left(\vartheta\right)}};~~~\small{\left[\arctan{\left(t\right)}=\vartheta\right]}\\ &=\int_{0}^{\theta}\mathrm{d}\vartheta\,\vartheta\csc{\left(\vartheta\right)}\sec{\left(\vartheta\right)}\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}-\int_{0}^{\theta}\mathrm{d}\vartheta\,\ln{\left(\tan{\left(\vartheta\right)}\right)};~~~\small{I.B.P.}\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}-\int_{0}^{2\theta}\mathrm{d}\varphi\,\frac12\ln{\left(\tan{\left(\frac{\varphi}{2}\right)}\right)};~~~\small{\left[\vartheta=\frac{\varphi}{2}\right]}\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}-\frac12\int_{0}^{2\theta}\mathrm{d}\varphi\,\left[\ln{\left(2\sin{\left(\frac{\varphi}{2}\right)}\right)}-\ln{\left(2\cos{\left(\frac{\varphi}{2}\right)}\right)}\right]\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}+\frac12\left[-\int_{0}^{2\theta}\mathrm{d}\varphi\,\ln{\left(2\sin{\left(\frac{\varphi}{2}\right)}\right)}+\int_{0}^{2\theta}\mathrm{d}\varphi\,\ln{\left(2\cos{\left(\frac{\varphi}{2}\right)}\right)}\right]\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}+\frac12\left[\operatorname{Cl}_{2}{\left(2\theta\right)}+\int_{0}^{2\theta}\mathrm{d}\varphi\,\ln{\left(2\sin{\left(\frac{\pi-\varphi}{2}\right)}\right)}\right]\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}+\frac12\left[\operatorname{Cl}_{2}{\left(2\theta\right)}-\int_{\pi}^{\pi-2\theta}\mathrm{d}\varphi\,\ln{\left(2\sin{\left(\frac{\varphi}{2}\right)}\right)}\right];~~~\small{\left[\varphi\mapsto\pi-\varphi\right]}\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}+\frac12\left[\operatorname{Cl}_{2}{\left(2\theta\right)}+\operatorname{Cl}_{2}{\left(\pi-2\theta\right)}-\operatorname{Cl}_{2}{\left(\pi\right)}\right]\\ &=\theta\ln{\left(\tan{\left(\theta\right)}\right)}+\frac12\operatorname{Cl}_{2}{\left(2\theta\right)}+\frac12\operatorname{Cl}_{2}{\left(\pi-2\theta\right)}.\\ \end{align}$$

We can use this relation to rewrite the expression for $\mathcal{I}$ obtained above as

$$\begin{align} \mathcal{I}{\left(a\right)} &=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\varphi\,\ln{\left(a+\sin{\left(\varphi\right)}\right)}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\operatorname{Cl}_{2}{\left(\alpha\right)}-\operatorname{Cl}_{2}{\left(\pi+\alpha\right)}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\operatorname{Cl}_{2}{\left(\alpha\right)}+\operatorname{Cl}_{2}{\left(-\pi-\alpha\right)}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}+\operatorname{Cl}_{2}{\left(\alpha\right)}+\operatorname{Cl}_{2}{\left(\pi-\alpha\right)}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}-\alpha\ln{\left(\tan{\left(\frac{\alpha}{2}\right)}\right)}+2\operatorname{Ti}_{2}{\left(\tan{\left(\frac{\alpha}{2}\right)}\right)}\\ &=-\frac{\pi}{2}\ln{\left(2\right)}-\arcsin{\left(a\right)}\ln{\left(\frac{a}{1+\sqrt{1-a^{2}}}\right)}+2\operatorname{Ti}_{2}{\left(\frac{a}{1+\sqrt{1-a^{2}}}\right)}.\blacksquare\\ \end{align}$$


David H
  • 29,921
2

Considering the parameterized integral $$ I(\theta)=\int_0^\pi \ln (1+\cos \theta \cos x) d x $$ Differentiating $I(\theta)$ w.r.t. $\theta$ yields $$ \begin{aligned} I^{\prime}(\theta)&= -\int_0^{\frac{\pi}{2}} \frac{\sin \theta \cos x}{1+\cos \theta \cos x} d x\\ &= -\frac{\sin \theta}{\cos \theta} \int_0^{\frac{\pi}{2}} \frac{1+\sec \theta \cos x-1}{1+\cos \theta \cos x} d x \\ & =-\frac{\pi \tan \theta}{2}+\tan \theta \int_0^{\frac{\pi}{2}} \frac{d x}{1+\cos \theta \cos x} \\ & =-\frac{\pi\tan \theta}{2}+\tan \theta \cdot \frac{\theta}{\sin \theta} \cdots (*) \\ & =-\frac{\pi \tan \theta}{2}+\frac{\theta}{\cos \theta} \\ & \end{aligned} $$ where $(*)$ refer to the post.

Integrating back from $0$ to $\theta$ gives $$ \begin{aligned} I(\theta)-I(0)&=\int_0^\theta\left(-\frac{\pi \tan t}{2}+\frac{t}{\cos t}\right) d t \\ & =\frac{\pi}{2} \ln (\cos \theta)+\int_0^\theta \frac{t}{\cos t} d t \end{aligned} $$ Using $I(0)=\int_0^{\frac{\pi}{2}} \ln (1+\cos x) d x=2G-\frac{\pi}{2} \ln 2$, where $G$ is the Catalan’s constant, we have $$ \int_0^{\frac{\pi}{2}} \ln (1+\cos \theta \cos x) d x= 2 G-\frac{\pi}{2} \ln 2+\frac{\pi}{2} \ln (\cos \theta)+\int_0^\theta \frac{t}{\cos t} d t $$

By the post, we have

$$\int\frac{t}{\cos t}=-2it\arctan(e^{it})+i(\mathrm{Li}_2(-ie^{it})-\mathrm{Li}_2(ie^{it}))$$ and hence $$ \begin{aligned} \int_0^{\frac{\pi}{2}} \ln (1+\cos \theta \cos x) d x& =2G-\frac{\pi}{2} \ln 2+\frac{\pi}{2} \ln (\cos \theta)-2 i \theta \tan^{-1}\left(e^{\theta i}\right) \\ & \quad +i\left(\mathrm{Li}_2\left(-i e^{\theta i}\right)\right)-\mathrm{Li}_2\left(i e^{i \theta}\right) +i\mathrm{Li}_2(-i)-\mathrm{Li}_2(i) \end{aligned} $$ Come back to our integral for $a>1$, we have

$$\int_0^{\frac{\pi}{2}} \ln (a+\sin x) d x=\int_0^{\frac{\pi}{2}} \ln (a+\cos x) d x = \frac{\pi}{2} \ln a+\int_0^{\frac{\pi}{2}} \ln \left(1+\frac{1}{a} \cos x\right) d x $$ Letting $a=\sec \theta$ brings us

$$ \int_0^{\frac{\pi}{2}} \ln (a+\sin x) d x = 2G+\frac{\pi}{2} \ln \frac {a}{2}-2 i\sec^{-1} a\tan^{-1}\left(e^{i\sec^{-1} a }\right)+i\left(\mathrm{Li}_2\left(-i e^{i\sec^{-1} a}\right)\right)-\mathrm{Li}_2\left(i e^{i\sec^{-1} a}\right) +i\mathrm{Li}_2(-i)-\mathrm{Li}_2(i) $$

Lai
  • 20,421