#### Find the shortest distance between the lines given by $r=\left ( 8+3\lambda \right )\hat{i}-\left ( 9+16\lambda \right )\hat{j}+\left ( 10+7\lambda \right )\hat{k}$ and $r=15\hat{i}+29\hat{j}+5\hat{k}+\mu\left ( 3\hat{i}+8\hat{j}-5\hat{k} \right )$

Given two lines,

$\vec{r}=\left ( 8+3\lambda \right )\hat{i}-\left ( 9+16\lambda \right )\hat{j}+\left ( 10+7\lambda \right )\hat{k}...........(i)\\ \\ \vec{r}=15\hat{i}+29\hat{j}+5\hat{k}+\mu\left ( 3\hat{i}+8\hat{j}-5\hat{k} \right )...........(ii)$

Taking equation (i),

$\vec{r}=\left ( 8+3\lambda \right )\hat{i}-\left ( 9+16\lambda \right )\hat{j}+\left ( 10+7\lambda \right )\hat{k} \\ \Rightarrow \vec{r}= 8\hat{i}+3\lambda \hat{i}- 9\hat{j}+16\lambda \hat{j})+ 10 \hat{k}+7\lambda \hat{k} \\ \Rightarrow \vec{r}=8\hat{i}-9\hat{j}+10\hat{k}+3 \lambda \hat{i}-16 \lambda \hat{j}+7 \lambda \hat{k}\\ \Rightarrow \vec{r}=8\hat{i}-9\hat{j}+10\hat{k}+\lambda \left(3 \hat{i}-16 \hat{j}+7 \hat{k} \right ).............(iii)$

We know, the vector equation of a line passing through a point and parallel to a vector is  where  $\lambda\epsilon \mathbb{R}$

$\vec{a}$ = Position vector of the point through which line passes

$\vec{b}$ = Normal to the line

Comparing this with equation (iii), we get

$\vec{a_{1}}=8\hat{i}-9\hat{j}+10\hat{k}\\ \vec{b_{1}}=3\hat{i}-16\hat{j}+7\hat{k}\\$

Now take equation (ii)

$\vec{r}=15\hat{i}+29\hat{i}+5\hat{k}+\mu\left ( 3\hat{i}+8\hat{j}-5\hat{k} \right ) \\ \vec{r}=\left (15\hat{i}+29\hat{i}+5\hat{k} \right )+\mu\left ( 3\hat{i}+8\hat{j}-5\hat{k} \right )..........(iv)$

Similarly from (iv)

$\vec{a_{2}}=\left (15\hat{i}+29\hat{i}+5\hat{k} \right )\\ \vec{b_{2}}=\left ( 3\hat{i}+8\hat{j}-5\hat{k} \right )$

So, the shortest distance between two lines can be represented as:

$d=\left |\frac{\left ( \vec{b_{1}} \times \vec{b_{2}} \right ).\left ( \vec{a_{2}} - \vec{a_{1} }\right ) } {\left | \vec{b_{1}} \times \vec{b_{2}} \right |}\right |$

solve $\vec{b_{1}} \times \vec{b_{2}}$

$\vec{b_{1}} \times \vec{b_{2}}=\begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 3 & -16 & 7 \\ 3 & 8 & -5 \end{vmatrix}$

Taking 1st row and 1st column, we multiply the 1st element of the row  (a??) with the difference of the product of the opposite elements $\left ( a_{22}\times a_{33}-a_{23} \times a_{32}\right )$, excluding the 1st row and the 1st column;

$\begin{vmatrix} a_{11} &a_{12} & a_{13} \\ a_{21} &a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{vmatrix}=a_{11}\left ( a_{22}\times a_{33}-a_{23} \times a_{32} \right )$

Here

$\begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 3 & -16 & 7 \\ 3 & 8 & -5 \end{vmatrix}=\hat{i}\left (\left ( -16 \times -5 \right )-\left ( 7 \times 8 \right ) \right )$

Now, we take the 2nd column and 1st row, and multiply the 2nd element of the row (a??) with the difference of the product of opposite elements   (a?? x a?? - a?? x a??)

$\begin{vmatrix} a_{11} &a_{12} & a_{13} \\ a_{21} &a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{vmatrix}=a_{11}\left ( a_{22}\times a_{33}-a_{23} \times a_{32} \right )-a_{12}\left ( a_{21}\times a_{33}-a_{23} \times a_{31} \right )$

Here

$\begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 3 & -16 & 7 \\ 3 & 8 & -5 \end{vmatrix}=\hat{i}\left (\left ( -16 \times -5 \right )-\left ( 7 \times 8 \right ) \right )-\hat{j}\left (\left ( 3 \times -5 \right )-\left ( 7 \times 3 \right ) \right )$

Finally, taking the 1st row and 3rd column , we multiply the 3rd element of the row (a??) with the difference of the product of opposite elements   (a?? x a?? - a?? x a??), excluding the 1st row and 3rd column.

$\begin{vmatrix} a_{11} &a_{12} & a_{13} \\ a_{21} &a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{vmatrix}=a_{11}\left ( a_{22}\times a_{33}-a_{23} \times a_{32} \right )-a_{12}\left ( a_{21}\times a_{33}-a_{23} \times a_{31} \right )+a_{13}\left ( a_{21}\times a_{32}-a_{22} \times a_{31} \right )$

Here

$\begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 3 & -16 & 7 \\ 3 & 8 & -5 \end{vmatrix}=\hat{i}\left (\left ( -16 \times -5 \right )-\left ( 7 \times 8 \right ) \right )-\hat{j}\left (\left ( 3 \times -5 \right )-\left ( 7 \times 3 \right ) \right )+\hat{k}\left ( \left ( 3 \times 8 \right )-\left ( -16 \times 3 \right ) \right )$

Further simplifying it.

$\begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 3 & -16 & 7 \\ 3 & 8 & -5 \end{vmatrix}=\hat{i}\left (80-56 \right )-\hat{j}\left (-15-21 \right )+\hat{k}\left (24+48 \right )$

$\Rightarrow \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 3 & -16 & 7 \\ 3 & 8 & -5 \end{vmatrix}=24\hat{i}+36\hat{j}+72\hat{k}\\ \\ \\ \Rightarrow \vec{b}\times \vec{b}= 24\hat{i}+36\hat{j}+72\hat{k}........(v)$

And,

$\left | \vec{b}\times \vec{b} \right |= \left |24\hat{i}+36\hat{j}+72\hat{k} \right |\\ \\ \Rightarrow \left | \vec{b}\times \vec{b} \right |=\sqrt{24^{2}+36^{2}+72^{2}} \\ \Rightarrow \left | \vec{b}\times \vec{b} \right |=12\sqrt{2^{2}+3^{2}+6^{2}} \\ \Rightarrow \left | \vec{b}\times \vec{b} \right |=12 \sqrt{4+9+36}\\ \Rightarrow \left | \vec{b}\times \vec{b} \right |=12\sqrt{49}\\ \Rightarrow \left | \vec{b}\times \vec{b} \right |=12 \times 7\\ \Rightarrow \left | \vec{b}\times \vec{b} \right |=84...........(vi)$

$Now \; \; solving \: \: \vec{a_{2}}- \vec{a_{1}}\\ \\ \vec{a_{2}}- \vec{a_{1}} =\left (15\hat{i}+29\hat{i}+5\hat{k} \right )-\left ( 8\hat{i}-9\hat{j}+10\hat{k} \right )\\ \Rightarrow \vec{a_{2}}- \vec{a_{1}} = 15\hat{i}-8\hat{i}+29\hat{j}+9\hat{j}+5\hat{k}-10\hat{k}\\ \Rightarrow \vec{a_{2}}- \vec{a_{1}} = 7\hat{i}+38\hat{j}-5\hat{k}.....(vii)$

Substituting the values from (v), (vi) and (vii) in d, we get

$d=\left |\frac{\left ( \vec{b_{1}} \times \vec{b_{2}} \right ).\left ( \vec{a_{2}} - \vec{a_{1} }\right ) } {\left | \vec{b_{1}} \times \vec{b_{2}} \right |}\right |$

$\Rightarrow d =\left | \frac{\left ( 24\hat{i}+36\hat{j}+72\hat{k} \right ).\left ( 7\hat{i}+38\hat{j}-5\hat{k} \right )}{84} \right |\\ \Rightarrow d =\left | \frac{24 \times 7 +36 \times 38+72 \times -5}{84} \right |\\ \Rightarrow d =\left | \frac{168+1368-360}{84} \right |\\ \Rightarrow d =\left | \frac{1176}{84} \right |\\ \Rightarrow d =14\\$

Thus, the shortest distance between the lines is 14 units.