\(P=\left(x^2+2x\right)\left(y^2-4y\right)+5\left(x^2+2x\right)+4\left(y^2-4y\right)+2021\)
\(=\left[\left(x+1\right)^2-1\right]\left[\left(y-2\right)^2-4\right]+5\left(x+1\right)^2+4\left(y-2\right)^2+2000\)
\(=\left(x+1\right)^2\left(y-2\right)^2+\left(x+1\right)^2+3\left(y-2\right)^2+2024\ge2024\)
\(P_{min}=2024\) khi \(\left(x;y\right)=\left(-1;2\right)\)