1. 用1阶至4阶Newton-Cotes公式计算积分 程序: function I = NewtonCotes(f,a,b,type) % syms t; t=findsym(sym(f)); I=0; switch type case 1, I=((b-a)/2)*(subs(sym(f),t,a)+subs(sym(f),t,b)); case 2, I=((b-a)/6)*(subs(sym(f),t,a)+4*subs(sym(f),t,(a+b)/2)+... subs(sym(f)…