Let the capacity of the tank be $ 1 $ unit.
Pipe $ A $ can fill the tank in $ 2 $ minutes, so its rate of filling is:
$ \frac{1}{2} $ tank per minute.
Pipe $ B $ can fill the tank in $ 15 $ minutes, so its rate of filling is:
$ \frac{1}{15} $ tank per minute.
Both pipes are opened together for the first $ 4 $ minutes. The part of the tank filled in $ 4 $ minutes is:
$ 4 \times \left( \frac{1}{2} + \frac{1}{15} \right) $
$ = 4 \times \left( \frac{15 + 2}{30} \right) $
$ = 4 \times \frac{17}{30} = \frac{68}{30} = \frac{34}{15} $.
After $ 4 $ minutes, pipe $ A $ is turned off, and only pipe $ B $ continues to fill the tank.
The remaining part to be filled is:
$ 1 - \frac{34}{15} = \frac{15}{15} - \frac{34}{30} = \frac{11}{30} $.
Time taken by pipe $ B $ to fill the remaining part:
$ \frac{\frac{11}{30}}{\frac{1}{15}} = \frac{11}{30} \times 15 = \frac{11}{2} = 5.5 $ minutes.
Total time to fill the tank:
$ 4 + 5.5 = 9.5 $ minutes.