since the first car covers the distance D in t hour, the second car will cover the same distance in t-4 hours
so distance is: for first car 42t for second car 58(t-4)
so it will be 42t=58(t-4) 42t=58t-232 42t-58t=-232. -16t=-232 t=-232/-16 = 14.5 hours
so the first car runs for 14.5 hours to cover the distance and the second one runs for 14.5-4=10.5 hours
The distance is: 42*14.5 = 58*10.5 = 609 miles