# Simplifying multiplies of sums into a single double sum

I have the following expression:

Sum[x^n, {n, 1, Infinity}]*Sum[Log[m, x], {m, 2, Infinity}]

How can I Force Mathematica to write this expression in the following form?

Sum[x^n Log[m, x], {n, 1, Infinity}, {m, 2, Infinity}]
• In the first expression, the first sum will evaluate symbolically unless held or inactivated; and the second sum contains a division by zero i.e. Log[1, x] Dec 5, 2021 at 1:58
• I edited the zero division problem. Thanks for that. @BobHanlon Dec 5, 2021 at 7:14

Try the following. Let us introduce a rule:

rule = Inactive[Sum][a_., {k_, k0_: 1, m_}]*
Inactive[Sum][b_., {q_, q0_: 1, n_}] :>
Inactive[Sum][Simplify[(a *b)], {k, k0, m}, {q, q0, n}];

In your expression let us first inactivate the sums:

expr = Inactive[Sum][x^n, {n, 1, Infinity}]*
Inactive[Sum][Log[m, x], {m, 2, Infinity}]

Then:

expr1=expr /. rule

yields the following:

Now you can activate the result:

expr1//Activate

The result you will see on the screen is the same as I have shown above:

Have fun!