line_int.c integrate to find area Numerical quadrature, x=1 to x=3 Using trapezoidal method f1(x)=x+2.0 np=4, h=0.666667 4 function evaluations computed area=8, exact area=8, error=0 f2(x)=x*x+2.0*x+3.0 np=4, h=0.666667 4 function evaluations computed area=22.8148, exact area=22.6667, error=0.148148 f2(x)=x*x+2.0*x+3.0 np=8, h=0.285714 8 function evaluations computed area=22.6939, exact area=22.6667, error=0.0272109 f2(x)=x*x+2.0*x+3.0 np=16, h=0.133333 16 function evaluations computed area=22.6726, exact area=22.6667, error=0.00592593 f3(x)=x*x*x+2.0*x*x+3.0*x+4.0 np=4, h=0.666667 4 function evaluations computed area=43.8889, exact area=57.3333, error=-13.4444 f3(x)=x*x*x+2.0*x*x+3.0*x+4.0 np=16, h=0.133333 16 function evaluations computed area=57.3807, exact area=57.3333, error=0.0474074 f3(x)=x*x*x+2.0*x*x+3.0*x+4.0 np=64, h=0.031746 64 function evaluations computed area=57.336, exact area=57.3333, error=0.00268749 fe(x)=exp(x) np=4, h=0.666667 4 function evaluations computed area=32.5898, exact area=17.3673, error=15.2226 fe(x)=exp(x) np=16, h=0.133333 16 function evaluations computed area=17.393, exact area=17.3673, error=0.0257216 fe(x)=exp(x) np=64, h=0.031746 64 function evaluations computed area=17.3687, exact area=17.3673, error=0.00145855 Using Gauss Legendre method f1(x)=x+2.0 np=4 4 function evaluations computed area=8, exact area=8, error=-4.79616e-14 f2(x)=x*x+2.0*x+3.0 np=4 4 function evaluations computed area=22.6667, exact area=22.6667, error=-1.45661e-13 f3(x)=x*x*x+2.0*x*x+3.0*x+4 np=4 4 function evaluations computed area=57.3333, exact area=57.3333, error=-3.83693e-13 fe(x)=exp(x) np=4 4 function evaluations computed area=17.3673, exact area=17.3673, error=-2.18074e-06 fe(x)=exp(x) np=8 8 function evaluations computed area=17.3673, exact area=17.3673, error=-1.20792e-13