Recently, there was some discussion $[1]$, $[2]$ on certain infinite sums, like these
$$f = \sum_{k=1}^\infty \left(\frac{1}{k(k^2+1)}\right)$$
$$g = \sum_{k=1}^\infty \left( \frac{1}{k^2+1}\right)$$
$$h_0=\sum_{k=1}^\infty \frac{\sin(k)}{k}$$
$$h_1=\sum_{k=1}^\infty \frac{\sin(k^2)}{k}$$
$$h_2=\sum_{k=1}^\infty \frac{\sin(k^2)}{k^2}$$
and I wondered if the elegant summation formula of Abel and Plana could be applied to these sums. In summary, AP works fine for $f$, $g$, and $h_0$ but does not for $h_1$ and $h_2$.
This led me to the question in the heading.
But let us start from the beginning.
Quoting $[3]$: "In mathematics, the Abel-Plana formula (AP) is a summation formula discovered independently by Niels Henrik Abel (1823) and Giovanni Antonio Amedeo Plana (1820). It states that
$$\sum _{n=0}^{\infty } f(n)=\frac{1}{2}f(0)+\int_0^{\infty } f(x) \, dx+i \int_0^{\infty } \frac{f(i y)-f(-i y)}{e^{2 \pi y}-1} \, dy\tag{1}$$
It holds for functions f that are holomorphic in the region Re(z) >= 0, and satisfy a suitable growth condition in this region; for example it is enough to assume that |f| is bounded by $C/|z|^{1+\epsilon}$ in this region for some constants C, $\epsilon > 0$, though the formula also holds under much weaker bounds."
Ok, the growth condition for applicability of AP,
$$|f(z)| < C / |z|^{1+\epsilon}\text{, with } C>0, \epsilon >0\tag{2}$$
is fulfilled for $f$ and $g$ above, and is violated by the $h$-sums because $\sin(z)$ is not limited in the complex plane.
I have obtained the following results: AP works for $f$, $g$, and $h_0$ and doesn't for the remaining $h_{1,2}$. The surprising case is $h_0$ where the growth condition $(2)$ not met but AP still gives the correct result.
Examples
Example $g$. -> sucess
The sum has a closed form
$$g = \frac{1}{2} (\pi \coth (\pi )-1)\simeq 1.0766740474685811741$$
Now we to AP: Here $f(n)=\frac{1}{1+(n+1)^2}$ to let the index start at $n=0$. $f(z)$ is meromorhpic (it has two simple poles at $-1+\pm i$) and it goes to zero like $1/|z|^2 for $|z|\to\infty$ so that condition $(2)$ is fulfilled.
We write the r.h.s. of $(1)$ as a sum of three parts, a, b, and c, and calculate
$$a = \frac{1}{2}f(0)= \frac{1}{2}= 0.5$$ $$b = \int_0^{\infty } f(x) \, dx=\frac{\pi}{4}\simeq 0.785398$$
the integrand of the last integral is
$$c_i = i \frac{f(i y)-f(-i y)}{e^{2 \pi y}-1} = \frac{i (f(i y)-f(-i y))}{e^{2 \pi y}-1}= \frac{4 y}{\left(e^{2 \pi y}-1\right) \left(y^4+4\right)}$$
hence the integral is
$$c = \int_0^\infty \frac{4 y}{\left(e^{2 \pi y}-1\right) \left(y^4+4\right)}$$
The integral is convergent and the numerical value is
$$c_n = 0.041275695056277776209$$
Hence $a+b+c$ is equivalent to the closed expression for $g$. Success!
Example $h_0$ -> success
$$f(n) = \frac{\sin(n+1)}{n+1}$$
The sum has the closed form
$$\frac{1}{2} (\pi -1)\simeq 1.0707963267948966192$$
Condition $(2)$ is not fulfilled because for complex $z$ we have $f(z) \sim \sinh(|z|)$. Let us nevertheless apply AP.
$$a = \frac{1}{2}f(0)=\frac{\sin (1)}{2}\simeq 0.420735$$ $$b = \int_0^{\infty } f(x) \, dx=\frac{1}{2} (\pi -2 \text{Si}(1))\simeq 0.624713$$ $$c_i = i \frac{f(i y)-f(-i y)}{e^{2 \pi y}-1} = \frac{2 (y \sin (1) \cosh (y)-\cos (1) \sinh (y))}{\left(e^{2 \pi y}-1\right) \left(y^2+1\right)}$$ $$c = \int_0^\infty \frac{2 (y \sin (1) \cosh (y)-\cos (1) \sinh (y))}{\left(e^{2 \pi y}-1\right) \left(y^2+1\right)}$$
The integral is convergent and the numerical value is
$$c_n = 0.0253475$$
Hence we have $a+b+c \simeq 1.070796$ in good agreement with $h_0$. So in spite of violating the growing condition AP gives the correct result.
Example $h_1$ -> failure
$$f(n) = \frac{\sin((n+1)^2)}{n+1}$$
Numerically we have
$$h_1 \simeq 0.167924$$
Condition $(2)$ is not fulfilled because for complex $z$ we have $f(z) \sim \sinh(|z|^2)$. Let us nevertheless formally apply AP.
$$a = \frac{1}{2}f(0)=\frac{\sin (1)}{2}\simeq 0.420735$$ $$b = \int_0^{\infty } f(x) \, dx=\frac{1}{4} (\pi -2 \text{Si}(1))\simeq 0.312357$$ $$c_i = i \frac{f(i y)-f(-i y)}{e^{2 \pi y}-1} = \frac{\left(-(y+i) \sin \left((y-i)^2\right)-(y-i) \sin \left((y+i)^2\right)\right) (\coth (\pi y)-1)}{2 \left(y^2+1\right)}$$ $$c = \int_0^\infty c_i \,dy\simeq -0.0304174$$
and we have
$a+b+c \simeq 0.758439693815265076542$ whic siginifantly deviates from the value of the sum $h_1$.
References
$[1]$ Find Harmonic Numbers for Imaginary and Complex Values
$[2]$ Convergence of $\sum_{k=1}^\infty \frac{\sin(k(k-1))}{k}$
$[3]$ https://en.wikipedia.org/wiki/Abel%E2%80%93Plana_formula