Maximizing the Area of Some Geometric Figures of Fixed Perimeter

Manipulate[
base=Graphics[Style[Line[{{0,0},{b,0}}],Thick,Blue]];
r=b/2;

leftsideRect=Graphics[Style[Line[{{0,0},{0,5-2r}}],Thick,Blue]];
rightsideRect=Graphics[Style[Line[{{2r,0},{2r,5-2r}}],Thick,Blue]];
topRect=Plot[5-2r,{x,0,2r},PlotStyle->{Thick,Blue},Filling->0,FillingStyle->RGBColor[.25,.75,.25],AxesOrigin->{0,0},AxesLabel->{"x",None}];
rectArea[b_]:=b/2(10-2b);

leftsideRightTri=Graphics[Style[Line[{{0,0},{0,10(b-5)/(b-10)}}],Thick,Blue]];
topRightTri=Plot[10(b-5)/(b-10)-10(b-5)/(b^2-10b)x,{x,0,2r},PlotStyle->{Thick,Blue},Filling->0,FillingStyle->RGBColor[.25,.75,.25],AxesOrigin->{0,0},AxesLabel->{"x",None}];
rightTriArea[b_]:=5b(b-5)/(b-10);

leftsideIsosc=Plot[Sqrt[(5-r)^2-r^2]/r x,{x,0,r},PlotStyle->{Thick,Blue},Filling->0,FillingStyle->RGBColor[.25,.75,.25],AxesOrigin->{0,0},AxesLabel->{"x",None}];
rightsideIsosc=Plot[2Sqrt[(5-r)^2-r^2]-Sqrt[(5-r)^2-r^2]/r x,{x,r,2r},PlotStyle->{Thick,Blue},Filling->0,FillingStyle->RGBColor[.25,.75,.25],AxesOrigin->{0,0},AxesLabel->{"x",None}];
isoscArea[b_]:=b/2*Sqrt[(5-b/2)^2-(b/2)^2];

leftsideNorman=Graphics[Style[Line[{{0,0},{0,(10-(2+Pi)r)/2}}],Thick,Blue]];
rightsideNorman=Graphics[Style[Line[{{2r,0},{2r,(10-(2+Pi)r)/2}}],Thick,Blue]];
topNorman=Plot[(10-(2+Pi)r)/2+Sqrt[r^2-(x-r)^2],{x,0,2r},PlotStyle->{Thick,Blue},Filling->0,FillingStyle->RGBColor[.25,.75,.25],AxesOrigin->{0,0},AxesLabel->{"x",None}];
normanArea[b_]:=5b-((2+Pi/2)/4)(b^2);

leftsideHouse=Graphics[Style[Line[{{0,0},{0,5-3r}}],Thick,Blue]];
rightsideHouse=Graphics[Style[Line[{{2r,0},{2r,5-3r}}],Thick,Blue]];
lefttopHouse=Plot[5-3r+Sqrt[3]x,{x,0,r},PlotStyle->{Thick,Blue},Filling->0,FillingStyle->RGBColor[.25,.75,.25],AxesOrigin->{0,0},AxesLabel->{"x",None}];
righttopHouse=Plot[5+(2Sqrt[3]-3)r-Sqrt[3]x,{x,r,2r},PlotStyle->{Thick,Blue},Filling->0,FillingStyle->RGBColor[.25,.75,.25],AxesOrigin->{0,0},AxesLabel->{"x",None}];
houseArea[b_]:=b(5-3/2 b)+Sqrt[3]b;


Switch[fig,

rect,figure={topRect,leftsideRect,rightsideRect,base};
maxb=5;
areaFunc=rectArea;
areaPlot=Plot[areaFunc[x],{x,0,maxb},PlotRange->{{0,5},Automatic},PlotLabel->Style[Row[{"area of rectangle"}],18],ImageSize->250],

rightTri,figure={topRightTri,leftsideRightTri,base};
maxb=5;
areaFunc=rightTriArea;
areaPlot=areaPlot=Plot[areaFunc[x],{x,0,maxb},PlotRange->{{0,5},Automatic},PlotLabel->Style[Row[{"area of right triangle"}],18],ImageSize->250],

isosc,figure={leftsideIsosc,rightsideIsosc,base};
maxb=5;
areaFunc=isoscArea;
areaPlot=Plot[areaFunc[x],{x,0,maxb},PlotRange->{{0,5},Automatic},PlotLabel->Style[Row[{"area of isosceles triangle"}],18],ImageSize->250],


norm, figure={topNorman,base,leftsideNorman,rightsideNorman};
maxb=20/(2+Pi);
If[b>maxb,b=2];
areaFunc=normanArea;
areaPlot=Plot[areaFunc[x],{x,0,maxb},PlotRange->{{0,5},Automatic},PlotLabel->Style[Row[{"area of Norman window"}],18],ImageSize->250],

house, figure={lefttopHouse,righttopHouse,leftsideHouse,rightsideHouse,base};
maxb=10/3;
If[b>maxb,b=2];
areaFunc=houseArea;
areaPlot=Plot[areaFunc[x],{x,0,maxb},PlotRange->{{0,5},Automatic},PlotLabel->Style[Row[{"area of side of house"}],18],ImageSize->250]
];

pointOnCurve=Graphics[{PointSize[Large],RGBColor[.25,.75,.25],Point[{b,areaFunc[b]}]}];

Text@Pane[Row[{Show[figure,Axes->True,PlotRange->{{0,5},{0,5}},AspectRatio->1,ImageSize->300],"",Column[{Show[areaPlot,pointOnCurve],"",Style[Row[{Style["x",Italic]," = ",If[MachineNumberQ@b,NumberForm[b,{6,4}],b]}],24],Style[Row[{"area = ",If[MachineNumberQ@areaFunc[b],NumberForm[areaFunc[b],{6,4}],areaFunc[b]]}],24]}]}],ImageSize->{560,320}],
{{fig,rect,"figure"},{rect->"rectangle",rightTri->"right triangle",isosc->"isosceles triangle",norm->"Norman window",house->"side of house"},ControlType->PopupMenu},
{{b,2,"length of base, x"},0.0001,Dynamic[maxb]},TrackedSymbols->True]

This Demonstration illustrates a common type of max-min problem from a Calculus I course—that of finding the maximum area of a geometric figure of fixed perimeter. The figures available are a rectangle, a right triangle, an isosceles triangle, a Norman window (a rectangle topped by a semicircle), and a "side view of a house" (a rectangle topped by an equilateral triangle). The perimeter is 10 units for each figure.

Contributed by: Marc Brodie (Wheeling Jesuit University)