f[x_]:=Sin[Pi x]^2
Plot[f[x],{x,0,1}]
Res=Integrate[f[x],{x,0,1}]
n:=1000;S:=0; R=Table[0,{n}];  For[k=1,k≤n, k++,{ S=S+f[RandomReal[]]; R[[k]]=(S/k-Res)/Res; }]
ListPlot[R]

f[x_]:=Sin[Cos[x^3+2x]]
Plot[f[x],{x,0,1}]
Res=N[Integrate[f[x],{x,0,1}]]
n:=1000;S:=0; R=Table[0,{n}];  For[k=1,k≤n, k++,{ S=S+f[RandomReal[]]; R[[k]]=(S/k-Res)/Res; }]
ListPlot[R]