Let t1 and t2 be times taken by the car to go from X to Y and then from Y to X respectively. Then, t1+t2=vuXY+vdXY=XY⋅(vuvdvu+vd)
Total distance travelled =XY+XY=2XY
Therefore, average speed of the car for this round trip is vav=XY(vuvdvu+vd)2XY
or vav=vu+vd2vuvd