a,\(P=\frac{x^2+x}{x^2-2x+1}\div\left(\frac{x+1}{x}-\frac{1}{1-x}+\frac{2-x^2}{x^2-x}\right)\)
\(=\frac{x^2+x}{\left(x-1\right)^2}\div\left(\frac{x+1}{x}+\frac{1}{x-1}+\frac{2-x^2}{x\left(x-1\right)}\right)\)
\(=\frac{x^2+x}{\left(x-1\right)^2}\div\left(\frac{x^2-1}{x\left(x-1\right)}+\frac{x}{x\left(x-1\right)}+\frac{2-x^2}{x\left(x-1\right)}\right)\)
\(=\frac{x^2+x}{\left(x-1\right)^2}\div\left(\frac{x^2-1+x+2-x^2}{x\left(x-1\right)}\right)\)
\(=\frac{x^2+x}{\left(x-1\right)^2}\div\frac{x+1}{x\left(x-1\right)}=\frac{x^2+x}{\left(x-1\right)^2}\times\frac{x\left(x-1\right)}{x+1}\)
\(=\frac{x^2\left(x+1\right)\left(x-1\right)}{\left(x-1\right)^2\left(x+1\right)}=\frac{x^2}{x-1}\)
b,a,Để \(P\le1\Rightarrow\frac{x^2}{x-1}\le1\)
\(\Leftrightarrow\frac{x^2}{x-1}-1\le0\)
\(\Leftrightarrow\frac{x^2-x+1}{x-1}\le0\)
\(\Leftrightarrow x-1\le0\)
\(\Leftrightarrow x\le1\)