I was trying to plot the polar curve: $r=\cos(2n\theta)$ ($0\leq\theta\leq 2\pi$) and tried differentiating with respect to $\theta$ to get some information about where the petals would be. My reasoning was along the lines of: since when $\frac{\text{d}y}{\text{d}x}=0$ the function is flat, or the change in $y$ is becoming zero; so surely when $\frac{\text{d}r}{\text{d}\theta}=0$ the change is $r$ is becoming zero (around the particular $\theta$ that makes $r'(\theta)=0$), or it would be similar to a circle of suitable radius (since if $r(\theta)=c$ then $r'(\theta)=0\; \forall \theta$ so $r$ doesn't change with respect to $\theta$).
Now this seems to work for the equation $r(\theta)=\cos(2n\theta)$ since we would get: $$ r'(\theta)=-2n\sin(2n\theta) \text{ which is zero when } 2n\theta=k\pi \rightarrow \theta=\frac{k\pi}{2n}$$ so that would imply that for $\cos(2n\theta)$ there would be $4n$ petals, which seems to agree with what actually happens. The issue came when trying to apply the same logic to $r(\theta)=\cos(3\theta)$ since we would get that the petals should be at: $$ 3\theta=n\pi \rightarrow \theta=\frac{n\pi}{3} $$ which means that there would be 6 petals, which isn't true. So I'm wondering where the problem is in my reasoning, the whole thing was more of a guess that anything else, but I'm curious about why it doesn't work.
The rectangular coordinates of a point on the graph are $$ p(\theta) = (\cos{n\theta} \cos{\theta}, \cos{n\theta} \sin{\theta}) $$ Notice that if $n$ is an integer, $$ \cos{n(\theta+\pi)} = \cos{n\theta}\cos{n\pi} - \sin{n\theta}\sin{n\pi} = (-1)^n \cos{n\theta}. $$ Then, using $(\cos{(\pi+\theta)},\sin{(\pi+\theta)}) = (-\cos{\theta},-\sin{\theta})$, we have $$ p(\pi+\theta) = ((-1)^{n+1}\cos{n\theta} \cos{\theta}, (-1)^{n+1}\cos{n\theta} \sin{\theta}) = (-1)^{n+1} p(\theta). $$ This means that when $n$ is odd, the part of the graph covered by $[\pi,2\pi]$ is the same as the graph covered by $[0,\pi]$. Hence the whole graph is covered only by the range $[0,\pi]$ and you end up with only the roots of the derivative in this interval being important.