Using calculus to determine drainage time for iV bags This question got me thinking really hard, but still couldn't solve it. It concerns the drainage of an IV bag. Initially, the example model the output velocity of the bag using Bernoulli's Extended equation accounting for tube friction, by which then they used the continuity equation to model the flow rate and find how long it took to drain the bag. Yet they made the assumption that the flow rate was constant, which its clearly not since as the level of water decreases, the hydrostatic pressure also decreases causes the flow rate decrease with time. So instead of focusing on the output velocity, they decided to focus on the level of the water, Z1. They modelled the mass balance of the bag in terms of the height of the water and also in terms of the continuity equation. The problem assumes that the cross sectional area S is constant, and hence equal to Volume/length of the bag.
I found the differential equation really difficult to solve, and maybe I wasn't setting my initial conditions correctly. Any help is truly appreciated!
Actual question regarding the examples
1st section of the example
2nd section of example
 A: This focuses on mathematics, not engineering, with the hope of simplifying work with similar problems.
We have a reservoir of time-dependent volume $V$ that can be expressed as a function of the depth of fluid $Z$ in the reservoir. If the reservoir is nearly of constant cross-section, we may treat $V$ as proportional to $Z$. If the fluid drains from a point located at "height" $H$ below the bottom of the reservoir, one model is that the fluid drains at a rate $dV/dt$ proportional to $\sqrt{Z + H}$ by conservation of energy. (Toricelli's law: if $v$ is the speed of efflux then $g(Z + H) = \frac{1}{2}v^{2}$. If there is a difference of pressure, we can refine our flow rate model using Bernoulli's principle.)
Putting everything together,
$$
\frac{dZ}{dt} = k\sqrt{Z + H}
$$
for some constants $k < 0$ and $H > 0$. (The key point is how simple this looks after the constants have been "packaged" into a single letter $k$.) To solve we separate variables and integrate:
$$
\frac{dZ}{\sqrt{Z + H}} = k\, dt,\quad
2\sqrt{Z + H} - 2\sqrt{Z_{0} + H} = kt.
$$
The reservoir is empty when $Z = 0$.
The remaining work is to express $k$ and $H$ in terms of parameters given in the problem, which requires only algebra (and understanding of the notation).
