The difficulty in such problems tends to be the nature of the units. Switching around the units make it all more clear.If an empty bath is plugged and the tap opened, the tub fills in a minutes. if the plug is removed the bath empties in b minutes , b>a. How long will it take for the bath to fill if the tap is opened and the plug taken away?
With the tap opened, it fills in a minutes. Translation: The tap can fill (1/a) bathtubs in one minute.
With the drain opened, it drains in b minutes. Translation: The drain can drain (1/b) bathtubs in one minute.
Since b > a, we have 1/b < 1/a
Working against each other, we manage to fill [(1/a) - (1/b)] bathtubs per minute. How long does it take to fill a whole bathtub at that rate? A little algebra remains.