Question (IIT 2023) : Let $A_i\ (1 \le i \le 8)$ be the vertices of the regular octagon that lie on the circle of radius $2$. Let $P$ be a point on the circle and let $|PA_i|$ denote the distance between the point $P$ and $A_i$ for $1\le i\le 8$. If $P$ varies over the circle, then the maximum value of the product is $\prod_{i=1}^{8}|PA_i|$, is:
My Solution :
As all the points are of a octagon they are equally aligned at $\dfrac{\pi}{4}$ with each other and taking point $P$ to be at an angle of $\theta$ with the $x$-axis we can rewrite the product as : $$\prod_{i=1}^{8} 4\sin\left(\frac{i\pi}{8}+\frac{\theta}{2}\right)$$ which can be further simplified into $2^9\sin(4\theta)$ which gives us our answer $2^9$ at $\theta = \dfrac{\pi}{8}$. Now there's another solution floating around online which relies on complex numbers and is quite shorter and it goes as following :
what I am not getting here is how does maximizing the product of the roots of $z^8-2^8=0$ produces the same result as asked in the question, as maximizing the roots of $z^8-2^8$ should give the value of product of the distances if $P$ were to be taken at center of circle. Is there any relation between my solution and the other which verifies this...

Indeed, this explanation isn't sufficient !
They do not show that the maximal value is obtained in particular for :
$$\omega := 2e^{i \pi/8}$$
Proof : $(\omega)^8-2^8=2^8(e^{i \pi/8})^8-2^8=2^8(-1)-2^8=-2^9$
which is (in absolute value) the maximal value (as established in the document) which can be taken by the product of distances.
A global understanding is provided by the graphical representation of the surface with equation
$$z=f(x,y)=2^8|(x+iy)^8 -1|.\tag{1}$$
(see below). Caution : letter $z$ in (1) is for the altitude coordinate ; it's not the complex number $z$).
Graphical representation of function $f$. Imagine it as a membrane constrained to pass through a metal thread (the red curve) ; its maximal value(s) $2^9=512$ are reached at points $\omega_k := 2e^{i(2k+1) \pi/8}$ - in particular for $k=0$ as shown above - alternating with minimal values $0$ at points $2e^{i(2k) \pi/8}$). Please note an internal "plateau" at altitude $\approx 2^8=256$.
Matlab program having generated the figure :