a bathtub can be filled by the hot and cold water pipes in four minutes and, when full, can be emptied by the waste pipe in five minutes. If it is half full and all three pipes are set running, when will the tub be filled?

To fill the whole tub with the water running and the drain open would take

tub/(tub/4 - tub/5)
= 20 minutes

But the tub was already half full, so it would take 10 minutes to fill from the moment it was half-full.

To solve this problem, we need to understand the concept of rates and work. Let's break it down step by step:

1. Determine the rate of filling: We know that the hot and cold water pipes can fill the bathtub in 4 minutes. Therefore, the rate at which the pipes can fill the bathtub is 1/4 (1 bathtub filled in 4 minutes).

2. Determine the rate of emptying: The waste pipe can empty the bathtub in 5 minutes. So, the rate at which it can empty the bathtub is 1/5 (1 bathtub emptied in 5 minutes).

3. Determine the net rate: To find the rate at which the bathtub fills or empties when both the filling and emptying pipes are operated together, we subtract the rate of emptying from the rate of filling. In this case, the net rate is 1/4 - 1/5.

4. Determine the time needed to fill the half-full bathtub: Since the bathtub is already half-full, it means there is only half of the work required to fill it. Therefore, we need to find the time it takes to complete half of the work.

5. Use the formula: Time = Work / Rate. In this case, Time = (1/2) / (1/4 - 1/5).

Now let's calculate the time needed to fill the half-full bathtub using the formula:

Time = (1/2) / (1/4 - 1/5)
= (1/2) / (5/20 - 4/20)
= (1/2) / (1/20)
= (1/2) * (20/1)
= 10 minutes.

Therefore, if all three pipes are running when the bathtub is half-full, it will take 10 minutes to fill the bathtub completely.