Solution (source code)

= Solution

The square $d(t)^2=(t+1)^2+1/2$ is minimized when its first term vanishes. Therefore
$$
\boxed{t_{\min}=-1,\qquad d_{\min}=\frac1{\sqrt2}=s.}
$$
This agrees with the <distance between skew lines> found in part (b). The corresponding parameter on the first line is its <orthogonal projection> value
$$
\lambda_{\min}=\frac{(\boldsymbol r_2(-1)-\boldsymbol a_1)\cdot\boldsymbol n_1}{\|\boldsymbol n_1\|^2}=-\frac32.
$$
The closest pair is $(-1/2,-3/2,0)$ and $(-1,-1,0)$; their connecting <vector> $(-1/2,1/2,0)$ is perpendicular to both direction <vectors>.