# 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:

1. Seperating denominator as $(1-\sqrt{2}\sin{x}\cos{x})(1-\sqrt{2}\sin{x}\cos{x})$ and applying partial fractions.
2. 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.

• If I was up to it, my first try would be to use $$\sin (x)=\dfrac{2\tan (x/2)}{1+(\tan (x/2))^2}\\ \cos(x)=\dfrac{1-(\tan (x/2))^2}{1+(\tan (x/2))^2}$$ and make the substitution $u=\tan (x/2)$. However, I avoid masochism as much as possible. Commented Sep 14, 2013 at 11:29
• @GitGud I am scared by the thought, but I'll give it a shot anyways! Any alternative ideas? Commented Sep 14, 2013 at 11:33
• None other than the standard tries. I'm in hopes that there is an elegant trick that spits out the answer immediately, but since you said WA gave a complicated answer, I don't think such an easy alternative exists. Commented Sep 14, 2013 at 11:37

$$\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$

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}