Symbolic Summation

You can compute symbolic summations, when they exist, by using the symsum command. For example, the p-series

1+122+132+...

sums to π2/6, while the geometric series

1 + x + x2 + ...

sums to 1/(1 – x), provided |x|<1. These summations are demonstrated below:

syms x k
s1 = symsum(1/k^2, 1, inf)
s2 = symsum(x^k, k, 0, inf)
s1 =
pi^2/6

s2 =
piecewise([1 <= x, Inf], [abs(x) < 1, -1/(x - 1)])
Was this topic helpful?