For B to catch A both will have to reach the same point in same time.
Let that distance be x . B will have to cover x+2kmin the same time.
For B equation will be
x=60km/hr×t
t=x60hr
For A equation will be
x+2=70km/hr×x60hr+12×−20km/hr2×(x60)2
x2−60x+720=0
The solution for the above equation using the quadratic formula will be
x=30(1±√2)km
As we have to find the shortest distance, that distance will be
x=30(1−√2)km