I know the explicit form for $u_0=0, u_{n+1}=u_n+2n+1$ is $u_n=n^2$ but I want to know if there is a generalized or formal way of finding the explicit term for this kind of sequences.
The answer seems to be some kind of “guessing” followed by an induction proof to validate the choice of the explicit formula, but there is no easy way to do so (apart from arithmetic-geometric sequences).
Note: WolframAlpha seems to solve them, I wonder how it does.
In general, given initial condition $u_0$ to the recurrence $$u_{n+1}=u_n+a_n$$ with $a_n$ being an arbitrary sequence, we see that $$u_{k+1}-u_k=a_k$$ so that $$\sum_{k=0}^{n}(u_{k+1}-u_{k})=u_{n+1}-u_0$$ is the same as $\sum_{k=0}^{n}a_k,$ thus $$u_n=u_0+\sum_{k=0}^{n-1}a_k.$$ Use $u_0=0$ and $a_k=2k+1$ so that $$\begin{align} u_n&=0+\sum_{k=0}^{n-1}(2k+1)\\ &=2\sum_{k=0}^{n-1}k+\sum_{k=0}^{n-1}(1)\\ &=2\cdot\frac{n(n-1)}{2}+n\\ &=n^2. \end{align}$$