Sum the series $\sum_{n = 0}^{\infty} (-1)^{n}\{(2n + 1)^{7}\cosh((2n + 1)\pi\sqrt{3}/2)\}^{-1}$ In one of his letters to G. H. Hardy, Ramanujan gave the following sum $$\dfrac{1}{1^{7}\cosh\left(\dfrac{\pi\sqrt{3}}{2}\right)} - \dfrac{1}{3^{7}\cosh\left(\dfrac{3\pi\sqrt{3}}{2}\right)} + \dfrac{1}{5^{7}\cosh\left(\dfrac{5\pi\sqrt{3}}{2}\right)} - \cdots = \frac{\pi^{7}}{23040}\tag{1}$$ or using $\sum $ notation $$\sum_{n = 0}^{\infty} \dfrac{(-1)^{n}}{(2n + 1)^{7}\cosh\left(\dfrac{(2n + 1)\pi\sqrt{3}}{2}\right)} = \frac{\pi^{7}}{23040}$$ Since $\cosh y = (e^{y} + e^{-y})/2$ we can see that the sum is equal to $$S = 2\sum_{n = 0}^{\infty}\dfrac{(-1)^{n}\exp\left(-\dfrac{(2n + 1)\pi\sqrt{3}}{2}\right)}{(2n + 1)^{7}\left\{1 + \exp\left(-(2n + 1)\pi\sqrt{3}\right)\right\}}$$ Putting $$q = \exp\left(-\pi\sqrt{3}\right)$$ we get the sum as $$S = 2\sum_{n = 0}^{\infty}\frac{(-1)^{n}q^{n + 1/2}}{(2n + 1)^{7}(1 + q^{2n + 1})}$$ We can then use $$\dfrac{q^{n + 1/2}}{1 + q^{2n + 1}} = \frac{q^{n + 1/2} - q^{3(n + 1/2)}}{1 - q^{4n + 2}}$$ and hope to use the Ramanujan functions $P, Q, R$ given by $$P(q) = 1 - 24\sum_{n = 1}^{\infty}\frac{nq^{2n}}{1 - q^{2n}}\\
Q(q) = 1 + 240\sum_{n = 1}^{\infty}\frac{n^{3}q^{2n}}{1 - q^{2n}}\\
R(q) = 1 - 504\sum_{n = 1}^{\infty}\frac{n^{5}q^{2n}}{1 - q^{2n}}$$ to calculate the sum $S$ in terms of $P, Q, R$. However the stumbling block is the term $(2n + 1)^{7}$ appearing in the denominator. Therefore I am not sure if the functions $P, Q, R$ can be used in the evaluation of sum $S$. Please let me know if there are any other approaches to calculate the sum $S$.

Update: While going through Ramanujan's Notebooks Vol 3 (by Bruce C. Berndt) I found the proof for the above sum. But he uses a highly non-obvious formula (also discovered by Ramanujan) $$\frac{u^{6n}}{\cos u\cos(\omega u)\cos(\omega^{2}u)} = 12\sum_{k = 0}^{\infty}\dfrac{(-1)^{k}\left\{\left(k + \dfrac{1}{2}\right)\pi\right\}^{6n + 5}}{\left[\left\{\left(k + \dfrac{1}{2}\right)\pi\right\}^{6} - u^{6}\right]\cosh\left\{\left(k + \dfrac{1}{2}\right)\pi\sqrt{3}\right\}}\tag{2}$$ where $\omega$ is a primitive cube root of unity. Berndt goes on to say that Ramanujan probably obtained this formula $(2)$ via partial fractions and says that it can be obtained by a routine procedure with somewhat lengthy calculation. The method of partial fractions is used to express a rational function (for the purpose of integrating them) in the form of a sum of finite terms which can be integrated via standard formulas. I am nor sure how that could be extended to any general function (which is not rational) and thereby produce a series. Berndt says "the sum $(1)$ can be obtained by putting $n = 0$ in $(2)$ and then equating coefficients of $u^{6}$ on both sides". This part requires some reasonable amount of calculation, but it is not so difficult.

I want to understand the technique of partial fractions as applied to general functions (may be with some requirement of continuity and differentiability) and its proper justification so that I can provide a proof of formula $(2)$ for myself and thereby have a complete proof of the Ramanujan's sum $(1)$.

 A: We want to prove that
$$
\frac{1}{\cos z\cos(\omega z)\cos(\omega^{2}z)}=12\sum_{k = 0}^{\infty}\dfrac{(-1)^{k}\left\{\left(k + \dfrac{1}{2}\right)\pi\right\}^{5}}{\left[\left\{\left(k + \dfrac{1}{2}\right)\pi\right\}^{6} - z^{6}\right]\cosh\left\{\left(k + \dfrac{1}{2}\right)\pi\sqrt{3}\right\}}.
$$
["Expand both sides in powers of z and equate coefficients of $z^6$ on both sides to achieve the proposed formula."(Ramanujan's notebooks, part 3, p. 162) This means that the case $n=0$ of eq.$(2)$ is enough to calculate the sum in the title.]
$\it{Proof}.$ Let
$$
f(z)=\frac{1}{\cos z\cos(\omega z)\cos(\omega^{2}z)},\qquad \omega=e^{2\pi i/3},
$$
$$
g(z)=12\sum_{k = 0}^{\infty}\dfrac{(-1)^{k}\left\{\left(k + \dfrac{1}{2}\right)\pi\right\}^{5}}{\left[\left\{\left(k + \dfrac{1}{2}\right)\pi\right\}^{6} - z^{6}\right]\cosh\left\{\left(k + \dfrac{1}{2}\right)\pi\sqrt{3}\right\}}.
$$
It is plain that $g(e^{2\pi i /6}z)=g(z)$ and $f(e^{2\pi i /6}z)=f(-\omega^2 z)=f(z)$. Also $f(z)$ ad $g(z)$ have simple poles at the same set of points: $z_{k,m}=\left(k + \dfrac{1}{2}\right)\pi e^{2\pi im /6},\ k=0,1,2,...; 0\le m\le 5$ ($m-$ integer). Simple calculation shows that
$$
\operatorname{res}f(z)\Bigr\rvert_{z=\left(k + \frac{1}{2}\right)\pi}=\frac{1}{(-1)^{k+1}\cos\left(\frac{-1+i\sqrt{3}}{2}\left(k + \frac{1}{2}\right)\pi\right)\cos\left(\frac{1+i\sqrt{3}}{2}\left(k + \frac{1}{2}\right)\pi\right)}=\\
\frac{(-1)^{k+1}}{\cos^2\left(k + \frac{1}{2}\right)\frac{\pi}{2}\cdot \cosh^2\frac{\sqrt{3}}{2}\left(k + \frac{1}{2}\right)\pi+\sin^2\left(k + \frac{1}{2}\right)\frac{\pi}{2}\cdot \sinh^2\frac{\sqrt{3}}{2}\left(k + \frac{1}{2}\right)\pi}=\\
\frac{(-1)^{k+1}}{\cosh^2\frac{\sqrt{3}}{2}\left(k + \frac{1}{2}\right)\pi-\sin^2\left(k + \frac{1}{2}\right)\frac{\pi}{2}}=\frac{2(-1)^{k+1}}{\cosh\sqrt{3}\left(k + \frac{1}{2}\right)\pi},
$$
$$
\operatorname{res}g(z)\Bigr\rvert_{z=\left(k + \frac{1}{2}\right)\pi}=\frac{2(-1)^{k+1}}{\cosh\sqrt{3}\left(k + \frac{1}{2}\right)\pi}.
$$
One can see that $f(z)$ and $g(z)$ have equal residues at $z_{k,0}$, but by the symmetry mentioned above $g(e^{2\pi i /6}z)=g(z)$, $f(e^{2\pi i /6}z)=f(z)$ one can also see that they have equal residues at all other poles. So $f(z)-g(z)$ doesn't have any poles and since it is a meromorphic function, according to Liouville's theorem it is a constant: $f(z)-g(z)=C$. $C$ can be found considering the point $z=+i\infty$ and we get $C=0$, which completes the proof.
