Áp dụng \(x^2+y^2\ge2xy\)
\(\Rightarrow\left(a^{1009}\right)^2+\left(b^{1009}\right)^2\ge2a^{1009}b^{1009}\)
\(\Rightarrow2a^{2018}b^{2018}\ge2a^{1009}b^{1009}\)
\(\Leftrightarrow2a^{1009}b^{1009}\left(1-ab\right)\le0\)
\(\Rightarrow0\le ab\le1\) \(\Rightarrow1-ab\ge0\)
\(\Rightarrow P=2018\left(1-ab\right)\ge0\)