The $n$th derivative of the $n$th spherical Bessel function 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?
 A: Note that the spherical Bessel functions admit the integral representation
$$j_n(z)=\frac{(-\mathrm i)^n}{2}\int_0^\pi \mathrm e^{\mathrm iz\cos\theta}P_n(\cos\theta)\sin\theta~\mathrm d\theta$$
Which, by the Leibniz rule, means
$$j_n^{(n)}(z)=\frac{1}{2}\int_0^\pi \mathrm e^{\mathrm iz\cos\theta}\cos(\theta)^nP_n(\cos\theta)\sin\theta~\mathrm d\theta \\ j_n^{(n)}(0)=\frac{1}{2}\int_0^\pi \cos(\theta)^n P_n(\cos\theta)\sin\theta~\mathrm d\theta$$
Which, by a change of variable $\cos\theta=x$ yields
$$j_n^{(n)}(0)=\frac{1}{2}\int_{-1}^1 x^nP_n(x)\mathrm dx$$
Which you already know!
A: To expand on @K.defaoite's answer, we can instead use the first formula in the link they provided:
$$
j_n(z) = \frac{z^n}{2^{n+1} n!}\int_0^\pi \cos(z\cos\theta) (\sin\theta)^{2n+1}\mathrm d \theta,
$$
which does show up earlier in the text (Problem 11.7.8). Differentiating this $n$ times gives
\begin{align}
j_n^{(n)}(z) &= \frac{1}{2^{n+1} n!}\sum_{k=0}^n {n \choose k} (z^n)^{(k)}\left[\int_0^\pi \cos(z\cos\theta) (\sin\theta)^{2n+1}\mathrm d \theta\right]^{(n-k)} \\
&= \frac{1}{2^{n+1} n!}\sum_{k=0}^n{n \choose k} \frac{n!}{(n-k)!}z^{n-k} \int_0^\pi (\cos\theta)^{n-k}\cos(z\cos\theta) (\sin\theta)^{2n+1}\mathrm d \theta.
\end{align}
Setting $z=0$, all of the terms in the sum vanish except for the $k=n$ term, so
$$
j_n^{(n)}(0) = \frac{1}{2^{n+1}} \int_0^\pi(\sin\theta)^{2n+1}\mathrm d \theta.
$$
This integral can be solved by a reduction formula to obtain
$$
j_n^{(n)}(0) = \frac{1}{2^{n+1}} \frac{2^{2n+1}(n!)^2}{(2n+1)!} =  \frac{2^{n}(n!)^2}{(2n+1)!},
$$
which is the result of @K.defaoite's answer. This method also allows the formula for $\int_0^\pi x^nP_n(x)\mathrm dx$ to be used, instead of the integrals just cancelling out on both sides.
