$P=x^2-x+$$\frac{1}{x}+4$
$=x^2-2x+1+x-2+$$\frac{1}{x}+5$
$=(x-1)^2+(\sqrt[]{x})^2-2\sqrt[]{x}.$$\frac{1}{\sqrt[]{x}}+$ $\frac{1}{(\sqrt[]{x})^2}+5$
$=(x-1)^2+(\sqrt[]{x}-$$\frac{1}{\sqrt[]{x}})^2+5$ $\geq5$
Dấu "=" xảy ra khi $x=1$
Vậy GTNN của P là 5 khi $x=1$