2.166. $\frac{\frac{|b-1|}{b}+b \cdot|b-1|+2-\frac{2}{b}}{\sqrt{b-2+\frac{1}{b}}}$.
Solution.

Domain of definition: $b>0, b \neq 1$.

$$
\begin{aligned}
& \frac{\frac{|b-1|}{b}+b \cdot|b-1|+2-\frac{2}{b}}{\sqrt{b-2+\frac{1}{b}}}=\frac{\frac{|b-1|+b^{2} \cdot|b-1|+2 b-2}{b}}{\sqrt{\frac{b^{2}-2 b+1}{b}}}= \\
& =\frac{|b-1| \cdot\left(b^{2}+1\right)+2(b-1)}{b \sqrt{\frac{(b-1)^{2}}{b}}}=\frac{|b-1| \cdot\left(b^{2}+1\right)+2(b-1)}{|b-1| \sqrt{b}}= \\
& =\left\{\begin{array}{l}
\frac{-(b-1)\left(b^{2}+1\right)+2(b-1)}{-(b-1) \sqrt{b}}=\frac{-(b-1)\left(b^{2}+1-2\right)}{-(b-1) \sqrt{b}}=\frac{b^{2}-1}{\sqrt{b}}, \text { if } 01
\end{array}\right.
\end{aligned}
$$

Answer: $\frac{b^{2}-1}{\sqrt{b}}$ for $b \in(0 ; 1) ; \frac{b^{2}+3}{\sqrt{b}}$ for $b \in(1 ; \infty)$.