a) Ta có
$P = \left( \dfrac{1}{1-\sqrt{x}} - \dfrac{1}{\sqrt{x}} \right) : \left( \dfrac{2x+\sqrt{x}-1}{1-x} + \dfrac{2x\sqrt{x} + x - \sqrt{x}}{1 + x\sqrt{x}} \right)$
$= \dfrac{\sqrt{x} - (1 - \sqrt{x})}{\sqrt{x} (1 - \sqrt{x})} : \left( \dfrac{(\sqrt{x} +1)(2\sqrt{x}-1)}{(1 - \sqrt{x})(1 + \sqrt{x})} + \dfrac{\sqrt{x}(2x + \sqrt{x} - 1)}{(1 + \sqrt{x})(x - \sqrt{x} + 1)} \right)$
$= \dfrac{2\sqrt{x}-1}{\sqrt{x}(1-\sqrt{x})}: \left( \dfrac{2\sqrt{x}-1}{1-\sqrt{x}} + \dfrac{\sqrt{x}(\sqrt{x}+1)(2\sqrt{x}-1)}{(1 + \sqrt{x})(x - \sqrt{x}+1)} \right)$
$= \dfrac{2\sqrt{x}-1}{\sqrt{x}(1-\sqrt{x})}: \left( \dfrac{2\sqrt{x}-1}{1-\sqrt{x}} + \dfrac{2x - \sqrt{x}}{x - \sqrt{x}+1}\right)$
$= \dfrac{2\sqrt{x}-1}{\sqrt{x}(1-\sqrt{x})}: \dfrac{(2\sqrt{x}-1)(x-\sqrt{x}+1) + (2x-\sqrt{x})(1-\sqrt{x})}{(1-\sqrt{x})(x-\sqrt{x}+1)}$
$= \dfrac{2\sqrt{x}-1}{\sqrt{x}(1-\sqrt{x})}: \dfrac{2x\sqrt{x} -3x+\sqrt{x}-1 + 3x - 2x\sqrt{x}-\sqrt{x}}{(1-\sqrt{x})(x-\sqrt{x}+1)}$
$= \dfrac{2\sqrt{x}-1}{\sqrt{x}(1-\sqrt{x})}: \dfrac{-1}{(1-\sqrt{x})(x-\sqrt{x}+1)}$
$= \dfrac{2\sqrt{x}-1}{\sqrt{x}(1-\sqrt{x})}. (\sqrt{x}-1)(x-\sqrt{x}+1)$
$= \dfrac{(1-2\sqrt{x})(x-\sqrt{x}+1)}{\sqrt{x}}$
$= \dfrac{-2x\sqrt{x} + 3x - 3\sqrt{x}+1}{\sqrt{x}}$
b) Ta có
$x = 7-4\sqrt{3} = 4 -2.2\sqrt{3} + 3 = (2-\sqrt{3})^2$
Vậy $\sqrt{x} = 2-\sqrt{3}$
Thay vào P ta có
$P = \dfrac{-2(7-4\sqrt{3})(2-\sqrt{3}) + 3(7-4\sqrt{3}) - 3(2-\sqrt{3}) + 1}{2-\sqrt{3}}$
$= \dfrac{-36 + 21\sqrt{3}}{2-\sqrt{3}}$
$= \dfrac{(21\sqrt{3}-36)(2 + \sqrt{3})}{2^2-3}$
$= 6\sqrt{3}-9$