I have been thinking about the problem of finding the sum of the first squares for a long time and now I have an idea how to do it. However, the second step of this technique looks suspicious.
$$\sum_{i=1}^n i = \frac{n^2+n}{2}$$
$$\int\sum_{i=1}^{n}idi=\int\frac{\left(n^{2}+n\right)}{2}dn$$
$$\sum_{i=1}^{n}\left(\frac{i^{2}}{2}+C_{1}\right)=\left(\frac{n^{3}}{3}+\frac{n^{2}}{2}\right)\cdot\frac{1}{2}+C_{0}$$
$$\sum_{i=1}^{n}i^{2}=\frac{n^{3}}{3}+\frac{n^{2}}{2}-2nC_{1}+2C_{0} $$
Assuming $C_{0}=0$. Next, we are going to find the constant $C_{1}$
From step 4, we can conclude that: $C_{1}=\frac{n^{2}}{6}+\frac{n}{4}-\sum_{i=1}^{n}\frac{i^{2}}{2n}$. We can fix $n$, at any value, it is more convenient to take one($n=1$) then $C_{1}=-\frac{1}{12}$
$$\sum_{i=1}^{n}i^{2}=\frac{n^{3}}{3}+\frac{n^{2}}{2}+\frac{n}{6}$$
Using the induction method, we can prove the correctness of this formula and that the value of the constant $C_{0}$ is really zero. But I created this question because the second step looks very strange, since the left part was multiplied by differential $di$, and the right by $dn$. If we assume that the second step is wrong, then why did we get the correct formula of summation of first squares?
Note: The technique shown based on the integrated one is really interesting for me, using the same reasoning we can get the formula of the first cubes and so on
EDIT1
According to @DatBoi's comment, we can calculate constants $C_{0}$ and $C_{1}$ by solving a system of linear equations. The desired system must contain two equations, since we have two unknown values($C_{0}$ and $C_{1}$). To achieve this, we need to use the right part of the statement from step 4 twice, for two different n. For simplicity, let's take $n=1$ for first equation and $n=2$ for second equation, then the sum of the squares for these $n$ is 1 and 5, respectively.
- The main system $$ \left\{ \begin{array}{c} \frac{1}{3}+\frac{1}{2}-2C_{1}+2C_{0}=1 \\ \frac{8}{3}+\frac{4}{2}-4C_{1}+2C_{0}=5 \\ \end{array} \right. $$
- After simplification $$ \left\{ \begin{array}{c} \ C_{0}-C_{1}=\frac{1}{12} \\ \ C_{0}-2C_{1}=\frac{1}{6} \\ \end{array} \right. $$
- Roots: $C_{0}=0$ and $C_{1}=-\frac{1}{12}$
EDIT2
Considering @epi163sqrt's answer, the second step should be changed and it will take this form:
- $$\sum_{i=1}^{n}\int_{ }^{ }idi=\int_{}^{}\frac{\left(n^{2}+n\right)}{2}dn$$
My hypothesis. If we have: $$\sum_{i=1}^{n}i^{p}=f\left(n,p\right)$$ Where $f$ is a closed form for summation, then this should be true for any natural degree
$$\sum_{i=1}^{n}\int_{}^{}i^{p}di=\int_{}^{}f\left(n,p\right)dn\ \to\ \sum_{i=1}^{n}\frac{i^{\left(p+1\right)}}{p+1}=\int_{}^{}f\left(n,p\right)dn-nC_{1}$$ Can you prove or disprove this hypothesis? My questions above are no longer relevant
EDIT3. Time for fun. Let's try to get a formula for summing the first cubes
$$\sum_{i=1}^{n}i^{2}=\frac{n^{3}}{3}+\frac{n^{2}}{2}+\frac{n}{6}$$
$$\sum_{i=1}^{n}\int_{ }^{ }i^{2}di=\int_{ }^{ }\frac{n^{3}}{3}+\frac{n^{2}}{2}+\frac{n}{6}dn$$
$$\sum_{i=1}^{n}\frac{i^{3}}{3}=\frac{n^{4}}{12}+\frac{n^{3}}{6}+\frac{n^{2}}{12}-nC_{1}+C_{0}$$
$$ \left\{ \begin{array}{c} \frac{1}{4}+\frac{1}{2}+\frac{1}{4}-3C_{1}+3C_{0}=1 \\ \frac{16}{4}+\frac{8}{2}+\frac{4}{4}-6C_{1}+3C_{0}=9 \\ \end{array} \right. $$ Roots: $C_{0}=0$ and $C_{1}=0$
$$\sum_{i=1}^{n}i^{3}=\frac{n^{4}}{4}+\frac{n^{3}}{2}+\frac{n^{2}}{4}$$
GREAT EDIT4 19.01.2022
So far I have no proof, however, the calculation of constants($C_{0}$ and $C_{1}$) can be significantly simplified by changing the lower index of summation to 0.
1b. Let $M_{p}(n)$ be a closed form to obtain the summation, with degree of $p$. I. e. $$\sum_{i=0}^{n}i^{p}=M_{p}\left(n\right)$$
2b. Now let's assume that the statement written below is true $$\sum_{i=0}^{n}\int_{ }^{ }i^{p}di=\int_{ }^{ }M_{p}\left(n\right)dn$$
3b. For now, we'll just take the integrals. $$\sum_{i=0}^{n}\left(\frac{i^{p+1}}{p+1}+C_{1}\right)=\int_{ }^{ }M_{p}\left(n\right)dn$$
4b. Now let's express the sum explicitly. Also, we will move the $C_{1}$ without changing its sign, this is a valid action, since multiplying the constant by (-1) leads to another constant $$\sum_{i=0}^{n}i^{p+1}=\left(\int_{ }^{ }M_{p}\left(n\right)dn+nC_{1}\right)\left(p+1\right)$$
5b. So we got the recurrent formula: $$M_{p}(n) = \left(\int_{ }^{ }M_{p-1}\left(n\right)dn+nC_{p}\right)p$$ $$M_{0}(n) = n+1$$
6b. Now we have to build and resolve a system for two unknown constants. Therefore, the number of equations is two, we are also going to take n=0 and n=1: $$ \left\{ \begin{array}{c} M_{p}(0)=0 \\ M_{p}(1)=1 \end{array} \right. $$ 7b. As I said, we have two constants. In order to see this, we will add a new definition for $W_{p-1}(n)$ that satisfies the following expression: $\int_{ }^{ }M_{p-1}\left(n\right)dn=W_{p-1}\left(n\right)+C_{-p}$. $$ \left\{ \begin{array}{c} \left(W_{p-1}\left(0\right)+C_{-p}+0C_{p}\right)p=0 \\ \left(W_{p-1}\left(1\right)+C_{-p}+1C_{p}\right)p=1 \end{array} \right. $$
8b. I will skip the formal proof of the fact, but the intuition is that $W_{p}(n)$ is a polynomial that does not have a constant term. Therefore, we can safely know that $W_{p}(0)=0$. let's rewrite and simplify the system:
8b.1. $$ \left\{ \begin{array}{c} \left(C_{-p}\right)p=0 \\ \left(W_{p-1}\left(1\right)+C_{-p}+C_{p}\right)p=1 \end{array} \right. $$
8b.2. $$ \left\{ \begin{array}{c} C_{-p}=0 \\ \left(W_{p-1}\left(1\right)+C_{p}\right)p=1 \end{array} \right. $$
8b.3 $$ C_{p}=\frac{1}{p}-W_{p-1}\left(1\right) $$
9b. We have completed the study of the constant. The last action is to match everything together. $$ M_{p}\left(n\right)=p\left(\left(\int_{ }^{ }M_{p-1}\left(n\right)dn\right)_{n}-n\left(\int_{ }^{ }M_{p-1}\left(n\right)dn\right)_{1}\right)+n $$ $$M_{0}(n) = n+1$$
10b. (New step 29.04.2022) The previous step was not recorded correctly. I will also proceed to the calculation of definite integrals: $$ M_{p}(n) = \begin{cases} n+1, & \text{if $p$ is zero } \\ p\int_{0}^{n}M_{p-1}\left(t\right)dt-np\int_{0}^{1}M_{p-1}\left(t\right)dt+n, & \text{otherwise} \end{cases} $$