Equation of 2nd order kernel of arc-cosine kernel In the paper "Kernel method for deep learning" (Cho and Saul, NIPS 2009), a part $J_n(\theta)$ of definition of the arc-cosine kernel is given as
$$J_n(\theta) = (-1)^n (\sin \theta)^{2n+1} \left( \frac{1}{\sin \theta} \frac{\partial}{\partial \theta} \right)^n \left( \frac{\pi - \theta}{\sin \theta} \right).$$
For $n=2$, eq.(7) in the paper shows
$$J_2(\theta) = 3 \sin \theta \cos \theta + (\pi - \theta) (1 + 2 \cos^2 \theta).$$
How to derive this equation?
In my calculation, $J_2(\theta)$ becomes $J_2(\theta) = 2 \sin \theta \cos \theta + (\pi - \theta) (1 + \cos^2 \theta)$.

Most likely you made a computational mistake somewhere.
\begin{align}
J_2(\theta) &= (-1)^2 (\sin\theta)^5 \left( \frac{1}{\sin \theta}\frac{\partial}{\partial \theta}\right)^2\left( \frac{\pi - \theta}{\sin \theta}\right)\\
&= (\sin^5 \theta) \left( \frac{1}{\sin \theta}\frac{\partial}{\partial \theta}\right)\frac1{\sin \theta} \frac{-\sin \theta -[\cos \theta] (\pi - \theta) }{\sin^2 \theta} \\
&= -\sin^4 \theta \frac{\partial }{\partial \theta } \left( \frac{\sin \theta + [\cos \theta] (\pi - \theta)}{\sin^3 \theta}\right)\\
&= - \sin^4 \theta \left(\frac{\sin^3 \theta (\cos \theta -\cos \theta -[\sin \theta] (\pi - \theta)) - (\sin \theta + [\cos \theta] (\pi - \theta))(3\sin^2 \theta \cos \theta)}{\sin^6 \theta} \right)\\
&= -\frac1{\sin^2 \theta} \left([ -\sin^4 \theta] (\pi-\theta)  - (\sin \theta + [\cos \theta] (\pi - \theta))(3\sin^2 \theta \cos \theta)  \right)\\
&=  [\sin^2 \theta] (\pi - \theta)  + (\sin \theta + [\cos \theta](\pi-\theta))3\cos \theta)\\
&= 3 \sin \theta \cos \theta  +  (2\cos ^2 \theta + 1)(\pi - \theta)
\end{align}
