\(P=\frac{x}{y+1}+\frac{y}{x+1}=\frac{x\left(x+1\right)+y\left(y+1\right)}{\left(y+1\right)\left(x+1\right)}=\frac{x^2+x+y^2+y}{\left(y+1\right)\left(x+1\right)}\)
\(P=\frac{\left(x+y\right)^2-2xy+\left(x+y\right)}{xy+x+y+1}=\frac{2-2xy}{2+xy}\)
\(P=\frac{2-2xy}{2+xy}=\frac{-4-2xy+6}{2+xy}=\frac{-2\left(2+xy\right)+6}{2+xy}=-2+\frac{6}{2+xy}\)
Ta có : xy \(\ge\)0 nên \(P=-2+\frac{6}{2+xy}\le-2+\frac{6}{2+0}=1\)
Vậy P max = 1 \(\Leftrightarrow\orbr{\begin{cases}x=0;y=1\\x=1;y=0\end{cases}}\)