Ask Your Question
0

Summing polynomials [closed]

asked 10 years ago

jjack gravatar image

I have a ´Univariate Polynomial Ring in t over Symbolic Ring´

sage: cj_t = (-1)**(j-1)/factorial(j-1)*(-j+a)**(j-1/2)*exp(-j)*(t+j)**(-1)

How can I compute the sum over j from 1 to N?

sage: sum(cj_t,1,N)

doesn't work.

sage: sum([cj_t for j in [1..N]])

(Python syntax) doesn't work either.

Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by jjack
close date 2014-07-26 13:50:15.670658

1 Answer

Sort by » oldest newest most voted
0

answered 10 years ago

FrédéricC gravatar image

You cannot compute a sum with variable bounds. But if you fix N=4 or any other integer, this works.

sage: j,a,t = var('j,a,t')
sage: cj_t = (-1)**(j-1)/factorial(j-1)*(-j+a)**(j-1/2)*exp(-j)*(t+j)**(-1)
sage: N = 2
sage: add(cj_t(j=j) for j in range(1,N+1))
-(a - 2)^(3/2)*e^(-2)/(t + 2) + sqrt(a - 1)*e^(-1)/(t + 1)
Preview: (hide)
link

Comments

Sorry if that wasn't clear. I understood N to be a finite integer.

jjack gravatar imagejjack ( 10 years ago )

Question Tools

1 follower

Stats

Asked: 10 years ago

Seen: 575 times

Last updated: Jul 26 '14