2 2 3 2
5 y - 3 z + 7 x y + 2 x z
Get the coefficients of p with respect to the indeterminates x and y.
2
2 z , 7, 5, - 3 z
Get the coefficients of y^2.
2
7 x
Get the degree of p with respect to x.
3
Get the total degree of p with respect to x, y and z.
5
The leading coeffient of p with respect to x and y according to a lexicographical ordering of the terms.
2
2 z
The leading coeffient according to a total degree ordering.
7
3 2
2 x z
3
x
Get the list of exponents of the leading term.
[3, 0]
Get the trailing coeffient.
- 3 z
A long division of polynomial expressions is performed by devide, returning the quotient and the remainder.
3 x - 3/2, 11/2
By using one of the options Rem or Quo the user may obtain the remainder or the quotient alone.
3 x - 3/2
11/2
With option Exact one gets the quotient, but only if the division is without remainder.
FAIL
x - 1
The function pdivide performs a pseudo division of polynomial expressions such that the coefficients are not devided. The first factor 4 times p equals the first expression times q plus the second expression:
4, 12 x - 6, 22
The greatest common divisior and least common multiple of two polynomial expressions over the rationals can be computed.
x + 1
x - y
4 4 3 3
x - y - x y + x y
Rational functions may be normalized such that common factors of the numerator and denominator are removed.
x - 1
-----
x + 1
x + y
-------------
2 2
x y + x + y
Factorization of multivariate polynomial expressions over the rationals is available.
[6, x + 4, 1, x - 1, 1]
-- 2 --
| 1, x + y, 1, 3 y + 4 x , 1 |
-- --
With function evalp the user can evaluate a polynomial expression at certain points.
2
4 y + 2
6
The function norm computes the maximum-norm or the p-norm of a polynomial expression.
3
3.605551275
Mapping a function to all coefficients.
sin(3) + x sin(2)
Internally MuPAD use a special data type for polynomials. Polynomials of this type can be created by the user by using the function poly
/ 2 2 \
poly \ x y + x y + 1, [x, y] /
Using poly polynomials can be defined over predefined (also user-defined) rings or fields like Z/Z7.
/ 2 2 \
poly \ - 2 x - x y + x y + 2 , [x, y], IntMod(7) /
For polynomials the arithmetical operators +, -, * and ^ are defined as usual.
>> a:= poly(x^2*y^2-2, IntMod(7)): b:=poly(2*x+2*y,IntMod(7)): a + b; a * b; a^3;
/ 2 2 \
poly \ 2 x + 2 y + x y - 2, [x, y], IntMod(7) /
/ 2 3 3 2 \
poly \ 3 x + 3 y + 2 x y + 2 x y , [x, y], IntMod(7) /
/ 2 2 4 4 6 6 \
poly \ - 2 x y + x y + x y - 1 , [x, y], IntMod(7) /
Each of the polynomial functions mentioned so far may also be used with polynomials instead of expressions. This is especially usefull in procedures, because polynomials can internally be handled much faster than expressions.
>> a:= poly( 2*x^3 + 7*x^2*y^2 + 5*y, [x,y] ): coeff(a); coeff(a, x,2); degreevec(a);
2, 7, 5
/ 2 \
poly \ 7 y , [y] /
[3, 0]
Factorization of univariate polynomials over the finite fields Z/pZ (where p is prim) is also available.
[- 1, poly(x-1,[x],IntMod(7)), 1, poly(x-3,[x],IntMod(7)), 1]
The user can also obtain a recursive representation of polynomials. Domains of polynomials created by Poly are used as coefficient domains.
/ / 2 \ 2 \
poly \ poly(2 y +3, [y]) + poly \ 5 y, [y] / x, [x], Poly([y], Expr) /
/ 2 \
poly \ 5 y , [y] /, poly(2 y + 3, [y])
At least we show an example for decomposing a polynomial. That is for a given polynomial P a sequence of polynomials P1,...,Pn such that P(X)=P1(P2(...(Pn(x))...)).
2 3
x + x - 5, 3 x + x
/ 2 \ / 2 \
poly \- x + x , [x], IntMod(5)/, poly\x + x , [x], IntMod(5)/
-- 2 --
| 1, x + 1, 1, - x + x + 1 , 1 |
-- --
Let's proof that the following polynomial P in Z is irreducible over Z (and therefore over the rationals Q).
>> P:= x^8+8*x^7+28*x^6+56*x^5+70*x^4+56*x^3+28*x^2+8*x^2+8*x+1: factor(P);
-- 2 3 4 5 6 7 8 --
| 1, 8 x +36 x +56 x +70 x +56 x +28 x +8 x +x +1, 1 |
-- --
An example with a result of a more complex structure:
-- / 2 \ / 3 4
| 1, poly \ x + x + 1, [x] /, 1, poly \ - x + x - x +
--
6 7 9 10 12 14 15 17 18 20
x - x + x - x + x - x + x - x + x - x + x
21 23 24 \ --
- x + x + 1 , [x] /, 1 |
--
Factorization of polynomial in the field in Z/2Z:
-- / 2 \ --
| 1, poly(x+1,[x],IntMod(2)), 1, poly\x+x+1,[x],IntMod(2)/, 1 |
-- --
Use the function Factor to get a more natural form of the factorization.
/ 2 \ / 2 3 4 \ /
(x - 1) (x + 1) \ x + 1 / \ x + x + x + x + 1 / \ - x
2 3 4 \ / 2 4 6 8 \ / 5
+ x - x + x + 1 / \ - x + x - x + x + 1 / \ x +
10 15 20 \ / 5 10 15 20 \ /
x + x + x + 1 / \ - x + x - x + x + 1 / \ -
10 20 30 40 \
x + x - x + x + 1 /