For proving $D(n) = n ! \sum_{k=0}^n \frac{(-1)^k}{k !}$, in this post under "derivation of closed form from Recursion", the fact is used that $\frac {(-1)^n}{n!} + \frac {D(n-1)}{(n-1)!}= \sum_{k=0}^n \frac {(-1)^k}{k!} + C $ where $C$ is a constant, which I am at a loss to understand. I do not see what a constant would have to do with something such as derangements with variables, also. For context, here is the full proof given (I marked my spot with ($*$)):
$ $Given $\mathcal{D}(0)=1, \mathcal{D}(1)=0$: Subtracting $n \mathcal{D}(n-1)$ from both sides of $D(n)= (n-1)(D{n-1}(n) + D{n-2}(n))$ yields $$ \mathcal{D}(n)-n \mathcal{D}(n-1)=-(\mathcal{D}(n-1)-(n-1) \mathcal{D}(n-2)) $$ this implies $$ \mathcal{D}(n)-n \mathcal{D}(n-1)=(-1)^n $$ Dividing both sides by $n$ ! yields $$ \frac{\mathcal{D}(n)}{n !}-\frac{\mathcal{D}(n-1)}{(n-1) !}=\frac{(-1)^n}{n !} $$ This is very simple to solve for $\frac{\mathcal{D}(n)}{n !}$ : $$ \frac{\mathcal{D}(n)}{n !}=\sum_{k=0}^n \frac{(-1)^k}{k !}+C \tag{$*$} $$ Plugging $n=0$ into this equation yields that $C=0$. Therefore, $$ \mathcal{D}(n)=n ! \sum_{k=0}^n \frac{(-1)^k}{k !} $$
I would appreciate an explanation as to $\frac {(-1)^n}{n!} + \frac {D(n-1)}{(n-1)!}= \sum_{k=0}^n \frac {(-1)^k}{k!} + C $.
Let $a_n = \frac{\mathcal{D}(n)}{n !}.$ Then the relevant equation becomes
$$a_n = a_{n-1} + \frac{(-1)^n}{n!}.$$ This says to get from one element of the sequence to the next you just add $(-1)^n/n!$. So to get from the first element to the last element, you just continually add terms $(-1)^n/n!$. To write this mathematically (but avoiding sigma notation):
Substituting $n-1$ for $n$ in the above equation, we have $$a_{n-1} = a_{n-2} + \frac{(-1)^{n-1}}{(n-1) !}.$$
Putting those together,
$$a_n = a_{n-2} + \frac{(-1)^{n-1}}{(n-1) !} + \frac{(-1)^n}{n !}.$$
Continuing, we get...
$$a_n = a_{0} + \frac{(-1)^{1}}{(1) !} + \cdots + \frac{(-1)^{n-1}}{(n-1) !} + \frac{(-1)^n}{n !}.$$
Then we just plug in $a_0 = 1$ and we are done.
Coming back to the original approach, it assumes a bit more experience with recurrence relations, namely that any two solution sequences for a recurrence relation of the form $a_n - a_{n-1} = b_n$ will be the same up to a constant $C$, just like (if you are familiar with calculus) any two solutions to a differential equation $f'(x) = g(x)$ will be the same up to a constant $C$. So for example, $a_n = n^2$ and $a_n = n^2 + \sqrt{\pi}$ are both equally good solutions to $a_n - a_{n-1} = 2n -1$, as you can check. So once you have found one such solution, you've found all of them - it's only a matter of finding the right $C$.