4
$\begingroup$

I want to expand the expression but I do not want it to evaluate.

Sum[(HoldForm[1/(2 # - 1) - 1/(2 # + 1)] &)[i], {i, 1, 6}]

However if you evaluate this you get: (Fraction-Fraction)+...+(Fraction-Fraction). What i want is to have this fraction evaluated without having to evaluate the subtraction inside the parenthesis or the addition outside the parenthesis. Could someone show me a simple way to do this?

$\endgroup$
  • $\begingroup$ It is a good habit to hold on with an accept a day or two, let's don't discourage others. $\endgroup$ – Kuba Jan 17 '15 at 16:24
  • $\begingroup$ @Kuba Okey, ill do that next time:) $\endgroup$ – ALEXANDER Jan 17 '15 at 16:29
7
$\begingroup$
HoldForm[# - #2] & @@@ Table[{1/(2 i - 1), 1/(2 i + 1)}, {i, 1, 6}] // Total

enter image description here

$\endgroup$
  • $\begingroup$ I am still (till now) don't know how to format any of my answers that way you did it here. can you tell me how? Thanks. $\endgroup$ – Algohi Jan 18 '15 at 1:30
  • $\begingroup$ @Algohi The result is a picture :) $\endgroup$ – Kuba Jan 18 '15 at 8:03
  • $\begingroup$ Oh, I see. I should have known this. I can't copy it:-) $\endgroup$ – Algohi Jan 18 '15 at 16:01
6
$\begingroup$

Another way of doing it (something similar to Kuba's great answer) is:

Sum[HoldForm[#1 - #2] &[1/(2 i - 1), 1/(2 i + 1)], {i, 1, 6}]

May be also something different:

Sum[(1/(2 i - 1) - 1/(2 i + 1) // Trace)[[-2]], {i, 1, 6}]
$\endgroup$
  • 1
    $\begingroup$ Nice! (8 to go) $\endgroup$ – Kuba Jan 17 '15 at 22:08
5
$\begingroup$

One more subtle variation:

Sum[Defer[# - #2] & @@ (1/(2 i + {-1, 1})), {i, 6}]
(1/11 - 1/13) + (1/9 - 1/11) + (1/7 - 1/9) + (1/5 - 1/7) + (1/3 - 1/5) + (1 - 1/3)
$\endgroup$
  • 1
    $\begingroup$ Always new thing to the scene. When the master speech, everyone has to listen. :) $\endgroup$ – Algohi Jan 17 '15 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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