cubic and quartic roots

Librairie C++ de calcul formel/ C++ symbolic computation library

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

cubic and quartic roots

Hello,
could Giac use Cardano (Ferrari) formula to obtain roots of cubic (resp. quartic) equations? Thus the solutions of e.g. x^3-x-1=0 would be both exact and readable. Also, a primitive function of e.g. 1/(x^3-x-1) could be computed. Rootofs are practical when dealing with complicated roots, but it would be nice to obtain an algebraic representation when possible.

parisse
Messages : 5082
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: cubic and quartic roots

Hi,
I don't want to do that, because it's very difficult to compute something with these formulas (for example a symmetric expression of the roots).

lukamar
Messages : 294
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: cubic and quartic roots

Thanks for the clarification. It makes sense, those formulas are indeed quite awkward to use.
In the meantime, I've found a way to compute a primitive function of 1/(x^3-x-1):

Code : Tout sélectionner

``````rootof([1,0],[1,0,-1,-1]):=a;
s:=cat(factor(x^3-x-1,a));
purge(a);
int(1/expr(s),x)
``````
This approach is a bit dirty, but it works. I tried subst, which does not allow to replace 'a' with some other symbol, and int won't integrate 1/factor(x^3-x-1,a), but the cat/expr transformation allows 'a' to be purged in between, making the subsequent integration possible.

parisse
Messages : 5082
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: cubic and quartic roots

I see, perhaps something for int and partfrac similar to factor should be added. By the way, you can enter rootof(x^3-x-1):=a at the beginning.