2. Let the function $f(x)$ be $\mathbf{R} \rightarrow \mathbf{R}$, satisfying for all $x \in \mathbf{R}$,
$$
f(x)+x f(2-x)=2 \text{. }
$$

Then the analytical expression of $f(x)$ is
2. $f(x)=\left\{\begin{array}{ll}-\frac{2}{x-1}, & x \neq 1 ; \\ 1, & x=1 .\end{array}\right.$

Substitute $2-x$ for $x$ to get
$$
f(2-x)+(2-x) f(x)=2 \text {, }
$$

Combining this with the given equation yields the expression for $f(x)$.