13

I'm currently working on a definite integral and am hoping to find alternative methods to evaluate. Here I will to address the integral: \begin{equation} I_n = \int_0^\frac{\pi}{2}\ln^n\left(\tan(x)\right)\:dx \end{equation} Where $n \in \mathbb{N}$. We first observe that when $n = 2k + 1$ ($k\in \mathbb{Z}, k \geq 0$) that, \begin{equation} I_{2k + 1} = \int_0^\frac{\pi}{2}\ln^{2k + 1}\left(\tan(x)\right)\:dx = 0 \end{equation} This can be easily shown by noticing that the integrand is odd over the region of integration about $x = \frac{\pi}{4}$. Thus, we need only resolve the cases when $n = 2k$, i.e. \begin{equation} I_{2k} = \int_0^\frac{\pi}{2}\ln^{2k}\left(\tan(x)\right)\:dx \end{equation} Here I have isolated two methods.


Method 1:

Let $u = \tan(x)$: \begin{equation} I_{2k} = \int_0^\infty\ln^{2k}\left(u\right) \cdot \frac{1}{u^2 + 1}\:du = \int_0^\infty \frac{\ln^{2k}\left(u\right)}{u^2 + 1}\:du \end{equation} We note that: \begin{equation} \ln^{2k}(u) = \frac{d^{2k}}{dy^{2k}}\big[u^y\big]_{y = 0} \end{equation} By Leibniz's Integral Rule: \begin{align} I_{2k} &= \int_0^\infty \frac{\frac{d^{2k}}{dy^{2k}}\big[u^y\big]_{y = 0}}{u^2 + 1}\:du = \frac{d^{2k}}{dy^{2k}} \left[ \int_0^\infty \frac{u^y}{u^2 + 1} \right]_{y = 0} \nonumber \\ &= \frac{d^{2k}}{dy^{2k}} \left[ \frac{1}{2}B\left(1 - \frac{y + 1}{2}, \frac{y + 1}{2} \right) \right]_{y = 0} =\frac{1}{2}\frac{d^{2k}}{dy^{2k}} \left[ \Gamma\left(1 - \frac{y + 1}{2}\right)\Gamma\left( \frac{y + 1}{2} \right) \right]_{y = 0} \nonumber \\ &=\frac{1}{2}\frac{d^{2k}}{dy^{2k}} \left[ \frac{\pi}{\sin\left(\pi\left(\frac{y + 1}{2}\right)\right)} \right]_{y = 0} = \frac{\pi}{2}\frac{d^{2k}}{dy^{2k}} \left[\operatorname{cosec}\left(\frac{\pi}{2}\left(y + 1\right)\right) \right]_{y = 0} \end{align}


Method 2:

We first observe that: \begin{align} \ln^{2k}\left(\tan(x)\right) &= \big[\ln\left(\sin(x)\right) - \ln\left(\cos(x)\right) \big]^{2k} \nonumber \\ &= \sum_{j = 0}^{2k} { 2k \choose j}(-1)^j \ln^j\left(\cos(x)\right)\ln^{2k - j}\left(\sin(x)\right) \end{align} By the linearity property of proper integrals we observe: \begin{align} I_{2k} &= \int_0^\frac{\pi}{2} \left[ \sum_{j = 0}^{2k} { 2k \choose j}(-1)^j \ln^j\left(\cos(x)\right)\ln^{2k - j}\left(\sin(x)\right) \right]\:dx \nonumber \\ &= \sum_{j = 0}^{2k} { 2k \choose j}(-1)^j \int_0^\frac{\pi}{2} \ln^j\left(\cos(x)\right)\ln^{2k - j}\left(\sin(x)\right)\:dx \nonumber \\ & = \sum_{j = 0}^{2k} { 2k \choose j}(-1)^j F_{n,m}(0,0) \end{align} Where \begin{equation} F_{n,m}(a,b) = \int_0^\frac{\pi}{2} \ln^n\left(\cos(x)\right)\ln^{m}\left(\sin(x)\right)\:dx \end{equation} Utilising the same identity given before, this becomes: \begin{align} F_{n,m}(a,b) &= \int_0^\frac{\pi}{2} \frac{d^n}{da^n}\big[\sin^a(x) \big] \cdot \frac{d^m}{db^m}\big[\cos^b(x) \big]\big|\:dx \nonumber \\ &= \frac{\partial^{n + m}}{\partial a^n \partial b^m}\left[ \int_0^\frac{\pi}{2} \sin^a(x)\cos^b(x)\:dx\right] = \frac{\partial^{n + m}}{\partial a^n \partial b^m}\left[\frac{1}{2} B\left(\frac{a + 1}{2}, \frac{b + 1}{2} \right)\right] \nonumber \\ &= \frac{1}{2}\frac{\partial^{n + m}}{\partial a^n \partial b^m}\left[\frac{\Gamma\left(\frac{a + 1}{2}\right)\Gamma\left(\frac{b + 1}{2}\right)}{\Gamma\left(\frac{a + b}{2} + 1\right)}\right] \end{align} Thus, \begin{equation} I_{2k} = \sum_{j = 0}^{2k} { 2k \choose j}(-1)^j \frac{1}{2}\frac{\partial^{2k }}{\partial a^j \partial b^{2k - j}}\left[\frac{\Gamma\left(\frac{a + 1}{2}\right)\Gamma\left(\frac{b + 1}{2}\right)}{\Gamma\left(\frac{a + b}{2} + 1\right)}\right]_{(a,b) = (0,0)} \end{equation}


So, I'm curious, are there any other Real Based Methods to evaluate this definite integral?

  • 4
    In method 1: $\csc\frac{\pi}2(y+1)=\sec\frac{\pi}2 y$ The $n$th derivative is well studied and is called Euler numbers. Search up the Maclaurin series of secant function on the internet. – Lee Jul 16 '19 at 05:18

4 Answers4

9

$$\begin{split} I_{2k} &= \int_0^\infty\frac{\ln^{2k}u}{u^2 + 1}du \\ &= \int_0^1\frac{\ln^{2k}u}{u^2 + 1}du +\int_1^{+\infty}\frac{\ln^{2k}\left(u\right)}{u^2 + 1}du \\ &=\int_0^1\frac{\ln^{2k}u}{u^2 + 1}du +\int_0^{1}\frac{\ln^{2k}t}{t^2 + 1}dt \,\,\,\left(\text{by } u\rightarrow \frac 1 t\right)\\ &=2\int_0^1\frac{\ln^{2k}u}{u^2 + 1}du\\ &=2\sum_{n\in\mathbb N}(-1)^n\int_0^1u^{2n}\ln^{2k} (u) du \end{split}$$ Now, let $$J_{p,q}=\int_0^1u^p\ln^q (u)du$$ If $q\geq 1$, by integration by parts, $$J_{p, q}=\left. \frac{u^{p+1}}{p+1}\ln^q u\right]_0^1-\int_0^1\frac{u^{p+1}}{p+1}q\ln^{q-1}(u)\frac{du}u=-\frac q{p+1}J_{p,q-1}$$ Consequently, if $q\geq 1$, $$J_{p,q} = (-1)^{q}\frac{q!}{(p+1)^{q+1}}$$ We conclude that $$I_{2k}=2\cdot (2k)!\sum_{n\in\mathbb N}\frac{(-1)^n}{(2n+1)^{2k+1}}$$ Following Zachy's suggestion, the last sum is known as the Dirichlet Beta function $$I_{2k}=2\cdot (2k)!\beta(2k+1)$$ Finally, values of $\beta$ at odd numbers are known in terms of Euler's numbers and we get $$\boxed{I_{2k}=2\frac{(-1)^kE_{2k}\pi^{2k+1}}{4^{k+1}}}$$

Stefan Lafon
  • 13,728
  • fantastic solution. Do you think the solution can be expressed using elementary functions? –  Jul 16 '19 at 08:12
  • 1
    Yes it can. I'm hitting the road soon. But here's the idea: $\zeta(2k)$ has a closed form in terms of powers of pi. I'll try to update when I'm back online. – Stefan Lafon Jul 16 '19 at 08:17
  • 2
    You can just use this: https://math.stackexchange.com/questions/2437487/formula-for-zeta2k-with-bernoulli-numbers. Although I think it looks nicer having the zeta function there. – Zacky Jul 16 '19 at 08:19
  • 1
    @Zacky - I personally prefer avoiding non-elementary functions where I can. But yes, it does look nice with the Zeta Function :-)

    Thanks for the reference.

    –  Jul 16 '19 at 08:26
  • OK, I re-read my computations, and I had made an error. The final result is almost the same, but with $\zeta$ evaluated at odd integers. Unfortunately, there is no known closed form for those values of $\zeta$. – Stefan Lafon Jul 16 '19 at 10:05
  • @StefanLafon - Ah darn! still, a very nice solution. Appreciate the post. –  Jul 16 '19 at 12:08
  • @StefanLafon - Well we do have:

    $$\zeta(2k + 1) = \frac{\frac{\pi}{2}\frac{d^{2k}}{dy^{2k}} \left[\operatorname{cosec}\left(\frac{\pi}{2}\left(y + 1\right)\right) \right]_{y = 0}}{2\cdot(2k)!\left( 1-\frac 1 {2^{2k+1}}\right)} $$

    –  Jul 16 '19 at 12:39
  • 1
    $@$Stefan Lafon. I think that in line 5 $(-1)^n$ is missing. Thus it should be \begin{equation} = 2\underset{n\in\mathbb{N}}{\sum}\int_{0}^{1}(-1)^{n}u^{2n}\ln^{2k}(u), du \end{equation} – JanG Jul 16 '19 at 13:33
  • Indeed. Another rookie's mistake. Now I can't find a closed form. – Stefan Lafon Jul 16 '19 at 14:42
  • @StefanLafon I haven't checked the calculation, but at your final result use this: https://en.wikipedia.org/wiki/Dirichlet_beta_function and then the relation with the Euler numbers for the odd values (found in the same wiki link). – Zacky Jul 16 '19 at 14:47
  • I think It is possible to express Dirichlet's eta function at $z=2k+1$ using Riemann Zeta function. – FDP Jul 16 '19 at 15:39
  • Simplifying Dirichlet beta function:

    Using the fact that $\quad\displaystyle \sum_{n=0}^\infty (-1)^n a_{2n+1}=\Im\sum_{n=1}^\infty i^n a_n\ $, we get $$\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)^{2k+1}}=\Im\sum_{n=1}^\infty\frac{i^n}{n^{2k+1}}=\Im\operatorname{Li}_{2k+1}(i)$$

    – Ali Olaikhan Jul 16 '19 at 20:58
  • 1
    @Zachy thank you so much. I didn't know anything about Dirichlet's Beta function. It was exactly what I was looking for. – Stefan Lafon Jul 16 '19 at 22:00
  • 1
    I have been working with this integral for so long, but I never thought to evaluate it this way. Thanks! (+1) – clathratus Jul 17 '19 at 00:39
  • According to https://en.wikipedia.org/wiki/Dirichlet_beta_function

    \begin{equation} \beta(s) = \dfrac{1}{\Gamma(s)}\int_{0}^{\infty}\dfrac{x^{s-1}e^{-x}}{1+e^{-2x}}, dx. \end{equation} This simplifies the answer that Stefan Lafon gave. Via the substituton $u=e^{-x}$ and an even integrand we get \begin{equation} I_{2k} = \int_{0}^{\infty}\dfrac{\ln^{2k}(u)}{u^2+1}, du = \int_{-\infty}^{\infty}\dfrac{x^{2k}e^{-x}}{e^{-2x}+1}, dx = 2\int_{0}^{\infty}\dfrac{x^{2k}e^{-x}}{e^{-2x}+1}, dx = 2\beta(2k+1)(2k)!, . \end{equation}

    – JanG Jul 17 '19 at 22:33
6

Make an exponential generating function with $I_k$, $$I_k: = \frac{1}{2} (1 + (-1)^k) \int_0^\infty \frac{ \log^{k}(u) }{u^2+1} du $$ Then $$I(x)=\sum_{k=0}^\infty I_k\,\frac{x^k}{k!} = \frac{1}{2}\int_0^\infty \frac{ u^x + u^{-x} }{u^2+1} du $$ where an interchange of $\sum$ and $\int$ has been made. The integral can be solved in closed form, $I(x) = \pi/2 \cdot \sec{(\pi x/2)}.$ Expanding the sec in a power series will give the last answer that Stafan Lafon gave, in terms of Euler numbers.

user321120
  • 6,895
5

Slightly different way - use well known results

$$\int_0^{\frac{\pi}{2}}\tan^ay\;dy=\frac{\pi}{2}\frac{1}{\sin \frac{\pi}2(a+1) } $$

( this integral is considered in this site probably many times.) $$\frac{1}{\sin x}=\frac{1}{x}+\sum _{n=1}^\infty (-1)^n\left ( \frac{1}{x-n\pi}+ \frac{1}{x+n\pi}\right )$$

and differentiate with respect to $a$ as many times as necessary.

Hans
  • 10,484
Martin Gales
  • 7,927
3

Using the Reflection property of Beta function, we have $$ \begin{aligned} \int_0^{\frac{\pi}{2}} \tan ^a x d x=\int_0^{\frac{\pi}{2}} \sin ^a x \cos ^{-a} x d x =& \frac{1}{2} B\left(\frac{a+1}{2}, \frac{1-a}{2}\right)=\frac{\pi}{2 \sin \left(\frac{a+1}{2} \pi\right)}=\frac{1}{2} \sec \frac{a \pi}{2} \end{aligned} $$ $$ \begin{aligned} \int_0^{\frac{\pi}{2}} \ln ^n(\tan x) d x =& \frac{\partial^n}{\partial a^n}\left.\left(\frac{\pi}{2} \sec \frac{a \pi}{2}\right) \right|_{x=0} \\ =&\left.\frac{\pi^{n+1}}{2^{n+1}} \frac{\partial^n}{\partial x^n}(\sec x)\right|_{x=0}\\ \end{aligned} $$ Now we can conclude that

$$\boxed{\int_0^{\frac{\pi}{2}} \ln ^n(\tan x) d x =\left\{\begin{array}{l} 0 \qquad\qquad \text { if } n \text { is odd } \\ \dfrac{\pi^{n+1}\left|E_{n}\right|}{2^{n+1}} \quad \text { if } n \text { is even } \end{array}\right.}$$

where $E_n$ is the Euler Number whose formula comes from WA.

Wish it helps.

Lai
  • 31,615