Find the maximum of the function $$f(\bar x)=\sqrt{x_1^2+2x_2^2+......2016x_{2016}^2}$$ $\bar x=(x_1,x_2,....x_{2016}) \in \mathbb{R}^{2016}$
where the domain of $f$ is $$\bar x=(x_1,x_2,....x_{2016}) \in \mathbb{R}^{2016} :\sum_{n=1}^{2016}x_n^2=1.$$
$f^2(\bar x)={x_1^2+2x_2^2+......2016x_{2016}^2}=\sum_{n=1}^{2016}nx_n^2$
I don't know how to use condition $||\bar x||=1$.
You can work step by step.
First of all, the function obviuously reaches its max at the same $\vec x$ as the function $g_1(x)=f(x)^2$, so you can skip the square root.
Now you have $$g_1(x)=x_1^2 + 2x_2^2+\dots + 2016x^2_{2016} = \\=||x|| + x_2^2+2x_3^2+\dots + 2015x_{2016}^2\\=1 + x_2^2+2x_3^2+\dots + 2015x_{2016}^2$$
Now, notice that $g_1$ reaches its maximum on the same point as $$h_1(x)=x_2^2+2x_3^2+\dots + 2015x_{2016}^2$$
so you can safely say that $x_1=0$.
Now, you can use the same trick to define $g_2$ and notice that $x_2=0$.
Or, another way. Once you have $g_1$, you can see that if $x_i\neq 0$ for any $i<2016$, you can always strictly increase the value of $g_1$ by setting $\bar x_i=0$ and $\bar x_{2016}=\sqrt{x_{2016}^2 - x_i^2}$.
This proves that $x_i=0$ for all $i<2016$.