ClearAll;
$DefaultFont = {"Times-Roman",10};
Needs["Statistics`DataManipulation`"];
Needs["Graphics`Graphics`"];
njags = 100;
text1 = Graphics[Text["0",{-0.03,0}]];
text2 = Graphics[Text["x",{1.03,0}]];
text3 = Graphics[Text["y",{0,0.065}]];
text4 = Graphics[Text["a",{0.27,-0.003}]];
text5 = Graphics[Text["c",{0.51,-0.003}]];
text6 = Graphics[Text["b",{0.79,-0.003}]];
axesx = Graphics[Line[{{0,0},{1,0}}]];
axesy = Graphics[Line[{{0,0},{0,0.06}}]];
g[x_]:= x^2(1-x)^2 + 0.02;

poly[a_,b_]:= Join[Table[{a+i(b-a)/njags,g[a+i(b-a)/njags]},
				  {i,0,njags}],{{b,0},{a,0}}];
shade[a_,b_,c_]:= Graphics[{GrayLevel[c],Polygon[poly[a,b]]}];
	 


graph = Graphics[Plot[g[x],{x,0,0.9}]];
fill = {shade[0.27,0.51,0.65],shade[0.51,0.79,0.35]};
plot = Show[axesx,axesy,text1,text2,text3,text4,text5,text6,fill,graph];
			
Show[GraphicsArray[{{plot}}],
	PlotLabel->"                         Figure 8.2\n\n
	Area(f,[a,c]) + Area(f,[c,b]) = Area(f,[a,b])"]