Speeds for 1st half= 50km/h
2nd half= 40 km/h
Let total distance to be travelled=2s km (skm at 50km/h + skm at 40 km/h)
We know, 
time=dist/speed, t=s/v
t for 1st half= t₁=s/50 
t for 2nd half= t₂=s/40
Now, we know, Average speed= Total dist/Total time
Avg speed= 2s/(t₁+t₂)
=2s/(s/50 + s/40)
1 5 1
Let the total distance be "2d"
Then total time taken by the car = d/50 + d/40
Average Speed = Total distance / total time taken
= \frac{2d}{ \frac{d}{40} + \frac{d}{50} }
= 44.44 km/hr
1 5 1