\(P=\frac{4\left(x-y\right)^2}{4}=\frac{4\left(x-y\right)^2}{x^2+2xy+3y^2}=\frac{4x^2-8xy+4y^2}{x^2+2xy+3y^2}\)
- Với \(y=0\Rightarrow P=x^2=4\)
- Với \(y\ne0\Rightarrow P=\frac{4\left(\frac{x}{y}\right)^2-8\left(\frac{x}{y}\right)+4}{\left(\frac{x}{y}\right)^2+2\left(\frac{x}{y}\right)+3}=\frac{4t^2-8t+4}{t^2+2t+3}\) với \(t=\frac{x}{y}\)
\(\Leftrightarrow Pt^2+2Pt+3P=4t^2-8t+4\)
\(\Leftrightarrow\left(P-4\right)t^2+2\left(P+4\right)t+3P-4=0\)
\(\Delta'=\left(P+4\right)^2-\left(P-4\right)\left(3P-4\right)\ge0\)
\(\Leftrightarrow-2P^2+24P\ge0\Rightarrow0\le P\le12\)
\(\Rightarrow P_{max}=12\)