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!
 A: To make the integral easier to evaluate. Write the integral as

$$ I = \int \frac{dx}{\cos^2(x)( 1+ \sqrt{\tan(x)} )^4}  $$

and the use the substitution $\tan(x)=u^2$ which makes the integral falls a part

$$ I=2 \int \frac{u}{(1+u)^4} du .$$

You can use another substitution $1+u=t$ to finish the problem.
A: 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}
$$
A: Multiplying top and bottom of the original integral by $\sec^2x$ yields
$$\int\frac{\sec^2xdx}{(1+\sqrt{\tan x})^4}$$
$$u=\tan x,du=\sec^2xdx$$
$$\int\frac{du}{(1+\sqrt u)^4}$$
$$u=t^2,du=2tdt$$
$$\int\frac{2tdt}{(1+t)^4}=\int\frac{(2t+2-2)dt}{(1+t)^4}=\int\frac{2dt}{(1+t)^3}-\int\frac{2dt}{(1+t)^4}=$$
$$\frac{2}{3(1+t)^3}-\frac{1}{(1+t)^2}=\frac{2}{3(1+\sqrt{\tan x})^3}-\frac1{(1+\sqrt{\tan x})^2}$$
