Does $dx$ have a particular "direction"? While solving some questions on definite integration, I faced some problems regarding setting the lower and upper limit. Consider this very famous rocket propulsion problem:

A rocket together with its fuel has a mass $m_0$ at $t=0$. Gas is ejected at a constant rate $r = -\frac{dm}{dt}$ and at a constant velocity $u$ relative to the rocket. Express the velocity of rocket as a function of time(ignore gravity).

My Approach
Let the mass of the rocket at time $t$ be $m$.  Applying conservation of linear momentum we get $mv = (m-dm)(v+dv)+dm (v-u) \implies mdv = udm$ or $$\frac{1}{u} dv = \frac{dm}{m}$$. Now this is where the main problem arises. When I integrate the left hand side and right hand side from initial to final conditions( i.e., velocity from $0$ to $v$ and mass from $m_0$ to $m(= m_0 -rt)$ I get wrong answer. In the solution, they put the limit in mass from $m$ to $m_0$. I guessed that I might be because I have $m - dm$ instead of $m+dm$. But, I am searching for some more clear and rigorous argument. Also, I want to know the proper method to set lower and upper limits so that there are no chances of error.
Note:
Please don't close my question seeing some Physics involved in it. My main doubt is related to Calculus so I posted it here.
 A: Ted Shifrin has already pointed out where you made your mistake, and how to fix it, in the comments above. Since you wanted a more rigorous approach, though, I will go ahead and do my best to answer the question you asked.
On its own, $dx$ doesn't really have a value. It is a piece of notation that is easily (and often) abused by treating it as though it does have a value, though.
Here's how I would proceed, being a little more rigorous (and less abusive of the notation).
The rocket's mass is a scalar function $m(t)$ with respect to time, $m(0)=m_0,$ and it has been given that $r=-\frac{dm}{dt},$ where $r$ is a positive constant in unit mass per unit time. The Fundamental Theorem of Calculus shows that $$m(t)-m_0=\int_{0}^{t}\frac{dm}{ds}\,ds=-r\int_{0}^{t}\,ds=\bigl[-rs\bigr]_{s=0}^{t}=-rt,$$ and so $m(t)=m_0-rt,$ as you calculated.
Observe that the mass of the rocket will not reach $0,$ but will remain positive. In particular, this means that $m_0>rt,$ and so the model is only valid for $0\leq t\leq T,$ for some $T<\frac{m_0}{r}.$ This will be important at the end.
Now, our reference frame has been chosen such that the initial velocity of the rocket is $\vec 0$ and the total momentum of the system is $\vec 0.$ We'll specify the "negative" direction to be the direction that the gas is being ejected.
Letting $\vec p_1(t)$ signify the momentum of the rocket at time $t$ and $\vec p_2(t)$ the combined momentum of all the ejected gas at time $t$, we have that both $\vec p_1(0)$ and $\vec p_2(0)$ are zero vectors. The reason $\vec p_1(0)$ is a zero vector is because if $\vec v(t)$ represents the rocket's velocity vector at time $t,$ then $\vec v(0)$ is a zero vector. The reason $\vec p_2(0)$ is a zero vector is that, at time $0,$ no gas has yet been ejected from the rocket--or more accurately, if any has been, it is safe to ignore it as far as our system is concerned--which means the ejected gas's total mass is the $0$ mass scalar. For $t>0,$ we will have that $\vec p_1(t)$ and $\vec p_2(t)$ will be nonzero vectors, respectively in the positive and negative directions, but regardless, conservation of momentum tells us that $\vec p_1(t)+\vec p_2(t)$ is a zero vector for all $t.$
We already have an explicit formula for $\vec p_1(t)$ in terms of $m(t)$ and $\vec v(t).$ Namely, we have $\vec p_1(t)=m(t)\vec v(t).$ Since we know that $\vec p_1(0)$ and $\vec p_2(0)$ are both zero vectors and that $\vec p_1(t)+\vec p_2(t)$ is a zero vector for all $t,$ we also know that know that $$\frac{d\vec p_1}{dt}=-\frac{d\vec p_2}{dt}\\\frac{d}{dt}\left[m(t)\vec v(t)\right]=-\frac{d\vec p_2}{dt}\\m(t)\frac{d\vec v}{dt}+\frac{dm}{dt}\vec v(t)-\frac{d\vec p_2}{dt}.$$
The velocity of the gas as it emerges will always be $\vec v(t)+\vec u$ (right up until the point that the rocket is completely out of gas, which will occur before the mass of the rocket reaches $0$), where $\vec u$ represents the (negative) velocity of the emerging gas relative to the rocket's frame of reference. The mass emerges at a rate of $r,$ and the product of $r$ and $\vec v+\vec u$ gives us the rate of change of the (total) ejected gas's momentum with respect to time. That is, $$\frac{d\vec p_2}{dt}=r\bigl[\vec v(t)+\vec u\bigr],$$ and so $$m(t)\frac{d\vec v}{dt}-r\vec v(t)=-r\bigl[\vec v(t)+\vec u\bigr]\\m(t)\frac{d\vec v}{dt}-r\vec v(t)=-r\vec v(t)+-r\vec u\\m(t)\frac{d\vec v}{dt}=-r\vec u,$$ and since $m(t)$ never actually reaches $0,$ then $$\frac{d\vec v}{dt}=-\frac{r}{m(t)}\vec u,$$ or equivalently, $$\frac{d\vec v}{dt}=-\frac{r}{m_0-rt}\vec u.$$
Since $\vec v(t)=\vec v(t)-\vec v(0)=\int_{0}^{t}\frac{d\vec v}{ds}\,ds,$ then $$\vec v(t)=-\int_{0}^{t}\frac{r}{m_0-rs}\vec u\,ds\\\vec v(t)=-\vec u\int_{0}^{t}\frac{r}{m_0-rs}\,ds\\\vec v(t)=-\vec u\bigl[-\ln(m_0-rs)\bigr]_{s=0}^{t}\\\vec v(t)=\vec u\bigl[\ln(m_0-rs)\bigr]_{s=0}^{t}\\\vec v(t)=\vec u\bigl[\ln(m_0-rt)-\ln(m_0)\bigr],$$ and so by rules of logarithms, $$\vec v(t)=\ln\left(1-\frac{r}{m_0}t\right)\vec u.$$ This is, in fact, a nonzero vector in the positive direction for all valid* nonzero $t,$ since $\vec u$ is in the negative direction, and $m_0,r$ are positive!
*This is why it really matters that our model is only valid where $0\leq t\leq T$ for some $T<\frac{m_0}{r}.$

As a slight caveat, it turns out not to be as important that $t\geq 0,$ as long as the rocket was, in fact, ejecting gas at the same rate prior to time $0.$ The formula above for  gives us a nonzero velocity vector for the rocket in the negative direction, but all that really means is that the rocket wasn't moving as quickly, yet, as it would be at time $0,$ so our frame of reference was actually catching up to the rocket! This is why I said it was safe to ignore any previously-expelled gas, as far as our system is concerned.
