The following is a passage from Spivak's Calculus - Ch.25 - pg 519 - 2nd ed. It revolves around the importance of complex numbers and solving for solutions:
My question revolves around where did the idea come from and what did the author ask themselves to use the substitutions:
$$x = y - \frac{b}{3} \\ x = w - \frac{p}{3w}$$
?
I see how they work, but as used plenty when teaching math, the substitutions seem to have been "pulled out of thin air". I'm trying to rectify that. So where did the notion come from to these things?


For the second part, the crucial observation (made in the 15 or 16th century - there was some priority dispute between Cardano and someone else) was that if $x=u+v$ then $x^3=u^3+v^3+3uv(u+v)$ which immediately suggested to look for $u,v$ st $u^3+v^3+q=0, 3uv=-p$ so $x^3+px+q=(u^3+v^3+q)+(3uv+p)(u+v)=0$ and then $u^3+v^3+q=0, 3uv+p=0$ lead to a quadratic in $u^3$.
Notice that then $x=u+v=u-p/(3u)$ exactly as shown in Spivak!