Find an equivalent function of $\sum_{n=0}^{\infty}{1 \over \cosh (nx)}$ at $0^+$. Let $f:\ x\mapsto \sum_{n=0}^{\infty}{1 \over \cosh (nx)}$. We can see that $f$ is defined in $\Bbb{R}/\{0\}$ and $f$ is an even function.
It is easy to prove $f\to+\infty$ at $0^+$, and by using mathematics software I found that
$$f(x)=_{x\to0^+}{\pi\over2x}+{1\over2}+o(1).$$
I can show that $\lim_{x\to0^+}xf(x)$ exists by proving $g:\ x\mapsto xf(x)$ is an increasing function in $(0,1)$, but I don't know how to give its exact value (which is supposed to be ${\pi\over2}$), furthermore I have no idea how to deal with the $1\over2$ in the formula above.
Any hint will be appreciated.
 A: Here is an elementary derivation. By the Taylor's theorem, if $|\epsilon| \leq x$ then
$$
\frac{1}{\cosh(nx+\epsilon)}
= \frac{1}{\cosh(nx)} - \frac{\sinh(nx)}{\cosh^2(nx)} \epsilon + \mathcal{O}\left(\frac{x^2}{\cosh(nx)}\right).
$$
Here, the implicit bound of the error term is independent of both $x$ and $n$, owing to the exponential decay of the second derivative of $\operatorname{sech}$. Then rearranging and averaging both sides w.r.t. $\epsilon$ over the interval $[0,x]$, we obtain
$$ \frac{1}{\cosh(nx)}
= \frac{1}{x} \int_{nx}^{(n+1)x} \frac{du}{\cosh u}
+ \frac{\sinh(nx)}{\cosh^2(nx)} \cdot \frac{x}{2}
+ \mathcal{O}\left(\frac{x^2}{\cosh(nx)}\right). $$
Applying similar trick to the second term in the RHS, we also obtain
$$ \frac{1}{\cosh(nx)}
= \frac{1}{x} \int_{nx}^{(n+1)x} \frac{du}{\cosh u}
+ \frac{1}{2}\int_{nx}^{(n+1)x} \frac{\sinh u}{\cosh^2 u} \, du + \mathcal{O}\left(\frac{x^2}{\cosh(nx)}\right). $$
Summing over $n = 0, 1, \cdots$, we have
\begin{align*}
f(x)
&= \frac{1}{x}\int_{0}^{\infty} \frac{du}{\cosh u}
+ \frac{1}{2}\int_{0}^{\infty} \frac{\sinh u}{\cosh^2 u} \, du
+ \mathcal{O}\left(\sum_{n=0}^{\infty} \frac{x^2}{\cosh(nx)}\right) \\
&= \frac{\pi}{2x} + \frac{1}{2} + \mathcal{O}\left(\sum_{n=0}^{\infty} \frac{x^2}{\cosh(nx)}\right).
\end{align*}
But it is easy to prove that $\sum_{n=0}^{\infty} \frac{x}{\cosh(nx)} \leq x + \int_{0}^{\infty} \frac{du}{\cosh u}$, so the above error term is $\mathcal{O}(x)$. Therefore we obtain
$$ f(x) = \frac{\pi}{2x} + \frac{1}{2} + \mathcal{O}(x). $$
A: This result belongs more properly to the theory of theta functions and elliptic integrals and the following approach is based on the same. 

Let $q=e^{-x} $ and then $$f(x) =1+2\sum_{n=1}^{\infty}\frac{q^{n}}{1+q^{2n}}=\frac{1+\vartheta_{3}^{2}(q)}{2}\tag{1}$$ where $\vartheta_{3}(q)$ is one of Jacobi's theta functions. It is known from the theory of theta functions and elliptic integrals that $$\vartheta_{3}^{2}(q)=\frac{2K(k) }{\pi}\tag{2}$$ where $q=e^{-\pi K'(k) /K(k) } $ so that $K'(k) /K(k) =x/\pi$ and hence we can see that $$f(x) =\frac{1}{2}+\frac{K(k) }{\pi}=\frac{1}{2}+\frac{K'(k) }{x}$$ Now as $x\to 0^{+}$ the variable $q\to 1^{-}$ and hence the elliptic modulus $k\to 1^{-}$ so that $K'(k) \to \pi/2$ and we obtain $$f(x) =\frac{1}{2}+\frac{\pi}{2x}+o(1)$$

You can avoid elliptic integrals by using transformation formula $$\vartheta_{3}(q)=\vartheta_{3}(e^{-x})=\sqrt{\frac{\pi} {x}} \vartheta_{3}(e^{-\pi^{2}/x})\tag{3}$$ which gives us $$f(x) =\frac{1}{2}+\frac{\pi}{2x}\vartheta_{3}^{2}(e^{-\pi^{2}/x})\tag{4}$$ Since $$\vartheta_{3}(q)=1+2\sum_{n=1}^{\infty}q^{n^{2}}\tag{5}$$ the desired result is obtained easily.

Equation $(5)$ is the usual definition of Jacobi theta function $\vartheta_{3}$ and equation $(3)$ is the transformation formula for this function and it can be proved using Poisson summation formula. Second equality in equation $(1)$ is another deep relation satisfied by Jacobi theta function $\vartheta_{3}$ and it is related to the Fourier series of elliptic function $\operatorname {dn} (u, k) $. 
A: Since $\frac{1}{\cosh(x)}$ belongs to $\mathcal{S}(\mathbb{R})$ and  $\int_{-\infty}^{+\infty}\frac{e^{-2\pi i n u}}{\cosh(n x)}\,dn = \frac{\pi}{x\cosh\left(\frac{\pi^2 u}{x}\right) } $, the Poisson summation formula ensures
$$ \sum_{n\in\mathbb{Z}}\frac{1}{\cosh(nx)} = \frac{\pi}{x}\sum_{u\in\mathbb{Z}}\frac{1}{\cosh\frac{\pi^2 u}{x}} $$
for any $x>0$. It can be rearranged as
$$ \sum_{n\geq 0}\frac{1}{\cosh(nx)} = \color{green}{\frac{1}{2}+\frac{\pi}{2x}}+\sum_{u\geq 1}\frac{\pi}{x\cosh\frac{\pi^2 u}{x}} $$
where for $x\to 0^+$ we have 
$$\begin{eqnarray*} \sum_{u\geq 1}\frac{\pi}{x\cosh\frac{\pi^2 u}{x}} &\approx& \frac{\pi}{2x\cosh\frac{\pi^2}{x}}+\int_{1}^{+\infty}\frac{\pi\,du}{x\cosh\frac{\pi^2 u}{x}}\\&=&\frac{\pi}{2x\cosh\frac{\pi^2}{x}}+\frac{\pi-4\arctan\tanh\frac{\pi^2}{2x}}{2\pi}\end{eqnarray*}$$
by the Euler-MacLaurin formula.
