22. (12 points) Let
$$
f(x)=\frac{a}{x}+x \ln x, \quad g(x)=x^{3}-x^{2}-3 \text {. }
$$
(1) When $a=2$, find the equation of the tangent line to the curve $y=f(x)$ at $x=1$;
(2) If there exist $x_{1}, x_{2} \in [0,2]$ such that
$$
g\left(x_{1}\right)-g\left(x_{2}\right) \geqslant M
$$

holds, find the maximum integer $M$ that satisfies the above condition;
(3) If for any $s, t \in \left[\frac{1}{2}, 2\right]$ we have
$$
f(s) \geqslant g(t)
$$

holds, find the range of values for the constant $a$.

22. (1) When $a=2$,
$$
f(1)=2, f^{\prime}(1)=-1 \text {. }
$$

Therefore, the equation of the tangent line to the curve $y=f(x)$ at $x=1$ is
$$
y-2=-(x-1) \text {. }
$$
(2) From $g^{\prime}(x)=3 x^{2}-2 x=3 x\left(x-\frac{2}{3}\right)$, and
$$
g(0)=-3, g(2)=1, g\left(\frac{2}{3}\right)=-\frac{85}{27},
$$

we know
$$
\begin{array}{l}
g(x)_{\text {min }}=g\left(\frac{2}{3}\right)=-\frac{85}{27}, \\
g(x)_{\text {max }}=g(2)=1 . \\
\text { Then }\left[g\left(x_{1}\right)-g\left(x_{2}\right)\right]_{\text {max }} \\
=g(x)_{\text {max }}-g(x)_{\text {min }} \\
=\frac{112}{27} .
\end{array}
$$

Therefore, the largest integer $M$ that satisfies the condition is $M=4$.
(3) For any $s, t \in\left[\frac{1}{2}, 2\right]$, the condition $f(s) \geqslant g(t)$ is equivalent to
$f(x)_{\text {min }} \geqslant g(x)_{\text {max }}$ on the interval $\left[\frac{1}{2}, 2\right]$.
From (2), we know that on the interval $\left[\frac{1}{2}, 2\right]$,
$g(x)_{\min }=g(2)=1$.
Thus, $f(x)_{\min } \geqslant 1$.
Also, $f(1)=a \Rightarrow a \geqslant 1$.
Next, we prove that when $a \geqslant 1$, the function $f(x) \geqslant 1$ holds on the interval $\left[\frac{1}{2}, 2\right]$.
When $a \geqslant 1$ and $x \in\left[\frac{1}{2}, 2\right]$,
$f(x)=\frac{a}{x}+x \ln x \geqslant \frac{1}{x}+x \ln x$.
Let $h(x)=\frac{1}{x}+x \ln x$. Then
$h^{\prime}(x)=-\frac{1}{x^{2}}+\ln x+1, h^{\prime}(1)=0$.
When $x \in\left[\frac{1}{2}, 1\right)$, $h^{\prime}(x)0$.
Thus, $h(x)_{\text {min }}=h(1)=1$, which means $h(x) \geqslant 1$.
Therefore, when $a \geqslant 1$ and $x \in\left[\frac{1}{2}, 2\right]$, $f(x) \geqslant 1$ holds, i.e., for any $s, t \in\left[\frac{1}{2}, 2\right]$, $f(s) \geqslant g(t)$.
(Wu Lihua provided)