TITLE: Compute close-form of $\int_0^{\frac\pi2}\frac{dt}{\sin t+\cos t+\tan t+\cot t+\csc t+\sec t}$
QUESTION [26 upvotes]: I came across the improper trigonometric integral recently shared in a Chinese web forum
\begin{align}
\int_0^{\frac\pi2}\frac{dt}{\sin t+\cos t+\tan t+\cot t+\csc t+\sec t}\\
\end{align}
which amuses me because of its appearance. What is more amusing is the claim, without providing the proof, that is has the close-form result
\begin{align}
\frac{\sqrt{8\sqrt2+2\sqrt7}}{7^{3/4} }\tanh^{-1}  \frac{\sqrt{2\sqrt7(4\sqrt2-5)}}{4\sqrt2-5 +\sqrt7}
+\frac{\sqrt{8\sqrt2-2\sqrt7}}{7^{3/4} }\tan^{-1}\frac{\sqrt{2\sqrt7(4\sqrt2-5)}}{4\sqrt2-5 - \sqrt7}
\end{align}
I was able to verify it numerically; yet rather curious in how it could ever be derived. Based on my knowledge and experience, I do not assume it would be easy.
I was able to find an unsolved post here from a long time ago, which only reexpresses the corresponding  indefinite integral via the tangent half-angle substitution as
$$\int\frac{2t(1-t)}
{2 t^4-3 t^3+3 t^2+t+1}dt$$
but gives up due to the complexity in partial fractionalization. I am doubtful that this approach would lead to the explicit expression claimed above. I am interested in any suitable methods producing the close-form.

REPLY [8 votes]: This feels more like a comment to Travis Willse's excellent answer, which essentially solves the problem, but here's the rest of the calculation:
So far we have ($u = \frac{\tan \left(\frac{\pi}{8} - \frac{t}{2}\right)}{\sqrt{2}-1}$)
\begin{align}
I &\equiv \int \limits_0^{\pi/2} \frac{\mathrm{d} t}{\sin(t) + \cos(t) + \tan(t) + \cot(t) + \sec(t) + \csc(t)} \\
&= 2 \int \limits_0^{\pi/4} \frac{\mathrm{d} t}{\sin(t) + \cos(t) + \tan(t) + \cot(t) + \sec(t) + \csc(t)} \\
&= \frac{2 \sqrt{2} \beta^2}{\sqrt{7}} \int \limits_0^1 \frac{1-u^2}{u^4 + \beta^4} \, \mathrm{d} u = \frac{2 \sqrt{2} \beta^2}{\sqrt{7}} \int \limits_0^1 \frac{1-u^2}{(u^2 + \mathrm{i} \beta^2) (u^2 - \mathrm{i} \beta^2)} \, \mathrm{d} u
\end{align}
with $\beta = \sqrt{\frac{5 + 4 \sqrt{2}}{\sqrt{7}}}$. We now need $a_{1/2} \in \mathbb{C}$ such that $a_1 (u^2 + \mathrm{i} \beta^2) + a_2 (u^2 - \mathrm{i} \beta^2) = 1 - u^2$ holds. The solution is $a_{1/2} = - \frac{1}{2} \left(1 \pm \frac{\mathrm{i}}{\beta^2}\right)$, so we can write
\begin{align}
I &= - \frac{2 \sqrt{2} \beta^2}{\sqrt{7}} \operatorname{Re} \left[\left(1 + \frac{\mathrm{i}}{\beta^2}\right) \int \limits_0^1 \frac{\mathrm{d} u}{u^2 - \mathrm{i} \beta^2} \right] = - \frac{2 \sqrt{2} \beta^2}{\sqrt{7}} \operatorname{Re} \left[\left(1 + \frac{\mathrm{i}}{\beta^2}\right) \int \limits_0^1 \frac{\mathrm{d} u}{u^2 + \left(\frac{1 - \mathrm{i}}{\sqrt{2}} \beta\right)^2} \right] \\
&= - \frac{2 \sqrt{2} \beta^2}{\sqrt{7}} \operatorname{Re} \left[\left(1 + \frac{\mathrm{i}}{\beta^2}\right) \frac{1 + \mathrm{i}}{\sqrt{2} \beta} \arctan \left(\frac{1 + \mathrm{i}}{\sqrt{2} \beta}\right) \right] \\
&= - \frac{2}{\sqrt{7}} \operatorname{Re} \left[\left(\beta - \beta^{-1} + \mathrm{i} \left(\beta + \beta^{-1}\right)\right) \arctan \left(\frac{1 + \mathrm{i}}{\sqrt{2} \beta}\right) \right] \\
&= - \frac{1}{\sqrt{7}} \operatorname{Re} \left[\left(\beta - \beta^{-1} + \mathrm{i} \left(\beta + \beta^{-1}\right)\right) \left(\arctan \left(\frac{\sqrt{2}}{\beta - \beta^{-1}}\right) + \mathrm{i} \operatorname{artanh} \left(\frac{\sqrt{2}}{\beta + \beta^{-1}}\right)\right) \right] \\
&= \frac{1}{\sqrt{7}} \left[\left(\beta + \beta^{-1}\right) \operatorname{artanh} \left(\frac{\sqrt{2}}{\beta + \beta^{-1}}\right)- \left(\beta - \beta^{-1}\right) \arctan \left(\frac{\sqrt{2}}{\beta - \beta^{-1}}\right)\right] \, .
\end{align}
In the penultimate step we have used
$$ \arctan(a + \mathrm{i} b) = \frac{1}{2} \left[\arctan \left(\frac{2 a}{1 - a^2 - b^2}\right) + \mathrm{i} \operatorname{artanh} \left(\frac{2 b}{1 + a^2 + b^2}\right)\right] $$
from here. Since $\beta \pm \beta^{-1} = \sqrt{2} \sqrt{4 \sqrt{\frac{2}{7}} \pm 1}$, we obtain
$$ I = \sqrt{\frac{2}{7}} \left[\sqrt{4 \sqrt{\frac{2}{7}} + 1} \operatorname{arcoth} \left(\sqrt{4 \sqrt{\frac{2}{7}} + 1}\right) - \sqrt{4 \sqrt{\frac{2}{7}} - 1} \operatorname{arccot} \left(\sqrt{4 \sqrt{\frac{2}{7}} - 1}\right)\right] \, , $$
which is a simplified version of the final result given in the question.