Ask Your Question

Summing polynomials [closed]

asked 2014-07-26 04:00:15 -0500

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 06:50:15.670658

1 answer

Sort by » oldest newest most voted

answered 2014-07-26 05:14:31 -0500

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


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

jjack gravatar imagejjack ( 2014-07-26 06:34:05 -0500 )edit

Question Tools

1 follower


Asked: 2014-07-26 04:00:15 -0500

Seen: 91 times

Last updated: Jul 26 '14