[R] Discriminant of a cubic polynomial

Leo Mada |eo@m@d@ @end|ng |rom @yon|c@eu
Thu Oct 10 14:38:34 CEST 2024


Dear Thomas,

Unfortunately, I do not know if any packages implement this functionality. Though, it is a topic that interests me.

Unlike the "classic discriminant", I prefer to work with the reduced polynomial. This "discriminant" is generalizable to a superset of Chebysev polynomials (which I called Cardano-polynomials).

x^3 - 3*c*x - 2*d = 0
x^5 - 5*c*x^3 + 5*c^2*x - 2*d = 0
x^7 - 7*c*x^5 + 14*c^2*x^3 - 7*c^3*x - 2*d = 0
discr = d^2 - c^n, where n = 3 for the degree 3 polynomial;

The beauty of this approach is that you can solve for all roots of these types of polynomials and the formula is much simpler. But you need to compute first the reduced polynomial. The order 3 polynomials always reduce to this type (which is not valid for higher orders).


By the way, the roots are as follows:
# intermediary quantities
p = (d + sqrt(discr))^(1/n);
q = (d - sqrt(discr))^(1/n);
# Roots:
p + q # Base-Root
m = cos(2*pi/n) + 1i * sin(2*pi/n); # root of unity
p * m^c(0, seq(n-1)) + q * m^c(0, rev(seq(n-1))); # All Roots

See on my GitHub page:
https://github.com/discoleo/R/blob/master/Math/Polynomials.CardanGeneralisation.R

Sincerely,

Leonard


	[[alternative HTML version deleted]]



More information about the R-help mailing list