Exercício 5.1 (a)
>
f:=x->exp(x);
plot(f(x),x=1..2.5);
df:=D(f);
x0:=1.8;
h:=0.01;
DfX0:=df(x0);
>
with(student):
showtangent(f(x),x=1.8,x=1..2.5,color=black);
>
DfPX0:=DifFinPro(f,x0,h);
erro:=abs(DfX0-DfPX0);
majorante:=h/2*maximize(abs((D@@2)(f)(xi)),{xi},{xi=x0..x0+h});
>
DfRX0:=DifFinReg(f,x0,h);
erro:=abs(DfX0-DfRX0);
majorante:=h/2*maximize(abs((D@@2)(f)(xi)),{xi},{xi=x0-h..x0});
>
DfCX0:=DifFinCen(f,x0,h);
erro:=abs(DfX0-DfCX0);
majorante:=h^2/24*maximize(abs((D@@3)(f)(xi)),{xi},{xi=x0-h/2..x0+h/2});
>