Why does the following program lead to different results of a21
and a211
?
moveconst[x_] := (x /. Integrate[factor_ expr_, {var_, min_, max_}] /;
FreeQ[factor, var] :> factor Integrate[expr, {var, min, max}]);
inta1 = 2 (2 Cos[q3[t]] fec1[x1] q5[t] - fe1[x1] Sin[q3[t]] );
a1 = Integrate[inta1, {x1, 0, L1}] q6[t];
inta2 = (4 Cos[q3[t]] fec1[x1] q5[t] q6[t] -2 fe1[x1] Sin[q3[t]] q6[t]);
a2 = Integrate[inta2, {x1, 0, L1}];
a21 = a1 - a2;
Simplify[a21, TransformationFunctions -> {Automatic, moveconst}]
inta11 = 4 Cos[q3[t]] fec1[x1] q5[t] - 2 fe1[x1] Sin[q3[t]] ;
a11 = Integrate[inta11, {x1, 0, L1}] q6[t];
inta21 = (4 Cos[q3[t]] fec1[x1] q5[t] q6[t] - 2 fe1[x1] Sin[q3[t]] q6[t]);
a21 = Integrate[inta21, {x1, 0, L1}];
a211 = a11 - a21;
Simplify[a211, TransformationFunctions -> {Automatic, moveconst}]