Find the domain and the maximum value that the function $$f(x,y,z)=\frac{x+2y+3z}{\sqrt{x^2+y^2+z^2}}$$ may attain in its domain.
I have found the domain of the function to be $\mathbb{R^3\backslash\mathbf{0}}$. To maximize I differentiated in terms of $x,y,z$ having $$f_x=\frac{-2 x y-3 x z+y^2+z^2}{\left(x^2+y^2+z^2\right)^{3/2}},\quad f_y=\frac{2 x^2-x y+z (2 z-3 y)}{\left(x^2+y^2+z^2\right)^{3/2}},\quad f_z=\frac{3 \left(x^2+y^2\right)-z (x+2 y)}{\left(x^2+y^2+z^2\right)^{3/2}}$$ But to solve the system $f_x=0,f_y=0$ and $f_z=0$ is rather hard. What are the plausible values of $x,y,z$?
Consider the vectors $\,\vec{u}=(x,y,z)\,$ and $\,\vec{v}=(1,2,3)$, then we can write $$\frac{x+2y+3z}{\sqrt{x^2+y^2+z^2}}=\frac{\vec{u}\boldsymbol{\cdot}\vec{v}}{\Vert\vec{u}\Vert}=\frac{\Vert\vec{u}\Vert\Vert\vec{v}\Vert\cos(\alpha)}{\Vert\vec{u}\Vert}=\Vert\vec{v}\Vert\cos(\alpha)=\sqrt{1^2+2^2+3^2}\cos(\alpha )=\sqrt{14}\cos(\alpha)$$
When is the last expression maximized? When $\alpha=k\pi,\,k\in\mathbb{Z}$, thus the maximum value of $f$ is $\sqrt{14}$.