Finding maximum and minimum in a region via Lagrange multipliers Consider the following function in n-dimensional space
$$f(x_{1},x_{2},...,x_{n})=x^{2}_{1}+x_{2}^{2}+...+x_{n}^{2}$$
What are the minimum and maximum values of $f$ in the region
$$x_{1}^{2}+2x_{2}^{2}+3x_{3}^{2}+...+nx_{n}^{2}\leq 1$$?
I think the minimum value is 0 when all $x_{1}=x_{2}=...=x_{n}=0$.
What is the maximum value?
I could use Lagrange multipliers but I would have to restrict myself to the boundary $$x_{1}^{2}+2x_{2}^{2}+3x_{3}^{2}+...+nx_{n}^{2}= 1$$.
 A: You can start with the inequality
\begin{equation}
\begin{split}
x_1^2+2x_2^2+3x_3^2+ \ldots +nx_n^2 &\leq 1\\
\mbox{i.e.,  } x_1^2+x_2^2+x_3^2+ \ldots +x_n^2 &\leq 1-\sum_{k=2}^n(k-1)x_k^2
\end{split}
\end{equation}
In other words, the value of $f\leq 1-\sum(\mbox{+ve terms})$. The max is attained when $x_2=x_3=\ldots x_n=0$ and $x_1=1$.
A: The maximum value occurs at some point such that $x_1^2+2x_2^2+\cdots +nx_n^2=1$. This is because the maximum clearly does not occur at the origin. And if it occurred at some $(a_1,\dots,a_n)$ with $0\lt a_1^2+2a_2^2+\cdots +na_n^2\lt 1$, we could by multiplication by a suitable $\tau$ obtain a larger sum of squares using a point on the boundary.
So the Lagrange multipliers method can be used. (The maximum will turn out to be $1$.)
Added: When we use Lagrange multipliers, it is easy to see that $\lambda\ne 0$, for $\lambda=0$ would force all the $x_i$ to be $0$. From the equations $x_i=\lambda  i x_i$, we find that all but one of the $x_i$ must be $0$. And among these $n$ options, the best choice is $x_1=1$, and $x_i=0$ for $i\gt 1$.
