> > In any case, can you send again an explicit example ? Thanks.
>
> The example is attached. The potential in this case is just a matter of
> two integrations.
>
Thanks for the example. The problem here is that one needs to do the
integral with all the terms together in the integrand not term by term
as the code currently does (these are the unevaluated integrals which
you see in your notebook when you attempt to find the potential). By
integrating all the terms together one can find a total derivative and
do the integration. Clearly the algorithm in this case has to be
improved and I still need to think what the best way of doing this is.
In the meantime the following patch solves your problem although not as
fast as the direct integration you performed yourself (it takes ~ 25
seconds in my computer). In section 2.10 of xTerior.nb look for the part
starting with the comment (*Simplest cases for grade 1 forms *) and
replace the code there by the following one:
(*Simplest cases for grade 1 forms *)
FindPotential[expr_Diff, point_List, chart_?ChartQ,
options : OptionsPattern[Integrate]] := Part[expr, 1];
FindPotential[factor_ expr_Diff, point_List, chart_?ChartQ,
options : OptionsPattern[Integrate]] :=
Integrate1[(factor /.
Thread[Rule[ScalarsOfChart@chart,
Times[#, t] & /@ (ScalarsOfChart@chart - point) +
point]]) (Part[expr, 1] -
Part[point,
First@Flatten@
Position[ScalarsOfChart@chart, Part[expr, 1]]]), {t, 0, 1},
options];
(* Do the actual integration *)
Integrate1 /: HoldPattern@Plus[var__Integrate1] :=
Integrate[Plus @@ First /@ {var}, {t, 0, 1}];
Alfonso.