Problem with $\int \frac{\sin^{3}x+\cos^{3}x}{\sin{x}\cos{x}} \text{dx}$ I wrote 
\begin{eqnarray}
I 
&=& \int \frac{\sin^{3}x+\cos^{3}x}{\sin{x}\cos{x}} \text{dx}\\
&=& 
\int \frac{\sin^{3}x}{\sin{x}\cos{x}}\text{dx}+\int \frac{\cos^{3}x}{\sin{x}\cos{x}}\text{dx}\\
 &=& 
 \int \frac{\sin^{2}x}{\cos^2{x}}\cos{x}\text{dx}+\int \frac{\cos^{2}x}{\sin^2{x}}\sin{x}\text{dx}\\
 &=& 
 \int \frac{\sin^{2}x}{1-\sin^2{x}}\cos{x}\text{dx}+\int \frac{\cos^{2}x}{1-\cos^2{x}}\sin{x}\text{dx}\\
&=&
\int\frac{u^2}{1-u^2}du-\int\frac{m^2}{1-m^2}dm\\
&=&
\color{blue}{\int\frac{u^2}{1-u^2}du-\int\frac{u^2}{1-u^2}du}\\
&=&
0
\end{eqnarray}
and Other
Let $x=\dfrac{\pi}{2}-t$ so
$$I=\int \frac{\sin^{3}x+\cos^{3}x}{\sin{x}\cos{x}} \text{dx}=-\int \frac{\sin^{3}t+\cos^{3}t}{\sin{t}\cos{t}} \text{dt}=-I$$
but correct answer is 
$$
I=\ln\left|\dfrac{1+\tan\dfrac{x}{2}}{1-\tan\dfrac{x}{2}}\right|+\ln\left|\tan\dfrac{x}{2}\right|-\sin x+\cos x+C
$$

Question.1 Where is wrong.?
Question.2 what conditions guarantee that our changing variable in indefinite integrals doesn't change our final solutions!.


The step that is wrong is precisely the one highlighted in blue. You have $u=\cos(x)$ and $m=\sin(x)$, how can you then happily set $m$ to $u$? 
