Ask Your Question

Revision history [back]

The impression that computations are numerical rather than in QQbar is mistaken.

Indeed, the trailing ?s in the following indicate elements in QQbar:

sage: R.<z> = PolynomialRing(QQbar)
sage: p = (z^2+1)*(z^2+4)
sage: q = p.quo_rem(z-I)[0]
sage: pd = p.differentiate(z)
sage: qd = q.differentiate(z)
sage: qd.roots()
[(-1.535183758487997?*I, 1), (0.8685170918213298?*I, 1)]
sage: qd.factor()
(3) * (z - 0.8685170918213298?*I) * (z + 1.535183758487997?*I)

Thus, you are working in QQbar and the following works, for instance:

sage: a = qd.roots()[0][0]
sage: a
-1.535183758487997?*I
sage: a.parent()
Algebraic Field
sage: a.radical_expression()
-1/3*sqrt(-2*sqrt(13) - 14)