\(x+y\le\sqrt{2\left(x^2+y^2\right)}=\sqrt{2}\Rightarrow\frac{1}{x+y}\ge\frac{\sqrt{2}}{2}\)
\(P=x+y+\frac{x}{y}+\frac{y}{x}+\frac{1}{x}+\frac{1}{y}+2\ge x+y+2\sqrt{\frac{xy}{xy}}+\frac{4}{x+y}+2\)
\(P\ge x+y+\frac{2}{x+y}+\frac{2}{x+y}+4\ge2\sqrt{\frac{2\left(x+y\right)}{x+y}}+2.\frac{\sqrt{2}}{2}+4=4+3\sqrt{2}\)
\(\Rightarrow P_{min}=4+3\sqrt{2}\) khi \(x=y=\frac{1}{\sqrt{2}}\)