8
$\begingroup$

Bug introduced in 10.2.0 or earlier and fixed in 10.4.0


Consider the following code.

ClearAll["Global`*"]
InactSum = Inactive[Sum]
InactInt = Inactive[Integrate]
A = InactInt[
    Subscript[\[Phi], j][x] InactSum[
    Subscript[a, i] Subscript[\[Phi], i][x], {i, 1, n}] , {x, a, b}]
B = InactInt[
    InactSum[Subscript[a, i]
    Subscript[\[Phi], i][x] Subscript[\[Phi], j][x], {i, 1, n}] , {x,
    a, b}]
Interchange = InactInt[InactSum[p_, q_], r_] -> InactSum[InactInt[p, r], q];
A /. Interchange
B /. Interchange

I have introduced two expressions

$$\begin{align} A &= \int_{a}^{b} \phi_{j}(x) \left[ \sum_{i=1}^{n} a_i \phi_{i}(x) \right] dx \\ B &= \int_{a}^{b} \left[ \sum_{i=1}^{n} a_i \phi_{i}(x) \phi_{j}(x)\right] dx \end{align}$$

where in $A$, $\phi_{j}$ is outside the summation while in $B$ it is inside the summation. Technically, these are both the same. But when I was trying to write a transformation rule that interchanges the integration and summation, then I noticed that it just applies to $B$ and not to $A$. So, I understood that Mathematica understands the little difference between these two but

The Standard Output for Both is the Same!

enter image description here

This prevents user from understanding the difference and it just shows itself when you want to apply the transformation rule.

I think this is a bug. In my opinion, the standard output for these two should be different. I would be happy to see what you think.

$\endgroup$
2
  • 2
    $\begingroup$ Version 10.4 Win 7 Pro 64bit does not display both the same (see here). What version are you using? $\endgroup$
    – Edmund
    Commented Mar 18, 2016 at 21:45
  • $\begingroup$ @Edmund: Thanks for the attention. :) I am using Mathmatica 10.3 on Window 7 32bit. :) It is due to system settings? $\endgroup$ Commented Mar 19, 2016 at 0:51

1 Answer 1

10
$\begingroup$

This is a bug I fixed in 10.4.0. Sorry for the inconvenience! To work around it in earlier versions, evaluate the following block of code:

InactiveDump`assembleInactiveSumProduct[{args_, disp_, interp_, char_,
    tag_, tooltip_, fmt_}] := 
  TemplateBox[args, tag, DisplayFunction -> Function[disp], 
    InterpretationFunction -> Function[interp], SyntaxForm -> char]

The SyntaxForm which specifies precedence for parenthesization was missing before 10.4.0.

$\endgroup$
0

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.