# Issues in expanding expressions with formal sums

I have a very long expression involving formal sums to infinity, unfixed functions and several variables.

In this very long expression, I need a typical term, like

$$\frac{6 A \sigma \sum _{n=0}^{\infty } \left(\frac{2 A (n+1)^2 e^{-\frac{A (n+1)}{w^2}} \left(\sum _{m=0}^{\infty } (m+1) (m+2) w^m \sigma ^n a(n+1,m+2)\right)}{w^3}+(n+1) e^{-\frac{A (n+1)}{w^2}} \left(\sum _{m=0}^{\infty } m (m+1) (m+2) w^{m-1} \sigma ^n a(n+1,m+2)\right)\right)}{w^3}$$,

to be given like,

$$\frac{6 A \sigma \sum _{n=0}^{\infty } (n+1) e^{-\frac{A (n+1)}{w^2}} \sum _{m=0}^{\infty } m (m+1) (m+2) w^{m-1} \sigma ^n a(n+1,m+2)}{w^3}+\frac{2 A \sum _{n=0}^{\infty } (n+1)^2 e^{-\frac{A (n+1)}{w^2}} \sum _{m=0}^{\infty } (m+1) (m+2) w^m \sigma ^n a(n+1,m+2)}{w^6}$$,

i.e to be expanded.

I need to do this for quite a lot of terms, and Mathematica's Expand or ExpandAll doesn't work.

Here's the code:

What I want is,

(6/w^3)*A*\[Sigma]*
Sum[((1 + n)*
Sum[m*(1 + m)*(2 + m)*w^(-1 + m)*\[Sigma]^n*
a[1 + n, 2 + m], {m, 0, Infinity}])/E^((A*(1 + n))/w^2), {n,
0, Infinity}] +
(2/w^6)*A*
Sum[((1 + n)^2*
Sum[(1 + m)*(2 + m)*w^m*\[Sigma]^n*a[1 + n, 2 + m], {m, 0,
Infinity}])/E^((A*(1 + n))/w^2), {n, 0, Infinity}]


What I have is,

(6*A*\[Sigma]*
Sum[((1 + n)*
Sum[m*(1 + m)*(2 + m)*w^(-1 + m)*\[Sigma]^n*
a[1 + n, 2 + m], {m, 0, Infinity}])/E^((A*(1 + n))/w^2) +
(2*A*(1 + n)^2*
Sum[(1 + m)*(2 + m)*w^m*\[Sigma]^n*a[1 + n, 2 + m], {m, 0,
Infinity}])/(E^((A*(1 + n))/w^2)*w^3), {n, 0, Infinity}])/
w^3

• Can you put the code you used in the question. Jul 11 '21 at 17:09
• Please post the Mathematica code (InputForm) for these expressions. Jul 11 '21 at 17:10
• Thanks, I've made the edit Jul 11 '21 at 17:22
• What is your goal? What kind of final result do you want to get? Jul 12 '21 at 16:46