Pipes are Time and Work in disguise: an inlet does positive work, an outlet (or leak) does negative work.
1Rates
Inlet fills in x hours ⇒ fills 1/x per hour; outlet empties in y hours ⇒ −1/y per hour
Both open (x < y): tank fills in xy/(y − x) hours
Two inlets: xy/(x + y) hours
2Leaks
A pipe fills in a hours but with a leak in b hours ⇒ the leak alone empties it in ab/(b − a) hours