Really universal quartic formula

674 Views Asked by At

At the outset, I would like to say hello to the honorable discussants in this forum.

[This is my first entry in this forum, so I apologize in advance for any possible mess.]

I have a need to write formulas for the roots of the quartic equation $ax^4+bx^3+cx^2+dx+e=0$ so that they work $\forall a,b,c,d,e\in \mathbb{C}$ including $0$ (at least for the first and last one: $a$ and $e$). This is not about the algorithm of finding roots but about a closed formula, because what I have to examine is the behavior of individual roots of a complex quartic expression when the coefficients vary. (Besides, I want to protect the obtained expressions against numerical instability, e.g. at small values of any coefficient.)

I will present the reasoning for $\mathbb{R}$ coefficients, postponing their checking and possible generalization for the $\mathbb{C}$ ones.

We know that in the case of a quadratic equation $ax^2+bx+c=0$, there are two alternative formulas for (both) roots: $$x_{ \begin{array}{c} 1 \\ 2 \end{array} }=\frac{-b\mp \sqrt{\mathrm{\Delta }}}{2a}$$ and $$x_{ \begin{array}{c} 1 \\ 2 \end{array} }=\frac{2c}{-b\mp \sqrt{\mathrm{\Delta }}}$$ The second one can be obtained from the first by expanding the fraction with an complementary expression to the difference of squares. $$x_{ \begin{array}{c} 1 \\ 2 \end{array} }=\frac{-b\mp \sqrt{\mathrm{\Delta }}}{2a}\cdot \frac{-b\pm \sqrt{\mathrm{\Delta }}}{-b\pm \sqrt{\mathrm{\Delta }}}=\frac{2c}{-b\pm \sqrt{\mathrm{\Delta }}}$$ or also by using of the product Vieta formula. $$x_{ \begin{array}{c} 1 \\ 2 \end{array} }\cdot x'_{ \begin{array}{c} 2 \\ 1 \end{array} }=\frac{c}{a}$$ $$x'_{ \begin{array}{c} 2 \\ 1 \end{array} }=\frac{c}{a}\cdot \frac{2a}{-b\mp \sqrt{\mathrm{\Delta }}}=\frac{2c}{-b\mp \sqrt{\mathrm{\Delta }}}$$ (In the second method, the formulas for both roots were found in the reverse order, but it does not matter.)

The first one works well $\forall b,c$ and $\forall a\neq 0$, the second one $\forall a,b$ but $\forall c\neq 0$.

In the first case, you can also proceed by calculating the appropriate limits. Then one of the roots will go to infinity, and the other will go smoothly into the only root of the obtained linear equation. $$x_1=\frac{-b-\sqrt{\mathrm{\Delta }}}{2a}{{\mathop{\longrightarrow}\limits_{a\to 0}}}\left\{ \begin{array}{cc} \mathrm{for}\ b<0: & -\frac{c}{b} \\ \mathrm{for}\ b=0: & \infty \left[-\sqrt{-{\mathrm{sgn} c\ }\ }\right] \\ \mathrm{for}\ b>0: & -\infty \end{array} \right.$$ $$x_2=\frac{-b+\sqrt{\mathrm{\Delta }}}{2a}{{\mathop{\longrightarrow}\limits_{a\to 0}}}\left\{ \begin{array}{cc} \mathrm{for}\ b<0: & \infty \\ \mathrm{for}\ b=0: & \infty \left[\sqrt{-{\mathrm{sgn} c\ }\ }\right] \\ \mathrm{for}\ b>0: & -\frac{c}{b} \end{array} \right.$$

Wherein, only finite results make sense as solutions to the linear equation!

Which root of the quadratic equation will go into the root of the linear equation depends on the sign of the linear coefficient $b$.

Formula $x_{ \begin{array}{c} 1 \\ 2 \end{array} }=\frac{2c}{-b\mp \sqrt{\mathrm{\Delta }}}$ reproduces these results without the use of limits, but it itself requires moving to the limit when $c\ =\ 0$. $$x_1=\frac{2c}{-b+\sqrt{\mathrm{\Delta }}}{{\mathop{\longrightarrow}\limits_{c\to 0}}}\left\{ \begin{array}{cc} \mathrm{for}\ b<0: & -\frac{b}{a} \\ \mathrm{for}\ b=0: & 0 \\ \mathrm{for}\ b>0: & 0 \end{array} \right.$$ $$x_2=\frac{2c}{-b-\sqrt{\mathrm{\Delta }}}{{\mathop{\longrightarrow}\limits_{c\to 0}}}\left\{ \begin{array}{cc} \mathrm{for}\ b<0: & 0 \\ \mathrm{for}\ b=0: & 0 \\ \mathrm{for}\ b>0: & -\frac{b}{a} \end{array} \right.$$ Here all the results have meaning.

That which root of the quadratic equation will go to $0$ and which in a potentially non-zero root of the obtained equation depends on the sign of the linear coefficient $b$.

There is also the possibility of refining formulas so that the root that can be calculated directly (without the use of limits) is always transformed into the root of the obtained equation. $$x_1=\frac{-b-{\mathrm{sgn} b\ }\sqrt{\mathrm{\Delta }}}{2a}={{\left|c=0\right|}}=-\frac{b}{a}$$ $$x_2=\frac{2c}{-b-{\mathrm{sgn} b\ }\sqrt{\mathrm{\Delta }}}={{\left|a=0\right|=}}\left\{ \begin{array}{cc} \mathrm{for}\ b\neq 0: & -\frac{c}{b} \\ \mathrm{for}\ b=0: & ? \end{array} \right.$$ Of course, only the case $b\ \neq \ 0$ have meaning.

The most universal (?) set of quadratic formulas is then: $$x_1=\frac{-b-{\mathrm{sgn} b\ }\sqrt{\mathrm{\Delta }}}{2a}$$ $$x_2=\frac{2c}{-b-{\mathrm{sgn} b\ }\sqrt{\mathrm{\Delta }}}$$ and they work for all $\mathbb{R}$ values of coefficients. (I leave the generalization for $\mathbb{C}$ numbers for later.)

And now the question is:

Is it possible to apply a similar trick to the quartic equation? That is, to develop the formula for roots that will behave well when the first or last (or both) coefficients ($a$, $e$) will pass through $0$.

I will be grateful for the answer (preferably with justification ;) ) and also possible development of the topic and indication of sources to read.

2

There are 2 best solutions below

3
On

The general quartic roots formulas are tremendous. I am not sure that anyone completely tackled the numerical stability issues for such monsters.

When these formulas are used, this is in general through the use of intermediate parameters. In particular, the polynomial is first made monic (so that $a=0$ is excluded), then depressed. I don't even know if using stable expressions for these parameters can improve the global stability.

0
On

Actually, as Yves Daoust said before, of course, the general quartic equation formula (specifically Ferrari's method) is derived from the monic depressed quartic that is yielded from the original quartic. See this link for more details. https://en.wikipedia.org/wiki/Quartic_function

To answer your question, to be able to use a and e as parameters to find roots for the equation can work, but unlike a quadratic equation, which only has one other term, the quartic equation will require a lot more work to find a root through such a method.

To further elaborate, in a quadratic equation of form ax^2 + bx + c = 0, you just need to the roots that match the middle to bx. However, a general quartic is of the form ax^4 + bx^3 + cx^2 + dx + e = 0, so you would have to match bx^3, cx^2, and dx. Of course, your proposed method can definitely work for biquadratic equations, i.e. ax^4 + cx^2 + e = 0, but unfortunately, even Ferrari's solution requires the use of two plus-and-minus signs, and using the general formula to create such forms for your quartic solutions is possible, but perhaps even more cluttered than Ferrari's solution already is.

FYI, the intermediate values seen in Ferrari's solution are there for ease of readability and calculation. They are not absolutely necessary but if they are not used, they will make the formula extremely cluttered.