Ask Your Question

jonatan's profile - activity

2019-03-05 16:17:56 +0200 received badge  Notable Question (source)
2018-02-01 15:53:45 +0200 received badge  Popular Question (source)
2015-12-18 17:20:14 +0200 received badge  Scholar (source)
2015-12-18 14:57:19 +0200 asked a question Symbolic function that sums over variable sequence

How do I define a symbolic function that takes a sum of variables as value?

I have tried the following:

k=var('k')
f(x)=sum(x[k], k, 1, 5)

But I get the following error:

TypeError: unable to convert k to an integer

I want to be able to symbolically differentiate f with regards to e.g. x[3].