A = larger, faster pipe
B = smaller, slower pipe
let's say B can fill the tank in hmmm 8hrs... so in 1hr, it has only done 1/8 of the job, in 2hrs it has done 2/8 of the job and in 3hrs has done 3/8 of the job and so on, to finish the job, it needs to do 8/8 of the job or 8/8=1 whole
we dunno how long it took the B pipe to do it though, let's say it took "t" hours, so in 1hr it had done 1/t of the job
now, if B took "t" hours to do the whole job, pipe A is faster and thus it did it 5hrs less than that, so, A can do it in "t - 5" hours
so, in 1hr, A had done 1/(t-5) of the job
now, we know the rates in 1hr of each pipe, we know together, they can do the job in 6hrs
so

well, clearly, if both pipes take 6hrs, the smaller B can't do it in 2hrs by itsef, thus 15 = t