## `solvelib::pdioe` -- solve polynomial Diophantine equations

#### Introduction

`solvelib::pdioe``(a, b, c)` returns polynomials `u` and v that satisfy the equation `au + bv = c`.

`solvelib::pdioe``(aexpr, bexpr, cexpr, x)` does the same after converting the arguments into univariate polynomials `a, b, c` in the variable `x`.

#### Call(s)

`solvelib::pdioe(a,b,c)`
`solvelib::pdioe(aexpr, bexpr, cexpr, x)`

#### Parameters

`x` | - | identifier or indexed identifier
`a, b, c` | - | univariate polynomials
`aexpr, bexpr, cexpr` | - | polynomial expressions

#### Returns

If the equation is solvable, `solvelib::pdioe` returns an expression sequence consisting of two operands of the same type as the input (expressions or polynomials). If the equation has no solution, `solvelib::pdioe` returns `FAIL`.

#### Related Functions

`solve`

#### Details

- The coefficient ring of the polynomials `a`, `b`, and `c` must be either `Expr`, or `IntMod(p)` for some prime p, or a domain belonging to the category `Cat::Field`.

#### Example 1

If expressions are passed as arguments, a fourth argument must be provided:

    >> solvelib::pdioe(x, 13*x + 22*x^2 + 18*x^3 + 7*x^4 + x^5 + 3, x^2 + 1, x)

                                          3    4
                         19 x      2   7 x    x
                       - ---- - 6 x  - ---- - -- - 13/3, 1/3
                          3             3     3

#### Example 2

x is not a multiple of the gcd of x+1 and x2-1. Hence the equation u(x+1)+v(x2-1)=x has no solution for u and v:

    >> solvelib::pdioe(x + 1, x^2 - 1, x, x)

                                       FAIL

#### Example 3

If the arguments are polynomials, the fourth argument may be omitted:

    >> solvelib::pdioe(poly(a + 1, [a]), poly(a^2 + 1, [a]), poly(a - 1, [a]))

                            poly(a, [a]), poly(-1, [a])

#### Changes

- used to be called `pdioe`

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000