Sum the series $\sum_{n = 1}^{\infty}\{\coth (n\pi x) + x^{2}\coth(n\pi/x)\}/n^{3}$ This sum is from Ramanujan's letters to G. H. Hardy and Ramanujan gives the summation formula as
\begin{align} &\frac{1}{1^{3}}\left(\coth \pi x + x^{2}\coth\frac{\pi}{x}\right) + \frac{1}{2^{3}}\left(\coth 2\pi x + x^{2}\coth\frac{2\pi}{x}\right) \notag\\
&\, \, \, \, \, \, \, \, + \frac{1}{3^{3}}\left(\coth 3\pi x + x^{2}\coth\frac{3\pi}{x}\right) + \cdots\notag\\
&\, \, \, \, \, \, \, \, = \frac{\pi^{3}}{90x}(x^{4} + 5x^{2} + 1)\notag
\end{align}
Since $$\coth x = \frac{e^{x} + e^{-x}}{e^{x} - e^{-x}} = \frac{1 + e^{-2x}}{1 - e^{-2x}} = 1 + 2\frac{e^{-2x}}{1 - e^{-2x}}$$the above sum is transformed into $$(1 + x^{2})\sum_{n = 1}^{\infty}\frac{1}{n^{3}} + 2\sum_{n = 1}^{\infty}\frac{e^{-2n\pi x}}{n^{3}(1 - e^{-2n\pi x})} + 2x^{2}\sum_{n = 1}^{\infty}\frac{e^{-2n\pi/x}}{n^{3}(1 - e^{-2n\pi/x})}$$ If we put $q = e^{-\pi x}$ we get sums like $\sum q^{2n}/\{n^{3}(1 - q^{2n})\}$ which I don't know how to sum.
It seems I am going on a wrong track. Please provide some alternative approach.
Update: All the answers given below so far use complex analyis (transforms and residues) to evaluate the sum. I am almost certain that Ramanujan did not evaluate the sum using complex analysis. Perhaps the method by Ramanujan is more like the one explained in this question. Do we have any approach based on real-analysis only?
 A: Recall the well known Mittag-Leffler expansion of hyperbolic cotangent function (denote $\mathbb{W}=\mathbb{Z}/\{0\}$) :

$$\sum_{m\in\mathbb{W}}\frac{1}{m^2+z^2}=\frac{\pi\coth\pi z}{z}-\frac{1}{z^2}\tag{ML}$$

Hence, your sum is by its symmetry :
$$\begin{align}
S&=\frac{1}{2}\sum_{n \in \mathbb{W}}\{\coth (n\pi x) + x^{2}\coth(n\pi/x)\}/n^{3} \\ \\
&=\frac{1}{2\pi x}\sum_{n \in \mathbb{W}}\left(\frac{1}{n^4}+\sum_{m\in\mathbb{W}}\frac{x^2/n^2}{m^2+n^2x^2}\right)
+\left(\frac{x^4}{n^4}+\sum_{m\in\mathbb{W}}\frac{x^2/n^2}{m^2+n^2/x^2}\right)\tag{1}\\ \\
&=\frac{1}{2\pi x}\left(\zeta(4)+x^4\zeta(4)+\sum_{n,m \in \mathbb{W}^2}\frac{x^2}{n^2}\frac{1}{m^2+n^2x^2}+\frac{x^2}{n^2}\frac{1}{m^2+n^2/x^2}\right)\tag{2}\\ \\
&=\frac{1}{2\pi x}\left(2\zeta(4)+2x^4\zeta(4)+x^2\sum_{n,m\in\mathbb{W}^2}\frac{1}{n^2m^2}\frac{m^2+n^2x^2}{m^2+n^2x^2}\right)\tag{3}\\ \\
&=\frac{1}{2\pi x}\left(2\zeta(4)+2x^4\zeta(4)+4x^2\zeta^2(2)\right)\tag{4}\\ \\
&=\frac{1}{2\pi x}\left(2\frac{\pi^4}{90}+2x^4\frac{\pi^4}{90}+4x^2\frac{\pi^4}{36}\right)\tag{5}\\ \\
&=\frac{\pi^3}{90x}\left(1+x^4+5x^2\right)
\end{align}$$
Explanations
$(1)$ Use the Mittag-Leffler formula (ML) with $z=nx$ and $z=n/x$
$(2,4)$ Recall $\zeta(s)=\sum_{n=1}^{\infty}1/n^s$
$(3)$ In the second sum rename $n \longleftrightarrow m$
$(5)$ Zetas for $s=2$ and $4$ are well known, i.e. $\zeta(2)=\pi^2/6$ and $\zeta(4)=\pi^4/90$
A: Following in the same manner as this answer...
We are going to use the contour integral
$$
\oint\pi\cot\left(\frac{\pi z}{\pi x}\right)\left(\frac{\coth(z)}{z^3}-\frac1{z^4}-\frac1{3z^2}\right)\mathrm{d}z=0\tag{1}
$$
where the contours of interest are, for real $R\to\infty$ and integer $n\to\infty$,
$$
\small\textstyle\color{#00A000}{[R,-R]+(n+\frac12)\pi i}\cup\color{#C00000}{-R+(n+\frac12)\pi i[1,-1]}\cup\color{#00A000}{[-R,R]-(n+\frac12)\pi i}\cup\color{#C00000}{R+(n+\frac12)\pi i[-1,1]}
$$
The integral along the red paths becomes negligible as $R\to\infty$. Along the upper green path, where $\mathrm{Im}(z)\approx+\infty$, $\cot(z)\approx-i$. Along the lower green path, where $\mathrm{Im}(z)\approx-\infty$, $\cot(z)\approx+i$. Since $\coth(z+\frac\pi2i)=\tanh(z)$, the integral along each of the green paths tends to $0$. Therefore, the full integral is $0$.
Since
$$
\pi\cot\left(\frac{\pi z}{\pi x}\right)\text{ has residue }\pi x\text{ at }z=\pi nx\tag{2}
$$
and
$$
\frac{\coth(z)}{z^3}-\frac1{z^4}-\frac1{3z^2}=-\frac1{45}+O(z^2)\text{ at }z=0\tag{3}
$$
the contribution from the singularities on the real axis is
$$
2\pi i\cdot\pi x\left[2\sum_{n=1}^\infty\left(\frac{\coth(\pi nx)}{(\pi nx)^3}-\frac1{(\pi nx)^4}-\frac1{3(\pi nx)^2}\right)-\frac1{45}\right]\tag{4}
$$
Since
$$
\frac{\coth(z)}{z^3}\text{ has residue }\frac1{(\pi in)^3}\text{ at }z=\pi i n\text{ for }n\ne0\tag{5}
$$
and
$$
\pi\cot\left(\frac{\pi z}{\pi x}\right)=-\pi i\coth\left(\frac{\pi n}{x}\right)\text{ at }z=\pi in\tag{6}
$$
the contribution from the singularities on the imaginary axis is
$$
2\pi i\left[2\sum_{n=1}^\infty\frac\pi{x^3}\frac{\coth\left(\frac{\pi n}{x}\right)}{\left(\frac{\pi n}{x}\right)^3}\right]\tag{7}
$$
Combining $(1)$, $(4)$, and $(7)$, yields
$$
x^2\sum_{n=1}^\infty\frac{\coth(\pi nx)}{(\pi nx)^3}+\frac1{x^2}\sum_{n=1}^\infty\frac{\coth\left(\frac{\pi n}{x}\right)}{\left(\frac{\pi n}{x}\right)^3}
=\frac{\zeta(4)}{\pi^4x^2}+\frac{\zeta(2)}{3\pi^2}+\frac{x^2}{90}\tag{8}
$$
Multiplying by $\pi^3x$ to match the question, we get
$$
\sum_{n=1}^\infty\frac{\coth(\pi nx)+x^2\coth(\pi n/x)}{n^3}=\frac{\pi^3}{90x}\left(1+5x^2+x^4\right)\tag{9}
$$
A: Yet another approach using contour integration is to integrate the function $$f(z) = \frac{\pi \cot (\pi z) \coth (\pi x z)}{z^{3}} $$ around a circle centered at the origin that avoids the poles on the real and imaginary axes.
If we let the radius of the circle go to infinity discretely, the integral will vanish.
So summing the residues,  we get $$2 \sum_{n=1}^{\infty} \frac{\coth (n \pi x)}{n^{3}} +  \sum_{n=1}^{\infty} \frac{\cot (\frac{in \pi}{x})}{x(\frac{in}{x})^{3}} + \sum_{n=1}^{\infty} \frac{\cot (-\frac{i n \pi}{x})}{x (-\frac{in}{x} )^{3}} + \text{Res}[f(z),0] =  0,$$
which implies
$$\sum_{n=1}^{\infty} \frac{\coth (n \pi x)}{n^{3}} + x^{2} \sum_{n=1}^{\infty} \frac{\coth(\frac{n \pi}{x})}{n^{3}} = - \frac{1}{2} \ \text{Res} [f(z),0]. $$
Expanding at the origin, we get 
$$ \begin{align} \small f(z) &= \frac{\pi}{z^{3}}\left(\frac{1}{\pi z} - \frac{2 \zeta(2)}{\pi} z-\frac{2 \zeta(4)}{\pi} z^{3}  + \mathcal{O}(z^{5})\right) \left(\frac{1}{\pi (xz)} + \frac{2 \zeta(2)}{\pi} (xz) - \frac{2 \zeta(4)}{\pi} (xz)^{3} + \mathcal{O}(z^{5}) \right) \\ &= \frac{1}{\pi x} \frac{1}{z^{5}} + \frac{2 \zeta(2) x^{2}-2 \zeta(2)}{\pi x} \frac{1}{z^{3}}  {\color{red}{-\frac{2 \zeta(4) x^{4}+4 \zeta(2)^{2} x^{2} + 2 \zeta(4)}{\pi x}}} \frac{1}{z} + \mathcal{O}(z) .\end{align}  $$
Therefore,  $$ \sum_{n=1}^{\infty} \frac{\coth (n \pi x)}{n^{3}} + x^{2} \sum_{n=1}^{\infty} \frac{\coth(\frac{n \pi}{x})}{n^{3}} = \frac{\zeta(4) x^{4}+2 \zeta(2)^{2} x^{2} + \zeta(4)}{\pi x} =\frac{\pi^{3}}{90x} \left( x^{4}+5x^{2}+1 \right). $$
