kill(all)$

appendix1 : intro 1e order pde : functions (functions) & derivatives,version1.0
peter.vlasschaert@gmail.com, 17/05/2021

load packages ,option:
--------------------------------

load(lrats)$ ratprint:false$

given :
1e)  u=f( x_1, x_2,x_3,....x_n )
2e)  x_i=x_i( t_1,t_2,t_3,...t_m )
--------------------------------------------
rem : _ lower index

n:4;
m:3;

k1:makelist(x[i],i,1,n);

k2:makelist(t[i],i,1,m);

depends([f],k1);

p1:del(u)=diff(f);

maxima = del(u)  → math = du

p1a:depends([f1],k2);

reason : f1 must be symbol , index variables or not allowed.

1e step : index variable.
---------------------------------

p2: makelist(subst([f1=x[i]],p1a),i,1,n);

2e step :flatten
---------------------

p2a:flatten(p2);

3e step : see 2e) above 'given',notation
------------------------------------------------------

p2b:makelist(x[i]=p2a[i],i,1,n);

p2b1:makelist(rhs(p2b[i])=lhs(p2b[i]),i,1,n);

4e step : differentation
--------------------------------

→ one element :del(x[1])

p3:del(lhs(p2b[1]))=diff(p2a[1]);

→ list                 :del(x[i]) ,i=1,2,..n

p3a:makelist(del(lhs(p2b[i]))=diff(p2a[i]),i,1,n)$

ᐆ first element of the list

p3a1:p3a[1];

ᐇ last element of the list

p3a2:p3a[length(p3a)];

5e step :put 'p3a' into   'p1'
-------------------------------------

p4:subst(p3a,p1);

6e step :find coef del(t[i]), i=1,2,..,m
--------------------------------------------------

→ coef :one element :del(t[i]), i=1

p5:ratcoeff(rhs(p4),del(t[1]));

ᐆ combination :result =first term of del(u)

p5a:p5*del(t[1]);

→ coef :list :del(t[i]), i=1,2,..,m

p5b:makelist(ratcoeff(rhs(p4),del(t[i])),i,1,m);

ᐇ coef: first list ::del(t[1])

p5b1:p5b[1];

ᐆ combination :result =all terms of del(u), 'sum of all terms,i=1,2,..,m'

p5c:lhs(p4)=sum(p5b[i]*del(t[i]),i,1,m);

p5c1:ev(p5c,diff);
p5c1a:is(rhs(p5c)=rhs(p5c1));
p5c2:ev(p5c,nouns);
p5c2a:is(rhs(p5c)=rhs(p5c2));

easy to see : double sum :sum over 'm' and  sum over 'n' , here fixed values:m,n ,see 'above'
rem : see :notation in 3e step

7e step :simplification use  'p2b1'
---------------------------------------------

p5c1:subst(p2b1,p5c);

rem : from moment evalution  : with ev

ev:  with diff

p5c2a:ev(p5c1,diff);

ev: with nouns ( more general :all possible evaluations)

p5c2b:ev(p5c1,nouns);

reason :x[i],i=1,2..n  : only symbols not a function ,'in p5c1'

s1:'sum('diff(f,x[i])*'diff(x[i],t[j]),i,1,n);

s2:lhs(p4)='sum(s1*del(t[j]),j,1,m);

def: total derivative
---------------------------
del(u)

s3:lhs(p4)='sum('diff(u,t[j])*del(t[j]),j,1,m);

values;

example : 
------------

given : assume , V=constant

1e) step :representation of the problem.
-------------------------------------------------------
'diff(u,z) :there is ' before diff

p6:V*'diff(u,z)+'diff(u,t)=0;
p6a: y=t-z/V; /*new independent variables */
p6b: x=z;     /*new independent variables */

2e) what depends on what
-------------------------------------

depends(u,[z,t]);

p7:diff(u);

depends(y,[t,z]);
depends(x,z);

p7a:diff(u);

3) step 'diff(u,z), chain rule  depends  z(x,y)
----------------------------------------------------------

chainrule(f1,v1,m1):=block([],
m2:length(m1),      
m3:sum('diff(f1,m1[i])*'diff(m1[i],v1),i,1,m2),
    return([diff(f1,v1)=m3,m2])
);

p8a:chainrule(u,z,[x,y])[1];

p8b:chainrule(u,z,[x,y])[2];

ᐆ product in p8 :rhs: second part of term , make a list

p8a1:makelist(part(rhs(p8a),i,2),i,1,p8b);

ᐆ insert p6a,p6b

p8a2:subst([p6a,p6b],p8a1);

p8a3:ev(p8a2,diff);

p8a4:map("=",p8a1,p8a3);

final result :p8a

p8a5:subst(p8a4,p8a);

4) step 'diff(u,t), chain rule  depends  t(x,y)
----------------------------------------------------------

p9a:chainrule(u,t,[x,y])[1];
p9b:chainrule(u,t,[x,y])[2];

p9a1:makelist(part(rhs(p9a),i,2),i,1,p9b);

p9a2:subst([p6a,p6b],p9a1);

p9a3:ev(p9a2,diff);

p9a4:map("=",p9a1,p9a3);

final result :p9a

p9a5:subst(p9a4,p9a);

5) step:final solution
----------------------------

p10a:subst([p8a5,p9a5],p6);

p10b:expand(p10a);

use : chainrule , how to,use relation with dependencies.