You are on page 1of 2

> syms x f a1 b1 P1 P2 P3 P4 P5 P6 P7

>> f=x^4-2*x^3-4*x^2+4*x+4;
>> a1=1; b1=2;
>> fa1=a1^4-2*a1^3-4*a1^2+4*a1+4

fa1 =

>> P1=(b1+b1)/2

P1 =

>> P1=(a1+b1)/2

P1 =

1.500000000000000

>> fP1=P1^4-2*P1^3-4*P1^2+4*P1+4

fP1 =

-0.687500000000000

>> a2=a1; b2=P1;


>> P2=(a2+b2)/2

P2 =

1.250000000000000

>> fP2=P2^4-2*P2^3-4*P2^2+4*P2+4

fP2 =

1.285156250000000

>> a2=a1; b2=P1;


>> a3=P2; b3=b2;
>> P3=(a3+b3)/2

P3 =

1.375000000000000

>> fP3=P3^4-2*P3^3-4*P3^2+4*P3+4

fP3 =

0.312744140625000

>> syms x
>> x0=[1,2];
>> f=x^4-2*x^3-4*x^2+4*x+4;
>> x=fzero(inline('x^4-2*x^3-4*x^2+4*x+4'),x0)
x =

1.414213562373095

You might also like