What's the answer to $\int \frac{\cos^2x \sin x}{\sin x - \cos x} dx$?
$$\int\frac{\cos^2x\sin{x}}{\sin{x}-\cos{x}}dx=$$ $$=\int\left(\frac{\cos^2x\sin{x}}{\sin{x}-\cos{x}}+\frac{1}{2}\sin{x}(\sin{x}+\cos{x})\right)dx-\frac{1}{2}\int\sin{x}(\sin{x}+\cos{x})dx=$$ $$=\frac{1}{2}\int\frac{\sin{x}}{\sin{x}-\cos{x}}-\frac{1}{2}\int\sin{x}(\sin{x}+\cos{x})dx=$$ $$=\frac{1}{2}\int\left(\frac{\sin{x}}{\sin{x}-\cos{x}}-\frac{1}{2}\right)dx-\frac{1}{2}\int\left(\sin{x}(\sin{x}+\cos{x})-\frac{1}{2}\right)dx=$$ $$=\frac{1}{4}\int\frac{\sin{x}+\cos{x}}{\sin{x}-\cos{x}}dx-\frac{1}{2}\int\left(\sin{x}(\sin{x}+\cos{x})-\frac{1}{2}\right)dx=$$ $$=\frac{1}{4}\ln|\sin{x}-\cos{x}|-\frac{1}{4}\int\left(2\sin^2{x}-1+\sin2x\right)dx.$$ Can you end it now?
Let $\displaystyle I =\frac{1}{2}\int\frac{2\cos^2 x\cdot \sin x}{\sin x-\cos x}dx=\frac{1}{2}\int\frac{(1+\cos 2x)\cdot \sin x}{\sin x-\cos x}dx$
So $\displaystyle I =\frac{1}{4}\int \frac{2\sin x}{\sin x-\cos x}dx+\frac{1}{2}\int\frac{\cos 2x\cdot \sin x}{\sin x-\cos x}dx$
Now writting
$2\sin x=(\sin x+\cos x)+(\sin x-\cos x)$
and $\cos (2x)=\cos^2 x-\sin^2 x.$
Hint:
Let $\dfrac\pi4-x=y$
$\sin x-\cos x=\sqrt2\sin y$
$\sin x=\dfrac{\cos y-\sin y}{\sqrt2}$
$2\cos^2x=1+\cos2x=1+2\sin y\cos y$
$$\dfrac{(\cos y-\sin y)(1+2\sin y\cos y)}{\sin y}=2\cos^2y-2\sin y\cos y+\cot y-1=\cos2y-\sin2y+\cot y$$