The Maclaurin series expansion for the natural log of 1 x u

The Maclaurin series expansion for the natural log of (1 + x) up to some order n is given by 1n (1+x) = x - x^2/2 + x^3/3 - x^4/4 + x^5/5 - ...x^n/n, for |x|

Solution

function approx=natlogApprox(x,n)

approx=0.0

i=1

%LABEL abc

if(i<=n)

if(i%2==1)

approx=approx+((x^i)/i)

end

if(i%2==0)

approx=approx-((x^i)/i)

end

i=i+1

if(i<=n)

goto(\'abc\')

end

end

 The Maclaurin series expansion for the natural log of (1 + x) up to some order n is given by 1n (1+x) = x - x^2/2 + x^3/3 - x^4/4 + x^5/5 - ...x^n/n, for |x| S

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site