hello can anyone help me with an infinite series problem? i've tried it but i'm kinda stuck
1 view (last 30 days)
Show older comments

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)
0 Comments
Answers (1)
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
Walter Roberson
on 22 Apr 2020
That is what is expected from the code. Your code does not ask to display any results.
disp(y)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
