I need to calculate a closed-form expression for $\sum_{j=0}^{k-1}(2j+2)\sum_{i=1}^j \frac 1 {i^2}$. This isn't particularly difficult, and I do it by hand pretty much routinely.
However I found out Mathematica's symbolic computation gives me an answer which is slightly different from the one I'd derived myself: I believe the problem arises when switching the indices of the sums, and I'm sure I'm doing it right, but of course I can't believe Mathematica would give a wrong answer (for such a trivial problem in any case).
I'm purposefully omitting giving either answers so as to not bias responses (which, hopefully, there will be, as this is driving me crazy).
Any comment or help appreciated, thanks!
EDIT: Thanks to all who answered. What I find, by hand, is that my sum (let's call it $S$) is such that $S=k^2H_{k-1}^{(2)}-k$, where $H_{j}^{(2)}=\sum_{i=1}^j 1/j^2$.
What Mathematica/Maple finds (when you've done the appropriate simplifications as suggested by Andrew) is $S=k^2H_{k}^{(2)}-k$. For instance, with Maple, I type:
assume(k,posint): additionally(k>0): sum((2*j+1)*harmonic(j,2),j=1..(k-1));
I believe I get this discrepancy when I'm switching the sum on $j$ and the sum on $i$, but I don't understand what I'm doing wrong.