a: \(Q=\left(\dfrac{\sqrt{x}+2}{x+2\sqrt{x}+1}-\dfrac{\sqrt{x}-2}{x-1}\right)\cdot\left(x+\sqrt{x}\right)\)
\(=\left(\dfrac{\sqrt{x}+2}{\left(\sqrt{x}+1\right)^2}-\dfrac{\sqrt{x}-2}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\right)\cdot\left(x+\sqrt{x}\right)\)
\(=\dfrac{\left(\sqrt{x}+2\right)\left(\sqrt{x}-1\right)-\left(\sqrt{x}-2\right)\left(\sqrt{x}+1\right)}{\left(\sqrt{x}+1\right)^2\cdot\left(\sqrt{x}-1\right)}\cdot\sqrt{x}\cdot\left(\sqrt{x}+1\right)\)
\(=\dfrac{x+\sqrt{x}-2-\left(x-\sqrt{x}-2\right)}{\left(\sqrt{x}+1\right)\cdot\left(\sqrt{x}-1\right)}\cdot\sqrt{x}\)
\(=\dfrac{x+\sqrt{x}-2-x+\sqrt{x}+2}{\left(\sqrt{x}+1\right)\left(\sqrt{x}-1\right)}\cdot\sqrt{x}\)
\(=\dfrac{2\sqrt{x}\cdot\sqrt{x}}{x-1}=\dfrac{2x}{x-1}\)
b: Để Q là số nguyên thì \(2x⋮x-1\)
=>\(2x-2+2⋮x-1\)
=>\(2⋮x-1\)
=>\(x-1\in\left\{1;-1;2;-2\right\}\)
=>\(x\in\left\{2;0;3;-1\right\}\)
Kết hợp ĐKXĐ, ta được: \(x\in\left\{0;2;3\right\}\)