Need help with $\int_0^\infty\arctan\left(e^{-x}\right)\,\arctan\left(e^{-2x}\right)\,dx$

This is a fascinating integral! Following generally the same approach as shown in David H's answer, with help from Mathematica and manual simplification using known di- and trilogarithm identities, I was able to establish the following: $$\int_0^x\arctan\left(e^{-z}\right)\,\arctan\left(e^{-2z}\right)\,dz=x\operatorname{arccot}\left(e^x\right)\operatorname{arccot}\left(e^{2x}\right)\\ +\frac{\pi^2}{32}\left(\vphantom{\Large|}\!\ln\left(1+e^{4x}\right)-10\ln\left(e^{2x}+e^x\sqrt2+1\right)\right)\\ +\frac\pi2\left(\vphantom{\Large|}\!\operatorname{arccot}\left(1+e^x\sqrt2\right)+\arctan\left(e^x\right)\right)\cdot\ln\left(e^{2x}+e^x\sqrt2+1\right)\\ +\frac i4\left\{\left(\vphantom{\Large|}2\operatorname{arccot}\left(e^x\right)+\operatorname{arccot}\left(e^{2x}\right)\right)\cdot\\ \left[\operatorname{Li}_2\left(\tfrac{(-1)^{3/4}+e^x}{-i+e^x}\right)-\operatorname{Li}_2\left(\tfrac{-(-1)^{1/4}+e^x}{i+e^x}\right) +\operatorname{Li}_2\left(\tfrac{i-(-1)^{1/4}e^x}{i+e^x}\right)-\operatorname{Li}_2\left(\tfrac{1-(-1)^{1/4}e^x}{1+ie^x}\right)\right]\\ +\left(\vphantom{\Large|}\!\operatorname{arccot}\left(e^{2x}\right)+2\operatorname{arccot}\left(1+e^x\sqrt2\right)-2\operatorname{arccot}\left(e^x\right)\right)\cdot\\ \left[\operatorname{Li}_2\left(\tfrac{-(-1)^{1/4}+e^x}{-i+e^x}\right)-\operatorname{Li}_2\left(\tfrac{(-1)^{3/4}+e^x}{i+e^x}\right)+\operatorname{Li}_2\left(\tfrac{-1+(-1)^{1/4}e^x}{-1+ie^x}\right)-\operatorname{Li}_2\left(\tfrac{-i+(-1)^{1/4}e^x}{-i+e^x}\right)\right]\right\}\\ +\frac i2\left\{\operatorname{arccot}\left(1+e^x\sqrt2\right)\cdot\\ \left[\operatorname{Li}_2\left(\tfrac{-(-1)^{3/4}+e^x}{i+e^x}\right)-\operatorname{Li}_2\left(\tfrac{(-1)^{1/4}+e^x}{-i+e^x}\right)+\operatorname{Li}_2\left(\tfrac{i+(-1)^{1/4}e^x}{i-e^x}\right)-\operatorname{Li}_2\left(\tfrac{i+(-1)^{3/4}e^x}{i+e^x}\right)\right]+\left(\vphantom{\Large|}\!\operatorname{arccot}\left(e^x\right)-\operatorname{arccot}\left(1+e^x\sqrt2\right)\right)\cdot\left[\vphantom{\Large|}\operatorname{Li}_2\left(1-(-1)^{1/4}e^x\right)-\operatorname{Li}_2\left(1+(-1)^{1/4}e^x\right)\\ +\operatorname{Li}_2\left(1-(-1)^{3/4}e^x\right)-\operatorname{Li}_2\left(1+(-1)^{3/4}e^x\right)\right]\right\}\\ +\frac14\left[\operatorname{Li}_3\left(\tfrac{-(-1)^{1/4}+e^x}{-i+e^x}\right)-\operatorname{Li}_3\left(\tfrac{-(-1)^{1/4}+e^x}{i+e^x}\right)+\operatorname{Li}_3\left(\tfrac{(-1)^{1/4}+e^x}{-i+e^x}\right)-\operatorname{Li}_3\left(\tfrac{(-1)^{1/4}+e^x}{i+e^x}\right)\\ -\operatorname{Li}_3\left(\tfrac{-(-1)^{3/4}+e^x}{-i+e^x}\right)+\operatorname{Li}_3\left(\tfrac{-(-1)^{3/4}+e^x}{i+e^x}\right) -\operatorname{Li}_3\left(\tfrac{(-1)^{3/4}+e^x}{-i+e^x}\right)+\operatorname{Li}_3\left(\tfrac{(-1)^{3/4}+e^x}{i+e^x}\right)\\ +\operatorname{Li}_3\left(\tfrac{i-(-1)^{1/4}e^x}{i+e^x}\right)-\operatorname{Li}_3\left(\tfrac{-1+(-1)^{1/4}e^x}{-1+ie^x}\right)-\operatorname{Li}_3\left(\tfrac{-i+(-1)^{1/4}e^x}{-i+e^x}\right)-\operatorname{Li}_3\left(-\tfrac{i+(-1)^{1/4}e^x}{-i+e^x}\right)\\ +\operatorname{Li}_3\left(\tfrac{i+(-1)^{1/4}e^x}{i+e^x}\right)+\operatorname{Li}_3\left(\tfrac{-i+(-1)^{3/4}e^x}{-i+e^x}\right)+\operatorname{Li}_3\left(-\tfrac{i+(-1)^{3/4}e^x}{-i+e^x}\right) -\operatorname{Li}_3\left(\tfrac{i+(-1)^{3/4}e^x}{i+e^x}\right)\right]\\ +\frac\pi{64}\left[\left(2+\sqrt2\right)\cdot\left(16G+\pi^2\sqrt2\right)-\sqrt2\,\psi^{(1)}\!\left(\tfrac18\right)\right]$$ (here is the corresponding Mathematica expression)

If I'm not mistaken, it must hold for all real $x$, and might hold for some complex $x$, but in general there are some branch cuts that need to be dealt with (I was not yet able to analyze them completely). A possible proof consists of taking a derivative, a (tedious) simplification and computing a limit to establish the constant of integration. I relied on Mathematica for some steps, followed by high-precision numerical validation.

So, the final answer is

$$\int_0^\infty\arctan\left(e^{-x}\right)\,\arctan\left(e^{-2x}\right)\,dx=\frac\pi{64}\left[\left(2+\sqrt2\right)\cdot\left(16G+\pi^2\sqrt2\right)-\sqrt2\,\psi^{(1)}\!\left(\tfrac18\right)\right]$$


We'll have use for the following trigonometric identity, which may be verified by the well-known arctangent addition law:

$$\small{\arctan{\left(x^{2}\right)}=\arctan{\left(\frac{x}{\sqrt{2}-x}\right)}-\arctan{\left(\frac{x}{\sqrt{2}+x}\right)}};~~~\small{\left|x\right|<\sqrt{2}}.$$

We'll also need the definition of the arctangent function in terms of complex logarithms:

$$\arctan{\left(z\right)}=\frac{\ln{\left(\frac{1+iz}{1-iz}\right)}}{2i}.$$

Then,

$$\begin{align} I &=\int_{0}^{\infty}\arctan{\left(e^{-y}\right)}\arctan{\left(e^{-2y}\right)}\,\mathrm{d}y\\ &=\int_{0}^{1}\frac{\arctan{\left(x\right)}\arctan{\left(x^{2}\right)}}{x}\,\mathrm{d}x;~~~\small{\left[e^{-y}=x\right]}\\ &=\int_{0}^{1}\frac{\arctan{\left(x\right)}\left[\arctan{\left(\frac{x}{\sqrt{2}-x}\right)}-\arctan{\left(\frac{x}{\sqrt{2}+x}\right)}\right]}{x}\,\mathrm{d}x\\ &=\int_{0}^{1}\frac{\arctan{\left(x\right)}\left[\ln{\left(1-e^{-\frac{i\pi}{4}}x\right)}-\ln{\left(1-e^{\frac{i\pi}{4}}x\right)}\right]}{2ix}\,\mathrm{d}x\\ &~~~~~-\int_{0}^{1}\frac{\arctan{\left(x\right)}\left[\ln{\left(1+e^{\frac{i\pi}{4}}x\right)}-\ln{\left(1+e^{-\frac{i\pi}{4}}x\right)}\right]}{2ix}\,\mathrm{d}x\\ &=\small{\int_{0}^{1}\frac{\left[\ln{\left(1+ix\right)}-\ln{\left(1-ix\right)}\right]\left[\ln{\left(1+e^{\frac{i\pi}{4}}x\right)}-\ln{\left(1+e^{-\frac{i\pi}{4}}x\right)}\right]}{4x}\,\mathrm{d}x}\\ &~~~~~\small{-\int_{0}^{1}\frac{\left[\ln{\left(1+ix\right)}-\ln{\left(1-ix\right)}\right]\left[\ln{\left(1+e^{\frac{3i\pi}{4}}x\right)}-\ln{\left(1+e^{-\frac{3i\pi}{4}}x\right)}\right]}{4x}\,\mathrm{d}x}\\ &=\small{\int_{0}^{1}\frac{\Re{\left[\ln{\left(1+ix\right)}\ln{\left(1+e^{\frac{i\pi}{4}}x\right)}-\ln{\left(1-ix\right)}\ln{\left(1+e^{\frac{i\pi}{4}}x\right)}\right]}}{2x}\,\mathrm{d}x}\\ &~~~~~\small{-\int_{0}^{1}\frac{\Re{\left[\ln{\left(1+ix\right)}\ln{\left(1+e^{\frac{3i\pi}{4}}x\right)}-\ln{\left(1-ix\right)}\ln{\left(1+e^{\frac{3i\pi}{4}}x\right)}\right]}}{2x}\,\mathrm{d}x}.\\ \end{align}$$

Any integral of the form $\int\frac{\ln{\left(ax+b\right)}\ln{\left(cx+d\right)}}{px+q}\,\mathrm{d}x$ can be systematically reduced to trilogarithms, dilogarithms, and elementary functions. Thus, we recognize that $I$ can be decomposed into a sum of such integrals, and so in principle we are done except for the tedium.


Using the series for arctan, it is $$\sum_{i=0}^{\infty}\sum_{j=0}^{\infty}\frac{(-1)^{i+j}}{(2i+1)(4j+2)(2i+4j+3)}$$