Now, let the distance between A & B be 'd'.
We're gonna use the formula, (Distance)=(Speed)(Time).
Time taken to go from A to B is t1=d/V1.
Time taken to come from B to A is t2=d/V2.
Now, you know that average velocity is (total distance)/(total time).
You get V(average)=2(V1)(V2)/(V1+V2)