Ask Your Question
0

Summing polynomials [closed]

asked 2014-07-26 11:00:15 +0100

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.

edit retag flag offensive reopen merge delete

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 2014-07-26 12:14:31 +0100

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)
edit flag offensive delete link more

Comments

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

jjack gravatar imagejjack ( 2014-07-26 13:34:05 +0100 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-26 11:00:15 +0100

Seen: 508 times

Last updated: Jul 26 '14