Task B-2.2. (20 points) Given are real numbers $0<a<b$. Determine all solutions of the inequality

$$
\frac{a}{x-b}+\frac{b}{x-a} \leq 2
$$
First solution. By rearranging the given inequality, we obtain

$$
\frac{-2 x^{2}+(3 a+3 b) x-(a+b)^{2}}{(x-a)(x-b)} \leq 0
$$

Since the roots of the numerator are $x_{1}=a+b, x_{2}=\frac{a+b}{2}$, and the roots of the denominator are $x_{3}=a, x_{4}=b$, and given that

$$
a<\frac{a+b}{2}<b<a+b
$$

we can sketch the graphs of the functions $y_{1}=-2 x^{2}+(3 a+3 b) x-(a+b)^{2}$ and $y_{2}=(x-a)(x-b)$

![](https://cdn.mathpix.com/cropped/2024_05_30_978576e245d98ac92b08g-10.jpg?height=604&width=846&top_left_y=552&top_left_x=490)

Since the expression must be $\leq 0$, we consider where the graphs are on opposite sides of the $x$-axis. In this case, $x \neq a, x \neq b$. Therefore,

$$
x \in\langle-\infty, a\rangle \cup\left[\frac{a+b}{2}, b\right\rangle \cup[a+b, \infty\rangle
$$