Midnight formulas

The midnight formula gets its name from a school requirement: you should be able to recite the solution formula for quadratic equations even if you are woken up in the middle of the night. At the third and fourth degrees, this thought game becomes much more demanding. There are also closed formulas for this using basic arithmetic and roots, but they are considerably longer. Here they are completely in the original coefficients \(a,b,c,d,e\) , without auxiliary variables and with the necessary conditions.


The leading coefficient always satisfies \(a\ne0\) ; otherwise the degree drops. We are looking for all complex zeros including multiples. In the linear case \(n=1\) the coefficients \(a\) and \(b\) are sufficient: the equation can be solved directly for \(x\) and has exactly one simple zero. This also applies to complex coefficients. For \(a=0\) however, there is no solution for \(b\ne0\) ; are \(a=b=0\) , every complex \(x\) is a solution. For the actual linear equation one obtains:

$$ax+b=0,\qquad a\ne0.$$

$$\boxed{x_k=-\frac{b}{a},\qquad k\in\{1\}.}$$

For \(n=2\) the quadratic equation contains the coefficients \(a,b,c\) . With \(k=1,2\) \((-1)^k\) changes the sign and returns both zeros including multiples. For real coefficients there are two different real solutions for \(b^2-4ac>0\) , for \(b^2-4ac=0\) a double one and for a negative value two conjugate complexes: Then you can choose the roots so that \(\sqrt{b^2-4ac}=i\sqrt{4ac-b^2}\) applies, where \(i\) is the imaginary unit with \(i^2=-1\) is. There is no case distinction for complex coefficients; the formula applies with both square roots:

$$ax^2+bx+c=0,\qquad a\ne0.$$

$$\boxed{x_k=\frac{-b+(-1)^k\sqrt{b^2-4ac}}{2a},\qquad k\in\{1,2\}.}$$

For \(n=3\) Cardano's formula is written out directly in \(a,b,c,d\) . The letter \(k\) is just a solution index: the values \(1,2,3\) choose the three zeros, no other auxiliary quantity. The power contains a written out primitive third root of unity . Each root symbol represents any complex root; a repeated expression must denote the same value everywhere. Only with \(b^2-3ac=0\) does the inner square root have to have the value \(2b^3-9abc+27a^2d\) , otherwise the radicand of the cube root becomes zero:

$$ax^3+bx^2+cx+d=0,\qquad a\ne0.$$

$$\left(b^2-3ac,\;2b^3-9abc+27a^2d\right)\ne(0,0).$$

$$\boxed{\begin{gathered}x_k=-\frac{b}{3a}-\frac{\left(\frac{-1+i\sqrt{3}}{2}\right)^{k-1}}{3a}\sqrt[3]{\frac{1}{2}\left(\begin{aligned}&2b^3-9abc+27a^2d\\&+\sqrt{\left(2b^3-9abc+27a^2d\right)^2-4\left(b^2-3ac\right)^3}\end{aligned}\right)}-\frac{b^2-3ac}{3a\left(\frac{-1+i\sqrt{3}}{2}\right)^{k-1}\sqrt[3]{\frac{1}{2}\left(\begin{aligned}&2b^3-9abc+27a^2d\\&+\sqrt{\left(2b^3-9abc+27a^2d\right)^2-4\left(b^2-3ac\right)^3}\end{aligned}\right)}}\\[5pt]k\in\{1,2,3\}.\end{gathered}}$$

\(x^3-1=0\) shows how the determination of the inner square root works: Here \(b^2-3ac=0\) and \(2b^3-9abc+27a^2d=-27\) . With the value \(27\) instead of \(-27\) the cube root would be \(\frac{-27+27}{2}=0\) and the formula would not be evaluable. The condition under the initial equation excludes exactly the case in which both expressions are zero and the cube root therefore always disappears. The equation then has a triple zero and is not covered by the formula given here.

For real cubic coefficients, the sign of \(b^2c^2-4ac^3-4b^3d-27a^2d^2+18abcd\) determines the zeros: A positive value means three different real solutions, a negative value means one real and two non-real, at zero all are real with repetitions. In the first case, this Cardano formula forces complex intermediate values. Radical formulas are algebraically exact, but not always numerically stable: almost identical intermediate values ​​can cost digits in floating point calculations; if necessary, higher precision is used.

For \(n=4\) Ferrari's formula is also written out completely in \(a,b,c,d,e\) . The index \(k\) runs from \(1\) to \(4\) ; the powers of \(-1\) capture all four sign combinations and couple the roots appropriately. The same root expressions denote the same value, even for different \(k\) . For \(c^2-3bd+12ae=0\) \(2c^3-9bcd+27b^2e+27ad^2-72ace\) is the value of the inner square root. The conditions under the initial equation prevent division by zero; every zero is recorded with its multiplicity:

$$ax^4+bx^3+cx^2+dx+e=0,\qquad a\ne0.$$

$$\begin{gathered}b^3-4abc+8a^2d\ne0,\\\left(c^2-3bd+12ae,\;2c^3-9bcd+27b^2e+27ad^2-72ace\right)\ne(0,0).\end{gathered}$$

$$\boxed{\begin{gathered}x_k=-\frac{b}{4a}\\[6pt]+\frac{(-1)^{\frac{k(k-1)}{2}}\sqrt{3}}{12a}\sqrt{\begin{aligned}&3b^2-8ac+4a\sqrt[3]{\frac{1}{2}\left(2c^3-9bcd+27b^2e+27ad^2-72ace+\sqrt{\left(2c^3-9bcd+27b^2e+27ad^2-72ace\right)^2-4\left(c^2-3bd+12ae\right)^3}\right)}\\&+\frac{4a\left(c^2-3bd+12ae\right)}{\sqrt[3]{\frac{1}{2}\left(2c^3-9bcd+27b^2e+27ad^2-72ace+\sqrt{\left(2c^3-9bcd+27b^2e+27ad^2-72ace\right)^2-4\left(c^2-3bd+12ae\right)^3}\right)}}\end{aligned}}\\[6pt]+\frac{(-1)^k\sqrt{3}}{12a}\sqrt{\begin{aligned}&6b^2-16ac-4a\sqrt[3]{\frac{1}{2}\left(2c^3-9bcd+27b^2e+27ad^2-72ace+\sqrt{\left(2c^3-9bcd+27b^2e+27ad^2-72ace\right)^2-4\left(c^2-3bd+12ae\right)^3}\right)}\\&-\frac{4a\left(c^2-3bd+12ae\right)}{\sqrt[3]{\frac{1}{2}\left(2c^3-9bcd+27b^2e+27ad^2-72ace+\sqrt{\left(2c^3-9bcd+27b^2e+27ad^2-72ace\right)^2-4\left(c^2-3bd+12ae\right)^3}\right)}}\\&-\frac{6(-1)^{\frac{k(k-1)}{2}}\sqrt{3}\left(b^3-4abc+8a^2d\right)}{\sqrt{\begin{aligned}&3b^2-8ac+4a\sqrt[3]{\frac{1}{2}\left(2c^3-9bcd+27b^2e+27ad^2-72ace+\sqrt{\left(2c^3-9bcd+27b^2e+27ad^2-72ace\right)^2-4\left(c^2-3bd+12ae\right)^3}\right)}\\&+\frac{4a\left(c^2-3bd+12ae\right)}{\sqrt[3]{\frac{1}{2}\left(2c^3-9bcd+27b^2e+27ad^2-72ace+\sqrt{\left(2c^3-9bcd+27b^2e+27ad^2-72ace\right)^2-4\left(c^2-3bd+12ae\right)^3}\right)}}\end{aligned}}}\end{aligned}}\\[6pt]k\in\{1,2,3,4\}.\end{gathered}}$$

The first condition excludes polynomials that are symmetric about the position \(x=-\frac{b}{4a}\) , including biquadratic equations with \(b=d=0\) such as \(x^4-5x^2+4=0\) . There the first large root can become zero and is then in the denominator. The second condition excludes at least a triple zero, for example with \(x^4-6x^2+8x-3=(x-1)^3(x+3)=0\) : Here the cube root disappears in the denominator. The excluded special cases are not covered by the boxed formula; additional solution formulas are omitted here.

From \(n=5\) even the best memorization skills don't help: there is no general formula made up of a finite number of basic arithmetic operations and roots. This is what the Abel–Ruffini theorem says; a proof can be found in Milne's Fields and Galois Theory . Individual equations can still be solved using radicals. And other approximate values ​​and special functions remain, such as Bring's radical at the fifth degree. So the zeros don't disappear, only the prospect of a universal root formula.

Back