<s>[INST] $ \int \frac{\sin^{8}(x)}{\sin^{8}(x) + \cos^{8}(x)} dx $ $$ \int \frac{\sin^{8}(x)}{\sin^{8}(x) + \cos^{8}(x)} dx $$

is there more efficient and elegant way? Other than the solution below.
a solution:
Let $ I = \int \frac{\sin^{8}(x)}{\sin^{8}(x) + \cos^{8}(x)} dx $,
$$ \int \frac{\sin^{8}(x)}{\sin^{8}(x) + \cos^{8}(x)} dx  = \int \frac{\sin^{8}(x) + \cos^{8}(x) - \cos^{8}(x)}{\sin^{8}(x) + \cos^{8}(x)} dx = x - \int \frac{\cos^{8}(x)}{ \sin^{8}(x) + \cos^{8}(x) }dx $$
so we have $2I$ is:
$$ 2I = x + \int \frac{\sin^{8}(x)-\cos^{8}(x)}{ \sin^{8}(x) + \cos^{8}(x) }dx $$
Now,
$$ \sin^{8}(x) - \cos^{8}(x) = \left[ \sin^{4}(x) - \cos^{4}(x) \right] \left[ \sin^{4}(x) + \cos^{4}(x) \right]  $$
$$ = \left[ \sin^{2}(x) - \cos^{2}(x) \right]\left[ \sin^{2}(x) + \cos^{2}(x) \right] \left[ (\sin^{2}(x) + \cos^{2}(x))^{2} - 2 \sin^{2}(x)\cos^{2}(x) \right]  $$
$$ = \left[ \sin^{2}(x) - \cos^{2}(x) \right] \left[1 - 2 \sin^{2}(x)\cos^{2}(x) \right] $$
For the denominator:
$$ \sin^{8}(x) + \cos^{8}(x) = \left[ \sin^{4}(x) + \cos^{4}(x) \right]^{2} - 2 \sin^{4}(x)\cos^{4}(x) $$
$$ =  \left[ (\sin^{2}(x) + \cos^{2}(x))^{2} - 2 (\sin(x)\cos(x))^{2} \right]^{2} - 2 \sin^{4}(x)\cos^{4}(x) $$
$$ = \left[1 - 2 (\sin(x)\cos(x))^{2} \right]^{2} - 2 (\sin(x)\cos(x))^{4} $$
Now
$$ 2I =x+ \int \frac{ \left[ \sin^{2}(x) - \cos^{2}(x) \right] \left[1 - 2 \sin^{2}(x)\cos^{2}(x) \right] }{\left[1 - 2 (\sin(x)\cos(x))^{2} \right]^{2} - 2 (\sin(x)\cos(x))^{4}} dx $$
Let $U = \sin(x) \cos(x)$, then $U'(x) = \cos^{2}(x) - \sin^{2}(x)$, so
$$ 2I = x- \int \frac{\left[1 - 2 U^{2} \right] }{\left[1 - 2 U^{2} \right]^{2} - 2 U^{4}} dU $$
$$ =  x- \int \frac{\left[ 2 U^{2}  - 1 \right] }{ (1 - (2 + \sqrt{2})U^{2})(1 + (\sqrt{2} - 2)U^{2})} dU $$
And from here I can continue using Partial Fraction:
$$- \int \frac{\left[ 2 U^{2}  - 1 \right] }{ (1 - (2 + \sqrt{2})U^{2})(1 + (\sqrt{2} - 2)U^{2})} dU = -\frac{1}{2}\int \frac{1}{ (1 - (2 + \sqrt{2})U^{2})} + \frac{1}{(1 - (2 - \sqrt{2})U^{2})} dU $$
and then for each of the 2 terms we use Partial Fraction again. First, let $\alpha = \sqrt{2+\sqrt{2}}U$, $\beta = \sqrt{2-\sqrt{2}}U$, so we have
$$ = -\frac{1}{2\sqrt{2+\sqrt{2}}}\int \frac{1}{ 1 - \alpha^{2}} d \alpha - \frac{1}{2\sqrt{2-\sqrt{2}}}   \int \frac{1}{(1 - \beta^{2})} d \beta $$
then we have
$$ = -\frac{1}{2\sqrt{2+\sqrt{2}}} \left( \int \frac{1/2}{1-\alpha} d \alpha + \int \frac{1/2}{1+\alpha} d\alpha \right) - \frac{1}{2\sqrt{2-\sqrt{2}}} \left(   \int \frac{1/2}{1-\beta } d \beta +  \int \frac{1/2}{1 + \beta } d \beta \right) $$
$$ = -\frac{1}{4\sqrt{2+\sqrt{2}}} \left( -\ln(1-\alpha) + \ln(1+\alpha) \right) - \frac{1}{4\sqrt{2-\sqrt{2}}} \left(   -\ln(1-\beta) + \ln(1+\beta)  \right)  $$
 [/INST] Instead, we are going to evaluate
$$
\begin{aligned}
A=\int \frac{\cos ^{8} x}{\sin ^{8} x+\cos ^{8} x} d x=\int \frac{1}{\tan ^{8} x+1} d x\stackrel{t=\tan x}{=} \int \frac{d t}{\left(1+t^{2}\right)\left(1+t^{8}\right)}
\end{aligned}
$$
Noting that
$$
\frac{1}{(1+z )(1+z^{4})}
= \frac{1}{2} \cdot \frac{1}{z+1}+\frac{1}{4} \cdot \frac{1-z}{z^{2}+\sqrt{2} z+1}+\frac{1}{4} \cdot\frac{1-z}{z^{2}-\sqrt{2} z+1}
$$
Replacing $z$ by $t^2$ gives
$$
\int\frac{d t}{\left(1+t^{2}\right)\left(1+t^{8}\right)}=\frac{1}{2} \underbrace{\int \frac{d t}{t^{2}+1}}_{x+C_1}+\frac{1}{4} \underbrace{\int \frac{1-t^{2}}{t^{4}+\sqrt{2} t^{2}+1}}_{J} d t+\frac{1}{4} \underbrace{\int \frac{1-t^{2}}{t^{4}-\sqrt{2} t^{2}+1}}_{k} d t
$$
$$
\begin{aligned}
J&=-\int \frac{1-\frac{1}{t^{2}}}{t^{2}+\frac{1}{t^{2}}+\sqrt{2}} d t\\&=-\int \frac{d\left(t+\frac{1}{t}\right)}{\left(t+\frac{1}{t}\right)^{2}-(2-\sqrt{2})} \\&=-\frac{1}{2 \sqrt{2-\sqrt{2}}} \ln \left|\frac{t+\frac{1}{t}-\sqrt{2-\sqrt{2}}}{t+\frac{1}{t}+\sqrt{2-\sqrt{2}}}\right|+C_{2}
\end{aligned}
$$
Similarly,
$$
K=-\frac{1}{2 \sqrt{2+\sqrt{2}}} \ln \left|\frac{t+\frac{1}{t}-\sqrt{2+\sqrt{2}}}{t+\frac{1}{t}+\sqrt{2+\sqrt{2}}}\right|+C_{3}
$$
$$
\begin{aligned}
A=& \frac{1}{2} x-\frac{1}{8 \sqrt{2-\sqrt{2}}} \ln \left|\frac{\tan ^{2} x-\sqrt{2-\sqrt{2}} \tan x+1}{\tan ^{2} x+\sqrt{2-\sqrt{2}} \tan x+1}\right| \\&-\frac{1}{8 \sqrt{2+\sqrt{2}}} \ln \left|\frac{\tan ^{2} x-\sqrt{2+\sqrt{2}} \tan x+1}{\tan ^{2} x+\sqrt{2+\sqrt{2}} \tan x+1}\right|+C_4
\end{aligned}
$$
$$\begin{aligned}\int \frac{\sin ^{8} x}{\sin ^{8} x+\cos ^{8} x} dx=&x-A\\=& \frac{1}{2} x+\frac{1}{8 \sqrt{2-\sqrt{2}}} \ln \left|\frac{\tan ^{2} x-\sqrt{2-\sqrt{2}} \tan x+1}{\tan ^{2} x+\sqrt{2-\sqrt{2}} \tan x+1}\right|\\& +\frac{1}{8 \sqrt{2+\sqrt{2}}} \ln \left|\frac{\tan ^{2} x-\sqrt{2+\sqrt{2}} \tan x+1}{\tan ^{2} x+\sqrt{2+\sqrt{2}} \tan x+1}\right|+C \end{aligned}$$
</s>