The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Working with indefinite number of variables
Replies: 2   Last Post: Dec 18, 2012 2:35 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
David Bailey

Posts: 714
Registered: 11/7/08
Re: Working with indefinite number of variables
Posted: Dec 17, 2012 2:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 15/12/2012 10:47, Benjamin Hell wrote:
> Hi,
> I have been wrapping my head around this for a while now and I have not found a solution so far.
> I want to work with an indefinite number of variables in mathematica and use some built in functions.
> To make things more specific for starters I want to do the following:
> Define a sum with n summands each containing a new variable x[i] (in the i-th summand):
> sum[n_] = Sum[i*x[i], {i, 1, n}]
> Then I want to differentiate the expression with respect to some x[i] like:
> D[sum[n],x[2]]
> Mathematica return 0 instead of 2. If I supply a specific n like:
> D[sum[2],x[2]]
> everything works fine.
> I thought about using Assumptions for n, but with no success so far.
> How can I do that right?

Clearly D[sum[n],x[2]] should ideally return something like:




The problem is, of course, that the Sum command can't evaluate if n is

Possibly it would help if you supplied a bit more context regarding what
you are trying to do.

David Bailey

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.