\(a;b\ge0\Rightarrow ab\ge0\) ; \(1=a+b\ge2\sqrt{ab}\Rightarrow ab\le\frac{1}{4}\)
\(\Rightarrow0\le ab\le\frac{1}{4}\)
\(P=\frac{a\left(a+1\right)+b\left(b+1\right)}{\left(a+1\right)\left(b+1\right)}=\frac{a^2+b^2+a+b}{ab+a+b+1}=\frac{\left(a+b\right)^2-2ab+1}{ab+2}=\frac{2-2ab}{ab+2}\)
\(P=\frac{ab+2-3ab}{ab+2}=1-\frac{3ab}{ab+2}\le1\)
\(P_{max}=1\) khi \(ab=0\) hay \(\left(a;b\right)=\left(0;1\right)\) và hoán vị
\(P=\frac{6-6ab}{3\left(ab+2\right)}=\frac{2\left(ab+2\right)+2-8ab}{3\left(ab+2\right)}=\frac{2}{3}+\frac{8\left(\frac{1}{4}-ab\right)}{3\left(ab+2\right)}\ge\frac{2}{3}\)
\(P_{min}=\frac{2}{3}\) khi \(ab=\frac{1}{4}\) hay \(a=b=\frac{1}{2}\)