<

Question: symbolic summation: sum with if/piecewise

 Maple readily turns partial sum 1+sum(alpha^2, j = 1 .. l-1) into expression 1+(l-1)*alpha^2. 

I need to replace alpha with a function c(j) such that c(0)=1 and c(j)=alpha for j=1,2,3,...and to compute sum(c(j)^2, j = 0 .. l-1) symbolically to get the above expression. This is the simplest special case only and in general c(j) is 1 for j=0 and some expression involving j and alpha, beta, etc for j::posint.

I tried several thing, e.g., c := proc (j) if j = 0 then return 1 else return alpha end if end proc but then sum(c(j)^2, j = 0 .. l-1) returns l*alpha^2, which is not what I want. I tried to define c(j) via piecewise or `if`, but all to no avail. How do I do this symbolically? Thanks.  

 

Please Wait...