I'm trying to compute the turning number of a closed plane curve, which should be a really straight forward computation. But my result is not a whole number, i.e. the total curvature is not a multiple of $2\pi$, which is impossible so I'm making a mistake somewhere. I know from plotting the curve that the turning number should be $-2$. I've been looking for hours but cannot seem to find it. Maybe someone can spot the mistake... Here is my work:

Let $\beta(t) = ((1+2\cos(t))\sin(t), (1+2\cos(t))\cos(t))$ be a regular closed plane curve. To compute the turning number $n\_{\beta}$ I want to use the following:

$$n\_{\beta} = \frac{1}{2\pi}\int\_{0}^{L}K\_{\beta}(t)dt\, ,$$

where $L$ is the period of $\beta$ and $K\_{\beta}(t)$ is the curvature. I can compute the curvature like this:

$$K\_{\beta} = \frac{1}{||\dot{\beta}(t)||^3}\cdot\det({\dot{\beta}(t), \ddot{\beta}(t)})$$

Computations:

$$\dot{\beta}(t) = (\cos t + 2\cos 2t, -\sin t -2\sin 2t)$$
$$\ddot{\beta}(t) = (-\sin t - 4 \sin 2t, -\cos t - 4 \cos 2t)$$
$$||\dot{\beta}(t))|| = (4\cos t + 5)^{1/2}$$
$$\det({\dot{\beta}(t),\ddot{\beta}(t)}) = -6 \cos t - 9$$

This is giving me the curvature

$$K\_{\beta}(t) = \frac{-6 \cos t -9}{(4 \cos t + 5)^{3/2}}$$

At this point I integrated the curvature with the help of Wolframalpha, which did it numerically but I'm pretty sure it's $-2\pi-1$, when from the picture it should be $-4\pi$. Oddly enough, if I integrate the curvature without the power of $\frac{3}{2}$ in the denominator i actually get the correct result. Can anyone help me spot my mistake? Thanks a lot!

Edit: Here's a link to see the graph: <https://www.desmos.com/calculator/vcxbpj2ios>