\documentclass{article}
\begin{document}
\noindent\textbf{First solution example}:\\[1ex]
The shortest distance between two straight lines represented by the equations
\[ \frac{x-x_1}{l_1} = \frac{y-y_1}{m_1} = \frac{z-z_1}{n_1}\quad\mbox{und}%
\quad%
   \frac{x-x_2}{l_2} = \frac{y-y_2}{m_2} = \frac{z-z_2}{n_2}               \]
is given by the expression
\[ \frac{\pm\;\begin{array}{|ccc|}
     x_1 - x_2 & y_1 - y_2 & z_1 - z_2 \\
	 l_1   &     m_1   &    n_1    \\
	 l_2   &     m_2   &    n_2
    \end{array}}{
    \sqrt{\left|\begin{array}{cc} l_1 & m_1 \\ l_2 & m_2 \end{array}\right|^2
	+ \left|\begin{array}{cc} m_1 & n_1 \\ m_2 & n_2 \end{array}\right|^2
	+ \left|\begin{array}{cc} n_1 & l_1 \\ n_2 & l_2 \end{array}\right|^2}
		}   \]
If the numerator is zero, the two lines meet somewhere.

\bigskip
\noindent\textbf{Second solution example}:\\[1ex]
The shortest distance between two straight lines represented by the equations
\[ \frac{x-x_1}{l_1} = \frac{y-y_1}{m_1} = \frac{z-z_1}{n_1}\quad\mbox{und}%
\quad%
   \frac{x-x_2}{l_2} = \frac{y-y_2}{m_2} = \frac{z-z_2}{n_2}               \]
is given by the expression
\[ \frac{\pm\;\begin{array}{|ccc|}
     x_1 - x_2 & y_1 - y_2 & z_1 - z_2 \\
	 l_1   &     m_1   &    n_1    \\
	 l_2   &     m_2   &    n_2
    \end{array}}{
    \sqrt{\begin{array}{|cc|} l_1 & m_1 \\ l_2 & m_2 \end{array}^2
	    + \begin{array}{|cc|} m_1 & n_1 \\ m_2 & n_2 \end{array}^2
	    + \begin{array}{|cc|} n_1 & l_1 \\ n_2 & l_2 \end{array}^2}
		}   \]
If the numerator is zero, the two lines meet somewhere.
\end{document}

