I am trying to compute some quantity like a partition function for a harmonic oscillator type system and at the end of the computation I am coming across a sum that looks like,
\begin{align} S=\sum_{n=0}^{\infty}e^{an +bn^2} \end{align}
with $a,b \in \mathbb{R}$. How do I find the sum? Any help regarding the same is highly appreciated.