Concept:
To find the shortest distance between two lines, first check if they are parallel or skew.
If the direction vectors are parallel ($\vec{b}_1 \parallel \vec{b}_2$), the shortest distance formula is:
$$d = \frac{|\vec{b} \times (\vec{a}_2 - \vec{a}_1)|}{|\vec{b}|}$$
Where $\vec{b}$ is the common direction vector, and $\vec{a}_1, \vec{a}_2$ are position vectors of points on the lines.
Step 1: Extract position and direction vectors.
Line 1: $\vec{r} = (\hat{i} + \hat{j} + 3\hat{k}) + \lambda(2\hat{i} + 2\hat{j} + \hat{k})$
$\vec{a}_1 = \hat{i} + \hat{j} + 3\hat{k}$
$\vec{b}_1 = 2\hat{i} + 2\hat{j} + \hat{k}$
Line 2: Expand and rewrite to separate the parameter $\mu$:
$\vec{r} = (1\hat{i} - 1\hat{j} + 1\hat{k}) + \mu(2\hat{i} + 2\hat{j} + \hat{k})$
$\vec{a}_2 = \hat{i} - \hat{j} + \hat{k}$
$\vec{b}_2 = 2\hat{i} + 2\hat{j} + \hat{k}$
Notice that $\vec{b}_1 = \vec{b}_2 = \vec{b}$. The lines are parallel!
Step 2: Calculate the vector difference $(\vec{a}_2 - \vec{a}_1)$.
$$\vec{a}_2 - \vec{a}_1 = (\hat{i} - \hat{j} + \hat{k}) - (\hat{i} + \hat{j} + 3\hat{k})$$
$$\vec{a}_2 - \vec{a}_1 = 0\hat{i} - 2\hat{j} - 2\hat{k}$$
Step 3: Compute the cross product $\vec{b} \times (\vec{a}_2 - \vec{a}_1)$.
$$ \vec{b} \times (\vec{a}_2 - \vec{a}_1) = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k} \\ 2 & 2 & 1 \\ 0 & -2 & -2 \end{vmatrix} $$
$$ = \hat{i}(-4 - (-2)) - \hat{j}(-4 - 0) + \hat{k}(-4 - 0) $$
$$ = -2\hat{i} + 4\hat{j} - 4\hat{k} $$
Step 4: Calculate the required magnitudes and final distance.
Magnitude of the cross product:
$$|\vec{b} \times (\vec{a}_2 - \vec{a}_1)| = \sqrt{(-2)^2 + 4^2 + (-4)^2} = \sqrt{4 + 16 + 16} = \sqrt{36} = 6$$
Magnitude of direction vector $\vec{b}$:
$$|\vec{b}| = \sqrt{2^2 + 2^2 + 1^2} = \sqrt{4 + 4 + 1} = \sqrt{9} = 3$$
Calculate the distance $d$:
$$d = \frac{6}{3} = 2$$