Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Working with indefinite number of variables

  • To: mathgroup at
  • Subject: [mg129095] Working with indefinite number of variables
  • From: Benjamin Hell <hellben at>
  • Date: Sat, 15 Dec 2012 05:47:49 -0500 (EST)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

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: 

Mathematica return 0 instead of 2. If I supply a specific n like: 
everything works fine.

I thought about using Assumptions for n, but with no success so far.

How can I do that right?

  • Prev by Date: Re: Problem with PlotLegends
  • Next by Date: Re: Mathematica 9 does not read mathematica 8 ".mx" files
  • Previous by thread: Re: silly question on formatting tables
  • Next by thread: Re: Working with indefinite number of variables