Explanation:
Let \(S\) be distance between \(A\) and \(B\).
Let \({t_1}\) be time taken by the car to move from \(A\) to \(B\) with speed \({v_1}\) and \({t_2}\) be time taken by the car to move from \(B\) to \(A\) with speed \({v_2}\). Then
\({t_1} = \frac{S}{{{v_1}}}\,{\rm{and}}\,{t_2} = \frac{S}{{{v_2}}}\)
Average speed of the car
\({v_{avg}} = \frac{{{\rm{Total}}\,{\rm{distance}}\,{\rm{travelled}}}}{{{\rm{Total}}\,{\rm{time}}\,{\rm{taken}}}} = \frac{{2S}}{{{t_1} + {t_2}}}\)
\( = \frac{{2S}}{{\frac{S}{{{v_1}}} + \frac{S}{{{v_2}}}}} = \frac{{2{v_1}{v_2}}}{{{v_1} + {v_2}}}\)
Here, \({v_1} = 30\,kmph,{v_2} = 20\,kmph\)
\(\therefore {v_{avg}} = \frac{{2 \times 30 \times 20}}{{30 + 20}} = 24\,kmph\)