## something like algsubs (maple) in XCas/Giac?

Utilisation de Xcas

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

### something like algsubs (maple) in XCas/Giac?

Hi,

In maple there is a function called "algsubs" which allows me to use an expression (usually algebraic) on a given expression. For instance

Code : Tout sélectionner

``algsubs(l2^2=1,l2^2+l2^3)``
will yield "l2+1"

Is there a similar thing in XCas/giac (without going into complex method like grobner basis). For easy conditions this can be done by polynomial remainder, here is a giacpy code

Code : Tout sélectionner

``````from giacpy import giac, rem
f=giac("l2**2+l2**3")
print rem(f,"l2**2-1","l2")
``````
Jose

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

### Re: something like algsubs (maple) in XCas/Giac?

algsubs does that in Xcas, but it selects one solution, this is not exactly what you want.

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

### Re: something like algsubs (maple) in XCas/Giac?

To get l2+1, you can run

Code : Tout sélectionner

``````G:=gbasis([l2^2=1],[l2]);
greduce(l2^2+l2^3,G,[l2]);
``````

jocaps
Messages : 118
Inscription : lun. avr. 17, 2017 4:32 pm

### Re:something like algsubs (maple) in XCas/Giac?

Well, I really did not want to use Gröbner basis for this. But thanks for the suggestion.

Jose