the following is a question from my textbook on vectors:
EDIT: Added text, so that the post is self-contained even without the picture.
The points $A$ and $B$ have position vectors $\begin{pmatrix}2\\9\\t\end{pmatrix}$ and $\begin{pmatrix}2t\\5\\3t\end{pmatrix}$ respectively.
a. Find $\vec{AB}$.
b. Find, in terms of $t$, $|\vec{AB}|$.
c. Find the value of $t$ which makes $|\vec{AB}|$ a minimum.
d. Find the minimum value of $|\vec{AB}|$.
My issue is with part C. I accept the textbook's solution, as mine gives an incorrect answer but do not understand why their method is acceptable. Since the exercise is to find the value of t that makes vector AB a minimum, why is it acceptable to square vector AB and then differentiate, rather than just differentiating vector AB as it is, using the chain rule? I see how this leads to the problem of two t values, rather than one, but I didn't feel that it would be acceptable to just ignore one by squaring, and changing the original formula. What am I misunderstanding here?
EDIT: Added text.
(a) $\vec{AB}=\mathbf{b}-\mathbf{a}=\begin{pmatrix}2\\9\\t\end{pmatrix}-\begin{pmatrix}2t\\5\\3t\end{pmatrix} =\begin{pmatrix}2-2t\\-4\\2t\end{pmatrix}$
(b) $\begin{align}|\vec{AB}|&=\sqrt{(2-2t)^2+(-4)^2+{2t}^2}\\ &=\sqrt{4t^2-8t+4+16+4t^2}\\ &=\sqrt{8t^2-8t+20} \end{align}$
(c) Let $|\vec{AB}|^2=p$, then $p=8t^2-8t+20$ and $\frac{\mathrm{d}p}{\mathrm{d}t}=16t-8$
Thanks!