Answer
$d(t)=50t.$
Work Step by Step
If we choose the intersection to be $(0,0$), then after $t$ hours the coordinates of the car heading west will be $(0,-30t)$, of the car heading west will be $(-40t,0)$.
The distance formula from $P_1(x_1,y_1)$ to $P_2(x_2,y_2)$ is $d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$.
Hence here: $d(t)=\sqrt{(0-(-40t))^2+(-30t-0)^2}\\d(t)=\sqrt{(40t)^2+(-30t)^2}\\d(t)=\sqrt{1600t^2+900t^2}\\d(t)=\sqrt{2500t^2}\\d(t)=50t.$