Thursday, December 26, 2019

Exploration of Function Integration


f1=2^x; f2=2x-x^2; x1=0; x2=2; y1=0; y2=4;
s=Integrate[f1-f2,{x,x1,x2}];
l=Join[Prepend[Table[{.02i,2^(.02*i)},{i,100}],{0,0}],
Table[{.02i,.04i-.0004i^2},{i,100,0,-1}]];
pp1=Plot[{f1,f2},{x,x1,x2},Filling->True,
FillingStyle->RGBColor["#3636ff"],
PlotStyle->Directive[RGBColor["silver"],Thickness[.02]],
Frame->True,AspectRatio->1,
Epilog->{Directive[RGBColor["silver"],Thickness[.02]],
Line[{{{0,0},{0,1}},{{2,4},{2,0}}}]}];
pp3=RegionPlot[f2<y<f1,{x,x1,x2},{y,y1,y2},
Mesh->All,PlotStyle->RGBColor["#3636ff"],
MeshStyle->Directive[RGBColor["silver"],Thickness[.001]]];
pp2=Graphics[{RGBColor["#3636ff"],
EdgeForm[{RGBColor["silver"],Thickness[.02]}],
Polygon[l]},AspectRatio->1,Frame->True,PlotLabel->s->N[s]];                                   
{pp1,pp2,pp3}


No comments:

Post a Comment