In this Wikipedia article they show that the Mean Integrated Square Error (MISE) is given by $$\mathrm{MISE}(h)=\mathrm{E}\left[\int(\hat{f}_h(x)-f(x))^2dx\right],$$ where $f(x)$ is the real density function, $\hat{f}_h(x)$ is the estimate given by $$\hat{f}_h(x)=\frac{1}{nh}\sum_{i=1}^nK\left(\frac{x-x_i}{h}\right),$$ $K$ is the kernel, $x_i$ are sample points, $n$ is the number of samples and $h$ is the bandwidth.
They then show that the Asymptotic MISE (AMISE) is given by $$\mathrm{AMISE}(h)=\frac{R(K)}{nh}+\frac{1}{4}m_2(K)^2h^4R(f''),$$ where $$R(g)=\int g(x)^2dx,$$ for a function $g(x)$, $$m_2(K)=\int x^2K(x)dx$$ and $f''(x)$ is the second derivative of $f(x)$.
My question is how is the formula for $\mathrm{AMISE}$ derived? I understand terms of of order $o\left(\frac{1}{nh} + h^4\right)$ are neglected. But other than that I cannot see how this formula is derived.