### The Maxima on-line user's manual

Algebra Calculator

#### 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

ibase : 16;

k:0be;

Calculate

##### gcdex

gcdex(3*x^6+5*x^4+x^2...

Calculate

##### gcdex

98*(-335)-199*(-165);

gcdex(67,33);

Calculate

##### gcdex

gcdex(30808063,6);

Calculate

f[i,j]:=x^igcdex(i,j)...

M:genmatrix(f,3,3);

Calculate

##### gcdex

gcdex(x^5-4*x^4+8*x^3...

Calculate

##### gcdex-mod

mod(mod(3320144^49999...

gcdex(7293000,7299827);

Calculate

ibase : 10;

obase:16;

Calculate