\(P=\frac{a^2}{ab+a}+\frac{b^2}{ab+b}\ge\frac{\left(a+b\right)^2}{2ab+a+b}\ge\frac{\left(a+b\right)^2}{\frac{\left(a+b\right)^2}{2}+a+b}=\frac{2}{3}\)
\(\Rightarrow P_{min}=\frac{2}{3}\) khi \(a=b=\frac{1}{2}\)
\(P=\frac{a\left(b+1\right)-ab}{b+1}+\frac{b\left(a+1\right)-ab}{a+1}=a+b-\left(\frac{ab}{a+1}+\frac{ab}{b+1}\right)=1-ab\left(\frac{1}{a+1}+\frac{1}{b+1}\right)\le1\)
\(\Rightarrow P_{max}=1\) khi \(\left[{}\begin{matrix}a=0\\b=0\end{matrix}\right.\)