Log integrals IV
It can be determined that the integral \begin{align} \int_{0}^{\pi/2} \frac{x}{\sin(x)} \ln\left(\frac{1+\cos(x) - \sin(x)}{1+\cos(x) + \sin(x)} \right) dx \end{align} has a finite value. Is there an exact form in terms of well known constants?
Solution 1:
The work below is only partial result. The integral is re-expressed as an infinite series using the trigamma function.
First, note the following trigonometric identity:
$$\frac{1+\cos{\left(x\right)}-\sin{\left(x\right)}}{1+\cos{\left(x\right)}+\sin{\left(x\right)}}=\frac{\sin{\left(\frac{\pi}{4}-\frac{x}{2}\right)}}{\sin{\left(\frac{\pi}{4}+\frac{x}{2}\right)}}.$$
Then,
$$\begin{align} \mathcal{I} &=\int_{0}^{\frac{\pi}{2}}\frac{x}{\sin{\left(x\right)}}\ln{\left(\frac{1+\cos{\left(x\right)}-\sin{\left(x\right)}}{1+\cos{\left(x\right)}+\sin{\left(x\right)}}\right)}\,\mathrm{d}x\\ &=\int_{0}^{\frac{\pi}{2}}\frac{x}{\sin{\left(x\right)}}\ln{\left(\frac{\sin{\left(\frac{\pi}{4}-\frac{x}{2}\right)}}{\sin{\left(\frac{\pi}{4}+\frac{x}{2}\right)}}\right)}\,\mathrm{d}x\\ &=-\int_{\frac{\pi}{2}-0}^{\frac{\pi}{2}-\frac{\pi}{2}}\frac{\frac{\pi}{2}-u}{\sin{\left(\frac{\pi}{2}-u\right)}}\ln{\left(\frac{\sin{\left(\frac{u}{2}\right)}}{\sin{\left(\frac{\pi}{2}-\frac{u}{2}\right)}}\right)}\,\mathrm{d}u\\ &=\int_{0}^{\frac{\pi}{2}}\frac{\frac{\pi}{2}-u}{\cos{\left(u\right)}}\ln{\left(\frac{\sin{\left(\frac{u}{2}\right)}}{\cos{\left(\frac{u}{2}\right)}}\right)}\,\mathrm{d}u\\ &=\int_{0}^{\frac{\pi}{2}}\frac{\frac{\pi}{2}-u}{\cos{\left(u\right)}}\ln{\left(\tan{\left(\frac{u}{2}\right)}\right)}\,\mathrm{d}u\\ &=\int_{0}^{\frac{\pi}{2}}\frac{u-\frac{\pi}{2}}{\cos{\left(u\right)}}\ln{\left(\cot{\left(\frac{u}{2}\right)}\right)}\,\mathrm{d}u\\ &=\int_{0}^{\frac{\pi}{2}}\frac{2u-\pi}{\cos{\left(u\right)}}\sum_{k=1}^{\infty}\frac{\cos{\left((2k-1)u\right)}}{2k-1}\,\mathrm{d}u\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\int_{0}^{\frac{\pi}{2}}(2u-\pi)\frac{\cos{\left((2k-1)u\right)}}{\cos{\left(u\right)}}\,\mathrm{d}u\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\int_{0}^{\frac{\pi}{2}}(-2x)\frac{\cos{\left((2k-1)\left(\frac{\pi}{2}-x\right)\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\int_{0}^{\frac{\pi}{2}}(-2x)\frac{\cos{\left(k\pi-(2k-1)x-\frac{\pi}{2}\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\int_{0}^{\frac{\pi}{2}}(-2x)\frac{\sin{\left(k\pi-(2k-1)x\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\int_{0}^{\frac{\pi}{2}}(-2x)\frac{\sin{\left(k\pi\right)}\cos{\left((2k-1)x\right)}-\cos{\left(k\pi\right)}\sin{\left((2k-1)x\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\int_{0}^{\frac{\pi}{2}}(2x)\frac{(-1)^{k}\sin{\left((2k-1)x\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=2\sum_{k=1}^{\infty}\frac{(-1)^{k}}{2k-1}\int_{0}^{\frac{\pi}{2}}\frac{x\sin{\left((2k-1)x\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=2\sum_{k=1}^{\infty}\frac{(-1)^{k}}{2k-1}I_{k},\\ \end{align}$$
where $\forall k\in\mathbb{Z}^+$, we define $I_{k}:=\int_{0}^{\frac{\pi}{2}}\frac{x\sin{\left((2k-1)x\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x$.
By subtracting consecutive pairs of integrals, we arrive at a linear recurrence relation for $I_{k}$:
$$\begin{align} I_{k+1}-I_{k} &=\int_{0}^{\frac{\pi}{2}}\frac{x\sin{\left((2(k+1)-1)x\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x-\int_{0}^{\frac{\pi}{2}}\frac{x\sin{\left((2k-1)x\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=\int_{0}^{\frac{\pi}{2}}\frac{x\left[\sin{\left((2(k+1)-1)x\right)}-\sin{\left((2k-1)x\right)}\right]}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=\int_{0}^{\frac{\pi}{2}}\frac{x\left[2\sin{\left(x\right)}\cos{\left(2kx\right)}\right]}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=2\int_{0}^{\frac{\pi}{2}}\frac{x\sin{\left(x\right)}\cos{\left(2kx\right)}}{\sin{\left(x\right)}}\,\mathrm{d}x\\ &=2\int_{0}^{\frac{\pi}{2}}x\cos{\left(2kx\right)}\,\mathrm{d}x\\ &=\frac{-1+\cos{(k\pi)}+k\pi\sin{(k\pi)}}{2k^2}\\ &=-\frac{1}{2k^2}+\frac{\cos{(k\pi)}}{2k^2}+\frac{\pi\sin{(k\pi)}}{2k^2}\\ &=-\frac{1}{2k^2}+\frac{(-1)^{k}}{2k^2}.\\ \end{align}$$
With the value of the initial term,
$$I_{1}=\int_{0}^{\frac{\pi}{2}}x\,\mathrm{d}x=\frac{\pi^2}{8},$$
we can solve the initial-value problem for the first-order recurrence relation for $I_K$ (courtesy of Wolfram Alpha):
$$I_{k}=\frac12\Psi^{(1)}{(k)}+\frac{(-1)^{k}}{8}\left(\Psi^{(1)}{\left(\frac{k+1}{2}\right)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}\right).$$
Hence,
$$\begin{align} \mathcal{I} &=2\sum_{k=1}^{\infty}\frac{(-1)^{k}}{2k-1}I_{k}\\ &=2\sum_{k=1}^{\infty}\frac{(-1)^{k}}{2k-1}\left[\frac12\Psi^{(1)}{(k)}+\frac{(-1)^{k}}{8}\left(\Psi^{(1)}{\left(\frac{k+1}{2}\right)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}\right)\right]\\ &=\sum_{k=1}^{\infty}\frac{(-1)^{k}}{2k-1}\left[\Psi^{(1)}{(k)}+\frac{(-1)^{k}}{4}\left(\Psi^{(1)}{\left(\frac{k+1}{2}\right)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}\right)\right]\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\left[(-1)^{k}\Psi^{(1)}{(k)}+\frac14\left(\Psi^{(1)}{\left(\frac{k+1}{2}\right)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}\right)\right].\\ \end{align}$$
Now, the trigamma function satisfies the functional identity,
$$\Psi^{(1)}{\left(z+\frac12\right)}+\Psi^{(1)}{\left(z\right)}=4\Psi^{(1)}{\left(2z\right)}.$$
Letting $z=\frac{k}{2}$, we have:
$$\Psi^{(1)}{\left(\frac{k+1}{2}\right)}+\Psi^{(1)}{\left(\frac{k}{2}\right)}=4\Psi^{(1)}{\left(k\right)}\\ \implies \Psi^{(1)}{\left(\frac{k+1}{2}\right)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}=4\Psi^{(1)}{\left(k\right)}-2\Psi^{(1)}{\left(\frac{k}{2}\right)}\\ \implies \frac14\left(\Psi^{(1)}{\left(\frac{k+1}{2}\right)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}\right)=\Psi^{(1)}{\left(k\right)}-\frac12\Psi^{(1)}{\left(\frac{k}{2}\right)}.$$
Hence,
$$\begin{align} \mathcal{I} &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\left[(-1)^{k}\Psi^{(1)}{(k)}+\frac14\left(\Psi^{(1)}{\left(\frac{k+1}{2}\right)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}\right)\right]\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\left[(-1)^{k}\Psi^{(1)}{(k)}+\Psi^{(1)}{\left(k\right)}-\frac12\Psi^{(1)}{\left(\frac{k}{2}\right)}\right]\\ &=\sum_{k=1}^{\infty}\frac{1}{2k-1}\left[\left(1+(-1)^{k}\right)\Psi^{(1)}{(k)}-\frac12\Psi^{(1)}{\left(\frac{k}{2}\right)}\right]\\ &=\sum_{k,odd}^{\infty}\frac{1}{2k-1}\left[-\frac12\Psi^{(1)}{\left(\frac{k}{2}\right)}\right]+\sum_{k,even}^{\infty}\frac{1}{2k-1}\left[2\Psi^{(1)}{(k)}-\frac12\Psi^{(1)}{\left(\frac{k}{2}\right)}\right]\\ &=-\frac12\sum_{k,odd}^{\infty}\frac{\Psi^{(1)}{\left(\frac{k}{2}\right)}}{2k-1}+\frac12\sum_{k,even}^{\infty}\frac{1}{2k-1}\left[4\Psi^{(1)}{(k)}-\Psi^{(1)}{\left(\frac{k}{2}\right)}\right]\\ &=-\frac12\sum_{k,odd}^{\infty}\frac{\Psi^{(1)}{\left(\frac{k}{2}\right)}}{2k-1}+\frac12\sum_{k,even}^{\infty}\frac{\Psi^{(1)}{\left(\frac{k+1}{2}\right)}}{2k-1}\\ &=-\frac12\sum_{n=0}^{\infty}\frac{\Psi^{(1)}{\left(n+\frac12\right)}}{4n+1}+\frac12\sum_{n=1}^{\infty}\frac{\Psi^{(1)}{\left(n+\frac12\right)}}{4n-1}\\ &=-\frac{\pi^2}{4}-\frac12\sum_{n=1}^{\infty}\frac{\Psi^{(1)}{\left(n+\frac12\right)}}{4n+1}+\frac12\sum_{n=1}^{\infty}\frac{\Psi^{(1)}{\left(n+\frac12\right)}}{4n-1}\\ &=-\frac{\pi^2}{4}+\sum_{n=1}^{\infty}\frac{\Psi^{(1)}{\left(n+\frac12\right)}}{16n^2-1}\\ \end{align}$$