Ta có: \(\left(a^{100}+b^{100}\right)\cdot ab=a^{101}\cdot b+b^{101}\cdot a\)
\(\left(a^{101}+b^{101}\right)\cdot\left(a+b\right)=a^{102}+a^{101}\cdot b+b^{101}\cdot a+b^{102}\)
Do đó: \(\left(a^{101}+b^{101}\right)\left(a+b\right)-\left(a^{100}+b^{100}\right)\cdot ab\)
\(=a^{102}+b\cdot a^{101}+a\cdot b^{101}+b^{102}-a^{101}\cdot b-b^{101}\cdot a\)
\(=a^{102}+b^{102}\)
Kết hợp đề bài, ta có:
\(\left(a^{102}+b^{102}\right)\left(a+b\right)-\left(a^{102}+b^{102}\right)\cdot ab=a^{102}+b^{102}\)
\(\Leftrightarrow a+b-ab=1\)
\(\Leftrightarrow a+b-ab-1=0\)
\(\Leftrightarrow\left(a-1\right)+b\left(1-a\right)=0\)
\(\Leftrightarrow\left(a-1\right)-b\left(a-1\right)=0\)
\(\Leftrightarrow\left(a-1\right)\left(1-b\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}a-1=0\\1-b=0\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}a=1\\b=1\end{matrix}\right.\)
Vậy: \(P=a^{2004}+b^{2004}=1^{2004}+1^{2004}=2\)