1
$\begingroup$

Bug introduced in 10.0 and fixed in 10.4
Inactive is new in 10.0.


What is the reason that the Inactive[Sum] behaves in a strange way with Power?

When I evaluate

Power[Inactive[Sum][a[i], {i, 1, n}], m]

I see

$$ \sum_{i=1}^n a[i]^m $$

This is not correct in the formal mathematical sense.

I expected the result

$$ \left(\sum_{i=1}^n a[i]\right)^m $$

I am using Mathematica 10.1. How can I work around this problem?

$\endgroup$
6
  • $\begingroup$ It is not clear what you are asking. Also, there is no evaluation taking place here, thus there is not result. Please be explicit in your question: 1. this is what I got 2. this is what I think Mathematica should have returned 3. these are my arguments for why 1 is wrong and 2 is right. $\endgroup$
    – Szabolcs
    Commented Mar 20, 2017 at 9:11
  • $\begingroup$ Also, whenever you suspect an incorrect result: state your version of Mathematica. $\endgroup$
    – Szabolcs
    Commented Mar 20, 2017 at 9:12
  • $\begingroup$ I tried in an old version and I see what you mean now. Power[Inactive[Sum][a[i], {i, 1, n}], m] is displayed incorrectly in 10.0-10.3. The display is correct from version 10.4 onwards. The incorrect display does not affect the structure and interpretation of the expression. Next time please state the problem explicitly. Do not assume that everyone sees the same output that you see. $\endgroup$
    – Szabolcs
    Commented Mar 20, 2017 at 9:21
  • $\begingroup$ I do not know how to paste here the output of the Mathematica I write it in tex format, for Power[Inactive[Sum][a[i], {i, 1, n}], m] the answer was \sum_{i=1}^n a[i]^m the correct is (\sum_{i=1}^n a[i])^m. I am using Mathematica version 10.1. According to Szabolcs's answer the problem is the version of my Mathematica $\endgroup$ Commented Mar 20, 2017 at 10:36
  • $\begingroup$ The problem is what you see, not what Mathematica would do if the sum were evaluated. $\endgroup$
    – evanb
    Commented Mar 20, 2017 at 11:56

1 Answer 1

2
$\begingroup$

This is a bug in Mathematica 10.0-10.3. It is fixed in Mathematica 10.4.

The problem only with the way the expression is displayed. The structure of the expression is not affected:

enter image description here

If you wish to use this only for display purposes, a workaround is to use HoldForm instead of Inactive.

HoldForm[Sum[a[i], {i, 1, n}]]^m

enter image description here

If you wish to use it for computation, you can ignore the wrong display (although it is not only annoying but increases the chance of mistakes).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.