Write a program to approximate the innite series k0 1 2k 14
Write a program to approximate the innite series k=0 (1/ (2k + 1)^4).
i need matlab or octave code
Solution
You can not add infinite number of terms. If the sum is a converging sum, then you can add a large number of terms (e.g. n=5000) to get a satisfactory result.
n=5000;
format long
series1=0;
for i=1:n
p=1/((2*i+1)^4);
series1=series1+p;
end
used format long and compared.
n=5000
1.014678031604056
n=50000
1.014678031604056
