How does one arrive at the basic limit formulation for the Stieltjes constants?

The starting definition that I am using is:

$$\zeta(s)=\frac{1}{s-1}+\sum_{n=0}^\infty\gamma_n\cdot\frac{(-1)^n}{n!}(s-1)$$

If I naively differentiate, I find:

$$\zeta'(s)=\sum_{m=1}^\infty-\frac{\ln(m)}{m^s},\quad\zeta''(s)=\sum_{m=1}^\infty\frac{\ln^2(m)}{m^s},\cdots,\quad\zeta^{(n)}(s)=\sum_{m=1}^\infty(-1)^n\frac{\ln^n(m)}{m^s}$$

I say "naively", because as $s\to1^+$ (using the limit from above as this representation of $\zeta$ is not correct for $\Re s\le1$), this approach to finding the Taylor coefficients sees that:

$$\tag{1}\gamma_n=\lim_{s\to1^+}\sum_{m=1}^\infty\frac{\ln^n(m)}{m^s}$$

Except this is a divergent limit as far as I can tell. Various sources instead offer this formulation:

$$\tag{2}\gamma_n=\lim_{k\to\infty}\left[\sum_{m=1}^\infty\frac{\ln^nm}{m}-\frac{\ln^{n+1}k}{n+1}\right]$$

I simply do not see how I can go from $(1)$ to $(2)$ (or rather, how to avoid the fallacy of the divergent limit), and I have tried and failed for a while to find online proofs/resources. Note that I am not very well versed in the theory of $\zeta$; perhaps there is an analytic continuation of $\zeta$ with a more revealing form that I could use here, but I wouldn't know.

Any hints?


If as usual $\psi(x)=x-[x]-1/2$ a standard formula (see below after the answer) gives:

$$\zeta(s)=\frac {1}{s-1}-\int_{1^-}^{\infty}u^{-s}d\psi(u), \Re s >0$$ so with your notation

$$\gamma_k=(-1)^k\frac{d^k}{ds^k}(\zeta(s)-\frac {1}{s-1})|_{s=1}=-\int_{1^-}^{\infty}u^{-1}(\log u)^kd\psi(u)$$

But $$\int_{1^-}^{\infty}u^{-1}(\log u)^kd\psi(u)=\lim_{N \to \infty}\int_{1^-}^{N}u^{-1}(\log u)^m(du-d[u])$$

$$=\lim_{N \to \infty}(\frac{(\log u)^{k+1}}{k+1}|_1^N-\sum_{m=1}^N\frac {(\log m)^k}{k})$$ so indeed we get the required formula:

$$\gamma_k=\lim_{N \to \infty}(-\frac{(\log N)^{k+1}}{k+1}+\sum_{m=1}^N\frac {(\log m)^k}{k})$$

Note: since $d\psi(u)=du-d[u]$, a simple evaluation shows the formula above for $\Re s >1$ but the integral is convergent for $\Re s >0$ since $\psi$ is periodic hence $d\psi$ has uniformly bounded integrals from $1$ to $x>1$ and then the usual Dirichlet/Abel criterion applies as long as $u^{-s} \to 0, u \to \infty$; integrating by parts, one can get the continuation of $\zeta$ to $\Re s >-1$ by a similar integral, namely $$\zeta(s)=\frac {1}{s-1}+\frac{1}{2}-s\int_{1^-}^{\infty}\psi(u)u^{-s-1}du, \Re s >-1$$