6. On the coordinate plane, consider a figure $M$ consisting of all points with coordinates $(x ; y)$ that satisfy the system of inequalities

$$
\left\{\begin{array}{l}
|x-1|+|5-x| \leqslant 4 \\
\frac{x^{2}-6 x+2 y+7}{y+x-4} \leqslant 0
\end{array}\right.
$$

Sketch the figure $M$ and find its area.
Answer: 4.

Consider the first inequality. To open the absolute values, we consider three possible cases.

1) $x<1$. Then $1-x+5-x \leqslant 4 \Leftrightarrow x \geqslant 1$, i.e., there are no solutions.
2) $1 \leqslant x \leqslant 5$. Then $x-1+5-x \leqslant 4 \Leftrightarrow 4 \leqslant 4$, which is always true, so the solution is $x \in [1; 5]$.
3) $x>5$. Then $x-1+x-5 \leqslant 4 \Leftrightarrow x \leqslant 5$, i.e., there are no solutions.

Combining the results, we get that $x \in [1; 5]$.

Now let's move to the second inequality. The denominator of the fraction in its left part is zero at points belonging to the line $\ell$ with the equation $y=4-x$ (in this case, the inequality is not satisfied, as the fraction is undefined). The numerator of the fraction is zero when $x^{2}-6 x+2 y+7=0 \Leftrightarrow y=\frac{1}{2}(x-2)^{2}-1$. This set of points is a parabola with branches upwards and the vertex at point $C(2; -1)$. The points of intersection of the line and the parabola can be determined from the system of equations $\left\{\begin{array}{l}y=4-x, \\ x^{2}-6 x+2 y+7=0\end{array} \Leftrightarrow\left\{\begin{array}{l}y=4-x, \\ x^{2}-8 x+15=0 .\end{array}\right.\right.$ From this, we get two points $-A(5; -1)$ and $C(3; 1)$.

The second inequality is satisfied:

- at points on the parabola (except points $A$ and $C$);
- at points below the parabola and above the line (in this case, the numerator is negative, and the denominator is positive);
- at points above the parabola and below the line (the numerator is positive, and the denominator is negative).

Considering also the restriction $x \in [1; 5]$ from the first inequality, we get that the set $M$ is the union of two sets $M_{1}$ and $M_{2}$; the first of which is a curvilinear triangle $B C D$, where $B(1; -1)$ and $D(1; 3)$ are the points of intersection of the line $x=1$ with the parabola and the line $\ell$ respectively (its sides are segments $C D, B D$ and the arc of the parabola $B C$), and the second is the region bounded by the segment $A C$ and the arc of the parabola $A C$ (all points of the line $A C$ do not belong to the set, while the other boundary points do belong).

From the symmetry of the parabola relative to its axis (i.e., the line $x=3$), it follows that the area of the figure $M_{3}$, bounded by the segment $B C$ and the arc of the parabola $B C$, is equal to the area of $M_{2}$. But $M_{1} \cup M_{3}=\triangle B C D$, and the area of this triangle is easy to find: $S_{\triangle B C D}=\frac{1}{2} \cdot 4 \cdot 2=4$.