Q:

Derivation of Torricelli's equation

I am reading "Fundamentals of Physics" by Shanker and he is deriving Torricelli's equation.  First he says $\displaystyle a = \frac{dv}{dt}$. Next, he multiplies both sides by velocity to get $\displaystyle v\frac{dv}{dt} = a\frac{dx}{dt}$. Next, he does something I don't understand, he cancels the $dt$'s to get $v~dv = a~dx$. My first question is why is this justified, and what does the resulting equation "mean"?  
The next step he takes I also do not understand.  He does $\displaystyle \int_{v_1}^{v_2}vdv = \int_{x_1}^{x_2}adx$. Why is this mathematically justified?  I thought that $\displaystyle \int ~dx$ was thought of as a single entity, where the $dx$ solely acts as the "closing bracket" of the integral.  
In addition, why are there two different upper and lower bounds for the same integral?  Doesn't this break the equality?  In school I learned that you integrate by going from something like $\displaystyle \frac{dx}{dt} = v$ to $\displaystyle \int \frac{dx}{dt}dt = \int vdt$. This is not the same as what Shanker is doing. 

A:

Let's approach this slightly differently; I am sure you would agree that:
$$v a = a v$$
This is the equivalent of your equation after being multiplied by $v$ where $v=\frac{dx}{dt}$ and $a=\frac{dv}{dt}$.
Now integrate this with respect to time:
$$\int_{t_1}^{t_2} v a dt = \int_{t_1}^{t_2} a v dt $$ 
From the definition of the derivatives we know that $adt=dv$ and $vdt=dx$, i.e. the infinitesimal change in velocity|distance ($dv|dx$) is simply the acceleration|velocity ($a|v$) multiplied with an infinitesimal change in time $dt$. This then transforms the equation to:
$$\int_{v(x_1,t_1)}^{v(x_2,t_2)} v dv = \int_{x_1}^{x_2} a dx $$
This is equivalent to just cancelling the $dt$'s in your equation when you realize a derivative is not a single quantity but a ratio of infinitesimal quantities as mentioned by Gert in the comments. 
The bounds are changed because we have changed the variable with respect to which we are integrating.  However, they correspond to the same bounds as $v(x_1,t_1)=v_1$ and $v(x_2,t_2)=v_2$.

