Search code examples
formssubstitutionmaxima

How can I express a change of variables better?


I'm playing around integrating differential forms in maxima, and this is my program:

init_cartan([x,y]);

omega:1/(sqrt(x-y))*dx~dy;

phi:[u^2+v^2,2*u*v];
diff(phi,u);
diff(phi,v);

scalar:diff(phi,v)|(diff(phi,u)|omega);

integrand:subst(u^2+v^2,x,subst(2*u*v,y,scalar));

integrand:radcan(integrand);
integrate(integrate(integrand,u,0,1),v,0,1);

In the subst bit I have to give the relations between u,v and x,y again. This seems redundant. Is there a more natural expression?


Solution

  • load(cartan);
    init_cartan([x,y]);
    
    omega:1/sqrt(x-y)*dx~dy;
    def_xy:[x=u^2+v^2,y=2*u*v];
    
    phi:subst(def_xy,[x,y]);
    scalar:subst(def_xy,(diff(phi,u)|(diff(phi,v)|omega)));
    integrand:radcan(scalar);
    
    integrate(integrate(integrand,v,0,u),u,0,1);