Rút gọn biểu thức P
----- Nội dung ảnh -----
Câu 4.
Cho biểu thức \( P = \frac{\sqrt{x}}{2\sqrt{x-2}} - \frac{3\sqrt{x}}{2x-2} \sqrt{x+1} + \frac{\sqrt{x+2}}{x+\sqrt{x+1} - x\sqrt{x-1}} \) với \( x \geq 0, x \neq 1 \)
a) Rút gọn biểu thức \( P \).
b) Tính giá trị của \( P \), biết \( |x + 2\sqrt{x}| = 3 \).