Arclength as a function

Dr. Therese Shelton
Southwestern University
Georgetown, TX

Caution:  remember that you may have to tweak some things if you change functions or windows.

a second function

Set-up

Remember, the curve should be a simple smooth path.

Clear[x,y,tmin,tmax, xmin,xmax,ymin,ymax];
x[t_]:=Cos[t];
 y[t_]:=3/50t*Sin[t];
tmin=1.25; 
tmax=9.0;
xmin = -1.25; xmax=1.25;
ymin=-1.25;ymax=1.25;  
Clear[colorr]
colorr=RGBColor[1.,0.,0.];

Clear[plotAll];
plotAll =ParametricPlot[     {x[t],y[t]},           {t,tmin,tmax},
 PlotRange->{    {xmin,xmax},{ymin,ymax}    }  ,
AspectRatio->Automatic,PlotStyle->{colorr}   ]

numerical and visual aid

Clear[numberIntervals,deltat];

numberIntervals = 10;

deltat=(tmax-tmin)/numberIntervals

The full calculation of the actual arclength function
arclength[t_]:= (∫_tmin^t)(Sqrt[(((x'[u]))^2) + (((y'[u]))^2)])du
takes much too long.  We replace with numerical integration.

Clear[NumArclength];
NumArclength[t_]:=NIntegrate[ (Sqrt[(((x'[u]))^2) + (((y'[u]))^2)]), {u,tmin,t}]

Table[{t,NumArclength[t]}, {t, tmin, tmax,deltat}]//TableForm

Since arclength is a non-decreasing function, its largest value will occur at the largest t-value

Clear[ybig];
ybig =  NumArclength[tmax]

Clear[p1,p2]
p1 = Plot[
NumArclength[t],{t,tmin,tmax},
PlotRange-> {{tmin,tmax},{0,ybig}},Axes->True,AxesLabel->{" t"," arclength[t]"}
        ]

p2 = Plot[
NumArclength[t],{t,tmin,tmax},
PlotRange-> {{tmin,tmax},{0,ybig}},Axes->True,AxesLabel->{" t"," arclength[t]"}
        ]

Manipulate[Show[GraphicsRow[{
Show[p1,
Graphics[{  {colorr,PointSize[.04],Point[{q,NumArclength[q]}] }    }],
PlotRange-> {{tmin,tmax},{0,ybig}},Axes->True,AxesLabel->{" t"," arclength[t]"}],
ParametricPlot[ 
{x[t],y[t]},{t,tmin,q},
PlotStyle-> { { colorr,Thickness[.02] } },
PlotRange-> {{xmin,xmax},{ymin,ymax}},Axes->True,AspectRatio->Automatic,
AxesLabel->{" x[t]","y[t]"}]
}]],{q,tmin+deltat,tmax,deltat}]