This kind of problem where time is a variable could be solved with
the HARMONIC MEAN:
1÷(1/8 + 1/9) = 1÷(17/72) → 72/17 = 4.23.H ≈4:30 H
Another way of solving it:
In 1 hour pump 1 will perform 1/8 of the job
In 1 hour pump 2 will perform 1/9 of the job
Both pumps will perform the job in 1/8 +1/9 = 17/72 Hours
(Assume the whole job = 72 units)
So the complete job will be done in 72/17 ≈ 4:30 H