Find the shortest distance between straight line joining points A(3,2,-4) and B(1,6,-6) and straight line joining points C(-1,1,-2) and D(-3,1,-6). The complete question is below because the world limit doesn't allow me to post full question in title.
Find the shortest distance between the straight line joining the points A(3,2,-4) and B(1,6,-6) and the straight line joining the points C(-1,1,-2) and D(-3,1,-6). Also find equation of the line of shortest distance and coordinates of the feet of the common perpendicular
I have found the shortest distance by two methods

*

*by determining that lines are skew and proceeding further on e.g. taking dot product with direction vectors and then by finding s and t. Then I found the direction vector and thus by finding its magnitude of that direction vector I got the shortest distance


*by finding equation of parallel planes and by solving them using distance formula between two planes
In both cases, I got shortest distance equals to sqrt(21). [is it right]
But my real query is how to find equation of the line of shortest distance and coordinates of the feet of the common perpendicular. Please help.
 A: Let $PQ$ be the line of shortest distance whose equation is required such that $P$ lies on $AB$ and $Q$ lies on $CD$ and its direction ratios be $(a,b,c)$.
Now, direction ratios of $AB$ and $CD$ are $(2,-4,2)$ and $(2,0,4)$ respectively.
$\therefore$ $2a-4b+2c=0 \tag{i}\label{i}$ since $PQ \perp AB$
and $2a+0+4c=0 \tag{ii}\label{ii}$ since $PQ \perp CD$
In Eqs. $(i)$ and $(ii)$, by cross multiplication, we get
$$\frac{a}{4}=\frac{b}{1}=\frac{c}{-2}$$
Therefore $(4,1,-2)$ are direction ratios of PQ $\tag{iii}$
Clearly any point on $AB$ is of the form $X_{AB}(2\mu+3,2-4\mu,2\mu-4)$ and any point on $CD$ is of the form $X_{CD}(2\lambda-1,1,4\lambda-2)$.
So, let $P\equiv(2\mu+3,2-4\mu,2\mu-4)$
and $Q\equiv(2\lambda-1,1,4\lambda-2)$
$\therefore$ Direction ratios of $PQ$ can be given by
$(2\mu+3-2\lambda+1,2-4\mu-1,2\mu-4-4\lambda+2) \tag{iv}$
From $(iii)$ and $(iv)$,
$$\frac{2\mu+3-2\lambda+1}{4}=\frac{2-4\mu-1}{1}=\frac{2\mu-4-4\lambda+2}{-2}=k (say) \tag{v}$$
Since length of $PQ$ is $\sqrt{21}$ units,
$${(2\mu+3-2\lambda+1)}^2+{(2-4\mu-1)}^2+{(2\mu-4-4\lambda+2)}^2=21$$
$\implies {(4k)}^2+k^2+{(-2k)}^2=21$ using $(v)$
$$\implies k=\pm1$$
($k=-1$ is rejected since it can not satisfy $(v)$ for any real value of $\mu$ and $\lambda$)
Putting $k=1$ in Eq. $(v)$, we get
$\mu=0$ and $\lambda=0$
$\therefore$ Feet of common perpendicular PQ are nothing but the points $A(3,2,-4)$ and $C(-1,1,-2)$
and the required equation of $PQ$ is $$\frac{x-3}{4}=\frac{y-2}{1}=\frac{z+4}{-2}$$ which is same as line $AC$.
