Question: While deriving Lagrange equation of motion we may see two equations.

**The first one is** $\frac{\partial \mathbf{r}\_i}{\partial q\_j} = \frac{\partial \mathbf{\dot r}\_i}{\partial \dot q\_j}.$ How is this true?

AFAK $\mathbf{r}\_i = \mathbf{r}\_i(q\_1, q\_2, \cdots, q\_m),$ where in turn every $q$ is some function of $t.$ So first i need to know what is $\mathbf{\dot r}\_i.$ Is it $$\sum\_{j=1}^m \frac{d \mathbf{r}\_i}{d q\_j}\frac{dq\_j}{dt}?$$

If true, then we can write 
$$\frac{\partial \mathbf{\dot r}\_i}{\partial \dot q\_j} = \frac{\partial \bigg(\sum\_{k=1}^m \frac{d \mathbf{r}\_i}{d q\_k}\frac{dq\_k}{dt}\bigg)}{\partial \dot q\_j} = \frac{\partial \bigg(\frac{d \mathbf{r}\_i}{d q\_j} \dot q\_j\bigg)}{\partial \dot q\_j} = \frac{d \mathbf{r}\_i}{d q\_j} = \frac{\partial \mathbf{r}\_i}{\partial q\_j}.$$

**The second one is** $$\frac{d}{dt}\bigg(\frac{\partial \mathbf r\_i}{\partial q\_j}\bigg) = \frac{\partial \mathbf{\dot r}\_i}{\partial q\_j}$$
In this case i don't even know how to start.

Answer: 
Note that $|m-n|=m-n$ for $n< m$ and $|m-n|=n-m$ for $n\ge m$.The given sum can thus be split as
$$ \sum\_{n=0}^k|m-n|=\sum\_{n=0}^{m-1}|m-n|+\sum\_{n=m}^{k}|m-n|=\sum\_{n=0}^{m-1}(m-n)+\sum\_{n=m}^{k}(n-m).$$
The only remaining difference is that the summand for $n=m$ is missing from the first sum. But since $|m-m|=0$, this doesn't matter.

Implicitly, we used $0\le m\le k$ in the above. But the result also holds for $m>k$ or $m<0$, provided one interpretes sums with lower index greater than upper index accordingly.
\begin{align} \sum\_{n=0}^{k}|m-n|&= \sum\_{n=0, n \le m}^{k}|m-n| + \sum\_{n=0, n \ge m}^{k}|m-n| \\
&= \sum\_{n=0}^{m}|m-n| + \sum\_{n= m }^{k}|m-n|\\
&= \sum\_{n=0}^{m}(m-n) + \sum\_{n= m}^{k}(n-m) 
\end{align}