You are on page 1of 3

roots polynomials

dioses00misericordioso
November 2020

1 polynomial roots
1.1 Ejercicio 1
Use the Durand-Kerner algorithm to find all the roots of the polynomial

p(x) = x4 − 10x3 + 35x2 − 50x + 24


You should get x1234 = {1, 2, 3, 4}
SOLUCIÓN

%algoritmo de durand-kenner
x1=0.5
x2=2.5
x3=3.5
x4=4.5
for r=1:5
p=x1^4-10*x1^3+35*x1^2-50*x1+24
x1=x1-p/((x1-x2)*(x1-x3)*(x1-x4))
end
for r=1:5
p=x2^4-10*x2^3+35*x2^2-50*x2+24
x2=x2-p/((x2-x1)*(x2-x3)*(x2-x4))
end
for r=1:5
p=x3^4-10*x3^3+35*x3^2-50*x3+24
x3=x3-p/((x3-x1)*(x3-x2)*(x3-x4))
end
for r=1:5
p=x4^4-10*x4^3+35*x4^2-50*x4+24
x4=x4-p/((x4-x1)*(x4-x3)*(x4-x2))
end

1
Table 1: resultado para 5 iteraciones
n x1 x2 x3 x4
1 0.7734 2.3146 3.2480 3.9967
2 0.8872 2.1760 3.0975 4.0000
3 0.9414 2.0913 3.0340 4.0000
4 0.9689 2.0453 3.0113 4.0000
5 0.9834 2.0220 3.0037 4.0000

1.2 ejercicio 2
Use Durand-Kerner to find all the roots of the polynomial

p(x) = x7 − x − 1

SOLUCIÓN
se tomaron como puntos iniciales x1,2,3,4,5,6,7 = {0.9, −0.9, 4, 3, 7, i, −i}
%algoritmo de durand-kenner
x1=0.9
x2=-0.9
x3=4
x4=3
x5=7
x6=sqrt(-1)
x7=-sqrt(-1)
for r=1:10
p=x1^7-x1-1
x1=x1-p/((x1-x2)*(x1-x3)*(x1-x4)*(x1-x5)*(x1-x6)*(x1-x7))
end
for r=1:10
p=x2^7-x2-1
x2=x2-p/((x2-x1)*(x2-x3)*(x2-x4)*(x2-x5)*(x2-x6)*(x2-x7))
end
for r=1:10
p=x3^7-x3-1
x3=x3-p/((x3-x1)*(x3-x2)*(x3-x4)*(x3-x5)*(x3-x6)*(x3-x7))
end
for r=1:10
p=x4^7-x4-1
x4=x4-p/((x4-x1)*(x4-x3)*(x4-x2)*(x4-x5)*(x4-x6)*(x4-x7))
end
for r=1:10
p=x5^7-x5-1
x5=x5-p/((x5-x1)*(x5-x3)*(x5-x2)*(x5-x4)*(x5-x6)*(x5-x7))
end
for r=1:10

2
p=x6^7-x6-1
x6=x6-p/((x6-x1)*(x6-x3)*(x6-x2)*(x6-x5)*(x6-x4)*(x6-x7))
end
for r=1:10
p=x7^7-x7-1
x7=x7-p/((x7-x1)*(x7-x3)*(x7-x2)*(x7-x5)*(x7-x6)*(x7-x4))
end

Table 2: solucion para 10 iteraciones


n x1 x2 x3 x4 x5 x6 x7
1 0.8890 -0.8987 24.3961 4.3347 1.3714 -0.2673 + 0.6475i -0.0392 - 0.7735i
2 0.8777 -0.8975 -14.4197 9.1702 0.9014 -0.5150 + 0.7237i -0.2194 - 0.5440i
3 0.8662 -0.8962 -6.3345 -22.9138 2.7535 -0.5877 + 0.9034i -0.6527 - 0.5773i
4 0.8543 -0.8950 -4.2710 -3.8447 1.0798 -0.5284 + 1.0626i -0.8151 - 0.8576i
5 0.8422 -0.8937 -3.3088 -1.3303 1.1922 -0.3898 + 1.1149i -0.7696 - 1.2637i
6 0.8299 -0.8925 -2.7445 -2.1394 0.9942 -0.2857 + 1.0604i -0.3300 - 1.4351i
7 0.8173 -0.8913 -2.3696 0.5663 1.5655 -0.2857 + 1.0604i -0.0564 - 1.1986i
8 0.8045 -0.8900 -2.1003 0.823 0.8967 -0.2557 + 0.9735i -0.0126 - 0.9562i
9 0.7915 -0.8888 -1.896 0.0494 2.8701 -0.2844 + 0.9025i -0.0706 - 0.7352i
10 0.7784 -0.8876 -1.7344 0.1730 1.0952 -0.3451 + 0.8739i -0.2940 - 0.5284i

You might also like