How do I derive the Ramanujan Summation of $\sum_{n=1}^{\infty}n^2 = 0$? I'm sure everyone has seen the infamous identity of $\sum_{n=1}^{\infty}n^k=\frac{-1}{12}$, when $k=1$, and likely the associated series manipulations used to get that. I'm attempting to do a similar manipulation when $k=2$. Thus far, I've managed to do this:
$$
\begin{align}
S&=1^2+2^2+3^2+4^2+5^2+\ldots\\S-1^2&=2^2+3^2+4^2+5^2+\ldots\\&=\sum_{n=1}^{\infty}1^2+2n+n^2
\end{align}$$
I'm not really sure where to go from here, and I haven't found much online outlining the Ramanujan Sum for $k=2$. To be clear, I am trying to define $S-1^2$ in terms of a closed form manipulation of $S$.
 A: Note: since we are working in the context of regularized sums, all "equality" symbols in the following needs to be taken with the appropriate grain of salt.
The same argument using zeta-regularization gives you that
$$ 2 \cdot 2^2 S = 2  \sum n^2 \implies 7 S = \sum_{n = 1}^\infty (-1)^n n^2 $$
The right hand side can be evaluated using Abel summation:
Consider the corresponding power series (which is convergent for $|z| < 1$)
$$ \sum_{n = 1}^\infty (-z)^n n^2 = z \cdot \frac{d}{dz} \sum_{n = 1}^\infty n (-z)^n = z \cdot \frac{d}{dz} z \cdot \frac{d}{dz} \sum_{n = 0}^\infty (-z)^n = z(z(\frac{1}{1+z})')' = \frac{z(z-1)}{(1+z)^3} $$
Taking the limit as $z \to 1$ gives then that, at least formally in this context
$$ \sum_{n = 1}^\infty (-1)^n n^2 = 0 $$
and so your original sum $S = 0$. 
A: From Ramanujan's Notebooks Part 1, Chapter 6: starting with the Euler-Maclaurin summation formula (page 13)
$$ \sum_{k=\alpha}^\beta f(k) = \int_\alpha^\beta f(t) \ dt + \frac12(f(\alpha)+f(\beta))+\sum_{k=1}^n\frac{B_{2k}}{(2k)!}(f^{(2k-1)}(\beta)-f^{(2k-1)}(\alpha)) + R(n) \tag{I3}\label{I3} $$
(Where $R(n)\to 0$ as $n\to\infty$ is a condition on $f$, see page 13,134)
If you set $\alpha = 0 $ and rearrange, you can define the Ramanujan sum(called 'the constant of the series $\sum_{n\geq 1} f(n)$') as the value of $c$ in the expansion (page 134)
$$ \sum_{k=1}^x f(k) = c + \int_0^x f(t) \ dt + \frac12 f(x) + \sum_{k=1}^\infty\frac{B_{2k}}{(2k)!}f^{(2k-1)}(x) \tag{1.1}\label{1.1}$$
On comparison of \eqref{I3} and $\eqref{1.1}$ (note the summation range in $k$ of the LHS of both equations is different, accounting for the appearance of $-f(0)/2$), 
$$ c = -\frac12 f(0) -\sum_{k=1}^\infty\frac{B_{2k}}{(2k)!}f^{(2k-1)}(0)$$
Some care is needed in general to choose the 'correct function' $f$. 
From this formula and a few values $B_2 = 1/6, B_4 = -1/30,\dots$, one easily computes the Ramanujan sum of $\sum_1^\infty k$ with $f(k) = k$,
$$c = -0 - \frac{B_2}{2!}\times 1 = -\frac{1}{12}$$
$\sum_1^\infty k^2$ with $f(k) = k^2$,
$$ c= -0 - \frac{B_2}{2!}\times 0 = 0$$
$\sum_1^\infty k^3$ with $f(k) = k^3$,
$$ c = -0 - \frac{B_2}{2!}\times 0 - \frac{B_4}{4!} \times 3! = \frac{1}{120}$$
and so on, with the general cases $1 + 2^{2k} + 3^{2k} + \cdots = 0$ and $1+2^{2k-1}+3^{2k-1}+\cdots = -\frac{B_{2k}}{2k}$.
I believe this theory is rigorously developed in Hardy's Divergent Series; see the chapter on Euler-Maclaurin summation (or do a search for Ramanujan).
A: A simple way is to use the summation formula:
$$\sum_{k=0}^{\infty} f(k) = \int_0^{\infty}f(x) dx + \int_{-1}^0 S(x) dx$$
where $S(x)$ is the analytic continuation of the partial sum $S(n) = \sum_{k=0}^n f(k)$. I've explained this formula here. For divergent summation of positive functions the integral will also diverge. As I've explained in the other posting, the regularized summation will then be given by the above formula, where we replace the integral by the regularized version of it. This means that we integrate to $R$ and omit all positive powers of $R$ before taking the limit of $R$ to infinity.
If we sum over an even power of $k$, then the partial sum $S(x)$ is antisymmetric about the point $x = -\frac{1}{2}$, as I've shown here. This means that the integral over $S(x)$ from minus 1 to 0 is zero. The integral over the even power of $x$ from zero to infinity, when cut off at $R$ is a pure power of $R$ and must therefore be discarded. This means that the regularized summation from zero to infinity of an even power over the integers is zero.
