$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 $\left \{ {{x-1=0} \atop {\sqrt[]{x}-\frac{1}{\sqrt[]{x}}=0}} \right.$ ⇔ $x=1$
Vậy GTNN của $P$ là $5$ khi $x=1$