Assuming $a \neq 0$, rewrite it as
$\begin{align*}
\displaystyle S &= \sum \limits_{k=0}^\infty~\left(\int_{\frac{k \pi}{a}}^{\frac{(k+1)\pi}{a}}~(-1)^k e^{-\beta x}\sin(a x)~dx\right) \\ \\
&=\sum \limits_{k=0}^\infty~(-1)^k\left(\int_{\frac{k \pi}{a}}^{\frac{(k+1)\pi}{a}}~e^{-\beta x}\sin(a x)~dx\right)\\ \\
&=\sum \limits_{k=0}^\infty~(-1)^k \left(\dfrac{\left(e^{\frac{\pi \beta }{a}}+1\right) e^{-\frac{\pi \beta (k+1)}{a}} (a \cos (\pi k)+\beta \sin (\pi k))}{a^2+\beta ^2}\right) \\ \\
&= \dfrac{a \left(e^{\frac{\pi \beta }{a}}+1\right)}{\left(e^{\frac{\pi \beta }{a}}-1\right) \left(a^2+\beta ^2\right)}
\end{align*}$