Integration of $\int\frac{\sin^4x+\cos^4x}{\sin^3x+\cos^3x}dx$ How can we integrate:
$$
\int\frac{\sin^4x+\cos^4x}{\sin^3x+\cos^3x}dx
$$
Using simple algebraic identities I deduced it to  
$$
\int\frac{1-2\sin^2x\cdot\cos^2x}{(\sin x+\cos x)(1-\sin x\cdot\cos x)}dx
$$ but can't proceed further. Please provide some directions?
 A: $\displaystyle\frac{\sin^4x+\cos^4x}{\sin^3x+\cos^3x}=\sin x+\cos x-\frac{\sin x\cos x}{\sin^3 x+\cos^3x}=\sin x+\cos x-\frac{\sin x\cos x}{(\sin x+\cos x)(1-\sin x\cos x)}$,
and $\;\;\displaystyle\frac{\sin x\cos x}{(\sin x+\cos x)(1-\sin x\cos x)}=A\left(\frac{\sin x+\cos x}{1-\sin x\cos x}\right)+B\left(\frac{1}{\sin x+\cos x}\right)$ 
where $\sin x\cos x=A(\sin x+\cos x)^2+B(1-\sin x\cos x)=(A+B)+(2A-B)\sin x\cos x$.
Then $A=\frac{1}{3}$ and $B=-\frac{1}{3}$,
so $\displaystyle\int\frac{\sin^4x+\cos^4x}{\sin^3x+\cos^3x}dx=\int\left(\sin x+\cos x-\frac{1}{3}\cdot\frac{\sin x+\cos x}{1-\sin x\cos x}+\frac{1}{3}\cdot\frac{1}{\sin x+\cos x}\right)dx$
$\displaystyle=-\cos x+\sin x-\frac{1}{3}\int\frac{2\sin x+2\cos x}{2-2\sin x\cos x}dx+\frac{1}{3}\int\frac{1}{\sqrt{2}\sin(x+\frac{\pi}{4})}dx$
$\displaystyle=-\cos x+\sin x-\frac{2}{3}\int\frac{\sin x+\cos x}{1+(\sin x-\cos x)^2}dx+\frac{1}{3\sqrt{2}}\int\csc\left(x+\frac{\pi}{4}\right)dx$
$\displaystyle=-\cos x+\sin x-\frac{2}{3}\arctan(\sin x-\cos x)+\frac{1}{3\sqrt{2}}\ln\big|\csc\left(x+\frac{\pi}{4}\right)-\cot\left(x+\frac{\pi}{4}\right)\big|+C$
$\displaystyle=-\cos x+\sin x-\frac{2}{3}\arctan(\sin x-\cos x)+\frac{1}{3\sqrt{2}}\ln\left\vert\frac{\sqrt{2}-\cos x+\sin x}{\sin x+\cos x}\right\vert+C$
A: Noting that
$$
\sin ^4 x+\cos ^4 x= \left(\sin ^3 x+\cos ^3 x\right)(\cos x+\sin x)-\sin x \cos x\left(\sin ^2 x+\cos^2x \right),
$$
we have
$$
\begin{aligned}
I&=\int(\cos x+\sin x) d x-\int \frac{\sin x \cos x}{\sin ^3 x+\cos^3 x} d x \\
& =\sin ^2 x-\cos x-\int \frac{\sin x \cos x}{\sin ^3 x+\cos ^3 x} d x \\
& =\sin x-\cos x-\frac{1}{3}  \underbrace{ \int \frac{\sin x+\cos x}{\sin ^2 x-\sin x \cos x+\cos ^2 x} d x}_{J}  +\frac{1}{3} \underbrace{\int \frac{1}{\sin x+\cos x} d x}_K \\
&
\end{aligned}
$$

$$
\begin{aligned}
J & =\int \frac{2 d(\sin x-\cos x)}{1+(\sin x-\cos x)^2} \\
& =2 \tan ^{-1}(\sin x-\cos x)+C_1
\end{aligned}
$$

Using Weierstrass substitution $t=\tan \frac{x}{2}  $, we get
$$
\begin{aligned}
K& =\int \frac{1}{\frac{2 t}{1+t^2}+\frac{1-t^2}{1+t^2}} \cdot \frac{2 d t}{1+t^2} \\
& =\sqrt{2} \tanh ^{-1}\left(\frac{\tan \frac{x}{2}-1}{\sqrt{2}}\right)+C_2
\end{aligned}
$$
Now we can conclude that
$$\boxed{I=\sin x-\cos x-\frac{2}{3} \tan ^{-1}(\sin x-\cos x)+\frac{\sqrt{2}}{3} \tanh ^{-1}\left(\frac{\tan \frac{x}{2}-1}{\sqrt{2}}\right)+C }$$
