# Closed form of $I=\int_{0}^{\pi/2} \tan^{-1} \bigg( \frac{\cos(x)}{\sin(x) - 1 - \sqrt{2}} \bigg) \tan(x)\;dx$

Does the integral below have a closed-form:

$$I=\int_{0}^{\pi/2} \tan^{-1} \bigg( \frac{\cos(x)}{\sin(x) - 1 - \sqrt{2}} \bigg) \tan(x)\;dx,$$

where $\tan^{-1} (\cdot)$ is inverse tangent function.

Neither Wolfram|Alpha nor Maple 13 can return possible closed-form of the integral. I cannot also find a similar integral in G&R 8th edition. Its numeric integral computed by Maple 13 is

$$I=-0.60581547102487915432009247784178206365553774419860 ...$$

This integral came up in discussion during symbolic computation seminar. Our professor asked us to help him to find the closed form of several integrals. This one comes from the study in topic special function: Inverse Tangent Integral.

As I said in my comment and I'll add some details, we have tried many substitutions, standard techniques such as: integration by parts, differentiation under integral sign, etc. We also tried method of countour integration, but none of them gave promising result so far. We have been evaluating this integral since 2 weeks ago but no success. So, I thought it's about time to ask you for help. Can you help me out to find its closed-form, please? Can someone help to prove the closed-form given by users Cleo and Anastasiya Romanova? Thanks.

• I have also tried integration by parts and tried substitution $t=\sin(x)$, but it's still hard for me to evaluate the integral. I also think about using diferentiation under integral sign using $$I(a)=\int_{0}^{\pi/2} \tan^{-1} \bigg( \frac{\cos(x)}{\sin(x) - a }\bigg) \tan(x)\;dx$$ But no succeed so far – Dementor Oct 24 '14 at 17:05
• I have voted to close this question. It lacks vital context, namely why this integral in particular is interesting, and where this integral arose. The best questions on this site go beyond just posing a question by explaining the motivation for it. There are too many possible integrals for every one to be on-topic on its own. – Carl Mummert Oct 24 '14 at 20:46
• @CarlMummert Please, have a look edited version of my question. Thanks. – Dementor Oct 25 '14 at 14:03
• Beautiful integral! Please post more of these integrals from the symbolic computation seminar. (It is refreshing to see an integral here that is not of the form $\int_0^1 x^a \ln^b x$ for once.) – user111187 Oct 26 '14 at 10:26
• @Venus Thanks for giving a bounty to my question. I really apreciate it. – Dementor Nov 15 '14 at 9:54

Step 1: Introducing an extra parameter

Define $$\phi(\alpha)=\int^\frac{\pi}{2}_0\arctan\left(\frac{\sin{x}}{\cos{x}-\frac{1}{\alpha}}\right)\cot{x}\ {\rm d}x$$ Differentiating yields \begin{align} \phi'(\alpha) =&-\int^\frac{\pi}{2}_0\frac{\cos{x}}{1-2\alpha\cos{x}+\alpha^2}{\rm d}x\\ =&\frac{\pi}{4\alpha}-\frac{1+\alpha^2}{2\alpha(1-\alpha^2)}\int^\frac{\pi}{2}_0\frac{1-\alpha^2}{1-2\alpha\cos{x}+\alpha^2}{\rm d}x \end{align}

Step 2: Evaluation of $\phi'(\alpha)$

For $|\alpha|<1$, the following identity holds. $$\frac{1-\alpha^2}{1-2\alpha\cos{x}+\alpha^2}=1+2\sum^\infty_{n=1}\alpha^n\cos(nx)$$ Therefore, \begin{align} \phi'(\alpha) =&\frac{\pi}{4\alpha}-\frac{1+\alpha^2}{2\alpha(1-\alpha^2)}\left(\frac{\pi}{2}+2\sum^\infty_{n=0}\frac{(-1)^n}{2n+1}\alpha^{2n+1}\right)\\ =&-\frac{\pi\alpha}{2(1-\alpha^2)}-\frac{\arctan{\alpha}}{\alpha}-\frac{2\alpha\arctan{\alpha}}{1-\alpha^2}\tag1 \end{align}

Step 3: The Closed Form

Integrating back, we get \begin{align} &\color{red}{\Large{\phi(\sqrt{2}-1)}}\\ =&\left(\frac{\pi}{4}+\arctan{\alpha}\right)\ln(1-\alpha^2)\Bigg{|}^{\sqrt{2}-1}_0-\int^{\sqrt{2}-1}_0\left[\color{#FF4F00}{\frac{\arctan{\alpha}}{\alpha}}+\color{#00A000}{\frac{\ln(1-\alpha^2)}{1+\alpha^2}}\right]{\rm d}\alpha\tag2\\ =&\frac{3\pi}{8}\ln(2\sqrt{2}-2)\color{blue}{\underbrace{\color{black}{-\int^\frac{\pi}{8}_0\color{#FF4F00}{2x\csc{2x}}\ {\rm d}x+\int^\frac{\pi}{8}_0\color{#00A000}{2\ln(\cos{x})}\ {\rm d}x}}}-\int^\frac{\pi}{8}_0\color{#00A000}{\ln(\cos{2x})}\ {\rm d}x\tag3\\ =&\frac{3\pi}{8}\ln(2\sqrt{2}-2)\color{blue}{-x\ln(\tan{x})\Bigg{|}^\frac{\pi}{8}_0+\int^\frac{\pi}{8}_0\ln\left(\frac{1}{2}\sin{2x}\right)\ {\rm d}x}-\int^\frac{\pi}{8}_0\ln(\cos{2x})\ {\rm d}x\tag4\\ =&\frac{\pi}{4}\ln(2\sqrt{2}-2)+\int^\frac{\pi}{8}_0\ln(\tan{2x})\ {\rm d}x\\ =&\frac{\pi}{4}\ln(2\sqrt{2}-2)-2\sum^\infty_{n=0}\frac{1}{2n+1}\int^\frac{\pi}{8}_0\cos\left((8n+4)x\right)\ {\rm d}x\tag5\\ =&\frac{\pi}{4}\ln(2\sqrt{2}-2)-2\sum^\infty_{n=0}\frac{\cos(n\pi)}{(2n+1)(8n+4)}\\ =&\frac{\pi}{4}\ln(2\sqrt{2}-2)-\frac{1}{2}\sum^\infty_{n=0}\frac{(-1)^n}{(2n+1)^2}\tag6\\ =&\boxed{\color{red}{\Large{\displaystyle\frac{\pi}{4}\ln(2\sqrt{2}-2)-\frac{\mathbf{G}}{2}}}}\tag7 \end{align}

Explanation:

$(2):$ Integrated $(1)$ from $0$ to $\sqrt{2}-1$. Integrated $\dfrac{2\alpha\arctan{\alpha}}{1-\alpha^2}$ by parts.
$(3):$ Applied the substitution $\alpha=\tan{x}$.
$(4):$ Integrated $-2x\csc{2x}$ by parts.
$(5):$ Used the Fourier series of $\ln(\tan{2x})$.
$(6):$ $\cos(n\pi)=(-1)^n$ for $n\in\mathbb{N}$.
$(7):$ Used the definition of Catalan's constant.

• Very detail. Nice work, +1! Anyway, could you elaborate this step: \begin{align} \phi'(\alpha) =&-\int^\frac{\pi}{2}_0\frac{\cos{x}}{1-2\alpha\cos{x}+\alpha^2}{\rm d}x\\ =&\frac{\pi}{4\alpha}-\frac{1+\alpha^2}{2\alpha(1-\alpha^2)}\int^\frac{\pi}{2}_0\frac{1-\alpha^2}{1-2\alpha\cos{x}+\alpha^2}{\rm d}x \end{align} I'm bit lost there. Thanks. – Venus Nov 19 '14 at 10:45
• Oh, never mind. I get it. \begin{align} \phi'(\alpha) =&-\int^\frac{\pi}{2}_0\frac{\cos{x}}{1-2\alpha\cos{x}+\alpha^2}{\rm d}x\\ =&\frac{1}{2\alpha}-\frac{1}{2\alpha}-\int^\frac{\pi}{2}_0\frac{\cos{x}}{1-2 \alpha\cos{x}+\alpha^2}{\rm d}x\end{align} – Venus Nov 19 '14 at 10:54

## Hello there, this is Cleo who is using Anastasiya's M.S.E. account (>‿◠)✌

Does the integral below have a closed-form?

$$I=\int_{0}^{\Large\frac{\pi}{2}} \arctan \left( \frac{\cos x}{\sin x - 1 - \sqrt{2}} \right) \tan x \,\,dx$$

${\sf\mbox{Yes, it does.}}$

$$\large I=\frac{\pi\ln\bigg(2\sqrt{2}-2\bigg)-2\,\mathbf{G}}{4}$$

where $\mathbf{G}$ is Catalan's constant.

Hint :

Let $$I(a)=\int_{0}^{\Large\frac{\pi}{2}} \arctan \left( \frac{\cos x}{\sin x -a} \right) \tan x \,\,dx$$ so that $\,I(0)=\dfrac{\pi}{2}\ln2\,$, then $$I'(a)=\int_{0}^{\Large\frac{\pi}{2}} \frac{\sin x}{1+a^2-2a\sin x} \,\,dx=\int_{0}^{\Large\frac{\pi}{2}} \frac{\cos x}{1+a^2-2a\cos x} \,\,dx$$ Using identity $$1+2\sum_{n=1}^\infty \frac{\cos(n x)}{a^n}=\frac{a^2-1}{1+a^2-2a\cos x}\qquad,\qquad\mbox{for}\, a>|1|$$ we have $$I'(a)=\int_{0}^{\Large\frac{\pi}{2}} \frac{\cos x}{a^2-1} \,\,dx+\int_{0}^{\Large\frac{\pi}{2}} \frac{2\cos^2 x}{a\left(a^2-1\right)} \,\,dx+\frac{2}{a^2-1}\sum_{n=2}^\infty \int_{0}^{\Large\frac{\pi}{2}} \frac{\cos x\cos(n x) }{a^n}\,\,dx$$ I have no much time, so I'll leave it the rest to you. I am sure you can take it from here.

• Thank you for the closed-form but how did you get that closed-form? I have checked numerically and it's correct to 1000 digits precision. Can you share it to me? – Dementor Oct 25 '14 at 14:05
• Nice answer, but why doesn't Cleo post her answers herself? – user111187 Oct 26 '14 at 10:24
• Cleo! I guessed it has to be. – Shivam Patel Nov 17 '14 at 17:02

For $x\in \Big[0,\dfrac{\pi}{2}\Big]$ let $f(x)=\arctan\Big(\dfrac{\cos x}{\sin x-1-\sqrt{2}}\Big)$

$f'(x)=\dfrac{(\sqrt{2}+1)\sin x-1}{2(\sqrt{2}+1)(\sqrt{2}-\sin x)}$

For $x\in \Big[0,\dfrac{\pi}{2}\Big[$ let $g(x)=-\ln(\cos x)$

$g'(x)=\tan x$

Let $\alpha \in \Big[0,\dfrac{\pi}{2}\Big[$

$\displaystyle A(\alpha)=\int_0^{\alpha}f(x)g'(x)dx=\Big[-f(x)\ln(\cos x)\Big]_0^{\alpha}+\int_0^{\alpha}\dfrac{(\sqrt{2}+1)\sin x-1}{2(\sqrt{2}+1)(\sqrt{2}-\sin x)}\ln(\cos x)dx$

$f(0)\ln(\cos 0)=0$

For $x\in \mathbb{R}$, $\cos\Big(\dfrac{\pi}{2}-x\Big)=\sin(x)$

For $x\in \Big[0,\dfrac{\pi}{2}\Big[$ let $h(x)=f\Big(\dfrac{\pi}{2}-x\Big)$

Notice:

$h(0)=f\Big(\dfrac{\pi}{2}\Big)=0$

For $x\in \Big]0,\dfrac{\pi}{2}\Big[$

$h(x)\ln(\sin x)=\dfrac{h(x)}{x}\Big(x\ln x+x\ln\big(\dfrac{\sin x}{x}\big)\Big)$

$\lim_{x\rightarrow \tfrac{\pi}{2}^-}f(x)\ln(\cos x)=\lim_{x\rightarrow 0^+}h(x)\ln(\sin x)=0$

Since:

$\lim_{x\rightarrow 0^+} \dfrac{h(x)}{x}=h'(0)$

$\lim_{x\rightarrow 0} \dfrac{\sin x}{x}=1$

$\lim_{x\rightarrow 0^+}x\ln(x)=0$

Therefore

$\displaystyle I=\lim_{\alpha\rightarrow \tfrac{\pi}{2}^-}A(\alpha)=\int_0^{\tfrac{\pi}{2}}\dfrac{(\sqrt{2}+1)\sin x-1}{2(\sqrt{2}+1)(\sqrt{2}-\sin x)}\ln(\cos x)dx$

$\displaystyle I=\int_0^{\tfrac{\pi}{2}}\dfrac{(\sqrt{2}+1)\Big(-(\sqrt{2}-\sin x)+\sqrt{2}\Big)-1}{2(\sqrt{2}+1)(\sqrt{2}-\sin x)}\ln(\cos x)dx$

$\displaystyle I=\int_0^{\tfrac{\pi}{2}}\dfrac{(\sqrt{2}+1)\sqrt{2}-1}{2(\sqrt{2}+1)(\sqrt{2}-\sin x)}\ln(\cos x)dx-\dfrac{1}{2}\int_0^{\tfrac{\pi}{2}}\ln(\cos x)dx$

$\displaystyle I=\int_0^{\tfrac{\pi}{2}}\dfrac{\ln(\cos x)}{2(\sqrt{2}-\sin x)}dx-\dfrac{1}{2}\int_0^{\tfrac{\pi}{2}}\ln(\cos x)dx$

For the second term a closed form is well known to be $\dfrac{\pi\log2}{4}$

Let $\displaystyle J=\int_0^{\tfrac{\pi}{2}}\dfrac{\ln(\cos x)}{2(\sqrt{2}-\sin x)}dx$

Perform the change of variable $u=\tan\Big(\dfrac{x}{2}\Big)$ it follows:

$\displaystyle J=\dfrac{1}{\sqrt{2}}\int_0^1 \dfrac{\ln\Big(\dfrac{1-x^2}{1+x^2}\Big)}{x^2-\sqrt{2}x+1}dx$

One more step.

Notice: $(x^2-\sqrt{2}x+1)(x^2+\sqrt{2}x+1)=x^4+1$

Therefore:

$\displaystyle J=\dfrac{1}{\sqrt{2}}\int_0^1 \dfrac{(x^2+\sqrt{2}x+1)\ln\Big(\tfrac{1-x^2}{1+x^2}\Big)}{1+x^4}dx$

$\displaystyle J=\int_0^1 \dfrac{x\ln\Big(\tfrac{1-x^2}{1+x^2}\Big)}{1+x^4}dx+\dfrac{1}{\sqrt{2}}\int_0^1 \dfrac{(x^2+1)\ln\Big(\tfrac{1-x^2}{1+x^2}\Big)}{1+x^4}dx$

One can get a closed form for the first integral.

Perform the changes of variable $u=x^2$, then $u=\dfrac{1-x}{1+x}$

Finally one get:

$\displaystyle \dfrac{1}{2}\int_0^1 \dfrac{\ln(x)}{1+x^2}dx$

That is a well-known value for

-$\dfrac{1}{2}G$, where $G$ is the Catalan's constant.

I suppose the harder is left.

That's finding a proof for the closed form of

$K=\displaystyle \dfrac{1}{\sqrt{2}}\int_0^1 \dfrac{(x^2+1)\ln\Big(\tfrac{1-x^2}{1+x^2}\Big)}{1+x^4}dx$

Final part. It's magic !

$K=\displaystyle \int_0^1 \dfrac{\log\big(\tfrac{1-x^2}{1+x^2}\big)}{1+\sqrt{2}x+x^2}dx+\int_0^1 \dfrac{\log\big(\tfrac{1-x^2}{1+x^2}\big)}{1-\sqrt{2}x+x^2}dx$

In both integrals perform the change of variable:

$x=\dfrac{1-u}{1+u}$

Therefore:

$K=\displaystyle\dfrac{1}{2(\sqrt{2}-1)}\int_0^1 \dfrac{\log\big(\tfrac{2x}{1+x^2}\big)}{(\sqrt{2}+1)^2x^2+1}dx+\dfrac{1}{2(\sqrt{2}+1)}\int_0^1 \dfrac{\log\big(\tfrac{2x}{1+x^2}\big)}{(\sqrt{2}-1)^2x^2+1}dx$

In the first integral perform the change of variable $y=(\sqrt{2}+1)x$

In the second integral perform the change of variable $y=(\sqrt{2}-1)x$

Therefore:

$K=\displaystyle \dfrac{1}{2}\int_0^{\sqrt{2}+1}\dfrac{\log\Big(\tfrac{2(\sqrt{2}-1)x}{1+(\sqrt{2}-1)^2x^2}\Big)}{1+x^2}dx+\dfrac{1}{2}\int_0^{\sqrt{2}-1}\dfrac{\log\Big(\tfrac{2(\sqrt{2}+1)x}{1+(\sqrt{2}+1)^2x^2}\Big)}{1+x^2}dx$

Knowing that:

$\tan\Big(\dfrac{3\pi}{8}\Big)=\sqrt{2}+1$

$\tan\Big(\dfrac{\pi}{8}\Big)=\sqrt{2}-1$

$(\sqrt{2}+1)(\sqrt{2}-1)=1$

$\displaystyle \int_0^u \dfrac{1}{1+x^2}dx=\arctan(u)$

Therefore:

$K=\dfrac{\pi\log(2)}{4}+\dfrac{\pi\log(\sqrt{2}-1)}{8}+L$

Where $L=\displaystyle\dfrac{1}{2}\int_0^{\sqrt{2}+1}\dfrac{\log\big(\tfrac{x}{1+(\sqrt{2}-1)^2x^2}\big)}{1+x^2}dx+\dfrac{1}{2}\int_0^{\sqrt{2}-1}\dfrac{\log\big(\tfrac{x}{1+(\sqrt{2}+1)^2x^2}\big)}{1+x^2}dx$

In the second integral perform the change of variable $x=\dfrac{1}{u}$

$\displaystyle L=\dfrac{1}{2}\int_0^{\sqrt{2}+1}\dfrac{\log\big(\tfrac{x}{1+(\sqrt{2}-1)^2x^2}\big)}{1+x^2}dx+\dfrac{1}{2}\int_{\sqrt{2}+1}^{+\infty}\dfrac{\log\big(\tfrac{x}{x^2+(\sqrt{2}+1)^2}\big)}{1+x^2}dx$

$\displaystyle L=\dfrac{1}{2}\int_0^{\sqrt{2}+1}\dfrac{\log\big(\tfrac{x}{1+(\sqrt{2}-1)^2x^2}\big)}{1+x^2}dx+\dfrac{1}{2}\int_{\sqrt{2}+1}^{+\infty}\dfrac{\log\big(\tfrac{x(\sqrt{2}-1)^2}{(\sqrt{2}-1)^2x^2+1}\big)}{1+x^2}dx$

$\displaystyle L=\dfrac{1}{2}\int_0^{+\infty}\dfrac{\log\big(\tfrac{x}{1+(\sqrt{2}-1)^2x^2}\big)}{1+x^2}dx+\dfrac{\pi\log(\sqrt{2}-1)}{8}$

Since:

$\displaystyle \int_0^{+\infty}\dfrac{\log(x)}{1+x^2}dx=0$

(consider intervals $[0,1]$, $[1,+\infty]$ and perform the change of variable $u=\dfrac{1}{x}$ )

$\displaystyle \int_0^{+\infty}\dfrac{\log(1+t^2x^2)}{1+x^2}dx=\pi\log(1+t)$

(consider the function: $\displaystyle F(t)=\int_0^{+\infty}\dfrac{\log(1+t^2x^2)}{1+x^2}dx$ and compute its derivative) see here: Integral:$\int^\infty_{-\infty}\frac{\ln(x^{2}+1)}{x^{2}+1}dx$ )

Then: $L=-\dfrac{\pi\log(2)}{4}+\dfrac{\pi\log(\sqrt{2}-1)}{8}$

Hence:

$K=\dfrac{\pi\log(\sqrt{2}-1)}{4}$

QED

• Thanks for taking time to answer my question. I really apreciate it – Dementor Nov 15 '14 at 9:53
• Starting from your first line, you can make some reductions in terms of PolyLogarithm functions ${\rm Li_{s}}$. I guess so. – Felix Marin Nov 17 '14 at 3:42
• Nice answer, +1! Anyway, could you show your integration by parts in the first step because I can't see it immediately. Thanks. – Venus Nov 19 '14 at 6:02

(It's a comment, i can't connect right now, sorry)

Dementor approach seems to me alright.

Consider rather:

$\displaystyle I(a)=\int_{0}^{\pi/2} \tan^{-1} \bigg( \frac{\cos(x)}{\sin(x) - a^2 }\bigg) \tan(x)\;dx$

Compute derivative, use change of variable $u=\tan(x/2)$ and i think one can get expression of I'(a) without integral sign.

$I(0)$ can be computed using $\arctan(x)+\arctan(1/x)=\dfrac{\pi}{2}$

I hope everything is ok.