Distance of two lines in $\mathbb{R}^3$ Using vector methods show that the distance between two non parallel lines $l_1$ and $l_2$ is given by $$d=\frac{|(\overrightarrow{v}_1 - \overrightarrow{v}_2) \cdot (\overrightarrow{ a}_1 \times \overrightarrow{a}_2)|}{||\overrightarrow{a}_1 \times \overrightarrow{a}_2||}$$ where $\vec{v}_1$ and $\vec{v}_2$ are random points of $l_1$ and $l_2$ respectively, and $\vec{a}_1$ and $\vec{a}_2$ are the directions of $l_1$ and $l_2$. 
HINT: 
We consider the plane that contains $l_1$ and is parallel to $l_2$. Show that $\frac{\vec{a}_1 \times \vec{a}_2}{\|\vec{a}_1 \times \vec{a}_2\|}$ is unit perpendicular to that plane. Then take the projection of $\vec{v}_2-\vec{v}_1$ to that perpendicular direction. 
How can the plane that contains $l_1$ be parallel to $l_2$ while the line $l_1$ is non parallel to $l_2$?? 
$$$$ 
EDIT: 
We consider the plane that contains $l_1$ and is parallel to $l_2$. That means that the plane passes through the point $\overrightarrow{v}_1$ and has as parallel vector the vector $\overrightarrow{a}$. 
To find the distance between the two lines, we have to find the distance between the points $\overrightarrow{v}_1$ and $\overrightarrow{v}_2$. 
The vectors $\overrightarrow{a}_1$ and $\overrightarrow{a}_2$ produce the plane, so the vector $\overrightarrow{a}_1 \times \overrightarrow{a}_2$ is perpendicular to the plane. 
So, the unit perpendicular vector to the plane is $\frac{\overrightarrow{a}_1 \times \overrightarrow{a}_2}{||\overrightarrow{a}_1 \times \overrightarrow{a}_2||}$. 
A vector from the plane to the point $\overrightarrow{v}_2$ is $\overrightarrow{v}_2-\overrightarrow{v}_1$. 
The distance that we are looking for the length of the projection of this vector onto the normal vector to the plane. 
So, $$d=\frac{|(\overrightarrow{v}_1 - \overrightarrow{v}_2) \cdot (\overrightarrow{ a}_1 \times \overrightarrow{a}_2)|}{||\overrightarrow{a}_1 \times \overrightarrow{a}_2||}$$ 
Is this correct?? Could I improve something at the formulation?? 

we are looking for two pints $P_1 = v_1 + t_1\, a_1, P_2 = v_2 + t_2\,  a_2 $ where $t_1, t_2$ are real numbers so that $\vec{P_1P_2}$ is orthogonal to both $a_1$ and $a_2.$  in other words, $$\vec{P_1P_2} = (v_2 -t_2 a_2 )-(v_1-t_1a_1)=( v_2 - v_1) -t_2a_2 + t_1a_1= k a_1 \times a_2 \tag 1$$  taking dot product of $(1)$ with $a_1\times a_2$ gives 
$$(v_2 - v_1)\cdot(a_1 \times a_2) = k\, |a_1 \times a_2|^2 $$ that is 
$$|k| = \frac{|(v_2 - v_1)\cdot(a_1 \times a_2)|}{|a_1 \times a_2|^2}  $$
and the shortest distance between the lines is $$|\vec{P_1P_2}| = |k||a_1 \times a_2| =  \frac{|(v_2 - v_1)\cdot(a_1 \times a_2)|}{|a_1 \times a_2|}$$ as required.
