Expand floods all my 64GB RAM in MMA 12.1 (Windows) just by sorting the powers of 16 variables. Somebody with >64GB RAM could run it. A memory saving alternative would even be more interesting.
a=(x[1]-x[11])^2+(x[2]-x[12])^2+(x[3]-x[13])^2+(x[4]-x[14])^2;
b=(x[1]-x[21])^2+(x[2]-x[22])^2+(x[3]-x[23])^2+(x[4]-x[24])^2;
c=(x[1]-x[31])^2+(x[2]-x[32])^2+(x[3]-x[33])^2+(x[4]-x[34])^2;
d=(x[21]-x[31])^2+(x[22]-x[32])^2+(x[23]-x[33])^2+(x[24]-x[34])^2;
e=(x[11]-x[31])^2+(x[12]-x[32])^2+(x[13]-x[33])^2+(x[14]-x[34])^2;
f=(x[11]-x[21])^2+(x[12]-x[22])^2+(x[13]-x[23])^2+(x[14]-x[24])^2;
g=1/12*Sqrt[4*a*b*c-a*(b+c-d)^2-b*(a+c-e)^2-c*(a+b-f)^2+(b+c-d)*(a+c-e)*(a+b-f)];
g2=g /. x[i_] -> (z[i] - μ[i]) t + μ[i];
taylor= (Series[g2, {t,0,2}] // Normal) /. t -> 1;
(the next line exceeds 64 GB RAM)
taylor=Expand[taylor];
mean= taylor //. z[i_]^2 -> σ^2 + μ[i]^2;
mean= mean //. z[i_] -> μ[i];
FullSimplify[mean==g+[Sigma]^2 (4(ab+ac+bc+ed)-(a+b-f)^2-(a+c-e)^2-(b+c-d)^2-(e+d-f)^2)/(288g) /. x[i_] -> [Mu][i]]
Memory overflow happens after about 15min on a modern CPU. The code is adapted from here and here.
If the code outputs True then your code fix is right or you had enough memory.
In case you want to test the code and you need a running example without high memory demands then set in the 7th line g=Sqrt[a];.
The result will be different with and without Expand, meaning that this command cannot be omitted.
tand then substitute intog? – mikado Jan 12 '21 at 19:03Sqrt[Series[g^2, {t, 0, 2}]]instead ofSeries[g, {t, 0, 2}]. – Carl Woll Jan 12 '21 at 19:17taylor=(Series[g,{t,0,2}]//Normal)/.t -> 1;. You first expand $g$ with respect to $t$ about the point $t=0$, but then you replace $t$ in the expansion with $1$? Would it not be more accurate to expand directly around $1$? – MarcoB Jan 13 '21 at 15:21