In the classic bugs on a square problem, 4 bugs start out on the vertices of a square with side length 1. At \(t = 0\) the bugs all begin moving with speed \(v\) towards their counter-clockwise neighbor. The question is to determine how long the bugs take to reach the center of the square and how many rotations around the center will each bug make in doing so?
Let’s first solve the square case and see if we can then generalize the argument. We will use polar coordinates and focus on the upper right bug. We can represent its position as a function of time as \((r(t), \phi(t))\), with initial conditions $r(0) = \sqrt{2}/2$ and $\phi(0) = \pi /4$.
The key here is to use symmetry to reason that at every moment in time, the bugs maintain their relative positions as the vertices of square. In otherwords, at each moment in time, the bugs remain in a square formation.
With this in mind, we can consider the bug’s position after a small change in time $\Delta t$.
The bug moves a distance $v \Delta t$ towards the it’s adjacent bug. We can then do some geometery to and use a small angle approximation to find the change in $r$ and $\phi$. Noting the right trangle we can form with hypotenuse $v \cdot \Delta t$, we have
\(\begin{align} r(t + \Delta t) - r(t) & = - v \cdot \Delta t \cos \theta\\ r(t + \Delta t) \cdot \Delta \phi & = v \Delta t \sin \theta \end{align}\) Rearranging these and taking the limit as $\Delta t \to 0$, we obtain
\[\boxed{ \begin{align} r'(t)& = - v \cos \theta\\ \phi'(t) & = \frac{v \sin \theta}{r(t)}. \end{align}}\]We can solve (3) for \(r(t)\) using our initial condiditon $\theta = \pi /4 $ and \(r(0) = 1/\sqrt{2}\) to get
\(\begin{equation} r(t) = - \frac{v}{\sqrt{2}} t + \frac{1}{\sqrt{2}}. \end{equation}\) It then follows that the time it takes to reach the center $T$ is \(T = \frac{1}{v}.\) Now that we have an equation for \(r(t)\) we can plug it into (4) and solve for $\phi(t)$ to get
\(\begin{equation} \boxed{\phi(t) = \pi/4 - \log\left( 1 - v t\right)}. \end{equation}\) As \(t \to T\), we have \(\phi \to \infty\), implying that the bug makes an infinite number of rotations around the center of the circle as the approach the center!
This analysis was for the square but every step we used is actually applicable to the general case of a regular $n$-gon. In the general case \(\theta = 2 \pi / n\) and we can use the law-of-cosines and then a double angle formula for cosine to determine that \(r(0) = \frac{1}{\sqrt{2 \left(1 - \cos \left(\frac{2 \pi}{n} \right)\right)}} = \frac{1}{2 \sin \frac{\pi}{n}}\). Consider one of the \(n\) wedges from a regular $n$-gon shown below. Here the angle \(\alpha = \frac{\pi - 2\pi/n}{2} = \frac{\pi}{2} - \frac{\pi}{n}\).
Using our same steps as before, we find the differential equations
\[\begin{align} r'(t)& = - v \cos \alpha = - v \sin \frac{\pi}{n}\\ \phi'(t) & = \frac{v \sin \alpha}{r(t)} = \frac{v \cos \frac{\pi}{n}}{r(t)}. \end{align}\]We can solve these once again with our initial conditions to get
\(\begin{equation} \boxed{r(t) = \frac{1}{2 \sin \left(\frac{\pi}{n}\right) }- v \sin \left(\frac{\pi}{n}\right)\; t}. \end{equation}\) Which implies the time to reach the center for a bug on a regular $n$-gon is \(\boxed{T = \frac{1}{2 v \sin^2\left(\frac{\pi}{n}\right)}}\). Lastly we solve for \(\phi(t)\) to get \(\begin{equation} \boxed{\phi(t) = \frac{\pi}{n} - \cot\left(\frac{\pi}{n}\right) \log \left(1 - 2 v \sin^2 \left(\frac{\pi}{n}\right) t\right)}. \end{equation}\) note again we recover that \(\phi(t) \to \infty\) as \(t \to T\) meaning the bug will always rotate around the center of the $n$-gon an infinite number of times as it approaches the center.
Can we say anything about these results for large $n$? We can make a rough approximation for large $n$ using the small-angle approximation for sine. For large enough \(n\), \(\begin{equation}T = \frac{1}{2 v \sin^2\left(\frac{\pi}{n}\right)} \approx \frac{1}{2 v \left(\frac{\pi}{n}\right)^2} = \frac{n^2}{2 \pi^2 v} \end{equation}\) which grows unboundely as $n$ increases.
Lastly, it is fun to look at the actual path of the bug as a function of time for different $n$.Here are the paths to the center of the first bug for \(n = 4\) and \(n=20\).