points on surface that is closest to the point I need to Find the maximum and minimum values of  $$f(x, y, z) = x + 5y + 2z$$ on the sphere  $$x^{2} + y^{2} + z^{2} = 1$$
 A: Apply Cauchy-Schwarz inequality $\mathrm{(f(x,y,z))}^{2}$ = $(1\cdot x + 5\cdot y + 2\cdot z)^2 \le (1^2 + 5^2 + 2^2)(x^2 + y^2 + z^2) = 30$. So $\mathrm{f}_{max} = \mathrm{\sqrt30} = 5.477$ and $\mathrm{f}_{min} = - 5.477.$ 
A: The maximum and minimum are the largest and smallest values of $k$ such that the plane with equation $x+5y+2z=k$ is tangent to our sphere. 
The tangent plane to the sphere at $(a,b,c)$ is perpendicular to the vector $(2a,2b,2c)$. It follows that $a=t$, $b=5t$, $c=2t$ for some $t$.
Substituting in the equation of the sphere, we find that $30t^2=1$.  
The value of $a+5b+2c$ at $(t,5t,2t)$ is $30t$. For $t=\frac{1}{\sqrt{30}}$ this is $\sqrt{30}$. Similarly, the minimum value is $-\sqrt{30}$. 
A: How about using Lagrange multipliers, as T.Bongers mentioned? You get this system of equations to solve for the extrema:
$
\begin{align*}
\quad\frac{\partial}{\partial x}\left( x + 5y + 2z - \lambda(x^2+y^2+z^2-1)\right)=0\\
\quad\frac{\partial}{\partial y}\left( x + 5y + 2z - \lambda(x^2+y^2+z^2-1)\right)=0\\
\quad\frac{\partial}{\partial z}\left( x + 5y + 2z - \lambda(x^2+y^2+z^2-1)\right)=0\\
\quad\frac{\partial}{\partial \lambda}\left( x + 5y + 2z - \lambda(x^2+y^2+z^2-1)\right)=0\\
\end{align*}
$
This becomes
$
\begin{align*}
&\quad1-2x\lambda=0\\
&\quad5-2y\lambda=0\\
&\quad2-2z\lambda=0\\
&\quad x^2+y^2+z^2-1=0\\
\end{align*}
$
and the maximum and minimum are at the $(x,y,z)$ points that solve the system: $\left(\pm\frac{1}{\sqrt{30}},\pm\frac{5}{\sqrt{30}},\pm\frac{2}{\sqrt{30}}\right)$, which André found another way.
