Hello I've been doing an exercise but I don't know how to find the answer. I need your help, please.
Question
Let Q(1,1,4) be a point on the space and P(x,y,z) any point on the line Delta : (x,y,z) = (3,0,4) + t (2,1,-1), where t belongs to R. For which value of t is the distance between point Q and point P minimal?
What I've done
I determined the coordinates of P
I determined the length of the director vector d and the components of PQ
The square of the distance between $P$ and $Q$ is
$((3+2t)-1)^2+((t)-1)^2+((4-t)-4)^2=6t^2+6t+5=\frac32(2t+1)^2+\frac72.$
This is minimized when $2t+1=0$ or $t=-\frac12$.