<s>[INST] Maxmum distance from a point to a sphere Which point of the sphere $x^{2} + y^{2} + z^{2} = 1$ is at the maximum distance from the point $\left(\, 2,1,3\, \right)$ ?.
I know that the point is outside the sphere. Should we proceed with maxima and minima concept ?.
 [/INST] WLOG any point on the sphere $(\cos u,\sin u\cos t,\sin u\sin t)$
$$D^2=(\cos u-2)^2+(\sin u\cos t-1)^2+(\sin u\sin t-3)^2$$
$$2^2+1^2+3^2+\cos^2u+\sin^2u(\cos^2t+\sin^2t)-4\cos u-2\sin u(\cos t+3\sin t)$$
$$=2^2+1^2+3^2+\cos^2u+\sin^2u-4\cos u-2\sin u(\cos t+3\sin t)$$
$\cos t+3\sin t=\sqrt{1^2+3^2}\cos\left(t-\arccos\dfrac1{\sqrt{1^2+3^2}}\right)$
$\implies-\sqrt{10}\le\cos t+3\sin t\le\sqrt{10}$
$\implies-2\sqrt{10}|\sin u|\le-2\sin u(\cos t+3\sin t)\le2\sqrt{10}|\sin u|$
$$D^2-(2^2+1^2+3^2+1)\le-4\cos u+2\sqrt{10}|\sin u|\le\sqrt{4^2+(2\sqrt{10})^2}=2\sqrt{14}$$
</s>