Let
with or . A root satisfies . If the coefficients are real, nonreal roots occur in complex-conjugate pairs.
This appendix summarizes (i) the structure of analytic formulas for , (ii) why numerical methods are essential for (and often preferable even for ), and (iii) the main numerical approaches and their practical caveats.
A.1 Analytical solutions for degrees : structure and limitations¶
Linear ()¶
For ,
Quadratic ()¶
For with ,
Numerical caveat (cancellation)
If , one root suffers catastrophic cancellation in . A stable variant is:
This uses the fact that and avoids subtracting nearly equal numbers.
Cubic (): Cardano via “depressed cubic”¶
For , shift to remove the quadratic term:
where are explicit functions of . Cardano’s method seeks with and solving a quadratic (“resolvent”) equation, giving a closed-form expression in radicals.
Key limitation (casus irreducibilis)
When the cubic has three real roots, Cardano’s radical expression generally passes through complex numbers even though the final roots are real. This is algebraically correct, but can be numerically delicate in finite precision.
Practical note
Even though cubic formulas exist, robust numerical evaluation is nontrivial; in floating-point computations, it is common to prefer iterative methods or library routines designed for numerical stability.
Quartic (): Ferrari via “depressed quartic” and resolvent cubic¶
For , shift
to obtain a depressed quartic
Ferrari’s method introduces an auxiliary parameter to factor the quartic into two quadratics; determining this parameter reduces to solving a resolvent cubic, followed by two quadratic solves.
Key limitation
Quartic formulas are long and can be numerically unstable due to cancellation and sensitivity when roots cluster. For numerical work, “closed form” does not automatically imply “good floating-point behavior.”