Exercício 4.30

> restart;

> f:=t->exp(2*sin(2*t));
plot(f(t),t=0..Pi,axes=boxed,color=blue);
fplot:=%:
g:=t->exp(2*sin(t));
plot(g(t),t=0..2*Pi,axes=boxed,color=blue);
gplot:=%:

[Maple Math]

[Maple Plot]

[Maple Math]

[Maple Plot]

> n:=3:
tj:=vector(2*n+1,j->evalf(2*(j-1)*Pi/(2*n+1)));
gtj:=vector(2*n+1,j->g(tj[j]));

[Maple Math]

[Maple Math]

> with(plots):
A:=pointplot({seq([tj[i],gtj[i]],i=1..2*n+1)},axes=BOXED,symbol=circle):
display(A);

[Maple Plot]

> a[0]:=evalf(2/(2*n+1)*sum(gtj[i+1],i=0..2*n));
for k from 1 to n do
a[k]:=evalf(2/(2*n+1)*sum(gtj[i+1]*cos(k*tj[i+1]),i=0..2*n));
b[k]:=evalf(2/(2*n+1)*sum(gtj[i+1]*sin(k*tj[i+1]),i=0..2*n));
od;
k:='k':
p3:=a[0]/2+sum(a[k]*cos(k*t)+b[k]*sin(k*t),k=1..n);
with(student):
p3t:=makeproc(p3,t);
plot(p3t(t),t=0..2*Pi,axes=boxed,title="Polinómio trigonométrico de 3º grau");
pplot:=plot(p3t(t),t=0..2*Pi,axes=boxed):
display(A,pplot,gplot);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]
[Maple Math]

Warning, new definition for D

[Maple Math]
[Maple Math]

[Maple Plot]

[Maple Plot]

> p3f:=subs(t=2*t,p3);

[Maple Math]
[Maple Math]

> p3ft:=makeproc(p3f,t);
plot(p3ft(t),t=0..Pi,title="Polinómio trigonométrico de 3º grau");
pfplot:=plot(p3ft(t),t=0..Pi):
display(pfplot,fplot);

[Maple Math]
[Maple Math]
[Maple Math]

[Maple Plot]

[Maple Plot]