Integration

Clear[f,F]

f[x_]=Exp[-x^2];

Integrate[f[x],{x,0,1}]

N[%,10]

g[x_]=0.5Sqrt[Pi]Erf[x];

gplot=Plot[g[x],{x,0,2}]

fx=Plot[f[x],{x,0,2},PlotStyle->{RGBColor[1,0,0]}]

Show[fx,gplot]

Limit[g[x],x->Infinity]

N[%,10]

h=(1-0)/10;

Rektangel metoden

JR=h(f[0.5h]+f[1.5h]+f[2.5h]+f[3.5h]+f[4.5h]+f[5.5h]+f[6.5h]+
f[7.5h]+f[8.5h]+f[9.5h])

Trapez metoden

JT=h(0.5f[0]+f[h]+f[2h]+f[3h]+f[4h]+f[5h]+f[6h]+
f[7h]+f[8h]+f[9h]+0.5*f[1])

N[%,10]

Simpson metoden

JS=h(f[0]+4f[h]+2f[2h]+4f[3h]+2f[4h]+4f[5h]+2f[6h]+
4f[7h]+2f[8h]+4f[9h]+f[1])/3

N[%,10]

N[g[1]-JR]

N[g[1]-JT]

N[g[1]-JS]