Deriving the Formula for Average Speed (Same distance). Let me start of by specifying the question:


A and B are two towns. Kim covers the distance from A to B on a scooter at 17Km/hr and returns to A on a bicycle at 8km/hr.What is his average speed during the whole journey.


I solved this problem by using the formula (since the distances are same):
$$ \text{Average Speed (Same distance)} = \frac{2xy}{x+y} = \frac{2\times17\times8}{17+8} =10.88 \text{Km/hr}$$
Now I actually have two questions:
Q1- I know that $$ Velocity_{Average}=  \frac{\Delta S }{\Delta T} $$
Now here does $$\Delta S$$ represent $$ \frac{S_2+S_1 }{2} \,\text{or}\, S_2-S_1 ?$$
Where S2 is the distance covered from point A to point B and S1 is the distance covered from point B to point A
Q2. How did they derive the equation:
$$ Velocity_{Average(SameDistance)} = \frac{2xy}{x+y} $$
Could anyone derive it by using 
$$ Velocity_{Average}=  \frac{\Delta S }{\Delta T} $$

average speed= total distance/total time taken
lat take 1 km up and down journey. spped while going x kmper hour, while coming y km per hour: then tot dist= up+down=1+1=2 km
           total time taken= (1/x) + (1/y)   
          so avg speed=total distance/total time taken=2/((1/x) + (1/y) )=2xy/(x+y)
