Recovering the original cubic equation from Cardano’s nested surd formula

I was reading a lovely paper about Cardano’s formula for solving cubic equations (Hewitt, P, 2009, Cardano’s Formulas or A Pivotal Moment in the History of Algebra). For a general cubic

y^3 + py + q = 0

the solutions are given by Cardano’s nested surd formula as

y = \sqrt[3]{-\frac{q}{2} + \sqrt{\frac{q^2}{4} + \frac{p^3}{27}}} + \sqrt[3]{-\frac{q}{2} - \sqrt{\frac{q^2}{4} + \frac{p^3}{27}}}

It is well known (and not really surprising, looking at the formula) that this produces cumbersome and impractical-looking solutions even for simple cubic equations, so it is regarded as being largely of historical interest rather than being useful in practice. For example, page 4 of Hewitt’s paper considers the simple cubic equation

x^3 + 3x - 14 = 0

which can be factorised to read (x - 2)(x^2 + 2x + 7) = 0 and therefore has the single solution x = 2 (the quadratic component does not have any real roots). If we were to apply Cardano’s formula to this simple equation, we would get the horrible-looking answer

\sqrt[3]{7 + 5\sqrt{2}} + \sqrt[3]{7 - 5\sqrt{2}}

which actually equals 2, as the paper shows on page 6 by using a Pell’s equation approach.

After reading Hewitt’s paper I was idly playing with Cardano’s formula during a train journey, applying it to simple cubic equations to produce horrible-looking solutions like the one above, and the following question occurred to me: Suppose you did not know anything about Cardano’s formula, and you were faced with one of these horrible-looking nested surd expressions for the first time. Would it be possible to work backwards and deduce its value by manipulating it algebraically to obtain the (hopefully simple) cubic equation from which it came? I found a way of doing this during my train journey and want to record it here as another possible method of deducing the values of complicated-looking nested surds. (The great Indian mathematician Ramanujan was fond of nested surd formulas as can be seen in this page from his notebooks:

RamanujanSurds

I have used them myself in maths lessons to enthuse students, most of whom find them fascinating. For example, consider the following infinitely nested surds:

NestedSurds

Can you deduce their values by manipulating them algebraically?)

To illustrate the approach I was playing with during my train journey, suppose you don’t know anything about Cardano’s formula and you are simply presented with the nested surd formula

\sqrt[3]{-18 + \sqrt{325}} + \sqrt[3]{-18 - \sqrt{325}}

Can you find the value of this horrible-looking expression by manipulating it algebraically, without referring in any way to Cardano’s formula? (Have a go before reading on).

I found that one can find its value using some algebra as follows. Let

y = \sqrt[3]{-18 + \sqrt{325}} + \sqrt[3]{-18 - \sqrt{325}}

Then

y^3 = -36 + 3\sqrt[3]{(18^2 + 325 - 36\sqrt{325})(-18 - \sqrt{325})} + 3\sqrt[3]{(18^2 + 325 + 36\sqrt{325})(-18 + \sqrt{325})}

and after a bit more manipulation this reduces to

y^3 = -36 + 3\sqrt[3]{(18 - \sqrt{325})} + 3\sqrt[3]{(18 + \sqrt{325})}

But this is just

y^3 = -36 - 3y

so we end up with the cubic equation

y^3 + 3y + 36 = 0

which factorises as

(y + 3)(y^2 - 3y + 12) = 0

and therefore has the single solution y = -3 (the quadratic component does not have any real solutions). Without referring to Cardano’s formula in any way we have therefore deduced that

\sqrt[3]{-18 + \sqrt{325}} + \sqrt[3]{-18 - \sqrt{325}} = -3