Từ giả thiết ta có:
\(x+y=3\left(\sqrt{x+1}+\sqrt{y+2}\right)\le3\sqrt{2\left(x+y+3\right)}\)
\(\Leftrightarrow P\le3\sqrt{2\left(P+3\right)}\)
\(\Leftrightarrow\left\{{}\begin{matrix}P\ge0\\18P+54\ge P^2\end{matrix}\right.\)
\(\Leftrightarrow\left\{{}\begin{matrix}P\ge0\\P^2-18P-54\le0\end{matrix}\right.\)
\(\Leftrightarrow0\le P\le9+3\sqrt{15}\)
\(\Rightarrow maxP=9+3\sqrt{15}\Leftrightarrow\left(x;y\right)=\left(\dfrac{10+3\sqrt{15}}{2};\dfrac{8+3\sqrt{15}}{2}\right)\)