# Question:integration in if-statement

## Question:integration in if-statement

Maple 2022

How can I get the evaluation of integration inside if-statement?

Thanks for your help in advance,

 > restart;
 > #L:=1:sigma:=0.01:beta:=0.2:k0:=-100:
 > #For Free particle Projectile := proc({L:=1,sigma:=0.01,beta:=0.2,k0:=-100},n_max) local x0,g,c:  x0:= beta*L;  g := unapply(exp(-(x-x0)^2/2/sigma^2),x);  #c := int(g(x)^2,x=-L/2..L/2,numeric=true);  ub := (L/2-x0)/sqrt(2)/sigma;  lb := (-L/2-x0)/sqrt(2)/sigma;  a := Pi*sqrt(2)*sigma/L;  b := sqrt(2)*k0*sigma;  c := Pi*x/L;  d := k0*x0;  eq1 := [cos(a*n*z)*cos(b*z)/e^(z^2),cos(a*n*z)*sin(b*z)/e^(z^2),sin(a*n*z)*cos(b*z)/e^(z^2),sin(a*n*z)*sin(b*z)/e^(z^2)];  eq1 := map(f->unapply(f,n,z),eq1);  eq2 := [cos(n*c)*cos(d),cos(n*c)*sin(d),sin(n*c)*cos(d),sin(n*c)*sin(d)];  eq2 := map(f->unapply(f,n,z),eq2);  for j from 1 to n_max do:    if (is(j,odd)) then eq11 := int(eq1[1](j,z),z=lb..ub,numeric=true);    else 0;    end if;  end do: end proc:
 >
 > Projectile(1);
 (1)
 >
﻿