2. Find the minimum value of the expression for $a, b \geqslant 0$

$$
\frac{|a-3 b-2|+|3 a-b|}{\sqrt{a^{2}+(b+1)^{2}}}
$$
Answer: 2.

Solution 1. The minimized expression is $d_{1}+d_{2}$, where $d_{1}, d_{2}$ are the distances from points $A(1,3)$ and $B(3,1)$ to the line $\ell$ defined by the equation $a x-(b+1) y+1=0$. It can be rewritten as
$y=\frac{a}{b+1} x+\frac{1}{b+1}$ or $y=p x+q$, where $p \geqslant 0, q \in(0,1]$. We can assume that the line $\ell$ intersects the segment $A B$, otherwise we can rotate it around the point $C(0, q)$ towards $A B$, reducing $d_{1}$ and $d_{2}$. Then $d_{1}+d_{2}=A B \cdot \sin \alpha$, where $\alpha$ is the angle between the lines $\ell$ and $A B$. The right side reaches its minimum when the angle $\alpha$ is the smallest, which is realized when $\alpha=\angle C A B$ or $\alpha=\angle C B A$. Both of these angles are not less than $\frac{\pi}{4}$, and $\angle C B A=\frac{\pi}{4}$ when $a=b=0$. Therefore, the minimum of $d_{1}+d_{2}$ is $A B \cdot \frac{\sqrt{2}}{2}=2$.

Solution 2. Let $A$ be the maximized expression, $c=b+1 \geqslant 1$. Then

$$
A=\frac{|a-3 c+1|+|3 a-c+1|}{\sqrt{a^{2}+c^{2}}}
$$

Consider three cases.

1) Suppose $c \geqslant 3 a+1$. Then

$$
A=\frac{3 c-a-1+c-3 a-1}{\sqrt{a^{2}+c^{2}}}=\frac{4 c-4 a-2}{\sqrt{a^{2}+c^{2}}} \geqslant \frac{8 a+2}{\sqrt{a^{2}+(3 a+1)^{2}}}=\frac{8 a+2}{\sqrt{10 a^{2}+6 a+1}}
$$

and the inequality becomes an equality when $c=3 a+1$. Moreover,

$$
\frac{(8 a+2)^{2}}{10 a^{2}+6 a+1}=\frac{64 a^{2}+32 a+4}{10 a^{2}+6 a+1} \geqslant \frac{40 a^{2}+24 a+4}{10 a^{2}+6 a+1}=4
$$

and equality is achieved when $a=0$. Thus, the minimum of $A$ is realized when $a=0, c=1$ and is equal to 2.

2) Suppose $\frac{a+1}{3} \leqslant c \leqslant 3 a+1$. Then

$$
A=\frac{3 c-a-1+3 a-c+1}{\sqrt{a^{2}+c^{2}}}=\frac{2 c+2 a}{\sqrt{a^{2}+c^{2}}} \geqslant \frac{2 \left(\frac{a+1}{3}\right)+2 a}{\sqrt{a^{2}+\left(\frac{a+1}{3}\right)^{2}}}=\frac{\frac{8}{3} a+\frac{2}{3}}{\sqrt{a^{2}+\left(\frac{a+1}{3}\right)^{2}}}=\frac{8 a+2}{\sqrt{10 a^{2}+2 a+1}} \geqslant \frac{8 a+2}{\sqrt{10 a^{2}+6 a+1}} \geqslant 2
$$

Thus, in this case, the minimum of $A$ is not realized.