Find points $P$,$Q$ which are closest possible with $P$ lying on the line
$x=−1−t \\y=−1+4t\\ z=−3$
and $Q$ lying on the line
$x=−82+4s\\y=−15\\z=33+6s$
I tried by first subtracting the terms $P$ by $Q$, then took their square root. then I found The minimum for $PQ$ is when $f′(s)=0$;$f′(t)=0$ and tried from there to solve for $s$ and $t$, I got
$s=\frac{286}{31}$ and $t=\frac{12744}{527}$
then plugged those values back in to get my points but I'm not sure if I either got a calculation error or if I'm doing it wrong entirely because I keep getting the wrong answer!
I'll give a geometry driven solution.
The primary observation is that the line segment joining $P$ and $Q$, $\overline{PQ}$ will be perpendicular to both lines: $$ \ell_1:\ (x,y,z) = (-1,-1,-3) + t(-1,4,0)\\ \ell_2:\ (x,y,z) = (-82,-15,33) + s(4,0,6) $$
$\vec{PQ} = (-81+t+4s,-14-4t,36+6s)$ and using the scalar product to detect orthogonality yields $$ \vec{PQ}\perp\ell_1\ \Rightarrow\ \vec{PQ} \cdot (-1,4,0) = 0 \ \Rightarrow\ 81-t-4s +4(-14-4t) = 0\\ \vec{PQ}\perp\ell_2\ \Rightarrow\ \vec{PQ} \cdot (4,0,6) = 0 \ \Rightarrow\ 4(-81+t+4s) +6(36+6s) = 0 $$ or $$ 17t + 4s = 25 \\ t + 13s = 27 $$ So $t=1$ and $s=2$ and $$ \boxed{ P = (-1,-1,-3) + 1(-1,4,0) = (-2,3,-3)\\ Q = (-82,-15,33) + 2(4,0,6) = (-74,-15,45) } $$