\(\sqrt{x+5}-y^3=\sqrt{y+5}-x^3\)
\(\Leftrightarrow\sqrt{x+5}-\sqrt{y+5}+x^3-y^3=0\)
\(\Leftrightarrow\dfrac{\left(\sqrt{x+5}-\sqrt{y+5}\right)\left(\sqrt{x+5}+\sqrt{y+5}\right)}{\sqrt{x+5}+\sqrt{y+5}}+\left(x-y\right)\left(x^2+xy+y^2\right)=0\)
\(\Leftrightarrow\dfrac{\left(x+5\right)-\left(y+5\right)}{\sqrt{x+5}+\sqrt{y+5}}+\left(x-y\right)\left(x^2+xy+y^2\right)=0\)
\(\Leftrightarrow\dfrac{x-y}{\sqrt{x+5}+\sqrt{y+5}}+\left(x-y\right)\left(x^2+xy+y^2\right)=0\)
\(\Leftrightarrow\left(x-y\right)\left(\dfrac{1}{\sqrt{x+5}+\sqrt{y+5}}+x^2+xy+y^2\right)=0\)
\(\Leftrightarrow x-y=0\) và\(\dfrac{1}{\sqrt{x+5}+\sqrt{y+5}}+x^2+xy+y^2>0\)
\(\Leftrightarrow x=y\)
Khi đó: \(P=x^2-3xy+12-y^2+2018\)
\(\Leftrightarrow P=x^2-3x^2+12-x^2+2018\)
\(\Leftrightarrow P=2030-3x^2\le2030\)
dấu "=" xảy ra khi và chỉ khi x=y=0
vậy maxP=2030 khi và chỉ khi x=y=0