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.
 A: 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.
A: Hello there, this is Cleo who is using Anastasiya's M.S.E. account (>‿◠)✌

Does the integral below have a closed-form?
\begin{equation}
I=\int_{0}^{\Large\frac{\pi}{2}} \arctan \left( \frac{\cos x}{\sin x - 1 - \sqrt{2}} \right) \tan x \,\,dx
\end{equation}

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

Here is the bonus answer for your question:

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

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

Hint :
Let
\begin{equation}
I(a)=\int_{0}^{\Large\frac{\pi}{2}} \arctan \left( \frac{\cos x}{\sin x -a} \right) \tan x \,\,dx
\end{equation}
so that $\,I(0)=\dfrac{\pi}{2}\ln2\,$, then
\begin{equation}
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
\end{equation}
Using identity
\begin{equation}
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|
\end{equation}
we have
\begin{equation}
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
\end{equation}
I have no much time, so I'll leave it the rest to you. I am sure you can take it from here.
A: (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.
