A textbook on classical mechanics I am currently reading considers the stable orbit (at $r_0$) of a body subject to the power law:
$$\mathbf{F}(r)=-Kr^n\mathbf{\hat{r}},\quad n\in\mathbb{Z}$$ $$\mathbf{F}(r_0)=-Kr_0^n\mathbf{\hat{r}}\tag{1}$$
such that, in polar coordinates:
$$L=mr^2\dot\theta, \quad F(r)=m\ddot{r}-r\dot\theta^2$$ $$F(r)= m\ddot{r}-\frac{L^2}{mr^3}.\tag{2}$$
It suggests that for small displacements around $r_0$ in the form:
$$r=r_0+x, \quad x \ll r_0,\tag{3}$$
both sides can be approximated with a Taylor expansion, resulting in:
$$m\ddot x = -x\left(nKr_0^{n-1}+3\frac{L^2}{mr_0^4}\right)\tag{4}$$ $$m\ddot x=-xKr_0^{n-1}\left(n+3\right),\tag{5}$$
using the fact that, at equilibrium,
$$Kr_0^{n-1}=\frac{L^2}{mr_0^4}.$$
Equation (5) should then indicate that the orbit of the body behaves like a harmonic oscillator for $n > -3$. However, I don't understand how the Taylor approximation was applied in equation (4), and to what order. I would be very thankful if someone could give an explanation, without using Lagrangian mechanics, of how the approximation was taken.