Analytical Continuation

Let us consider the following contour integral
\begin{eqnarray}
f=\oint_C dz \frac{(-z)^{s-1}}{e^z-1}.
\end{eqnarray}
The closed contour $C$ consists of two pieces $C_1$ and $C_{2}$ given as follows:

- The contour $C_{2}$ is a large circle of radius $R=(2N+1)\pi$ so it contains all the poles $z=2\pi i n$, $n=\pm 1, \pm 2,...$ of the integrand defined by $e^z-1=0$. The pole $z=0$ is not inside the contour   $C_{2}$.

- The contour $C_1$ which starts below the branch cut  at $+\infty$ then comes and encircles the branch point $z=0$ before it goes to $+\infty$ above the branch cut. The branch cut due to the exponentiation $(-z)^{s-1}$ is assumed here to be between $z=0$ and $z=+\infty$.

Setp $1$

It is very easy to show that

\begin{eqnarray}
\int_{C_{2}} dz \frac{(-z)^{s-1}}{e^z-1}\propto R^s\longrightarrow 0~,~R\longrightarrow\infty~,~{\rm Re}(s)<0.\label{2}
\end{eqnarray}
The integral over the circle $C_{2}$ is vanishingly small for larger and larger radii.

Step $2$

Next, we assume that ${\rm Re}(s)\gt1$.  Clearly, around the encirclement of the branch point $z=0$ we have $(-z)^{s-1}=e^{-i(\pi-\theta)(s-1)}R^{s-1}$.

Thus,  the phase above the branch cut is $(-z)^{s-1}=e^{-i\pi(s-1)}x^{s-1}$ whereas below the branch cut we have the phase $(-z)^{s-1}=e^{i\pi(s-1)}x^{s-1}$.

We compute then

\begin{eqnarray}
\int_{C_1} dz \frac{(-z)^{s-1}}{e^z-1}=(e^{-i\pi(s-1)}-e^{i\pi(s-1)})\int_0^{\infty} dx \frac{x^{s-1}}{e^x-1}=-2i\sin \pi(s-1)I. \label{3}
\end{eqnarray}
It is not difficult to show (by expanding the denominator in $I$ in a geometric series and interchanging the sum with the integral) that the integral $I$ is given by the formula

\begin{eqnarray}
I=\Gamma(s)\zeta(s).\label{4}
\end{eqnarray}
The gamma function $\Gamma(s)$ is given by the usual formula
\begin{eqnarray}
\Gamma(s)=\int_0^{\infty}\frac{dt}{t}t^se^{-t}~,~{\rm Re}(s)>0.
\end{eqnarray}
The $\zeta(s)$ is the celebrated Riemann zeta function which is defined for ${\rm Re}(s)>1$ by the absolutely convergent series
\begin{eqnarray}
\boxed{\zeta(s)=\sum_{n=1}^{\infty}\frac{1}{n^s}~,~{\rm Re}(s)>1.}\label{6}
\end{eqnarray}
Equivalently, we have
\begin{eqnarray}
\zeta(s)=\frac{1}{\Gamma(s)}\int_0^{\infty} dx \frac{x^{s-1}}{e^x-1}.
\end{eqnarray}
This function can also be given (by means of equations (\ref{3}) and (\ref{4})) by the complex integral

\begin{eqnarray}
\zeta(s)=\frac{1}{2i\sin \pi s}\frac{1}{\Gamma(s)}\int_{C_1} dz \frac{(-z)^{s-1}}{e^z-1}.
\end{eqnarray}
But the gamma function satisfies
\begin{eqnarray}
\Gamma(s)\Gamma(1-s)=\frac{\pi}{\sin\pi s}.
\end{eqnarray}
Thus, the Riemann zeta function takes also the form

\begin{eqnarray}
\zeta(s)=\frac{\Gamma(1-s)}{2i\pi }\int_{C_1} dz \frac{(-z)^{s-1}}{e^z-1}.\label{9}
\end{eqnarray}
Since the contour integral over $C_1$ is defined everywhere we conclude that  the Riemann zeta function is also defined everywhere except at the poles of $\Gamma(1-s)$ which occur at $s=1,2,3,...$.

But the zeta function is actually regular for all $s$ such that ${\rm Re}(s)>1$, i.e. the poles $s=2,3,...$ of the gamma function $\Gamma(1-s)$ must be cancelled by corresponding zeros of the contour integral.

Hence, the Riemann zeta function is analytic in the complex plane (all values of $s$) except at $s=1$. We can also easily show that the residue of the pole of the zeta function at $z=1$ is exactly equal $1$.

Step $3$

The formula (\ref{9}) works then for ${\rm Re}(s)<0$. By using the result (\ref{2}) we end up with the formula
\begin{eqnarray}
\zeta(s)=\frac{\Gamma(1-s)}{2i\pi }\oint_{C} dz \frac{(-z)^{s-1}}{e^z-1}.
\end{eqnarray}
The contour has become closed and therefore  we can use the residue theorem which will only use the poles and their residues. In our current case the poles and residues are given by
\begin{eqnarray}
z= 2 i n\pi~,~n=\pm 1, \pm 2,....~,~{\rm Resi}(z)=\big[e^{\mp i\frac{\pi}{2}} 2\pi|n|\big]^{s-1}.
\end{eqnarray}
Hence the Riemann zeta function for ${\rm Re}(s)<0$ is given by
\begin{eqnarray}
\zeta(s)=\frac{\Gamma(1-s)}{2i\pi }(2\pi i)(2)\sum_{n=1}^{\infty}\cos((s-1)\frac{\pi}{2})(2\pi n)^{s-1}.
\end{eqnarray}
Or equivalently
\begin{eqnarray}
\boxed{\zeta(s)=2(2\pi)^{s-1}\Gamma(1-s)\cos((s-1)\frac{\pi}{2})\zeta(1-s).}\label{13}
\end{eqnarray}
This allows us to extend (analytically continue) the definition of the Riemann zeta function to outside its original domain.

Examples

Some important examples include:

\begin{eqnarray}
\zeta(0)&=&1+1+1+...\nonumber\\
&=&\frac{1}{\pi}\cos \frac{x\pi}{2}\zeta(x)\nonumber\\
&=&-\frac{1}{\pi}\sin\frac{(x-1)\pi}{2}\zeta(x)\nonumber\\
&=&-\frac{1}{2}.
\end{eqnarray}
As we have seen the series (\ref{6}) is absolutely convergent for all values of $s$ such that ${\rm Re}(s)>1$ whereas the map  (\ref{13}) allows us to analytically continue the function to all values of $s$ in the complex plane except $s=1$. At $s=1$ the Riemann zeta function defines the so-called harmonic series which is actually divergent as $(s-1)\zeta(s)\longrightarrow 1$ when $s\longrightarrow 1$ which is a fact that we have used in the last line in the above equation.

Another example:

\begin{eqnarray}
\zeta(-1)&=&1+2+3+...\nonumber\\
&=&-\frac{1}{2\pi^2}\zeta(2)\nonumber\\
&=&-\frac{1}{12}.
\end{eqnarray}
In this result we have used the Basel series $\zeta(2)=\pi^2/6$ calculated by Euler (by considering the $x^2-$term of the function $\sin x/x$).

Similarly, we have
\begin{eqnarray}
\zeta(-2)&=&1+4+9+...\nonumber\\
&=&0.
\end{eqnarray}
In general we have in terms of Bernoulli numbers the result

\begin{eqnarray}
\zeta(-s)
&=&-\frac{B_{s+1}}{s+1}.
\end{eqnarray}

Regularization

Let us redo the calculation of the divergent sum $\zeta(-1)$ using a regulator. We start with a sharp cutoff $N$ and write
\begin{eqnarray}
\zeta_N(-1)=\sum_{n=1}^Nn=\frac{1}{2}N^2+\frac{1}{2}N.
\end{eqnarray}
This shows explicitly that this sum diverges quadratically with the cutoff $N$ which is quite expected. However, there is no trace whatsoever of the value $-1/12$ given to the  sum by the Riemann zeta function. This is due to the fact that the above partial sum is discrete and therefore if $N$ is viewed as a real number it has jump discontinuities at each positive integer value of $N$.

This problem can be resolved if we consider a smooth cutoff function $\eta(n/N)$ instead of the sharp cutoff $N$ where $\eta:R^+\longrightarrow R$ is a smooth function supported in the interval $[0,1]$ and satisfies $\eta(0)=1$. We have then the smoothed partial sum
\begin{eqnarray}
\zeta_N(-1)&=&\sum_{n=1}^{\infty}\eta(\frac{n}{N})n\nonumber\\
&=& \sum_{n=1}^{N}f(n)~,~f(n)=\eta(\frac{n}{N})n.
\end{eqnarray}
Consider the integral
\begin{eqnarray}
\int_n^{n+1}f(x)dx&=&\int_n^{n+1}\big[f(n)+(x-n)f^{\prime}(n)+\frac{1}{2}(x-n)^2f^{\prime\prime}(n)+...\big]dx\nonumber\\
&=&f(n)+\frac{1}{2}f^{\prime}(n)+\frac{1}{6}f^{\prime\prime}(n)+...
\end{eqnarray}
Also from the Taylor expansion $f(n+1)=f(n)+f^{\prime}(n)+f^{\prime\prime}(n)/2+...$ we have
\begin{eqnarray}
\frac{1}{2}f(n+1)+\frac{1}{2}f(n)=f(n)+\frac{1}{2}f^{\prime}(n)+\frac{1}{4}f^{\prime\prime}(n)+....
\end{eqnarray}
By using now the Taylor expansion $f^{\prime}(n+1)=f^{\prime}(n)+f^{\prime\prime}(n)+...$ we arrive at the result
\begin{eqnarray}
\int_n^{n+1}f(x)dx&=&\frac{1}{2}f(n+1)+\frac{1}{2}f(n)-\frac{1}{12}f^{\prime}(n+1)+\frac{1}{12}f^{\prime}(n)+...
\end{eqnarray}
We take now the sum over $n$ of both sides  to obtain
\begin{eqnarray}
\sum_{n=0}^{N-1}\int_n^{n+1}f(x)dx&=&\frac{1}{2}\sum_{n=0}^{N-1}f(n+1)+\frac{1}{2}\sum_{n=0}^{N-1}f(n)-\frac{1}{12}\sum_{n=0}^{N-1}f^{\prime}(n+1)+\frac{1}{12}\sum_{n=0}^{N-1}f^{\prime}(n)+...
\end{eqnarray}
We get then

\begin{eqnarray}
\int_0^{N}f(x)dx&=&\sum_{n=0}^{N}f(n)+\frac{1}{2}f(0)+\frac{1}{12}f^{\prime}(0)-\frac{1}{2}f(N)-\frac{1}{12}f^{\prime}(N)+...
\end{eqnarray}
By assuming further that $f(N)=f^{\prime}(N)=0$ we get

\begin{eqnarray}
\int_0^{N}f(x)dx&=&\sum_{n=0}^{N}f(n)+\frac{1}{2}f(0)+\frac{1}{12}f^{\prime}(0)+...
\end{eqnarray}
This is effectively the the Euler-Maclaurin formula.

In our case $f(x)=x\eta(x/N)$. Immediately we have $f(0)=0$, $f^{\prime}(0)=\eta(0)=1$ and $\int_0^{N}f(x)dx=N^2C_{\eta,1}$ where $C_{\eta,1}=\int_0^{\infty}x\eta(x)dx$. We can even show that the error term is of order of $1/N$. Hence, we have

\begin{eqnarray}
\zeta_N(-1)&=&\sum_{n=1}^{\infty}\eta(\frac{n}{N})n\nonumber\\
&=& -\frac{1}{12}+N^2C_{\eta,1}+O(\frac{1}{N^2}).
\end{eqnarray}
Thus, the analytic continuation result is just the constant term of the asymptotic expansion of the smoothed partial sum, i.e. the Riemann zeta function has only subtracted the divergent piece $N^2C_{\eta,1}$ but one may as well subtract $N^2C_{\eta,1}-\epsilon$ (with any real number $\epsilon$) leaving a finite result for the sum. This method can be generalized to all other sums $\zeta(s)$. See the beautiful post by T.Tao.

References

T. Tao, The Euler-Maclaurin fomula, Bernoulli numbers, the zeta function, and real-variable analytic continuation.