kill(all)$

maxima:fvm: code d(c)integrate(expr,var,lo,hi),version 1.0
peter.vlasschaert@gmail.com, 20/10/2022

rem : lo ≤ var ≤ hi , integration range for : expr

code : "see below"
-----------------------

dintegrate     : diffusion function ( = Γ(x))   ,second order differential →( integration)
d(c)integrate : diffusion (c)onstant ( = ΓΓ   ),second order differential →( integration)

load(antid)$

p1:'diff((Γ(x)·('diff(y(x),x,1))),x,1);

p2:integrate(p1,x);

integration : a ≤ x ≤ b

p2a:at(p2,x=b)-at(p2,x=a);

p3:'integrate(p1,x,a,b);

p3a:args(p3);

p3a1:length(p3a);

dintegrate(pp1,xx1,aa1,bb1):=block([s1],
s1:integrate(pp1,xx1),
s2:at(s1,xx1=bb1)-at(s1,xx1=aa1),
return(s2)    
)$

→ optimize code :"dintegrate"

s1 : local variable

grind(dintegrate)$

p4:p3=dintegrate(p1,x,b,a);

→ use : args command (Maxima)

p4a:p3=dintegrate(p3a[1],p3a[2],p3a[3],p3a[4]);

p4a1:args(lhs(p4a));

rem : ΓΓ is here constant below

p4b:'diff(ΓΓ*diff(y(x),x),x) = diff(ΓΓ*diff(y(x),x),x) ;

p4b1:'integrate(lhs(p4b),x,a,b)=factor(at(integrate(rhs(p4b),x),x=b)-
at(integrate(rhs(p4b),x),x=a));

dcintegrate(pp2,xx2,aa2,bb2):=block([s11],
s11:integrate(pp2,xx2),
s22:at(s11,xx2=bb2)-at(s11,xx2=aa2),
return(factor(s22))    
)$

→ optimize code :"dcintegrate"

grind(dcintegrate)$

s11 : local variable

p4b2:lhs(p4b1) = dcintegrate(rhs(p4b),x,a,b);

for differential use always : at (otherwise wrong representation).

--------------------------------------------------------------------------------------------------