Each friend travelled for t hours
Recall, distance = speed x time
if one heads North at 50 miles per hour, then the distance that he covered after t hours is 50 x t = 50t
if the other heads East at 20 miles per hour, then the distance that he covered after t hours is 20 x t = 20t
The directions forms a right angle triangle as shown below
The distance after t hours is AC. We would find it by applying the pythagorean theorem which is expressed as
hypotenuse^2 = one leg^2 + other leg^2
hypotenuse = AC
one leg = 50t
another leg = 20t
The required equation is
Distance = 2500t^2 + 400t^2