Let
-

and
-

be skew lines. We want to understand the distance problem between the two lines as an extremal problem in the sense of higher-dimensional analysis. Let
-

and
-

The square of the distance between the two points
-

and
-

is
(setting
)

We interpret this expression with methods of Analysis 2. We consider the data given by the lines as fixed parameters, so that we have a real-valued expression
in the two real variables
and
,
and we want to determine its extrema. The
partial derivatives
are
-

and
-

If we equate this with
, then we obtain an inhomogeneous linear system of equations with two equations in the variables
and
.
Using
Cramer's rule,
we get
-

and
-

If
and
are normed, then these expressions can be simplified to
-

and
-
