\(a,A=\frac{x+2}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}+\frac{\sqrt{x}\left(\sqrt{x}-1\right)}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}-\frac{x+\sqrt{x}+1}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}\)
\(\Rightarrow A=\frac{x+2+\sqrt{x}\left(\sqrt{x}-1\right)+x+\sqrt{x}+1}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}\)
\(\Rightarrow A=\frac{x+2+x-\sqrt{x}+x+\sqrt{x}+1}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}\)
\(\Rightarrow\frac{3x+3}{\left(\sqrt{x}-1\right)\left(x+\sqrt{x}+1\right)}\)
\(b,Tacó:P=\frac{A}{B}=\frac{3x+3}{2\left(x+\sqrt{x}+1\right)}\)
\(\Rightarrow P=\frac{3}{2}.\frac{x+1}{x+\sqrt{x}+1}\)
\(\Rightarrow P=\frac{3}{2}.\frac{x+1}{x+1+\sqrt{x}}\)
\(\Rightarrow P=\frac{3}{2}.\left(1-\frac{\sqrt{x}}{x+1+\sqrt{x}}\right)\)
\(\Rightarrow P\le\frac{3}{2}.\left(1-0\right)\)
\(\Rightarrow P\le\frac{3}{2}\)
\(\Rightarrow Max_P=\frac{3}{2}\)