<s>[INST] Solve integral $\int\frac{dx}{\sin x+ \cos x+\tan x +\cot x}$ I need to find:

$$\int\frac{1}{\sin x+ \cos x+\tan x +\cot x}\ dx$$

My attempts:
I have tried the conventional substitutions. I have tried the $\tan(x/2)$ substitutions, tried to solve it by quadratic but nothing has worked so far.
 [/INST] Let $t=x-\frac\pi4$ and recognize $2\sin x\cos x= 2\cos^2t-1$
$$I= \int\frac{dx}{\sin x+ \cos x+\tan x +\cot x}
=\frac1{\sqrt2}\int \frac{\cos^2t-\frac12}{\cos^3t-\frac12\cos t+\frac1{\sqrt2}}dt
$$
Factorize the denominator ($y=\cos t$)
$$y^3-\frac12y+\frac1{\sqrt2}
=(y+a)\left(y-\frac {a-ib}2 \right) \left(y-\frac {a+ib}2 \right)
$$
where $a$ given below is the real root and $b =\frac12\sqrt{\frac3{\sqrt2a}-\frac12}$
$$a=  \bigg(\frac1{2\sqrt2}+\frac16\sqrt{\frac{13}3}\bigg)^{1/3}+ \bigg(\frac1{2\sqrt2}-\frac16\sqrt{\frac{13}3}\bigg)^{1/3}
\overset{\cdot}=1.0758
$$
Then, partially-fractionalize the integrand
\begin{align}
I&= \frac1{3+\sqrt2a}\int \frac{\frac1{\sqrt2}}{\cos t+a}
+\Re \frac{a+\sqrt2 -i \frac{a^2}b}{\cos t +\frac{ib-a}2}\ dt\\
\end{align}
and apply the known integral
$\int \frac{1}{\cos t+p}dt=\frac2{\sqrt{p^2-1}}\tan^{-1}\frac{\tan\frac t2}{\sqrt{\frac{p+1}{p-1}}}
$
to obtain
\begin{align}I
&= \frac1{3+\sqrt2a}\bigg(\frac{\sqrt2}{\sqrt{a^2-1}}\tan^{-1}\frac{\tan\frac t2}{\sqrt{\frac{a+1}{a-1}}} 
+4\Re \frac{a+\sqrt2-i\frac{a^2}b}{\sqrt{(ib-a)^2-4}}\tan^{-1}\frac{\tan\frac t2}{\sqrt{\frac{ib-a+2}{ib-a-2}}} \bigg)
\end{align}
</s>