Limits

Needs["Graphics`Colors`"];

The study of LIMITS is essential for an understanding of calculus.  We first met limits in geometry, where the area of a circle was found by calculating the area of inscribed polygons.

I.    The area of a circle

Below is a circle of radius 1.  The area of an inscribed square is 2.  The area of an inscribed octogon is 2.83.  If we continue to inscribe n-sided polygons, as n gets larger, the polygon looks more and more like the circle.

Clear[r,cir,ang,verts,poly,area,theta];
r=1;                          (* radius of circle = 1 *)
cir=Graphics[{RGBColor[0,0,0],
              Thickness[0.001],
              Circle[{0,0},r]}];
ang[x_,n_]:=x 2 Pi/n;         (* angle function for n-gon *)
Do[
    (*Calculate coords of verts of n-gon *)
    verts=Table[{r Cos[ang[a,n]], r Sin[ang[a,n]]},{a,0,n}];
    theta=Pi / n;
    area=N[n Sin[theta] Cos[theta],3];  (* area of n-gon *)
    poly=Graphics[{RGBColor[1,0,0],
                   Polygon[verts],
                   RGBColor[.2,.2,.2],
                   Text["Sides:",{-0.6,1.1},{1,0}],
                   Text[n,{-0.5,1.1},{-1,0}],
                   Text["Area:",{0.5,1.1},{1,0}],
                   Text[area, {0.6,1.1},{-1,0}]
                  }];
    Show[poly,cir,
         AspectRatio->Automatic,
         PlotRange->{{-1.1,1.1},{-1.1,1.5}}],
  {n,3,16}
  ];

We already know the area of a circle of radius r is `r€, so in this case where r=1, the area is `.  We see that the area of the inscribed n-sided polygons in the above approaches ` as n gets larger.

Q:  How many sides will we need before the area of the inscribed n-gon is equal to `?

Answer:  An infinite number of sides would be required.  However, it is possible to get "as close as we wish," merely by making n as large as "necessary."  This is the crucial idea behind limits.  We may never actually reach the desired number, but instead can get "very close."

II.   The speed of a rocket

A rocket is fired at a target 64 km away.  The function that describes the rocket's position is given by:  f(t) = í¢⁄ t€.  Where the distance is measured in kilometers and t is measured in minutes.

Clear[f,t,curve,pts];
f[t_]=(1/4) t^2;
tdistance=64;
pts={};
Do[pts=Append[pts,{t,f[t]}];
   lp=ListPlot[pts,
               DisplayFunction->Identity,
	           PlotRange->{{0,18},{0,80}},
	           PlotStyle->{Blue,PointSize[0.02]}];
   Show[lp,
        DisplayFunction->$DisplayFunction,
        AxesLabel->{"Minutes","kilometers"}],
   {t,0,18,2}
  ];
  curve=Plot[{f[t]},{t, 0, 18},
              PlotStyle->{Red},
              DisplayFunction->Identity,
              PlotRange->{{0,18},{0,80}}];
  Show[lp,curve,
       DisplayFunction->$DisplayFunction,
       AxesLabel->{"Minutes","kilometers"}];

Q1:  How long will it take the rocket to reach the target?

Solve[f[t]==tdistance,t]

Since the negative answer makes no sense, then the answer is 16 minutes, or í¢⁄ (16)€ = 64.

Clear[l1,p1,p2,p3];
ttime=16;
p1={0,tdistance};
p2={ttime,f[ttime]};
p3={ttime,0};
l1=Graphics[Line[{p1,p2,p3}],
               DisplayFunction->Identity];
Show[curve,l1,
     Graphics[{Text["Time req'd:",{3,40}],
               Text[ttime,{6.5,40}],
               Text["min",{7.8,40}]}],
     DisplayFunction->$DisplayFunction,
     PlotRange->{{0,18},{0,80}},
     AxesLabel->{"Minutes","kilometers"}];

Q2:  What is the average velocity of the rocket during its entire flight.

The formula for calculating average velocity is v=d/t.

Clear[starttime,timediff,v,l1,l2,p1,p2,p3,cnct];
starttime=0;
tdistance=f[ttime]-f[starttime];
timediff=ttime-starttime;
v=tdistance/timediff;
p1={starttime,f[starttime]};
p2={ttime,f[starttime]};
p3={ttime,f[ttime]};
l1=Graphics[Line[{p1,p2,p3}],
               DisplayFunction->Identity,
               PlotRange->{{0,18},{0,80}}];
l2=Plot[Fit[{p1,p3},{1,x},{x}],{x,0,18},
        DisplayFunction->Identity,
        PlotStyle->{Blue,Thickness[0.04]},
        PlotRange->{{0,18},{0,80}}];
Show[curve,l1,l2,
     Graphics[{Text["Velocity:",{5,50}],
               Text[v,{8,50}]}],
     DisplayFunction->$DisplayFunction,
     AxesLabel->{"Minutes","kilometers"}];

The answer is 4 km/min.

Q3:  What is the average velocity during the last 8 minutes of the flight?

Clear[starttime,timediff,v,l1,l2,p1,p2,p3,cnct];
starttime=8;
tdistance=f[ttime]-f[starttime];
timediff=ttime-starttime;
v=tdistance/timediff;
p1={starttime,f[starttime]};
p2={ttime,f[starttime]};
p3={ttime,f[ttime]};
l1=Graphics[Line[{p1,p2,p3}],
               DisplayFunction->Identity,
               PlotRange->{{0,18},{0,80}}];
l2=Plot[Fit[{p1,p3},{1,x},{x}],{x,0,18},
        DisplayFunction->Identity,
        PlotStyle->{Blue,Thickness[0.04]},
        PlotRange->{{0,18},{0,80}}];
Show[curve,l1,l2,
     Graphics[{Text["Velocity:",{5,50}],
               Text[v,{8,50}]}],
     DisplayFunction->$DisplayFunction,
     AxesLabel->{"Minutes","kilometers"}];

The answer is 6 km/min.  The average velocity during the entire flight and the average during the second half of the flight are not the same.  The rocket's velocity seems to be changing during the flight.

Q4:  What is the rocket's velocity at impact?

This is a trickier question than before because the formula we are using gives an average velocity not an instantaneous velocity.  We shall look at the average velocity from starting times that get closer and closer to 16.

Clear[starttime,pts];
pts={};
starttime=0;
Do[
   Clear[p1,p2,p3,tdistance,timediff,v,l1,l2,spots];
   starttime=starttime+(ttime-starttime)/2;
   tdistance=f[ttime]-f[starttime];
   timediff=ttime-starttime;
   v=tdistance/timediff;
   p1={starttime,f[starttime]};
   p2={ttime,f[starttime]};
   p3={ttime,f[ttime]};
   pts=Append[pts,{starttime,v}];
   l1=Graphics[Line[{p1,p2,p3}],DisplayFunction->Identity];
   l2=Plot[Fit[{p1,p3},{1,x},{x}],{x,0,18},
           DisplayFunction->Identity,
           PlotStyle->{Blue,Thickness[0.1]}];
   spots=ListPlot[{p1,p3},
                 PlotStyle->{Green,PointSize[0.02]},
                 DisplayFunction->Identity];         
   Show[curve,l1,l2,spots,
        Graphics[{Text["Velocity:",{5,50}],
                  Text[N[v,3],{8,50}],
                  Text["Starting time:",{6,70}],
                  Text[N[starttime,3],{10,70}]}],
        DisplayFunction->$DisplayFunction,
        AxesLabel->{"Minutes","kilometers"}];,
   {n,0,5}
   ];
   TableForm[pts//N]

From the graph or the table, you can see that as the starting time gets closer to 16 the average velocity approaches 8 km/min.  Although the average velocity will never reach 8 km/min, the velocity can be made as close to 8 km/min as we desire only by picking our start time as close to16 minutes as necessary.