Consider Green's function for the wave equation on a sphere, namely, for $t>0$ and fixed $0<\theta<\pi$, $$G(\theta,t) = \sum_{\ell=0}^{+\infty} (2\ell+1)\,P_\ell(\cos\theta)\,\cos\big(\sqrt{\ell(\ell+1)}\cdot t\big)$$ where $P_\ell$ are the Legendre polynomials. Actually, the above series does not converge, but it is easily given meaning outside of a singular set, e.g., by formally integrating w.r.t. $t$, summing and then differentiating, or as $$G(\theta,t) = \lim_{h\to 0} \sum_{\ell=0}^{+\infty} (2\ell+1)\,P_\ell(\cos\theta)\,\cos\big(\sqrt{\ell(\ell+1)}\cdot t\big)\;e^{-\ell(\ell+1)h}$$ (I think the singular set consists of the $t$ congruent to $\theta$ or $2\pi-\theta$ mod $2\pi$; I don't know how to prove this but it is not my question; for definiteness, we can assume $\theta<t<2\pi-\theta$).

**Question:** Is there a closed form expression for $G$? Failing that, is there an alternate expression more amenable to numerical computation, or some other technique to evaluate $G$ numerically with decent precision?

(The emphasis is on the case of fixed $\theta$ and $t$ variable. If this is useful, towards a closed form expression I am willing to assume $\cos\theta$ rational.)

To give an idea of what this looks like, here is a (very laboriously computed) approximate graph of $G(\frac{\pi}{2},t)$ (the singularities at integer multiples of $\pi/2$ are very wrong, of course, but far from them I suspect the graph to be accurate-ish):

Apologies if the question is ill-posed or stupid, I have to admit my considerable ignorance in such matters. (In reality, the question on the sphere is meant as a stepping stone for an analogous question on a compact Lie group, where $\cos\theta$ would be replaced by the Kac coordinates of the point under consideration.)