Using variables for integration parameters

What I need is to use variables $AA$ and $TT$. First code samples works and does what I need:

XX = 3*t + 1;
YY = a^3*Sin[t];
ZZ = a^3*Cos[t];
R = ParametricRegion[{XX, YY, ZZ}, {{a, 1/2, 1}, {t, Pi/6, Pi/4}}];
NIntegrate[x, {x, y, z} \[Element] R]


but second code sample does not work, and I can not understand why. It looks it must work, and we do not have any issues with $XX$,$YY$,$ZZ$.

XX = 3*t + 1;
YY = a^3*Sin[t];
ZZ = a^3*Cos[t];
AA = {a, 1/2, 1};
TT = {t, Pi/6, Pi/4};
R = ParametricRegion[{XX, YY, ZZ}, {AA, TT}];
NIntegrate[x, {x, y, z} \[Element] R]


Thanks a lot for your help!

Attributes[ParametricRegion]

(* {HoldAll, Protected} *)


Because of the attribute HoldAll your iterators are not expanded to the proper form for iterators. You need to use Evaluate to have the iterators expanded.

XX = 3*t + 1;
YY = a^3*Sin[t];
ZZ = a^3*Cos[t];
AA = {a, 1/2, 1};
TT = {t, Pi/6, Pi/4};
R = ParametricRegion[{XX, YY, ZZ}, Evaluate@{AA, TT}];
NIntegrate[x, {x, y, z} ∈ R]

(* 2.0789 *)

• Terrific, thanks! – Hedgehog Nov 10 '17 at 18:31