Evaluating $\int \frac{\sin{x}+\cos{x}}{\sin^4{x}+\cos^4{x}} \mathrm dx$ I am having real trouble evaluating this indefinite integral
$$\int{\frac{\sin{x}+\cos{x}}{\sin^4{x}+\cos^4{x}}}dx$$
Need I mention that I already tried WolframAlpha with little success? It returned a complicated expression full of many $\arctan$ terms.
Here is what I have already tried:


*

*Seperating denominator as $(1-\sqrt{2}\sin{x}\cos{x})(1-\sqrt{2}\sin{x}\cos{x})$ and applying partial fractions.

*Multiplying and dividing by $\sec^4{x}$


Please provide any help. It would be appreciated if you give a hint rather than the whole solution.
 A: $$\sin^4x+\cos^4x=(\sin^2x+\cos^2x)^2-2\sin^2x\cos^2x=1-\frac{\sin^22x}2$$
If we set $\int(\sin x+\cos x)dx=\sin x-\cos x,\sin2x=1-u^2$
$$\implies \int{\frac{\sin{x}+\cos{x}}{\sin^4{x}+\cos^4{x}}}dx=2\int\frac{du}{2-(1-u^2)^2}=2\int\frac{du}{(\sqrt2+1-u^2)(\sqrt2-1+u^2)}$$
$$=\frac2{2\sqrt2}\int\frac{(\sqrt2+1-u^2)+(\sqrt2-1+u^2)}{(\sqrt2+1-u^2)(\sqrt2-1+u^2)}du$$
$$=\frac1{\sqrt2}\left(\int\frac{du}{\sqrt2-1+u^2}+\int\frac{du}{\sqrt2+1-u^2}\right)$$
Now apply $\displaystyle\int\frac{dy}{a^2+y^2}=\frac1a\arctan \frac ya+K$
and $\displaystyle\int\frac{dy}{a^2-y^2}=\frac1{2a}\ln\big|\frac{a+y}{a-y}\big|+C$
A: We first split the integral into two.
$$
\begin{aligned}
I:=& \int \frac{\sin x+\cos x}{\sin ^{4} x+\cos ^{4} x} d x \\
=&-\int \frac{d(\cos x)}{\left(1-\cos ^{2} x\right)^{2}+\cos ^{4} x}+\int \frac{d(\sin x)}{\sin ^{4} x+\left(1-\sin ^{2} x\right)^{2}} \\
=& \frac{1}{2}\left[\underbrace{-\int \frac{d y}{y^{4}-y^{2}+\frac{1}{2}}}_{J}+\underbrace{\int \frac{d z}{z^{4}-z^{2}+\frac{1}{2}}}_{K}\right]
\end{aligned}
$$
where $y=\cos x$ and $z=\sin x$
We need to find one of them, say $J$. We are going to play a little trick on $J$.
\begin{aligned}J &=\int \frac{\frac{1}{y^{2}} d y}{y^{2}+\frac{1}{2 y^{2}}-1} \\
&=\frac{1}{\sqrt 2} \int \frac{1+\frac{1}{y^{2}}-\left(1-\frac{1}{y^{2}}\right)}{y^{2}+\frac{1}{2 y^{2}}-1} d y \\
&=\frac{1}{\sqrt2} \int \frac{d\left(y-\frac{1}{y}\right)}{\left(y-\frac{1}{y}\right)^{2}+1}-\frac{1}{\sqrt2} \int \frac{d\left(y+\frac{1}{y}\right)}{\left(y+\frac{1}{y}\right)^{2}-3}\\
&=\frac{1}{\sqrt2} \tan ^{-1}\left(y-\frac{1}{\sqrt2y}\right)-\frac{1}{2 \sqrt{6}} \ln \left|\frac{y+\frac{1}{\sqrt2y}-\sqrt{3}}{y+\frac{1}{\sqrt2y}+\sqrt{3}}\right|+C_{1} \\
&=\frac{1}{\sqrt2} \tan ^{-1}(\cos x-\frac{\sec x}{\sqrt2})-\frac{1}{2 \sqrt{6}} \ln \left|\frac{\sqrt2\cos ^{2} x-\sqrt{6} \cos x+1}{\sqrt2\cos ^{2} x+\sqrt{6} \cos x+1}\right|+C_{1}\end{aligned}
Replacing y by z yields
$$
K=\frac{1}{2} \tan ^{-1}(\sin x-\frac{\csc x}{\sqrt2})-\frac{1}{2 \sqrt{6}} \ln \left|\frac{\sqrt2\sin ^{2} x-\sqrt{6} \sin x+1}{\sqrt2\sin ^{2} x+\sqrt{6} \sin x+1}\right|+C_{2}
$$
We can now conclude that
$$
\begin{aligned}
I=& \frac{1}{2\sqrt2}\left[\tan ^{-1}(\sin x-\frac{\csc x}{\sqrt2})-\tan ^{-1}(\cos x-\frac{\sec x}{\sqrt2})\right] \\
&+\frac{1}{4 \sqrt{6}} \ln \left| \frac{\left(\sqrt2\cos ^{2} x-\sqrt{6} \cos x+1\right)\left(\sqrt2\sin ^{2} x+\sqrt{6} \sin x+1\right)}{\left(\sqrt2\cos ^{2} x+\sqrt{6} \cos x+1\right)\left(\sqrt2\sin ^{2} x-\sqrt{6} \sin x+1\right)}\right|+C
\end{aligned}
$$
