Question: if condition inside eval and sum

I really want to use if condition inside of eval and sum, example as below:

sum(eval(y=x^(j),(if j=1 then x=2 else x=3 fi)),j=1..2)

The reason is: the value of x to be evaluated depends on the value of j which differs inside of the sum (in the context of B-spline functions).

Any lights? Thanks,

Please Wait...