MATLAB: Character vectors and strings in the first argument can only specify a variable or number. To evaluate character vectors and strings representing symbolic expressions, use ‘str2sym’.

syms

Best Answer

syms x n
f2 = x^n ;
symsum(f2/factorial(n),n,0,inf)