cubic and quartic roots

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

Modérateur : xcasadmin

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

cubic and quartic roots

Message par lukamar » mar. mars 13, 2018 12:13 pm

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 : 5731
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: cubic and quartic roots

Message par parisse » mer. mars 14, 2018 6:40 pm

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 : 331
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: cubic and quartic roots

Message par lukamar » mer. mars 14, 2018 11:16 pm

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 : 5731
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: cubic and quartic roots

Message par parisse » jeu. mars 15, 2018 6:44 am

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.

Répondre