The shortest distance between two skew lines is given by:
\(\displaystyle PQ = \left| \frac{(\vec{b_1} \times \vec{b_2}) \cdot (\vec{a_2} - \vec{a_1})}{|\vec{b_1} \times \vec{b_2}|} \right|\)
First, compute:
\(\vec{a_2} - \vec{a_1} = (-\hat{i}-\hat{j}-\hat{k}) - (3\hat{i}+5\hat{j}+7\hat{k}) = -4\hat{i} - 6\hat{j} - 8\hat{k}\)

Now,
\(\vec{b_1} \times \vec{b_2} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 1 & -2 & 1 \\ 7 & -6 & 1 \end{vmatrix}\)
\(\Rightarrow \vec{b_1} \times \vec{b_2} = \hat{i}(-2+6) - \hat{j}(1-7) + \hat{k}(-6+14)\)
\(\Rightarrow \vec{b_1} \times \vec{b_2} = 4\hat{i} + 6\hat{j} + 8\hat{k}\)
Now substitute in the formula:
\(\displaystyle PQ = \left| \frac{(4\hat{i} + 6\hat{j} + 8\hat{k}) \cdot (-4\hat{i} - 6\hat{j} - 8\hat{k})}{\sqrt{4^2 + 6^2 + 8^2}} \right|\)
\(\Rightarrow PQ = \left| \frac{-16 - 36 - 64}{\sqrt{116}} \right| = \left| \frac{-116}{\sqrt{116}} \right|\)
\(\Rightarrow PQ = \sqrt{116} = 2\sqrt{29}\)
Therefore, the shortest distance is \(2\sqrt{29}\) units.
In a plane, the equation of a line is given by the popular equation y = m x + C. Let's look at how the equation of a line is written in vector form and Cartesian form.
Consider a line that passes through a given point, say ‘A’, and the line is parallel to a given vector '\(\vec{b}\)‘. Here, the line ’l' is given to pass through ‘A’, whose position vector is given by '\(\vec{a}\)‘. Now, consider another arbitrary point ’P' on the given line, where the position vector of 'P' is given by '\(\vec{r}\)'.
\(\vec{AP}\)=𝜆\(\vec{b}\)
Also, we can write vector AP in the following manner:
\(\vec{AP}\)=\(\vec{OP}\)–\(\vec{OA}\)
𝜆\(\vec{b}\) =\(\vec{r}\)–\(\vec{a}\)
\(\vec{a}\)=\(\vec{a}\)+𝜆\(\vec{b}\)
\(\vec{b}\)=𝑏1\(\hat{i}\)+𝑏2\(\hat{j}\) +𝑏3\(\hat{k}\)