Rút gọn biểu thức:
1) \(P=\frac{x^2-\sqrt{x}}{x+\sqrt{x}+1}-\frac{2x+\sqrt{x}}{\sqrt{x}}+\frac{2\cdot\left(x-1\right)}{\sqrt{x}-1}\)
2) \(P=\left(\frac{\sqrt{x}-2}{\sqrt{x}-1}-\frac{\sqrt{x}+2}{x+2\sqrt{x}+1}\right)\cdot\frac{\left(1-x\right)^2}{2}\)
3) \(B=\left(\frac{1-a\sqrt{a}}{1-\sqrt{a}}+\sqrt{a}\right)\cdot\left(\frac{1+a\sqrt{a}}{1+\sqrt{a}}-\sqrt{a}\right)\)
4) \(K=\left(\frac{\sqrt{a}}{\sqrt{a}-1}-\frac{1}{a-\sqrt{a}}\right)\div\left(\frac{1}{\sqrt{a}+1}-\frac{2}{a-1}\right)\)