I had a question to calculate the arc length of the cardiod $r=1+cos(\theta)$.
My calculation went as follows: $\displaystyle\int_0^{2\pi} \sqrt{((1+\cos(\theta))^2+\sin^2(\theta)}\mathrm d\theta = \int_0^{2\pi} \sqrt{4\cos^2\bigg(\frac{\theta}{2}\bigg)}\mathrm d\theta= \int_0^{2\pi} 2\cos\bigg(\frac{\theta}{2}\bigg)\mathrm d\theta = 4\sin\bigg(\frac{\theta}{2}\bigg)\bigg|_0^{2\pi}=0$
The step where I have gone wrong is that: $$\sqrt{4\cos^2\bigg(\frac{\theta}{2}\bigg)}$$ should be $$\bigg|2\cos\bigg(\frac{\theta}{2}\bigg)\bigg|$$ which leads to an arc length of $8$ but I don't see why this should happen. It is obvious to me that arc length cannot be zero in this case but why is the modulus sign needed here?
Also, I know about the argument saying that we could integrate from $0$ to $\pi$ and double the arc length since the curve is symmetric but could those arguments be avoided here since that is not the issue.
Can we have negative arc length? Does arc length become negative when the curve dips below the x-axis? Please could this be explained in more detail.