Quiet@Remove["Global`*"];
$HistoryLength=2;
SetDirectory[NotebookDirectory[]];

vyr[x_]:=a*(x^2)+b*x+c;
rce={vyr[x0-Δx]==fMinus,vyr[x0]==f0,vyr[x0+Δx]==fPlus};
dosabc=Solve [rce,{a,b,c}][[1]];
proklad=vyr[x]/.dosabc;
Integrate[proklad,{x,x0-Δx,x0+Δx}];

mySimpson[{fce_,n_?OddQ,{x1_,x2_}}]:=Module[{xka,Δx,funkcniHodnoty,trojice},
Δx=((x2-x1)/(n-1));
xka=Range[x1,x2,Δx];
funkcniHodnoty=fce/@xka;
trojice=Partition[funkcniHodnoty,3,2];
((Δx)/3.)*Total[{1,4,1}.#&/@trojice]
];
mySimpson[{Sin,3,{0.,(Pi/2)}}]

err[par:{fce_,n_?OddQ,{x1_,x2_}}]:=Module[{exact,simpson},exact=Integrate[fce[x],{x,x1,x2}];
simpson=mySimpson[par];
((exact-simpson)/exact)
];

f1[x_]:=(x^3)+2(x^2)+3x+5;
err[{f1,3,{0.,(Pi/2)}}]

errA4[a4_]:=err[{f1[#]+a4*((#)^4)&,13,{0.,(Pi/2)}}];
dat=Table[{a4,errA4[a4]},{a4,-10,10,0.5}];
ListPlot[dat];