I quote Problem 12.4.7 of the 5th edition of Mathematical Methods for Physicists by Arfken, Weber, and Harris:
A plane wave may be expanded in a series of spherical waves by the Rayleigh equation: $$ e^{ikr\cos\gamma} = \sum_{n=0}^\infty a_n j_n(kr) P_n(\cos \gamma). $$ Show that $a_n = i^n(2n+1)$. Hint: Use the orthogonality of the $P_n$ to solve for $a_n j_n(kr)$. Differentiate $n$ times with respect to $kr$ and set $r=0$ to eliminate the $r$-dependence. The remaining integral is $$ \int_{-1}^1 x^n P_n(x) \mathrm dx = \frac{2^{n+1} (n!)^2}{(2n+1)!}, $$ as shown in a previous exercise.
Using the orthogonality condition for the Legendre polynomials (and substitution $x=\cos\gamma$), I obtained $$ \frac{2}{2n+1} a_n j_n(kr) = \int_{-1}^1e^{ixkr}P_n(x)\mathrm dx, $$ differentiating which $n$ times w.r.t. $kr$ gives $$ \frac{2}{2n+1} a_n j_n^{(n)}(kr) = \int_{-1}^1(ix)^n e^{ixkr}P_n(x)\mathrm dx. $$ My trouble comes from the $j_n^{(n)}(kr)$ bit. How does one differentiate the $n$th spherical Bessel function $n$ times? Or does setting $r=0$ automatically tell us its value?