How should I enter

$\quad \quad \sum^{N}_{k=0}{f(n_k)}$

into Mathematica? More generally, how should I work with the indices?

Take the following as an example. I know how the Sum function works, but how to do get it to work with the $n_k$ in $\sum^N_{k=0}n_k$? Here is what I have:

Sum[n (ln (1 + e^(ax + y))), {n, 0, N}]

Note that the $n_k$ for $k\in{}\{0, 1, ..., N\}$ are unspecified constants (natural numbers if it matters).

I am trying to simplify a similar series.

  • 2
    $\begingroup$ When you write Sum[n (ln (1 + e^(ax + y))), {n, 0, N}] above, do you intend Sum[n Log[1 + E^(a x + y)], {n, 0, N}]. I hope so, because in the first expression ln, ax, and e are ordinary variables with no special meaning. $\endgroup$ – m_goldberg Jul 23 '15 at 9:18

I suspect you want something more than this but I would start with Indexed:

Sum[f[Indexed[n, k]], {k, 0, Ν}]

enter image description here

Note that I replaced N, a reserved symbol, with \[CapitalNu] which looks the same but is free for use.

  • $\begingroup$ Could you mind explaining the new functionality Indexed a bit more in details. What does it return just formatted text ... Can we assign values to Indexed what is the difference between part and Indexed etc. It will be very helpful for future users. $\endgroup$ – s.s.o Jul 23 '15 at 8:14
  • 1
    $\begingroup$ How symbolic vector part functionality (Indexed) integrates with other functionalities, like geometric regions is somewhat poorly documented. It can be used like Minimize[Indexed[p, 1] - Indexed[p, 2], Element[p, Disk[]]] ... so, in some contexts Indexed has quite a specific meaning. $\endgroup$ – kirma Jul 23 '15 at 8:31

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.