<s>[INST] Integral of rational function with trigonometric functions $$
\int \frac{dx}{(\sqrt{\cos x}+ \sqrt{\sin x})^4}
$$
I saw this problem online and it looked like an interesting/difficult problem to try and tackle.  My attempt so far is to use tangent half-angle substitution.
Let $t= \tan^2 (\frac{x}{2})$, then $dt= \frac{1}{2} \sec^2 (\frac{x}{2})\;dx.$  With algebra we get that $dx= \frac{2}{1+t^2}dt,$ $\sin x = \frac{2t}{1+t^2},$ and $\cos x = \frac{1-t^2}{1+t^2}.$ Therefore we get the following: 
$$
\int \frac{dx}{(\sqrt{\cos x}+ \sqrt{\sin x})^4} = \int \frac{\frac{2}{1+t^2}}{(\sqrt{\frac{1-t^2}{1+t^2}}+\sqrt{\frac{2t}{1+t^2}})^4}dt = 2\int \frac{1}{1+t^2}\cdot \frac{(1+t^2)^2}{(\sqrt{1-t^2}+ \sqrt{2t})^4}dt 
$$
$$
= 2\int \frac{1+t^2}{(\sqrt{1-t^2}+ \sqrt{2t})^4}dt
$$
I expanded the denominator, but only made things worse.  According to wolfram alpha, the solution is in terms of elementary functions.  Can you give me any clues or hints on how to evaluate this beast. Thank you!
 [/INST] You may write
$$
\int \frac{dx}{(\sqrt{\cos x}+ \sqrt{\sin x})^4}=\int \frac{1}{(1+ \sqrt{\tan x})^4}\frac{dx}{\cos^2 x}
$$ then make the change of variable $$\displaystyle u=\sqrt{\tan x},\quad \frac{1}{\cos^2 x}=1+u^4, \quad dx=\frac{2u}{1+u^4}du,$$ to just obtain
$$
\begin{align}
\int \frac{dx}{(\sqrt{\cos x}+ \sqrt{\sin x})^4}&=2\int \frac{u}{(1+u)^4}du=-\frac 1 3 \frac{3u+1}{(1+u)^3}+C\\\\&=-\frac1{(1+\sqrt{\tan x})^2}+\frac{2}{3(1+\sqrt{\tan x})^3}+C
\end{align}
$$
</s>