Note: The explanatory text for Torricelli's law in the book is a bit brief. It says correctly that ``the water drains with the velocity it would have if it fell freely from a height h.''
How come? Basically there is an argument of energy behind this law. If friction doesn't interfere, the energy you gain when lowering a bucket of water by 1 meter is the same as what you would need to raise another bucket of water (of the same capacity) by 1 meter. Therefore, even though the water molecules that are leaving through the drain have been pretty close to the drain before leavin, and have not fallen by the height h, other water molecules have fallen certain distances, with the *net* effect of removing water from the top. The lost potential energy has been converted into kinetic energy, and it is the draining water that is moving and therefore carrying the kinetic energy.
You see why absence of friction enters as a hypothesis: with friction, there are other ways to convert the energy (basically inot heat). Another detail should also be noted, as a tacit assumption in the modelling by Torricelli's law: We are assuming that the drain hole is small compared to the water surface: Most of the water in the tyank is at rest, and all the kinetic energy is carried by the water leaving through the drain. In contrast, in the case of a bucket turned upside down, *all* of the water enters into a free fall and begins to carry kinetic energy, and then (1) is no longer the appropriate ODE.