the assumption is that they both start off from the same point at the same time in opposite directions.
at some time say "t" hours, plane A will be some distance, hmmm say "d" miles, since we know they'll both be 4000 miles apart, then plane B will be "4000 - d" miles at that time, since both took off at the same time, then plane A as well as plane B have both been travelling "t" hours.