kill(all)$

maxima:fvm:updintegrate for differential inside the differential ,version 1.0a
peter.vlasschaert@gmail.com, 11/11/2022

ref.
maxima:fvm:appendix:updintegrate for differential inside the differential ,version 1.0
peter.vlasschaert@gmail.com, 11/11/2022

load packages,option :
================

load(lrats)$ ratprint:false$

→ model : differential

p1:'diff(u*a*k*'diff(Φ,x,2),x);

rem : derivative 

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

p1a:part(p1,0);

p1b:string(p1a);

p1c:is(p1b=string(derivative));

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

updintegrate : function
-------------------------------

function : updintegrate
------------------------------
arg : {expr,var:integrate,il,ol,list:constant}

given : list constant :

s1a:[a,k];

how to use : if -then - else
----------------------------------

updintegratetest(expr,va,il,ol,co):= block([],
s11:part(expr,0) ,  
if  string(s11) ="diff"  then
    print("differential")
 else
    print("no differential")
)$

test : updintegratetest(

updintegratetest(p1,va,il,ol,co)$

definition : updintegrate 
--------------------------------

updintegrate(expr,il,ol,co,xy):= block([zz],
  
if  xy =1  then 
 (
        t1aa:setify(co) ,
    t1b:args(expr),t1c:args(t1b[1]),
    t1d:t1b[2],t1e:setify(t1c),
    t1f:listify(setdifference(t1e,t1aa)),
    t1g:makelist(atom(t1f[i]),i,1,length(t1f)),
    t1g1:makelist( if t1g[i] = false then nx:i ,i,1,length(t1g)),
    t1h1:delete(t1f[nx],t1f),
     /* no differential part inside differential */   
    t1h2:makelist(subst([ttt=t1h1[i]],ttt(t1d)),i,1,length(t1h1)),
    t1h3:product(t1h2[i],i,1,length(t1h2)),
    t1h4:subst([x=zz],t1h3),    
     /* differential part inside differential      */
    t1i1:t1f[nx] ,
    t1i2:args(t1i1),
    t1i3:t1i2[1](t1i2[2]),   
    t1i4: at(subst([t1i2[1]=t1i3],t1i1),[x=zz]),
    /* combine : inside */
    t1j1:t1h4*t1i4,
    /* constant.list product */
    t1k0:product(co[i],i,1,length(co)),    
    /* integration interval : [il,ol] */    
    t1k1:at(t1j1,[zz=ol]) -at(t1j1,[zz=il]),
    t1k2:t1k0*t1k1    
    )
    else
    (xc1:args(expr),
     xc2:args(xc1[1]),
     xc3:product(xc2[i](xc1[2]),i,1,length(xc2)),
     xc4:at(xc3,[xc1[2]=zz]),
     xc5:at(xc4,[zz=ol]) - at(xc4,[zz=il])   
    )
  
)$

updintegrate(p1,w,e,s1a,1);

How to use : updintegrate 
-----------------------------------
----------------------------------------------------
expr : differential 
li       : lower limit  of integration
lo      : higher limit of integration
co     :  list of constant inside differential.
xy     : differential inside      = 1
           no differential inside = 2
-----------------------------------------------------
see :example for xy
-----------------------------------------------------

→ example 1: no constant(xy=1)
-----------------------------------

p2:'diff(k*'diff(Φ,x),x);

p2a:updintegrate(p2,w,e,[1],1);

rem : no constant use  co =[1]

→ example 2 : suppose k = constant(xy=1)
------------------------------------------------

p3a:updintegrate(p2,w,e,[k],1);

→ example 3: no differential inside (xy=2)
-----------------------------------------------

p4: 'diff(u*ρ*Φ,x);

p4a:args(p4);

p5:updintegrate(p4,w,e,[1],2);

rem : derivative
============

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

info : string(part(last(args(args(expr)[1])),0) ) = "diff" 

p6:p1;

if string(part(last(args(args(p6)[1])),0) ) = "diff" then print("True") else print("False") $

info :rem

p6a:part(p6,0);

p6b:string(p6a);

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