For a journey of equal distances covered at two different speeds, the average speed is found using the harmonic mean formula: 2ab divided by the sum of a and b. Substituting the uphill speed of the quantity u minus v and the downhill speed of the quantity u plus v gives a numerator of 2 times the quantity u minus v times the quantity u plus v. The denominator simplifies to u minus v plus u plus v, which is 2u. Canceling the 2 and expanding the numerator to u squared minus v squared gives an average speed of u squared minus v squared all over u kilometers per hour.