#### $AB=3\hat{i}-\hat{j}+\hat{k}\; \; and\; \; AB=-3\hat{i}+2\hat{j}+4\hat{k}$are two vectors. The positions vectors of the points A and C are $6\hat{i}+7\hat{j}+4\hat{k}\; \; and\; \;-9\hat{j}+2\hat{k}$ respectively. Find the position vector of a point P on the line AB and a  point Q on the line CD, such that PQ is perpendicular to AB and CD both.

Given,

$\vec{AB}=3\hat{i}-\hat{j}+\hat{k}\\ \vec{CD}=-3\hat{i}+2\hat{j}+4\hat{k}$

And the position vectors

$\vec{OA}=6\hat{i}+7\hat{j}+4\hat{k}\\ \vec{OC}=-9\hat{j}+2\hat{k}$

Therefore, the line passing through A and along AB will have the equation:

$\vec{r}=6\hat{i}+7\hat{j}+4\hat{k}+\lambda\left ( 3\hat{i}-\hat{j}+\hat{k} \right )\\ \Rightarrow \vec{r}=\left ( 6+3\lambda \right )\hat{i}+\left ( 7-\lambda \right )\hat{j}+\left ( 4+\lambda \right )\hat{k}$

and the line passing through C and along CD will have equation

$\vec{r}=-9\hat{j}+2\hat{k}+\mu \left ( -3\hat{i}+2\hat{j}+4\hat{k} \right )\\ \Rightarrow \vec{r}=-3\mu \hat{i}+\left ( 2\mu-9 \right )\hat{j}+\left ( 2+4\mu \right )\hat{k}$

Now, PQ is a vector perpendicular to both AB and CD, such that Q lies on CD and P lies on AB. Thus, coordinates of P and Q will be of the form
$P (6 + 3\lambda, 7 - \lambda, 4 + \lambda)....(i)\\ Q (-3\mu, 2\mu - 9, 2 + 4\mu) .....(ii)$

Hence, the vector PQ will be given as

$\vec{PQ}=\left ( -3\mu-6-3\lambda \right )\hat{i}+\left ( 2\mu-16+\lambda \right )\hat{j}+\left ( 4\mu-2-\lambda \right )\hat{k}$

Now, since PQ is perpendicular to both, hence the dot products of AB.PQ and CD.PQ will be equal to 0.

AB. PQ = 0 and CD. PQ = 0
$AB. PQ = 3(-3\mu - 6 - 3\lambda) - (2\mu - 16 + \lambda) + (4\mu - 2 - \lambda)\\ \Rightarrow 0 = -9\mu - 18 - 9\lambda - 2\mu + 16 - \lambda + 4\mu - 2 - \lambda\\ \Rightarrow -7\mu - 11\lambda - 4 = 0.....(iii)\\ CD.PQ = 3(-3\mu - 6 - 3\lambda) + 2(2\mu - 16 + \lambda) + 4(4\mu - 2 - \lambda)\\ \Rightarrow 0 = -9\mu - 18 -9\lambda + 4\mu - 32 + 2\lambda +16 \mu -8 - 4\lambda\\ \Rightarrow 29\mu + 7\lambda - 22 = 0 ....(iv)$

Solving (iii) and (iv), we get

$\lambda = -1\; \; and \: \: \mu = 1$

Putting the value of $\lambda$ in (i) we get,

$P (6 + 3(-1), 7 - (-1), 4 + (-1))\\ P (6-3,7+1,4-1)\\ P (3,8,3)$

Putting the value of $\mu$ in (ii) we get,

$Q (-3(1), 2(1) - 9, 2 + 4(1))\\ Q (-3, 2 - 9, 2 +4)\\ Q (-3, -7, 6)$

Hence, position vector of P and Q will be

$\\\vec{OP}=3\hat{i}+8\hat{j}+3\hat{k}\\ \vec{OQ}=-3\hat{i}-7\hat{j}+6\hat{k}$