How to solve this integral $I = \int\dfrac{\cos^3x}{\sin x + \cos x}dx$? $\displaystyle\int\dfrac{\cos^3x}{\sin x + \cos x}dx$
I added $J =\displaystyle \int\dfrac{\sin^3x}{\sin x + \cos x}dx$
then $I + J = \displaystyle\int\dfrac{\cos^3x + \sin^3x}{\sin x + \cos x}dx = x + \dfrac{1}{2}\cos2x + C$
but I can't find how to solve $I-J$
And is that the true way to solve it?
Please help!
 A: $$I-J = \int \frac{ \cos^3 x - \sin^3 x}{ \sin x  + \cos x} dx =  \int \frac{ (\cos x - \sin x)( \cos^2 x + \sin^2 x + \sin x \cos x )}{ \sin x + \cos x} dx$$
Substitute $$ \sin x + \cos x = t$$
$$t^2 = 1 - 2 \sin x \cos x$$
Or,
$$ \sin x \cos x = \frac{1-t^2}{2}$$
$$ I-J= \int \frac{(1+ ( \frac{1-t^2}{2}))}{t} dt$$
Can you finish?
A: If you use $\tan(x)=t$, you end with
$$I = \int\dfrac{\cos^3(x)}{\sin (x) + \cos (x)}dx=\int \frac{dt}{(t+1) \left(t^2+1\right)^2}$$ Using partial fraction decomposition
$$\frac{1}{(t+1) \left(t^2+1\right)^2}=\frac{1-t}{4 \left(t^2+1\right)}+\frac{1-t}{2 \left(t^2+1\right)^2}+\frac{1}{4
   (t+1)}$$ does not seem too bad.
A: Reducing the degree may be also a good idea...
$$
\begin{aligned}
I &=
\int\frac{\cos^3x}{(\cos x + \sin x)}\;dx =
\int\frac{\cos^3x(\cos x - \sin x)}{(\cos x + \sin x)(\cos x - \sin x)}\;dx 
\\
&=
\int\frac{\cos^4x - \cos^3x\sin x}{\cos^2 x - \sin^2 x}\;dx 
=
\int\frac{(\cos^2x)^2}{\cos 2x }\;dx 
-
\int\frac{\cos^2x\cdot\sin x\cos x}{\cos2 x}\;dx 
\\
&=
\frac 14\int\frac{(1+\cos2x)^2}{\cos 2x }\;dx 
-
\frac 18\int\frac{(1+\cos2x)\cdot2\cdot 2\sin x\cos x}{\cos2 x}\;dx 
\\
&=\frac 14
\int\left(\frac1{\cos 2x }+2+\cos 2x\right)\;dx 
+
\frac 18\int\frac{(1+\cos2x)\cdot(\cos 2x)'}{\cos2 x}\;dx 
\\
&=
\left(\frac 1{16}\log\frac{1+\sin 2x}{1-\sin 2x}+\frac x2 +\frac 18\sin 2x\right)
+
\left(\frac 18\cos 2x+\frac 18\log\cos 2x\right)+\text{constant .}
\end{aligned}
$$
(Hope there is no computational error, but the idea to proceed is at any rate clear.)
(It turns out from where i am looking to the integral that introducing the "counterpart" $J$ is in the same time introducing a more complicated expression.)
