$\sqrt[3]{A+B\sqrt{C}}$ generalized denesting formula Q: What is the generalized formula for denesting $\sqrt[3]{A+B\sqrt{C}}$?
Recently I've posted a question about nested radicals in solving the cubic equation. I received a comment about an ingenious method to denest the radical by solving a cubic equation, but, I was still not satisfied. See $\sqrt[3]{\text{something}\pm\sqrt{\text{something}}}$ and the link from the comments Denesting Phi, Denesting Cube Roots. Trying to solve cubic equations, sometimes I would get something like $\sqrt[3]{-27+6\sqrt{21}}$, which is not easily denested by hand. I had to go and solve another cubic equation. The radical derives from the equation $x^3+x-2=0$. The cubic equation I had to solve for the radical would be more complex than the equation itself. I tried searching the internet for a denesting formula but I couldn't find a definitive one. All I could find was something about Galois theory which is mathematics I don't understand (I'm a 10th grader in Romania).
So, I tried making my own algorithm. Based on the idea from Denesting Phi, Denesting Cube Roots, I might have generalized it to solving a depressed cubic equation, which should be relatively easy and, in lucky cases, immediate. Keep in mind this is not a formula, but a simplification.
See the answer below.
 A: A simpler denest formula reads
$$\sqrt[3]{A+B \sqrt C}=\frac12\sqrt[3]{3Bs+2A}\left(1+\frac {\sqrt C}{s+A/B}\right)$$
with $s$ satisfying the depressed cubic equation
$$s^3+3(C-\frac{A^2}{B^2})s +\frac{2A}B (C-\frac{A^2}{B^2}) =0$$
For $\sqrt[3]{-27+6\sqrt{21}}$,
$$s^3+\frac94s-\frac{27}4=0\implies s=\frac32$$
which leads to the denesting
$$\sqrt[3]{-27+6\sqrt{21}}
= \frac12\sqrt[3]{18s-54}\left(1+ \frac{\sqrt 21}{s+ 7/2}\right)=-\frac32+\frac12\sqrt{21}
$$
A: OP's example is one of the cases covered by my answer here.

Therefore a sufficient condition for $\,a,b = \sqrt[3]{m \sqrt{p} \pm n\sqrt{q}}\,$ to denest is for $\,m^2 \cdot p - n^2 \cdot q\,$ to be the cube of a rational $\,r\,$, and for the cubic $\,p\, t'^{\,3} - 3r\, t' - 2m\,$ to have an appropriate rational root, and in that case $\,a,b = \frac{1}{2}\left(t'\,\sqrt{p} \pm \sqrt{t'^{\,2} p-4r}\right)\,$.

For $\,a,b = \sqrt[3]{-27 \pm 6\sqrt{21}}\,$:

*

*$m=-27\,$, $\,p=1\,$, $\,n=\pm 6\,$, $\,q=21\,$;


*$m^2 \cdot p - n^2 \cdot q$ $= (-27)^2 - (\pm 6)^2 \cdot 21$ $= -27$ $=(-3)^3$ $\implies r=-3\,$;


*$0 = p\, t'^{\,3} - 3r\, t' - 2m = t'^{\,3} + 9 t' + 54\,$ with the only real root $\,t' = -3\,$.
Then:
$$
a,b = \frac{1}{2}\left(t'\,\sqrt{p} \pm \sqrt{t'^{\,2} p - 4r}\right) = \frac{1}{2}\left(-3 \cdot 1 \pm \sqrt{(-3)^2 \cdot 1 - 4 \cdot (-3)}\right) = \frac{1}{2}\left(-3 \pm \sqrt{21}\right) 
$$
