Evaluating some Log Trig integrals through the derivatives of Beta Function

        In this previous blog entry we have defined the beta function and derived some integral representations. We also mentioned that it´s very useful to compute a certain class of integrals. And this is the aim of today´s post. Lets start from the following representation (equation (8) in this post)


B(a,b)=2\int_{0}^{\pi/2}\cos^{2a-1}(x)\sin^{2b-1}(x)dx=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}(1)


Let´s differentiate the R.H.S of (1) with respect to b

\frac{\partial B(a,b)}{\partial b}=B_{b}(a,b)=\frac{\partial}{\partial b}\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}

B_{b}(a,b)=\frac{\Gamma^{\prime}(a)\Gamma(b)\Gamma(a+b)-\Gamma(a)\Gamma(b)\Gamma^{\prime}(a+b)}{\left(\Gamma(a+b)\right)^2}

B_{b}(a,b)=\frac{\Gamma(b)\left[\Gamma^{\prime}(a)\Gamma(a+b)-\Gamma(a)\Gamma^{\prime}(a+b)\right]}{\left(\Gamma(a+b)\right)^2}

Now recall the definition of the digamma function

\psi(x)=\frac{\Gamma^{\prime}(x)}{\Gamma(x)}

rearranging

\Gamma^{\prime}(x)=\Gamma(x)\psi(x)

therefore

B_{b}(a,b)=\frac{\Gamma(b)\left[\Gamma(a)\psi(a)\Gamma(a+b)-\Gamma(a)\Gamma(a+b)\psi(a+b)\right]}{\left(\Gamma(a+b)\right)^2}

B_{b}(a,b)=\frac{\Gamma(a)\Gamma(b)\Gamma(a+b)\left[\psi(a)-\psi(a+b)\right]}{\left(\Gamma(a+b)\right)^2}


\boxed{B_{b}(a,b)=B(a+b)\left[\psi(a)-\psi(a+b)\right]}(2)


Lets now compute \frac{\partial^{2} B(a,b)}{\partial b^{2}}=B_{bb}(a,b)

rewrite (2) as

B_{b}(a,b)=B(a+b)\psi(a)-B(a+b)\psi(a+b)

differentiating w.t. b

B_{bb}(a,b)=B_{b}(a+b)\psi(a)+B(a+b)\psi^{\prime}(a)-B_{b}(a+b)\psi(a+b)-B(a+b)\psi^{\prime}(a+b)}

B_{bb}(a,b)=B_{b}(a+b)\left[\psi(a)-\psi(a+b)\right]+B(a+b)\left[\psi^{\prime}(a)-\psi^{\prime}(a+b)\right]

substituting (2) in the above equation

B_{bb}(a,b)=B(a+b)\left[\psi(a)-\psi(a+b)\right]\left[\psi(a)-\psi(a+b)\right]+B(a+b)\left[\psi^{\prime}(a)-\psi^{\prime}(a+b)\right]


\boxed{\frac{\partial^{2} B(a,b)}{\partial b^{2}}=B(a+b)\left[\left(\psi(a)-\psi(a+b)\right)^2+\left(\psi^{\prime}(a)-\psi^{\prime}(a+b)\right)  \right]}(3)


Similarly we can compute \frac{\partial^{2} B(a,b)}{\partial a \partial b}

Differentiating (2) w.r. to a


\frac{\partial^{2} B(a,b)}{\partial a \partial b}=\frac{\partial B(a,b)}{\partial a}\psi(a)-\frac{\partial B(a,b)}{\partial a}\psi(a+b)-B(a,b)\psi^{\prime}(a+b)


Using (2) we get


\boxed{\frac{\partial^{2} B(a,b)}{\partial a \partial b}=B(a,b)\left[ \left(\psi(a)-\psi(a+b) \right)\left(\psi(b)-\psi(a+b) \right) - \psi^{\prime}(a+b)\right]}(4)


On the other hand we may compute the derivatives of the L.H.S of (1)

B(a,b)=2\int_{0}^{\pi/2}\cos^{2a-1}(x)\sin^{2b-1}(x)dx

B(a,b)=2\int_{0}^{\pi/2}e^{(2a-1)\log(\cos(x))}e^{(2b-1)\log(\sin(x))} dx

\frac{\partial B(a,b) }{\partial a}=4\int_{0}^{\pi/2}\cos^{2a-1}(x)\sin^{2b-1}(x) \log(\cos(x))dx(5)

\frac{\partial B(a,b) }{\partial b}=4\int_{0}^{\pi/2}\cos^{2a-1}(x)\sin^{2b-1}(x) \log(\sin(x))dx(6)

\frac{\partial^{2} B(a,b)}{\partial a \partial b}=8\int_{0}^{\pi/2}\cos^{2a-1}(x)\sin^{2b-1}(x) \log(\sin(x))\log(\cos(x))dx(7)

\frac{\partial^{2} B(a,b)}{\partial^{2} a }=8\int_{0}^{\pi/2}\cos^{2a-1}(x)\sin^{2b-1}(x) \log^2(\cos(x))dx(8)

\frac{\partial^{2} B(a,b)}{\partial^{2} b}=8\int_{0}^{\pi/2}\cos^{2a-1}(x)\sin^{2b-1}(x) \log^2(\sin(x))dx(9)

Note that if we set  a=\frac{1}{2}  and   b=\frac{1}{2}   in (5), (6), (7), (8) and (9) we get


\frac{\partial B(a,b) }{\partial a}\Big|_{a=1/2,b=1/2}=4\int_{0}^{\pi/2}\log(\cos(x))dx(10)

\frac{\partial B(a,b) }{\partial b}\Big|_{a=1/2,b=1/2}=4\int_{0}^{\pi/2}\log(\sin(x))dx(11)

\frac{\partial^{2} B(a,b)}{\partial a \partial b}\Big|_{a=1/2,b=1/2}=8\int_{0}^{\pi/2} \log(\sin(x))\log(\cos(x))dx(12)

\frac{\partial^{2} B(a,b)}{\partial^{2} a }\Big|_{a=1/2,b=1/2}=8\int_{0}^{\pi/2} \log^2(\cos(x))dx(13)

\frac{\partial^{2} B(a,b)}{\partial^{2} b}\Big|_{a=1/2,b=1/2}=8\int_{0}^{\pi/2} \log^2(\sin(x))dx(14)


In order to evaluate (10), (11), (12), (13) and (14) we have to find the values of  \Gamma(1),  \Gamma\left(\frac{1}{2}\right),   \psi(1), \psi\left(\frac{1}{2}\right),   \psi^{\prime}(1) and  \psi^{\prime}\left(\frac{1}{2}\right). And this is the goal of this section.

By definition   \Gamma(1)=1

\Gamma\left(\frac{1}{2}\right) we have already calculated in this post (equation (A.1)). Here we use another way, letting a=\frac{1}{2}  and b=\frac{1}{2} in (1)

2\int_{0}^{\pi/2}dx=\Gamma^2\left(\frac{1}{2}\right)

\pi=\Gamma^2\left(\frac{1}{2}\right)

\boxed{\Gamma\left(\frac{1}{2}\right)=\sqrt{\pi}}(15)

To find \psi(1) recall Weiertrass representation for the Digamma function derived in this post (eq.(2.1)):

\psi(s+1) &=-\gamma+\sum_{n=1}^{\infty}\left(\frac{1}{n}-\frac{1}{n+s}\right)(16)

Letting s=0 we get

\boxed{\psi(1)=-\gamma}(17)

To compute \psi\left(\frac{1}{2}\right), let´s do the following. Start with (16)

\psi(s+1) &=-\gamma+\sum_{n=1}^{\infty}\left(\frac{1}{n}-\frac{1}{n+s}\right)

=-\gamma+\sum_{n=1}^{\infty} \int_{0}^{1}\left(x^{n-1}-x^{n+s-1}\right) d x

=-\gamma+\int_{0}^{1} \sum_{n=1}^{\infty}\left(x^{n-1}-x^{n+s-1}\right) d x

\psi(s+1) &=-\gamma+\int_{0}^{1} \frac{1-x^{s}}{1-x} d x(18)

Now let s \longmapsto s-1 in (18)

\psi(s) &=-\gamma+\int_{0}^{1} \frac{1-x^{s-1}}{1-x} d x

and set s=\frac{1}{2}

\psi\left(\frac{1}{2}\right) &=-\gamma+\int_{0}^{1} \frac{1-x^{-1/2}}{1-x} d x

let x=u^2

\psi\left(\frac{1}{2}\right) &=-\gamma+2\int_{0}^{1} \frac{1-u^{-1}}{1-u^2} u d u

\psi\left(\frac{1}{2}\right) &=-\gamma-2\int_{0}^{1} \frac{(1-u)}{(1-u)(1+u)} u d u

\psi\left(\frac{1}{2}\right) &=-\gamma-2\int_{0}^{1} \frac{1}{1+u} u d u

\boxed{\psi\left(\frac{1}{2}\right) &=-\gamma-2\ln(2)}(19)

If we differentiate (16) w.r. to s we get

\psi^{\prime}(s+1) &=\sum_{n=1}^{\infty}\frac{1}{(n+s)^2}(20)

letting s=0 in (20)

\psi^{\prime}(1) =\sum_{n=1}^{\infty}\frac{1}{n^2}=\zeta(2)

\boxed{\psi^{\prime}(1) =\frac{\pi^2}{6}}(21)

For \psi^{\prime}\left(\frac{1}{2}\right)  set   s=-\frac{1}{2}  in (20)

\psi^{\prime}\left(\frac{1}{2}\right) &=\sum_{n=1}^{\infty}\frac{1}{\left(n-\frac{1}{2}\right)^2}

\psi^{\prime}\left(\frac{1}{2}\right) =4\sum_{n=1}^{\infty}\frac{1}{\left(2n-1\right)^2}(22)

Now observe the following:

\zeta(2)=\sum_{n=1}^{\infty}\frac{1}{n^2}

splitting in even and odd terms we get:

\zeta(2)=\sum_{n=1}^{\infty}\frac{1}{(2n)^2}+\sum_{n=1}^{\infty}\frac{1}{\left(2n-1\right)^2}

\zeta(2)=\frac{1}{4}\zeta(2)+\sum_{n=1}^{\infty}\frac{1}{\left(2n-1\right)^2}

\sum_{n=1}^{\infty}\frac{1}{\left(2n-1\right)^2}=\frac{3}{4}\zeta(2)(23)

plugging (23) in (22) we get

\boxed{\psi^{\prime}\left(\frac{1}{2}\right) =3\zeta(2)}(24)


So we have the following results:

\Gamma(1)=1

\Gamma\left(\frac{1}{2}\right)=\sqrt{\pi}

\psi(1)=-\gamma

\psi\left(\frac{1}{2}\right)=-\gamma-2\ln(2)

\psi^{\prime}(1)=\zeta(2)

\psi^{\prime}\left(\frac{1}{2}\right)=3\zeta(2)


We can now compute equations (10) to (14). From equations (2) and (10) we get:

4\int_{0}^{\pi/2}\log(\cos(x))dx=B\left(\frac{1}{2},\frac{1}{2}\right)\left[\psi\left(\frac{1}{2}\right)-\psi(1)\right]

4\int_{0}^{\pi/2}\log(\cos(x))dx=\pi\left[-\gamma-2\ln(2)+\gamma\right]

\boxed{\int_{0}^{\pi/2}\log(\cos(x))dx=-\frac{\pi\ln(2)}{2}}(25)

Similarly

\boxed{\int_{0}^{\pi/2}\log(\sin(x))dx=-\frac{\pi\ln(2)}{2}}(26)

From equations (4) and (12) we get:

8\int_{0}^{\pi/2} \log(\sin(x))\log(\cos(x))dx=B\left(\frac{1}{2},\frac{1}{2}\right)\left[\left(\psi\left(\frac{1}{2}\right)-\psi(1)\right)^2-\psi^{\prime}(1)\right]

\int_{0}^{\pi/2} \log(\sin(x))\log(\cos(x))dx=\frac{\pi}{8}\left[\left(-2\ln(2)\right)^2+\zeta(2)\right]

\boxed{\int_{0}^{\pi/2} \log(\sin(x))\log(\cos(x))dx=\frac{\pi\ln^2(2)}{2}-\frac{\pi^3}{48}}(27)

From equations (3) and (13) we get:

8\int_{0}^{\pi/2} \log^2(\cos(x))dx=B\left(\frac{1}{2},\frac{1}{2}\right)\left[\left(\psi\left(\frac{1}{2}\right)-\psi(1)\right)^2+\psi^{\prime}\left(\frac{1}{2}\right) -\psi^{\prime}(1)\right]

\int_{0}^{\pi/2} \log^2(\cos(x))dx=\frac{\pi}
{8}\left[\left(-2\ln(2)\right)^2+2\zeta(2)\right]

\boxed{\int_{0}^{\pi/2} \log^2(\cos(x))dx=\frac{\pi\ln^2(2)}{2}+\frac{\pi^3}{24}}}(28)

and similarly

\boxed{\int_{0}^{\pi/2} \log^2(\sin(x))dx=\frac{\pi\ln^2(2)}{2}+\frac{\pi^3}{24}}}(29)

As a corollary we can compute another beautiful result

\int_{0}^{\pi/2} \log^2(\tan(x))dx=\int_{0}^{\pi/2}\left(\log^2(\cos(x))+ \log^2(\sin(x))-2\log(\sin(x))\log(\cos(x))\right)dx

\int_{0}^{\pi/2} \log^2(\tan(x))dx=2\left( \frac{\pi\ln^2(2)}{2}+\frac{\pi^3}{24}}\right)-2\left(\frac{\pi\ln^2(2)}{2}-\frac{\pi^3}{48} \right)

\boxed{\int_{0}^{\pi/2} \log^2(\tan(x))dx=\frac{\pi^3}{8}}(30)


Ricardo Albahari


Comments

Popular posts from this blog