Since the cars start at the same point and are going in directions at right angles to each other, the speed at which the distance between them is increasing is a constant that can be computed as the Pythagorean sum:
... d = √(32² + 24²) = 40 . . . . mi/h