$$
\begin{array}{l}
\text { Three. (20 points) Let } x_{1}=3, \\
x_{n+1}=\left(\frac{2}{n^{2}}+\frac{3}{n}+1\right) x_{n}+n+1
\end{array}
$$
$(n=1,2, \cdots)$. Find the general formula for $x_{n}$.
From the problem, we have
$$
\begin{array}{l}
x_{n+1}=\frac{n^{2}+3 n+2}{n^{2}} \cdot x_{n}+n+1 \\
=\frac{(n+1)(n+2)}{n^{2}} \cdot x_{n}+n+1 \\
=(n+1)\left(\frac{n+2}{n^{2}} \cdot x_{n}+1\right) .
\end{array}
$$

Let $x_{n}=n a_{n}$, then
$$
(n+1) a_{n+1}=(n+1)\left(\frac{n+2}{n^{2}} \cdot n a_{n}+1\right) \text {, }
$$

which simplifies to $a_{n+1}=\frac{n+2}{n} \cdot a_{n}+1$.
Thus, $n a_{n+1}=(n+2) a_{n}+n$,
$$
n\left(a_{n+1}-1\right)=(n+2) a_{n} \text {. }
$$

Therefore, $\frac{a_{n+1}-1}{a_{n}}=\frac{n+2}{n}$.
From equation (1) and the properties of geometric sequences, we get
$$
\frac{a_{n+1}-1+n+2}{a_{n}+n}=\frac{n+2}{n} \text {, }
$$

which simplifies to $\frac{a_{n+1}+n+1}{a_{n}+n}=\frac{n+2}{n}$.
From equation (2), we have
$\frac{a_{n+1}+n+1}{a_{n}+n}=\frac{n+2}{n}, \frac{a_{n}+n}{a_{n-1}+n-1}=\frac{n+1}{n-1}$,
$\frac{a_{n-1}+n-1}{a_{n-2}+n-2}=\frac{n}{n-2}, \cdots, \frac{a_{3}+3}{a_{2}+2}=\frac{4}{2}, \frac{a_{2}+2}{a_{1}+1}=\frac{3}{1}$.
Multiplying both sides of the above $n$ equations, we get
$$
\frac{a_{n+1}+n+1}{a_{1}+1}=\frac{\frac{(n+2)!}{2}}{n!}=\frac{(n+2)(n+1)}{2} \text {. }
$$

Thus, $a_{n+1}=2(n+2)(n+1)-n-1=(n+1)(2 n+3)$.
Hence, $a_{n}=n(2 n+1)(n \geqslant 1)$.
Therefore, $x_{n}=n a_{n}=n^{2}(2 n+1)$.
Note: This problem can also be solved by first guessing the formula for $x_{n}$ (the answer), and then proving it using mathematical induction.