11220132066004MatlabO175.8A1007-39732013002-112-031f()=11+252(1)[-11]n=1020(2)[-11]n=1020(3)[-11]1110L10()(4)[-11]n=11252Matlab2.1n+101nnLn()Ln(j)=yjj=012nnj(j=012n)n+101nn+1n01n01nnnk=012nL0==0.2.2x1=linspace(-1,1,n);y1=1./(1+25*x1.^2);symsx;N=length(x1);L=0;fork=1:Nla=y1(k);forj=1:k-1la=la*(x-x1(j))/(x1(k)-x1(j));endforj=k+1:nla=la*(x-x1(j))/(x1(k)-x1(j));endL=L+la;end2.3110Lagrange220Lagrange11320132fplot(fun,limits)limitsfunlimitsx[xminxmax]22.412=±1L10()L20()f()=11+2Ln()f()=11+23Matlab3.1p1()=p0()+f[01](0)=f(0)++f[01](0)p2()=p1()+f[012](0)(1)[a,b]f()=f(0)+f[01](0)f[0n-1]=f[01n]+f[0n](n)f()=f(0)+f[01](0)+f[012](n)(1)++f[01n](0)(n-1)+[0n]n+1()=pn()+=Rn().pn()=f(0)+f[01](0)+f[012](n)(1)++f[01n](0)(n-1)3.2x1=linspace(-1,1,n);y1=1./(1+25*x1.^2);symsx;P=y1(1)+(x-x1(1))*(y1(2)-y1(1))/(x1(2)-x1(1));fork=3:na1=1;fori=1:k-1a1=a1*(x-x1(i));endb=0;forj=1:ka2=1;forl=1:kifabs(l-j)0a2=(x1(j)-x1(l))*a2;endendb=y1(j)/a2+b;endP=a1*b+P;endp=collect(P);p3.3310Newton410Newton3.4(1)34=±5p10()p20()f()=11+252pn()f()=11+252(2)1234p10()p20()L10()L20()4Matlab4.1T()[-11]nk=cos212k=12nn+1k=cosk=01n[-11]4.2Matlab(1)T11()k=1:1:11;x1=cos((2*k-1)/22*pi);11420132y2=1./(1+25*x.^2);(2)matlaba=1:1:11;x1=cos((2*a-1)/22*pi);y1=1./(1+25*x1.^2);symsx;N=length(x1);L=0;fork=1:Nla=y1(k);forj=1:k-1la=la*(x-x1(j))/(x1(k)-x1(j));endforj=k+1:11la=la*(x-x1(j))/(x1(k)-x1(j));endL=L+la;end4.3f()=11+2L10()5LagrangeChebyshev4.45±15Matlab5.1S()C2[ab][jj+1]a=01n=bS()=12njyj=f(j)(j=01n)S(j)=yjj=01nS()5.2Matlabn=15;x1=linspace(-1,1,n);y1=1./(1+25*x1.^2);pp=csape(x1,y1,'variational');pp.coefsfnplt(pp)holdonfplot(inline('1/(1+25*x^2)'),[-1,1],'m')holdonlegend('','')5.3n=116n=2575.4Sn()f()[1],,.(4)[M].:,2006.[2],,.()[M].:,2006.