WOLFRAM NOTEBOOK

In[]:=
deploy
Thu 26 Aug 2021 11:50:03
Series expansion used in https://math.stackexchange.com/questions/4228308/average-value-of-fracxa2xxa3x-over-surface-of-n-dimensional-sphere
Utility from https://mathematica.stackexchange.com/a/15025/217
In[]:=
multiTaylor[f_,{vars_?VectorQ,pt_?VectorQ,n_Integer?NonNegative}]:=Sum[Nest[(vars-pt).#&,(D[f,{vars,k.}]/.Thread[vars->pt]),k.]/k.!,{k.,0,n},Method->"Procedural"]
In[]:=
expand[order_]:=Clear[A,B,muA,muB];n=2;xs=Array[x,n];Ex[expr_]:=NExpectation[expr,(x[#]NormalDistribution[]&/@Range[n])];series=multiTaylor
A
B
,{{A,B},{muA,muB},order};A=Total@Table
2
x[i]
2
i
,{i,1,n};B=Total@Table
2
x[i]
3
i
,{i,1,n};muA=Ex[A];muB=Ex[B];Ex[series];orders=Table[k,{k,0,4}];vals=Table[expand[k],{k,orders}];ListPlot[vals,FillingAxis,PlotRangeAll]TableForm[vals,TableHeadings{orders,{"Taylor expansion","simplified"}}]
NIntegrate
:Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.
Out[]=
Out[]//TableForm=
0
1.11111
1
1.1123
2
1.26475
3
0.650206
4
4.713
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.