In order to express continuous summation, define an auxiliary function $s(x,f)$ equal to the $RHS$ of the Euler-Maclaurin formula with zero remainder, such that, the index variable $n$ is replaced with the real variable $x$.
$$
\displaystyle s(x,f)\text{:=}\int_a^x f(t) \, dt+\frac{f(x)}{2}+\frac{f(a)}{2}+\sum _{k=1}^{\infty } \frac{B_{2 k} }{(2 k)!} \left(f^{(2 k-1)}(x)-f^{(2 k-1)}(a)\right)
$$
Clearly, if $x$ is an integer $n$, then $s(n,f)$ is equal to the summation of $f(t)$.
$
\displaystyle s(n,f)=\sum _{t=a}^n f(t)
$
We can now derive a differential equation for $s$. Differentiate $s$ with respect to $x$ and simplify.
$
\displaystyle \frac{\partial s(x,f)}{\partial x}=f(x)+\frac{f'(x)}{2}+\sum _{k=1}^{\infty } \frac{B_{2 k} f^{(2 k)}(x)}{(2 k)!}
$
Substitute $f'(t)$ for $f(t)$.
$
\displaystyle s\left(x,f'\right)=f(x)-f(a)+\frac{f'(x)}{2}+\frac{f'(a)}{2}+\sum _{k=1}^{\infty } \frac{B_{2 k} }{(2 k)!} \left(f^{(2 k)}(x)-f^{(2 k)}(a)\right)
$
Calculate the difference and simplify.
$
\displaystyle \frac{\partial s(x,f)}{\partial x}-s\left(x,f'\right)=\sum _{k=0}^{\infty } \frac{B_k}{k!} f^{(k)}(a)
$
Observe that the term $\frac{f^{(k)}(a)}{k!}$ is the coefficient for the Taylor expansion of $f(t)$, hence.
$
\displaystyle f(t)=\sum _{k=0}^{\infty } \frac{f^{(k)}(a)}{k!} (t-a)^k=\sum _{k=0}^{\infty } c(k) (t-a)^k
$
$
\displaystyle \frac{\partial s(x,f)}{\partial x}-s\left(x,f'\right)=\sum _{k=0}^{\infty } c(k) B_k
$
Consider what happens if we restrict $x$ to be an integer $n$.
$
\displaystyle \left.\frac{\partial s(x,f)}{\partial x}\right|_{x=n}=\sum _{k=0}^{\infty } c(k) B_k+\sum _{t=a}^n f'(t)
$
Now, let's get creative and allow the following symbolic equivalence.
$
\displaystyle \left.\frac{\partial s(x,f(t))}{\partial x}\right|_{x=n}\equiv \partial _n\sum _{t=a}^n f(t)
$
The derivative of a summation with respect to it's upper limit may then be expressed as,
$$
\displaystyle \partial _n\sum _{t=a}^n f(t)=\sum _{k=0}^{\infty } c(k) B_k+\sum _{t=a}^n f'(t)
$$
Example
As an example consider the following summation identity with integer $m\geq 1$.
$
\displaystyle \sum _{t=0}^n t^m=\frac{B_{m+1}(n+1)-B_{m+1}}{m+1}
$
Define the functions $f$ and $s$.
$
\displaystyle f(t)=t^m
$
$
\displaystyle s(x,f)=\frac{B_{m+1}(x+1)-B_{m+1}}{m+1}
$
Verify the differential equation.
$
\displaystyle \partial _n\sum _{t=a}^n f(t)=\sum _{k=0}^{\infty } c(k) B_k+\sum _{t=a}^n f'(t)
$
$
\displaystyle \left.\partial _x\left(\frac{B_{m+1}(x+1)-B_{m+1}}{m+1}\right)\right|_{x=n}=B_m+\sum _{t=0}^n m t^{m-1}
$
$
\displaystyle B_m(n+1)=B_m+m\left(\frac{(B_m(n+1)-B_m)}{m}\right)
$
$
\displaystyle B_m(n+1)=B_m(n+1)
$
Application
As an application consider the following summation identity that uses the incomplete gamma function, $\Gamma (a,z)$.
$
\displaystyle \sum _{t=0}^n \frac{1}{\Gamma (t+1)}=\frac{e \Gamma (n+1,1)}{n!}
$
Define the functions $f$ and $s$.
$
\displaystyle f(t)=\frac{1}{\Gamma (t+1)}
$
$
\displaystyle s(x,f)=\frac{e \Gamma (x+1,1)}{\Gamma (x+1)}
$
Let the constant $C$ represent the Bernoulli sum.
$
\displaystyle C=\sum _{k=0}^{\infty } c(k) B_k
$
Because $C$ is a constant, we may choose any valid $n$ to solve for $C$, choose $n=0$.
$
\displaystyle C=-e \text{Ei}(-1)
$
In conclusion, assemble the differential equation and simplify. The variable $t$ is replaced with the standard index variable $k$. The result is a summation identity that makes use of these additional functions: (1)
$\, _2\tilde{F}_2$, (2) $\text{Ei}$, and (3) $\psi ^{(0)}$.
$$
\displaystyle \frac{-1}{e}\sum _{k=0}^n \frac{1}{k!}\psi ^{(0)}(k+1)=\text{Ei}(-1)+\psi ^{(0)}(n+1) \left(1-\frac{1}{n!}\Gamma (n+1,1)\right)\\ +n! \, _2\tilde{F}_2(n+1,n+1;n+2,n+2;-1)
$$
Peace
The derivative and thus the partial derivative are linear operators, i.e. for a sum of functions $f_i$ and $a \in \mathbb{R}$:$${\partial \over \partial x}\left( \sum a\cdot f_i \right)= a\cdot \sum {{\partial f_i \over \partial x}}$$
So in your case we have
$${\partial \over \partial \mu}\left( -\sum\limits_{i=1}^n \frac{(x_i-\mu)^2}{2\sigma^2} \right) = -{1 \over 2 \sigma^2}\sum\limits_{i=1}^n{\partial \over \partial \mu} \left( {(x_i-\mu)^2}\right) = -{1 \over 2 \sigma^2}\sum\limits_{i=1}^n -2{(x_i-\mu)} $$ $$= {1 \over \sigma^2}\sum\limits_{i=1}^n {x_i-\mu} $$
Which is exactly what you have as a result. Further, I don't know what you mean by the u-substitution. This is plain application of the chain rule. Moreover, what you have here is not correct:
$$\sum\limits_{i=1}^n \frac{1}{\sqrt{2\pi\sigma^2}} \color{red}{\neq} \bigg(\frac{1}{\sqrt{2\pi\sigma^2}}\bigg)^n$$
Summation does not result in exponentiation, but just multiplication. You should have gotten:
$$\sum\limits_{i=1}^n \frac{1}{\sqrt{2\pi\sigma^2}} = \frac{n}{\sqrt{2\pi\sigma^2}}$$
Best Answer
First step
Think of the sum as a function. To find a minima/maxima for a certain function we need to find it's derivative and set it to 0. And because we have 2 terms in between the parenthesis, we can't just apply the rule $\frac{\partial}{\partial x} x^n = nx^{n-1}$, but instead we apply the chain rule. So that -2 is from the chain rule.
Second step
Let's denote the derivative of the sum as $S_1$, the when $2S_1 = 0$? It's only possible if $S_1 =0$, so we left out the 2.
Fourth step
$C$ is a constant that's independent from $n$ so after every step we just add $C$. If $n$ is the number of steps then we have added $nC$