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!.

 A: Note that 
$$\begin{align}
\int \frac{u^2}{1-u^2}\,du&=-u+\frac12\log\left|\frac{1-u}{1+u}\right|+C\\\\
&=-\sin(x)+\frac12\log\left|\frac{1-\sin(x)}{1+\sin(x)}\right|+C
\end{align}$$
and similarly for $\int \frac{m^2}{1-m^2}\,dm$ with $m=\cos(x)$, and not $\sin(x)$.

NOTE $1$:

We need to be preserve the separate identities of the transformations $u \to \sin(x)$ and $m\to \cos(x)$ throughout the analysis.  That is to say, that $u$ is not simply a "dummy" integration variable inasmuch as it represents $\sin(x)$, and not $\cos(x)$. 

Naturally, both are $u$ and $m$ are "dummy" variables in the sense that we could use other symbols to represent the transformation.  But, it is of critical importance to distinguish the two different transformations by the corresponding pair of symbols used as new variables. 

NOTE $2$:

One way to clarify things is to turn the indefinite integral into a definite one.  The separate substitutions lead to distinct integration limits.

So, let's look at the integrals $\int_a^b \frac{\sin^2(x)}{1-\sin^2(x)}\cos(x)\,dx$ and $\int_a^b \frac{\cos^2(x)}{1-\cos^2(x)}\sin(x)\,dx$.  Upon enforcing the proposed substitutions we arrive at  
$$\begin{align}
\int_a^b \frac{\sin^2(x)}{1-\sin^2(x)}\cos(x)\,dx=\int_{\sin(a)}^{\sin(b)} \frac{u^2}{1-u^2}\,du\tag 1
\end{align}$$
and
$$\begin{align}
\int_a^b \frac{\cos^2(x)}{1-\cos^2(x)}\sin(x)\,dx=-\int_{\cos(a)}^{\cos(b)} \frac{u^2}{1-u^2}\,du \tag 2
\end{align}$$
Clearly, $(1)$ and $(2)$ do not add to zero.

NOTE $3$:  
The indefinite integral (antiderivative), $F(x)$, of a function $f$, can be more clearly written $F(x)=\int_a^x f(t)\,dt+C$ (for a suitable number $a$).  This can help to avoid the potential pitfall that comes from the notation $F(x)=\int f(x)\,dx$.
A: 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$? 
A: $$\sin^3x+\cos^3x=(\sin x+\cos x)(1-\sin x\cos x)$$
$$\implies\dfrac{\sin^3x+\cos^3x}{\sin x\cos x}=\dfrac{\sin x+\cos x}{\sin x\cos x}-\sin x-\cos x$$
As $\int(\sin x+\cos x)dx=\sin x-\cos x$ and $(\sin x-\cos x)^2=1-2\sin x\cos x,$
set $\sin x-\cos x=u$ in $$\int\dfrac{\sin x+\cos x}{\sin x\cos x}dx$$
A: All the other other answers here seem to be complicating this too much. Let's try a simple example:
Let $0=a$ and $1=b$. According to your logic, these should be equal, which is clearly assured. What you are missing here is that using a letter to represent something else is only symbolic — think of the letters as just being shorthand for something else.  
Perhaps another enemy of your confusion is the times when we can subtract integrals to get $0$. Why can we do this? It's because $a-a=0$, but what you were trying to do was to claim $a-b=0$, which is only true when $a=b$. Note that this is not a equality between the symbols themselves, but instead an equality between whatever $a$ represents and whatever $b$ represents
