Polinomios Definición de polinomio - UGRpjara/D/Docen13/AC/Files/Polinomios-01.pdf · Polinomios...
Transcript of Polinomios Definición de polinomio - UGRpjara/D/Docen13/AC/Files/Polinomios-01.pdf · Polinomios...
Polinomios
Definición de polinomio
Un polinomio es una expresión algebraica con coeficientes y variables; cada uno de los suman-
dos (no nulos) se llama un término; cada término consta de un coeficiente y un monomio.
Ejemplos de polinomios son:
In[1]:= P = X^3 Y^4 + 5 X^2 Y Z^5 + Y ^4 Z^4 - 2
Q = X^2 + X Y + 3 Y Z - 2 Y^2
H = HX - YL HX + YL^2 + X^3
Expand@HD
Out[1]= -2 + X3
Y4
+ Y4
Z4
+ 5 X2
Y Z5
Out[2]= X2
+ X Y - 2 Y2
+ 3 Y Z
Out[3]= X3
+ HX - YL HX + YL2
Out[4]= 2 X3
+ X2
Y - X Y2
- Y3
Para calcular un coeficiente en particular utilizamos la siguiente orden:
In[5]:= Coefficient@P, Y ZDCoefficient@Q, Y ZDCoefficient@P, X, 3DCoefficient@P, X^3D
Out[5]= 0
Out[6]= 3
Out[7]= Y4
Out[8]= Y4
Podemos manejar todos los coeficientes (en grado ascendente) mediante el uso de listas uti-
lizando la orden:
In[9]:= CoefficientList@P, 8X, Y, Z<DMatrixForm@%DCoefficientList@P, 8X, Y<DMatrixForm@%DCoefficientList@P, 8X<DMatrixForm@%D
Out[9]= 888-2, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 1, 0<<, 880, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<<,
880, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 5<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<<, 880, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 81, 0, 0, 0, 0, 0<<<Out[10]//MatrixForm=
-2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
Out[11]= 99-2, 0, 0, 0, Z4=, 80, 0, 0, 0, 0<, 90, 5 Z
5, 0, 0, 0=, 80, 0, 0, 0, 1<=
Out[12]//MatrixForm=
-2 0 0 0 Z4
0 0 0 0 0
0 5 Z5
0 0 0
0 0 0 0 1
Out[13]= 9-2 + Y4
Z4, 0, 5 Y Z
5, Y
4=
Out[14]//MatrixForm=
-2 + Y4
Z4
0
5 Y Z5
Y4
Las variables de un polinomio también pueden determinarse fácilmente.
2 Polinomios-01.nb
In[15]:= Variables@PDOut[15]= 8X, Y, Z<
In[16]:= CoefficientList@P, Variables@PDDOut[16]= 888-2, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 1, 0<<, 880, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<<,
880, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 5<, 80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<<, 880, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<,
80, 0, 0, 0, 0, 0<, 80, 0, 0, 0, 0, 0<, 81, 0, 0, 0, 0, 0<<<
Sin embago las variables podemos definirlas en cada momento.
In[17]:= CoefficientList@H, 8X<D
Out[17]= 9-Y3, -Y
2, Y, 2=
Cada término está formado por un coeficiente y un monomio; éstos se obtienen mediante la
siguiente orden:
In[18]:= CoefficientRules@P, 8X, Y, Z<DOut[18]= 883, 4, 0< ® 1, 82, 1, 5< ® 5, 80, 4, 4< ® 1, 80, 0, 0< ® -2<
En este caso tenemos cuatro términos.
El resultado se ordena según el orden monomial que hayamos usado; aquí tenemos un ejemplo
para los órdenes más usuales.
In[19]:= CoefficientRules@P, 8X, Y, Z<, LexicographicDCoefficientRules@P, 8X, Y, Z<, DegreeReverseLexicographicDCoefficientRules@P, 8X, Y, Z<, DegreeLexicographicD8%@@1, 1DD, %@@1, 2DD<
Out[19]= 883, 4, 0< ® 1, 82, 1, 5< ® 5, 80, 4, 4< ® 1, 80, 0, 0< ® -2<
Out[20]= 880, 4, 4< ® 1, 82, 1, 5< ® 5, 83, 4, 0< ® 1, 80, 0, 0< ® -2<
Out[21]= 882, 1, 5< ® 5, 80, 4, 4< ® 1, 83, 4, 0< ® 1, 80, 0, 0< ® -2<
Out[22]= 882, 1, 5<, 5<
Veamos cómo conseguir el coeficiente líder, el monomio líder y el término líder.
In[26]:= LeaderCoefficient@P_, L_, O_D := CoefficientRules@P, L, OD@@1, 2DDLeaderMonomial@P_, L_, O_D := CoefficientRules@P, L, OD@@1, 1DDLeaderTerm@P_, L_, O_D := LeaderCoefficient@P, L, OD *
Product@L@@iDD^LeaderMonomial@P, L, OD@@iDD, 8i, 1, Length@LD<D
Polinomios-01.nb 3
In[29]:= LeaderCoefficient@P, 8X, Y, Z<, LexicographicDLeaderMonomial@P, 8X, Y, Z<, LexicographicDLeaderTerm@P, 8X, Y, Z<, LexicographicD
Out[29]= 1
Out[30]= 83, 4, 0<
Out[31]= X3
Y4
In[32]:= LeaderCoefficient@P, 8X, Y, Z<, DegreeReverseLexicographicDLeaderMonomial@P, 8X, Y, Z<, DegreeReverseLexicographicDLeaderTerm@P, 8X, Y, Z<, DegreeReverseLexicographicD
Out[32]= 1
Out[33]= 80, 4, 4<
Out[34]= Y4
Z4
In[35]:= LeaderCoefficient@P, 8X, Y, Z<, DegreeLexicographicDLeaderMonomial@P, 8X, Y, Z<, DegreeLexicographicDLeaderTerm@P, 8X, Y, Z<, DegreeLexicographicD
Out[35]= 5
Out[36]= 82, 1, 5<
Out[37]= 5 X2
Y Z5
La función Exponent determina el exponente al que están elevadas las variables que se
consideran.
In[38]:= Exponent@P, XDExponent@P, YDExponent@P, 8X, Y<DExponent@P, 8X, Y, Z<D
Out[38]= 3
Out[39]= 4
Out[40]= 83, 4<
Out[41]= 83, 4, 5<
Por último las funciones Expand y Collect permiten manejar polinomios de forma cómoda.
In[42]:= HX + YL HX - YL^2 + X^2 Z
Expand@HX + YL HX - YL^2 + X^2 ZDCollect@%, 8X, Y<D
Out[42]= HX - YL2 HX + YL + X2
Z
Out[43]= X3
- X2
Y - X Y2
+ Y3
+ X2
Z
Out[44]= X3
- X Y2
+ Y3
+ X2 H-Y + ZL
FIN
4 Polinomios-01.nb