Solve $x^3 = 3px + 2q$ when $q^2 < p^3$ by the substitution $x = 2 \sqrt{p} \cos(\theta)$. The solutions are given by $x = 2 \sqrt{p} \cos(\frac{1}{3}(\phi + 2k\pi))$ for $k = 0,1,2$ where $\cos\phi = \frac{q}{p\sqrt{p}}$
I have made the subsitution to get:
$$8p^{\frac{3}{2}} (\cos(\theta))^3 = 6p^{\frac{3}{2}}\cos(\theta) + 2q $$ $$ q = 4p^{\frac{3}{2}}(\cos(\theta))^3 - 3p^{\frac{3}{2}}\cos(\theta)$$
$ q = p^{\frac{3}{2}} \cos(3 \theta)$ (this last identity I got from a previous question)
$$\frac{q}{p^{\frac{3}{2}}} = \cos(3 \theta)$$
I am unsure how to proceed from here, any hints?