Sponsored links: Algebra eBooks ### The Maxima on-line user's manual

Algebra Calculator

#### Search: #### Gcdex

Function: gcdex (<f>, <g>)

Function: gcdex (<f>, <g>, <x>) Returns a list `[<a>, <b>, <u>]` where <u> is the greatest common divisor (gcd) of <f> and <g>, and <u> is equal to `<a> <f> + <b> <g>`. The arguments <f> and <g> should be univariate polynomials, or else polynomials in <x> a supplied main variable since we need to be in a principal ideal domain for this to work. The gcd means the gcd regarding <f> and <g> as univariate polynomials with coefficients being rational functions in the other variables.

`gcdex` implements the Euclidean algorithm, where we have a sequence of `L[i]: [a[i], b[i], r[i]]` which are all perpendicular to `[f, g, -1]` and the next one is built as if `q = quotient(r[i]/r[i+1])` then `L[i+2]: L[i] - q L[i+1]`, and it terminates at `L[i+1]` when the remainder `r[i+2]` is zero.

```          (%i1) gcdex (x^2 + 1, x^3 + 4);
2
x  + 4 x - 1  x + 4
(%o1)/R/           [- ------------, -----, 1]
17        17
(%i2) % . [x^2 + 1, x^3 + 4, -1];
(%o2)/R/                        0```

Note that the gcd in the following is `1` since we work in `k(y)[x]`, not the `y+1` we would expect in `k[y, x]`.

```          (%i1) gcdex (x*(y + 1), y^2 - 1, x);
1
(%o1)/R/                 [0, ------, 1]
2
y  - 1```

```(%o1)                                true
(%i2) ```

### Related Examples

##### gcdex

gcdex(75,39,10000);

Calculate

gcdex(96,7);

Calculate

##### gcdex-totient

totient(3245227);

gcdex(3304800,56219);

Calculate

##### gcdex-mod

gcdex(3245227,71549);

mod(8049^1211832,3308...

Calculate

##### gcdex-mod-power_mod-totient

totient(3245227);

gcdex(3241600, 71549);

power_mod(7130,56799,...

Calculate

gcdex(55,11);

Calculate

ibase : 16;

k:0be;

Calculate

##### gcdex

gcdex(X^4+2*X^3+1,X^2...

Calculate

##### gcdex

gcdex(x*x*x-3*x-29,x*...

Calculate

##### gcdex

igcdex(7,3432);

Calculate 