kill(all)$

maxima:fvm:appendix:lineintegral definition(parametric),example :"circle area",version 1.0
peter.vlasschaert@gmail.com,26/11/2022

see: website
----------------
ref 1:
new:26/11/2022:maxima :  appendix : fvm : lineintegral (2D)conversion surface integral (2D)  ,version 1.0

rem : Green's theorem in the plane.

integrate(P(x(t),y(t))*('diff(y,t,1))+Q(x(t),y(t))*('diff(x,t,1)),t);

here used : calculation of a surface "circle",see: ref 1

line integral :
----------------

→ parameter :

p1:[-y,x,x,y];                                    /*-y*dx+x*dy , dx =position(2) =del(x), dy = position(4) =del(y) */
p2:[x=cos(t),y=sin(t)];                     /*parametric eq:circle*/
p3:listofvars(rhs(p2[1]))[1];            /*t*/
p4:[a,b];                                           /*begin value integration,end value integration */

→ square power : p2

p2a:(p2[1])^2+(p2[2])^2;

→ simplification (trig identity),"cartesian version"

p2a1:trigsimp(p2a);/*circle with radius =1*/

definition line integral
------------------------------

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

lineintegral(p1,p2,p4):=block([],
s1:p1,
s2:listofvars(rhs(p2[1]))[1],
s2a:p2,    
s3:p1[1]*del(p1[2])+p1[2]*del(p1[4]),
s3a:subst(p2,s3),
s3b:ev(s3a,nouns),
s3c:subst([del(s2)=1],s3b),   
s4:integrate(s3c,s2,p4[1],p4[2])    
)$

→ optimized :code

grind(lineintegral)$

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

→ example : circle.

line integral 
----------------
------------------------------------
parametric equation circle :
r=1 ,[x=cos(t),y=sin(t)]
------------------------------------

p6:surface(circle) =1/2*lineintegral(p1,p2,[0,2*%pi]);

rem : radius = r ,surface(circle) =π*r^2

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