HP PRIME Programa 2.0 Fourier
HP PRIME Programa 2.0 Fourier
HP PRIME Programa 2.0 Fourier
#CAS
xfourier(f1,i1,i2,f2,i3,i4,T)
BEGIN
w0:=2*π/T;
w0:=simplify(w0);
a0:=1/T*int(f1,x,i1,i2)+1/T*int(f2,x,i3,i4);
a0:=simplify(a0);
an:=2/T*int(f1*COS(n*w0*x),x,i1,i2)+2/T*int(f2*COS(n*w0*x),x,i3,i4);
simplify(subst(an,SIN(n*π/2)=(−1)^((n-1)/2)),SIN(n*π)=0,SIN(2*n*π)=0);
an:=factor(an) //factor par
a1:=2/T*int(f1*COS(w0*x),x,i1,i2)+2/T*int(f2*COS(w0*x),x,i3,i4);
a1:=factor(a1);
bn:=2/T*int(f1*SIN(n*w0*x),x,i1,i2)+2/T*int(f2*SIN(n*w0*x),x,i3,i4);
simplify(subst(bn,COS(n*π/2=0),COS(n*π)=(-1)^n,COS(2*n*π)=1);
bn:=factor(bn);
b1:=2/T*int(f1*SIN(w0*x),x,i1,i2)+2/T*int(f2*SIN(w0*x),x,i3,i4);
b1:=factor(b1);
print(" ");
print(" SERIE FOURIER version 2.0 PTRRZA");
print(T);
print(w0);
print("sin(n*π)=0 cos(n*π)=(-1)^n ");
print("sin(2*n*π)=0 cos(2*n*π)=1");
print("n=2*k-1: sin(n*π/2)=(-1)^(n-1)/2, cos(n*π/2)=0");
print(" ");
print(a0);
print(an);
print(a1);
print(bn);
print(b1);
print(" ");
return({a0,an,bn});
END;
#end