(*^
::[ Information =
"This is a Mathematica Notebook file. It contains ASCII text, and can be
transferred by email, ftp, or other text-file transfer utility. It should
be read or edited using a copy of Mathematica or MathReader. If you
received this as email, use your mail application or copy/paste to save
everything from the line containing (*^ down to the line containing ^*)
into a plain text file. On some systems you may have to give the file a
name ending with ".ma" to allow Mathematica to recognize it as a Notebook.
The line below identifies what version of Mathematica created this file,
but it can be opened using any other version as well.";
FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2";
MacintoshStandardFontEncoding;
fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times";
fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times";
fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times";
fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times";
fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times";
fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times";
fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier";
fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier";
fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier";
fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier";
fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier";
fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier";
fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva";
fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = leftheader, inactive, L2, 12, "Times";
fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times";
fontset = leftfooter, inactive, L2, 12, "Times";
fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times";
fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times";
paletteColors = 128; automaticGrouping; currentKernel;
]
:[font = input; preserveAspect]
ClearAll;
$DefaultFont = {"Times-Roman",10};
Needs["Statistics`DataManipulation`"];
Needs["Graphics`Graphics`"];
njags = 100;
text1 = Graphics[Text["0",{0.15,0}]];
text2 = Graphics[Text["x",{0.9,0}]];
text4 = Graphics[Text["a",{0.27,-0.01}]];
text6 = Graphics[Text["b",{0.79,-0.01}]];
axesx = Graphics[Line[{{0.18,0},{0.85,0}}]];
axesy = Graphics[Line[{{0.18,0},{0.18,0.25}}]];
zero[x_]:= 0;
g[x_]:= 0.1 - x^2(1-0.9x)^2;
h[x_]:= x^2(1-x)^2 + 0.02;
twice[x_]:= 2 g[x];
thrice[x_]:= 3 g[x];
quad[x_]:= 4 g[x];
poly[a_,b_,v_,w_]:= Polygon[Join[Table[{a+i(b-a)/njags,v[a+i(b-a)/njags]},
{i,0,njags}],
Reverse[Table[{a+i(b-a)/njags,w[a+i(b-a)/njags]},
{i,0,njags}]]]];
shade[a_,b_,c_,v_,w_]:= Graphics[{GrayLevel[c],poly[a,b,v,w]}];
graph1 = Graphics[Plot[g[x],{x,0.2,0.85}]];
fill1 = {shade[0.27,0.79,0.35,zero,g],shade[0.27,0.79,1.0,g,thrice]};
plot1 = Show[axesx,axesy,text1,text2,text4,text6,
fill1,graph1,PlotLabel->"y = g(x)"];
graph2 = Graphics[Plot[twice[x],{x,0.2,0.85}]];
fill2 = {shade[0.27,0.79,0.35,zero,g],shade[0.27,0.79,0.65,g,twice],shade[0.27,0.79,1.0,twice,thrice]};
plot2 = Show[axesx,axesy,text1,text2,text4,text6,
fill2,graph2,PlotLabel->"y = 2g(x)"];
graph3 = Graphics[Plot[thrice[x],{x,0.2,0.85}]];
fill3 = {shade[0.27,0.79,0.35,zero,g],shade[0.27,0.79,0.65,g,twice],shade[0.27,0.79,0.35,twice,thrice]};
plot3 = Show[axesx,axesy,text1,text2,text4,text6,
fill3,graph3,PlotLabel->"y = 3g(x)"];
graph4 = Graphics[Plot[quad[x],{x,0.2,0.85}]];
fill4 = {shade[0.27,0.79,0.35,zero,g],shade[0.27,0.79,0.65,g,twice],
shade[0.27,0.79,0.35,twice,thrice],shade[0.27,0.79,0.65,thrice,quad]};
plot4 = Show[axesx,axesy,text1,text2,text4,text6,
fill4,graph4,PlotLabel->"y = 4g(x)"];
Show[GraphicsArray[{{plot1, plot2}, {plot3, plot4}}],
PlotLabel->" Figure 9.4\n\n
Area(kg,[a,b]) = kArea(g,[a,b]) for k = 2,3,4"]
^*)