I study about Ruler-and-compass construction.
I read this post :Can a regular heptagon be constructed using a compass, straightedge, and angle trisector?
The relevant part of the solution which take from Akerbeltz's answer:
Akerbeltz found this polynum $(y^3-py-q)$ , denote $\alpha^2 = \frac{4p}{3}, \cos(3θ)=\frac{4q}{\alpha^3} , y=\alpha \cos(\theta)$.
Indeed, $(\alpha\cos(\theta))^3-p\alpha\cos(\theta)-q=\alpha\frac{4p}{3}\cos^3(\theta)-p\alpha\cos(\theta)-q=\alpha p(\frac{4}{3}\cos^3(\theta)-\cos(\theta))-q=\\ =\frac{\alpha p}{3}\cos(3\theta)-q=\frac{\alpha p}{3}\frac{4q}{\alpha^3}-q=\frac{4pq}{3\alpha^2}-q=\frac{4pq}{3\cdot4p/3}-q=0$
My question is how he knows to take $\alpha^2 = \frac{4p}{3}, cos(3θ)=\frac{4q}{\alpha^3}$ for solving the equation ?