\(x+y=4\Rightarrow y=4-x\)
\(P=2x^2+\left(4-x\right)^2-3x+4-x\)
\(P=3x^2-12x+20\)
Do \(x+y=4\Rightarrow0\le x\le4\)
Xét \(P=f\left(x\right)=3x^2-12x+20\) trên \(\left[0;4\right]\)
\(P\left(0\right)=20\) ; \(P\left(4\right)=20\); \(P\left(-\frac{b}{2a}\right)=P\left(2\right)=8\)
\(\Rightarrow P_{max}=20\) khi \(\left(x;y\right)=\left(0;4\right);\left(4;0\right)\)
\(P_{min}=8\) khi \(x=y=2\)