If I have two lines $ \eqalign{ & L_1 \left( t \right):p_1 + td_1 \cr & L_2 \left( q \right):p_2 + qd_2 \cr} $ living in $\mathbb{R}^n$, there exists a classical formula to find the distance between them involving dot and cross products. The question is: can I deduce that formula only using calculus? (In this case, 2 variables) i.e., find the values such that the function $ f\left( {t,q} \right) = \left \| L_1 (t) - L_2(t) \right \| = \left \| p_1 + td_1 - p_2 - qd_2 \right\| $ reaches its minimum value.
Oh sorry; for simplicity, to have the natural cross product, just take $\mathbb{R}^3$.