Assuming that the question defines the entire system:
Let the velocity of the first-mentioned plane be Va in miles per hour - mph West
Let the velocity of the second be Vb, similarly – mph East
Let the lapsed time be T in hours - hr
Let the distance be D in miles - mile.
Va = 520 mph West
Vb = 540 mph East
T = 3 hr
Therefore, since the vectors, East and West, are diametrically opposite, the relative velocity is:
V = Va + Vb = 520 + 540 = 1 060 mph
Since V = D / T then, D = V x T
Therefore, D = 1 060 x 3 = 3 180 mile.