The steps of mathematical Pythagorean theorem are more detailed. Thanks for flying 4000m above the boy's head. It took 20 seconds to know how many kilometers the plane flew every hour.
4000 is the vertical distance and 5000 is the diagonal distance.
So the speed of the plane is X.
x^2=5000^2-4000^2
X = 3000m
20s = 20/3600h = 1/ 180h
Speed = distance/time = 3/(1180) = 540 km/h.