\solution{\ref{problemDistanceLineLine(1,2,3)(6,5,4)to(1,3,5)(2,4,6)}
We need to first establish whether the two lines are parallel. Let $\fcv u$ be the direction vector of the first line given by
\[\fcv u=\fcv Q_0 \fcv Q_1= ( 6,5,4)-( 1,2,3) = (5,3,1)
\]
and let $\fcv v$ be the direction vector of the second line given by
\[
\fcv v=\fcv P_0 \fcv P_1= (2,4,6 )-(1,3,5)=( 1, 1, 1).
\]
Now it is straightforward to see that the two lines are not parallel - indeed, one immediately sees that $\fcv u= (5,3,1)$ is not a scalar multiple of $\fcv v=(1,1,1)$. Since the two lines are not parallel, the two direction vectors determine a plane through the origin whose normal vector is given by
\[
\fcv n= \fcv u\times \fcv v=  (5,3,1)\times ( 1, 1, 1)= \left| \begin{array}{ccc} \fcv i & \fcv j &\fcv k\\ 5&3&1 \\1 &1 &1\end{array}\right|= 2\fcv i -4\fcv j+ 2\fcv k= (2, -4, 2)\quad .
\]
We note that if the vectors $\fcv u, \fcv v$ were parallel, then the cross product above would had been zero. Now the distance between the two lines is obtained by taking an arbitrary vector with tail on one line and head on the other, and computing the length of its projection onto $\fcv n $. We use the vector $\fcv r= \fcv Q_0\fcv P_0$. Then the distance $d$ between the two lines is given by:
\[
d=\frac{|\fcv r \cdot \fcv n| }{|\fcv n|}= \frac{|\left(( 1,3,5) - ( 1,2,3)\right) \cdot \fcv  n|}{|\fcv n|}=\frac{ |( 0, 1, 2 )\cdot( 2, -4,2 )|}{|\fcv n|}=0.
\]
Therefore the distance between the two lines is zero. This completes our solution.

We note that since the distance between the lines is zero, they must intersect. As a consistency check for our work, let us verify that the two lines do indeed intersect. The first line is parametrized by $( 1,2,3)+t( 5,3,1) $ i.e., has parametric equations

\[
\left|\begin{array}{rcl}x&=& 1 +5t \\y&=&2+3t\\z&=&3+t \end{array}\right.\quad .
\]
Similarly, the second line is given by the equations
\[
\left|\begin{array}{rcl}x&=& 1 +s \\y&=&3+s\\z&=&5+s \end{array}\right.\quad .
\]
Therefore to find an intersection of the two lines, we need to solve the system
\[
\left|\begin{array}{rcl} 1 +5t&=&1+s \\2+3t&=&3+s\\3+t&=&5+s \end{array}\right.\quad.
\]
From the first equality we get that $s=5t$. We substitute that into the second equality to get that $t=-\frac{1}{2}$. Therefore the intersection of the two lines is the point

\[
(1,2,3)-\frac{1}{2}(5,3,1)= \left(-\frac{3}{2}, \frac{1}{2}, \frac{5}2\right)= (1,3,5)-\frac{5}{2}(1,1,1)\quad ;
\]
all our error checks have been successful.
}

\solution{\ref{problemDistanceLineLine(1,3,4)(2,3,1)to(1,2,2)(0,2,5)}
We present a solution in a concise form suitable for exam taking.

Let $L_1, L_2$ be the two lines.
\[
\begin{array}{rcll|l}
\fcv u &=& (2,3,1)-(1,3,4)=(1,0,-3)&& \text{direction vector } L_1\\
\fcv v &=& (0,2,5)-(1,2,2)=(-1,0,3)=-\fcv u&&\text{direction vector } L_2\\
&&\text{Therefore } L_1 \parallel  L_2\\
\fcv r&=&(2,3,1)-(0,2,5)=(2,1,-4) &&\text{arbitrary vector connecting } L_1, L_2\\
L_1\parallel L_2\Rightarrow\\
\text{dist}(L_1,L_2)&=&|\fcv{orth}_{\fcv u} \fcv r| \\
&=&\left|\fcv r- \fcv {proj}_{\fcv u} \fcv r \right|\\
&=&\left|\fcv r- \frac{\fcv r \cdot \fcv u}{|\fcv u|^2}\fcv{u} \right|\\
&=&\left| (2,1,-4)-\frac{(2,1,-4)\cdot (1,0,-3)}{1^2+0^2+(-3)^2}(1,0,-3) \right|\\
&=&\left|\left(\frac{3}{5}, 1, \frac{1}{5} \right)\right|\\
&=&\sqrt{\left(\frac{3}{5}\right)^2+ 1^2+ \left(\frac{1}{5}\right)^2 }\\
&=&\frac{\sqrt{35}}{5} \quad .
\end{array}
\]
}

\solution{\ref{problemDistanceLineLine(1,3,4)(2,3,1)to(1,2,2)(0,2,4)}
We present a solution in a concise form suitable for exam taking.
\[\begin{array}{rcll|l}
\fcv u &=& (2,3,1)-(1,3,4)=(1,0,-3)&& \text{direction vector } L_1\\
\fcv v &=& (0,2,4)-(1,2,2)=(-1,0,2)=-\fcv u&&\text{direction vector } L_2\\
\fcv r &=& (1,3,4)-(1,2,2)=(0, 1, 2)  &&\text{arbitrary vector connecting } L_1,L_2\\
\fcv n&=&u\times v=(0, 1, 0) &&\neq 0\Rightarrow L_1\not \parallel L_2\\
L_1\not \parallel L_2\Rightarrow \\
\text{dist}(L_1,L_2)&=&\left|\fcv {proj}_{\fcv n} \fcv r\right|\\
&=&\left|\fcv r \cdot \frac{\fcv n}{|\fcv n|}\right|\\
&=&\left| (0,1,2)\cdot (0,1,0)\right|\\
&=&1\quad .
\end{array}
\]
}