Question on Time and work problems A cistern which has a leak on the bottom is filled in $1$ hr. Had there been no leak, it could have been filled in $40$ minutes. If the cistern is full, at what time will the leakage empty it?
My attempt
Let the cistern hold $x$l of water.
If there is leak,
To fill $x$l of water, it takes $1$hr.
If there is no leak,
To fill $x$l of water, it takes $40$ minutes.
Now, how should I move on?
 A: Let $t$ be time and $x$ be the ratio of the cistern filled with water. Assume that the cistern has a constant horizontal cross-section, which implies that the rate of leaking is proportional to the square-root of the amount of water by Torricelli's law, since the leak is at the bottom, and the amount is proportional to the water depth. Also assume that the cistern is filled via a tap at a constant rate.
The differential equation for the leaking cistern is then:

$\frac{dx}{dt} = a - c\sqrt{x}$.

where $a = \frac{3}{2}$ is the rate of tap flow, since it takes $\frac{2}{3}$ hours to fill the cistern when there is no leak, and $c$ is some positive constant that is larger for larger leaks.
We know that throughout the process of filling the cistern $a - c\sqrt{x} > 0$, otherwise it can never be filled. Thus during that process we have:
  $\frac{1}{a-c\sqrt{x}} \frac{dx}{dt} = 1$.
  $\int \frac{1}{a-c\sqrt{x}} \ dx = \int \frac{1}{a-c\sqrt{x}} \frac{dx}{dt} \ dt = t + k$ for some constant $k$.
We find that:
  $\int \frac{1}{a-c\sqrt{x}} \ dx = \int \left( - \frac{1}{c\sqrt{x}} + \frac{a}{c\sqrt{x}(a-c\sqrt{x})} \right) \ dx = - \frac{2}{c} \sqrt{x} - \frac{2a}{c^2} \ln(a-c\sqrt{x})$.
Therefore:

$- \frac{2}{c} \sqrt{x} - \frac{2a}{c^2} \ln(a-c\sqrt{x}) = t + m$ for some constant $m$.

Now we know that at $t = 0$ we have $x = 0$, therefore $m = - \frac{2a}{c^2} \ln(a)$.
Also at $t = 1$ (hour) we have $x = 1$ (full tank), therefore $- \frac{2}{c} - \frac{2a}{c^2} \ln(a-c) = 1 - \frac{2a}{c^2} \ln(a)$. Since $a = \frac{3}{2}$, we can numerically solve for $c$:

$c \approx 0.7114$.

If the leaky cistern starts full and the tap is off, it will run dry according to:

$\frac{dx}{dt} = -c\sqrt{x}$.

Which we can solve easily:
  $\int \frac{1}{2\sqrt{x}} \ dx = \int -\frac{c}{2} \ dt$.
  $\sqrt{x} = 1 - \frac{c}{2} t$.   [since at $t=0$ we have $x=1$]
  $x = ( 1 - \frac{c}{2} t )^2$.
Therefore the answer is:

The full leaky cistern will run dry at $t = \frac{2}{c} \approx 2.81$ hours.

An interesting feature of filling such leaky cisterns with a tap is that they can only be filled up to a certain limit, at which the rate of tap flow is equal to the rate of leak. That limit is at most $(\frac{a}{c})^2$, because if $x$ ever reaches that then $\frac{dx}{dt} = 0$ and so $x$ will not increase anymore. The fact that $x$ really tends to that limit can be seen by observing that $\ln(a-c\sqrt{x})$ must tend to $\infty$ as $t \to \infty$. This means that the tap flow rate $a$ must be at least $c$ otherwise it will be unable to fill the cistern.
Note
The previous version of this answer was using the assumption that leak rate is proportional to pressure at leak, which after almagest's comment and some online searching I now believe is not physically correct for water. I think it might be valid for very tiny leaks or if the cistern is leaking because the material is permeable, in which case viscosity has a large effect and so the Hagen–Poiseuille equation would imply my assumption. But if the cistern is quite big then the tap flow rate has to be reasonably high to be able to fill it up in 1 hour if there is no leak, so 20 min difference if there is a leak implies that the leak is actually not so tiny, which means that perhaps viscosity is not a dominant factor, and Torricelli's law would be the relevant one.
A: Let $a$ the outflow rate and $b$ the inflow rate in $\frac{l}{min}$. In 60 minutes the cistern is filled. The equation is
$(-a+b)\cdot 60= c \quad(\text{1 cistern})$
If there is no leak the cistern is filled in 40 minutes.
$b\cdot 40= c \quad(\text{1 cistern})$
$b=\frac{c}{40}$
The first equation becomes
$(-a+\frac{c}{40})\cdot 60= c $
Solving the equation you´ll get $a=\frac{1}{120}c$. That means that in one minute $\frac{1}{120}$ of the content will be drained. Hence in 2 hours the cistern is completely empty.
A: Quickly, 
$$V(t)=\int_0^t f(s) - \delta(s)\mathrm{d}s.$$
If $f(s) = f$ and $\delta(s)=\delta$ for $s\geq0$, then $$ V^T = f-\delta$$
$$V^T=V(1)=\int_0^1 f(s) \mathrm{d}s- \int_0^1\delta(s)\mathrm{d}s = f-\delta$$
If $f(s) = f$ and $\delta(s)=0$ for $s\geq0$, then
$$ V^T = V(2/3)=\int_0^{2/3} f(s) \mathrm{d}s- \int_0^{2/3}\delta(s)\mathrm{d}s  = \frac{2}{3}f$$
Now, $$V(u) =0= V^T - \int_0^{u}\delta(s)\mathrm{d}s \implies 0 =V^T-u\delta$$
Using, the relations obtained before, we can say $$\delta=\frac{1}{3}f \qquad \text{and} \qquad V^T =  \frac{2}{3}f.$$
Therefore
$$u\delta=V^T \implies u\frac{1}{3}f=\frac{2}{3}f \implies u=2.$$
The time unit used was, of course, hours. So, if the cistern is full, if the input flow is stopped, it will get empty in 2 hours.
A: Take Volume =$V$, Rate of filling =$x$, Rate of leaking=$l $
We need $\frac{V}{l}$
$\frac{V}{x}=40$
$\frac{V}{x-l}=60$
$\frac{x-l}{x}=\frac{2}{3}$
$l=\frac{x}{3}$
$\frac{V}{x}.\frac {x}{l}=\frac{V}{l}=120$
