We have points $A(1,-1,1),B(6,-3,1),C(2,-1,5),D(5,1,1)$
We also have a line $p$ that goes through the edges $AD$ and $BC$ perpendicularly.
Find the equation of this line: My try:
$$AD = (4,2,0)$$ $$BC = (-4,2,4)$$ $$s = (s_1,s_2,s_3)$$
Then we know that(*...scalar product): $$s*AD = 0$$ $$s*BC = 0$$ From this two equations we get: $$4s_1+2s_2+0s_3 = 0 = -4s_1+2s_2+4s_3 $$ $$ 4s_1+2s_2+0s_3 = 0\\-4s_1+2s_2+4s_3 = 0\\ \text{We add both equations together }\implies 4s_2 + 4 s_3 = 0 \implies 4s_2 = -4s_3\implies s_2 = -s_3$$ Then we get: $$4s_1 = 4s_3\implies s_1 = s_3$$ However, when I plug this back into the equation I get zero at the end, which is not correct.
The solution is $p:x - 3 = \frac{y}{-2} = \frac{z-1}{2}$
We have $AD=(2,1,0)$ and $BC=(-2,1,2)$. Direction of $p$ can be found by taking cross-product. This will be found as $(1,-2,2)$.
Now we find a point on $p$. A point on $BC$ is given by $(2,-1,5)+t(-2,1,2)$. A point on $AD$ is given by $(1,-1,1)+s(2,1,0)$.
From a specific point on $BC$, if we travel along $p$, we will arrive at a specific point on $AD$. The second point satisfies $$(1,-1,1)+s(2,1,0)=(2,-1,5)+t(-2,1,2)+r(1,-2,2)$$
This is a system of linear equations in $r,s,t$ which can be solved easily. The intersection point is indeed found as $(3,0,1)$. Thus $$p : \frac{x-3}{1}=\frac{y-0}{-2}=\frac{z-1}{2}$$