# pattern matching – 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.