A car traveled from A to B at a speed of 15 km/h and return at a speed of 30 km/h. Find the average speed for the whole journey.

time for first part = d/15

time for 2nd part = d/30
total time = d/15 + d/30
= d/10

avg speed = total distance/total time
= 2d/(d/10)
= 20 km/h

notice we can't just average the two speeds.

Best to imagine a distance first. For eg, a distance of 30km.

Time for first part = 2 hours
Time for second part = 1 hour
Total time = 3 hours.

avg speed = total distance/total time
= (30+30)/(2+1)
= 60/3
= 20 km/h

To find the average speed for the whole journey, we need to consider the total distance traveled and the total time taken.

Let's assume the distance from A to B is "d" kilometers.
The car traveled from A to B at a speed of 15 km/h, so it took (d / 15) hours to cover this distance.
The car then returned from B to A at a speed of 30 km/h, so it took (d / 30) hours to cover this distance.

So, the total time taken for the whole journey is (d / 15) hours + (d / 30) hours = (2d + d) / 30 = (3d) / 30 = d / 10 hours.

Now, the average speed is calculated by dividing the total distance traveled by the total time taken.
Average Speed = Total Distance / Total Time

In this case, the total distance is 2d (going from A to B and returning from B to A), and the total time is d / 10 hours.

Therefore, Average Speed = 2d / (d / 10) = 20d / d = 20 km/h.

Hence, the average speed for the whole journey is 20 km/h.