hello can anyone help me with an infinite series problem? i've tried it but i'm kinda stuck

1 view (last 30 days)
function T = sum(n = 1 to infty)((-1)^{n-1}(n^2+1))/(2^n)
x=input('enter the x value: ');
epsilon_s=(0.5*10^(2-n));
epsilon=100;
iteration=1;
eps_array(1) = 0;
while epsilon>epsilon_s
(i'm stuck on this step)

Answers (1)

Ameer Hamza
Ameer Hamza on 21 Apr 2020
Edited: Ameer Hamza on 21 Apr 2020
Try this. It finds the sum symbolically.
syms n
term = (-1)^(n-1)*(n^2+1)/2^n;
y = symsum(term, n, 1, inf);
  9 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!