Exercício 5.1 (b)
> restart;
>
f:=x->x^3*exp(x^2)-sin(x);
plot(f(x),x=1.6..2);
df:=D(f);
x0:=1.8;
h:=0.1;
DfX0:=D(f)(x0);
plot((D@@2)(f)(x),x=x0-h..x0+h);
>
with(student):
showtangent(f(x),x=1.8,x=1.6..2,color=black);
>
DfPX0:=DifFinPro(f,x0,h);
erro:=abs(DfX0-DfPX0);
majorante:=h/2*abs((D@@2)(f)(x0+h));
>
DfRX0:=DifFinReg(f,x0,h);
erro:=abs(DfX0-DfRX0);
majorante:=h/2*abs((D@@2)(f)(x0));
>
DfCX0:=DifFinCen(f,x0,h);
erro:=abs(DfX0-DfCX0);
majorante:=h^2/24*abs((D@@3)(f)(x0+h/2));
>