Cauchy Schwarz - Finding minimum of a function For $x, y , z$ in real numbers, If $2x+y+z=5$, then what is the min value of $x^2 + y^2 + z^2 - 2x + 4y + 6$.  This is a weekend brain teaser in the 2nd week of Calc 3.

Here is an alternate solution using the Cauchy-Schwarz Inequality:-
We have to minimize  $f(x,y,z)=x^2+y^2+z^2-2x+4y+6=(x-1)^2+(y+2)^2+z^2+1$ subject to $2x+y+z=5$
From the Cauchy-Schwarz Inequality , we have $$(2\cdot(x-1)+1 \cdot (y+2) +1\cdot z)^2 \leq (2^2+1^2+1^2)((x-1)^2+(y+2)^2+z^2)$$ $$ \therefore (2x+y+z)^2 \leq 
6\cdot ( (f(x,y,z)-1)$$
$$ \implies \frac{(2x+y+z)^2}{6} + 1 \leq f(x,y,z) \implies f(x,y,z) \geq \frac{25}{6}+1=\boxed{\frac{31}{6}} $$

Let’s take it a step further , and generalise the result .
We have to find the minimum of $f(x,y,z)=a_1x^2+b_1y^2+c_1z^2+a_2x+b_2y+c_2z+d$ , subject to $a_0x+b_0y+c_0z=l$
First , we complete the squares , and obtain $$f(x,y,z)=(\sqrt{a_1}x+\frac{a_2}{2\sqrt{a_1}})^2+(\sqrt{b_1}y+\frac{b_2}{2\sqrt{b_2}})^2+(\sqrt{c_1}z+\frac{c_2}{2\sqrt{c_1}})^2 +(d-(\frac{a_2^2}{4a_1}+\frac{b_2^2}{4b_1}+\frac{c_2^2}{4c_1}))$$
Then , by the Cauchy Schwarz Inequality , we have :- $$((\sqrt{a_1}x+\frac{a_2}{2\sqrt{a_1}})\cdot \frac{a_0}{\sqrt{a_1}}+(\sqrt{b_1}y+\frac{b_2}{2\sqrt{b_1}})\cdot \frac{b_0}{\sqrt{b_1}}+(\sqrt{c_1}z+\frac{c_2}{2\sqrt{c_1}})\cdot \frac{c_0}{\sqrt{c_1}})^2 \leq (f(x,y,z)-(d-(\frac{a_2^2}{4a_1}+\frac{b_2^2}{4b_1}+\frac{c_2^2}{4c_1})))(\frac{a_0^2}{a_1}+\frac{b_0^2}{b_1}+\frac{c_0^2}{c_1})        $$
And from this , we obtain :- $$ f(x,y,z) \geq \frac{(l+\frac{a_2a_0}{2a_1}+\frac{b_0b_2}{2b_1}+\frac{c_0c_2}{2c_1})^2}{(\frac{a_0^2}{a_1}+\frac{b_0^2}{b_1}+\frac{c_0^2}{c_1})}+(d-(\frac{a_2^2}{4a_1}+\frac{b_2^2}{4b_1}+\frac{c_2^2}{4c_1})$$ Perhaps not the prettiest  result , but certainly works when none of the denominators equate to $0$ . And in your case , on substituting the values , the formula happens to equal $\frac{31}{6}$ .
