Question: better way to write the code for the integration of orthogonal cosine functions

how to write the code for integration of the orthogonal cosine function with nu=mu or with nu<>mu

restart;

 

phi:= (mu,Q2)->sqrt(2/l)*sin(mu*Pi*(Q2+l/2)/l);    # E:=mu->(Pi*mu/sqrt(2)/l)^2, mu=1,2...

proc (mu, Q2) options operator, arrow; sqrt(2/l)*sin(mu*Pi*(Q2+(1/2)*l)/l) end proc

(1)

fh1:=simplify((-1/2/m2*Int(diff(phi(mu,Q2),Q2)*diff(phi(nu,Q2),Q2),Q2=-l/2..l/2)))

-mu*Pi^2*nu*(Int(cos((1/2)*mu*Pi*(2*Q2+l)/l)*cos((1/2)*nu*Pi*(2*Q2+l)/l), Q2 = -(1/2)*l .. (1/2)*l))/(l^3*m2)

(2)

convert(fh1,int) assuming(mu,integer,nu,integer);

0

(3)

fh1_subs := simplify(subs(nu = mu, fh1));

-mu^2*Pi^2*(Int(cos((1/2)*mu*Pi*(2*Q2+l)/l)^2, Q2 = -(1/2)*l .. (1/2)*l))/(l^3*m2)

(4)

convert(fh1_substituted,int)assuming (mu,integer,nu,integer);

-(1/2)*mu^2*Pi^2/(l^2*m2)

(5)

 

Download test1.mw

Please Wait...