\(u_{n+1}=\dfrac{n\left(u_n+2\right)+n^2+1}{n+1}\)
\(\Rightarrow\left(n+1\right)u_{n+1}=nu_n+n^2+2n+1\)
\(\Rightarrow\left(n+1\right)u_{n+1}-\dfrac{1}{3}\left(n+1\right)^3-\dfrac{1}{2}\left(n+1\right)^2-\dfrac{1}{6}\left(n+1\right)=n.u_n-\dfrac{1}{3}n^3-\dfrac{1}{2}n^2-\dfrac{1}{6}n\)
Đặt \(v_n=u.u_n-\dfrac{1}{3}n^3-\dfrac{1}{2}n^2-\dfrac{1}{6}n\Rightarrow\left\{{}\begin{matrix}v_1=1-\dfrac{1}{3}-\dfrac{1}{2}-\dfrac{1}{6}=0\\v_{n+1}=v_n=...=v_1=0\end{matrix}\right.\)
\(\Rightarrow n.u_n-\dfrac{1}{3}n^3-\dfrac{1}{2}n^2-\dfrac{1}{6}n=0\)
\(\Rightarrow u_n=\dfrac{1}{3}n^2+\dfrac{1}{2}n+\dfrac{1}{6}=\dfrac{\left(n+1\right)\left(2n+1\right)}{6}\)