<s>[INST] Other way to evaluate $\int \frac{1}{\cos 2x+3}\ dx$? I am evaluating
$$\int \frac{1}{\cos 2x+3} dx \quad (1)$$

Using Weierstrass substitution:
$$ (1)=\int \frac{1}{\frac{1-v^2}{1+v^2}+3}\cdot \frac{2}{1+v^2}dv  =\int \frac{1}{v^2+2}dv \quad (2) $$
And then $\:v=\sqrt{2}w$
$$ (2) = \int \frac{1}{\left(\sqrt{2}w\right)^2+2}\sqrt{2} dw$$$$= \frac{1}{2} \int \frac{1}{\sqrt{2}\left(w^2+1\right)}dw$$$$ =  \frac{1}{2\sqrt{2}}\arctan \left(w\right) + C$$$$=  \frac{1}{2\sqrt{2}}\arctan \left(\frac{\tan \left(x\right)}{\sqrt{2}}\right)+C$$
Therefore,
$$\int \frac{1}{\cos 2x+3} dx = \frac{1}{2\sqrt{2}}\arctan \left(\frac{\tan \left(x\right)}{\sqrt{2}}\right)+C $$

That's a decent solution but I am wondering if there are any other simpler ways to solve this (besides Weierstass). Can you come up with one?
 [/INST] Long way but doable
$$I=\int \frac{dx}{\cos (2x)+3}$$
Let
$$\cos(2x)=t \implies x=\frac{1}{2} \cos ^{-1}(t)\implies dx=-\frac{1}{2 \sqrt{1-t^2}}$$
$$I=-\frac{1}{2}\int \frac{dx}{(t+3) \sqrt{1-t^2}}=-\frac{1}{2}\int \frac{\sqrt{1-t^2}}{(t+3) (1-t^2)}\,dt$$
$$\frac{1}{(t+3) (1-t^2)}=-\frac{1}{8 (t+1)}+\frac{1}{16 (t+3)}+\frac{1}{16 (t-1)}$$ and we face three integrals
$$J_a=\int \frac {\sqrt{1-t^2} }{t+a}$$
$$J_a=-\sqrt{1-a^2} \log \left(\sqrt{1-a^2} \sqrt{1-t^2}+a t+1\right)+\sqrt{1-a^2} \log (a+t)+a   \sin ^{-1}(t)+\sqrt{1-t^2}$$
This leads to
$$I=\frac{i \left(\log (t+3)-\log \left(2 i \sqrt{2-2 t^2}+3 t+1\right)\right)}{4 \sqrt{2}}=-\frac{i}{4 \sqrt{2}}\log \left(1+i\frac{2 \sqrt{2} \sqrt{1-t^2}}{t+3}\right)$$
</s>