Finding Arc Length
In[27]:=
Clear[x,y,f,r,curve]
x[t_]:=t^2
y[t_]:=t
r[t_]:={x[t],y[t]}
f[x_,y_]:={2 x y,x^3}
In[28]:=
curve=ParametricPlot[r[t],{t,0,5}];

In[29]:=
n=1;
lines=vectorPlot[Table[r[i],{i,0,5-1/n,1/n}],
Table[r[i+1/n],{i,0,5-1/n,1/n}]];
Show[lines,curve];

Notice how this is a decent approximation to the curve. The sum of the lengths of these lines should be a pretty good approximation of the arc length of the curve.
In[30]:=
l=Table[norm[r[i+1/n]-r[i]],{i,0,5-1/n,1/n}];
N[Sum[l[[i]],{i,1,Length[l]}]]
Out[30]=
25.802
Repeat this a few times by re-evaluating these two groups of command cells, but increase n each time.
As n increases, the line segments get smaller and smaller and approximate a small piece of the length of a curve, call it ds. (The variable s is usually taken to represent arc length.)
Using the Pythagorean theorem, we see that
(dx)^2 + (dy)^2 = (ds)^2, so
ds=Sqrt[ (dx)^2 + (dy)^2 ] or written in another way
ds=Sqrt[ x'(t)^2 + y'(t)^2 ] = ||r'(t)||, if r(t)=x(t)i + y(t)j.
In true calculus fashion, adding up these small pieces (in the limit) becomes integration! We have the following:
![]()
If r(t)=x(t)i+y(t)j+z(t)k from a to b is a continuously differentiable curve, the length of the curve is given by Integral from a to b of ||r'(t)|| with respect to t. To make this seem reasonable, let's look at the following:
In[31]:=
r[t_]:={Cos[t],Sin[t]}
In[32]:=
ParametricPlot[r[t],{t,0,2 Pi},AspectRatio->Automatic];

In[33]:=
Integrate[norm[D[r[t],t]],{t,0,2 Pi}]
Out[33]=
2 Pi
I hope that was what you expected!
I have made this a Mathematica function in the
"initialization.ma" notebook. The definition is
arclength[r_,a_,b_]:=Integrate[norm[D[r[#],#]],{#,a,b}]
Let's try another one.
In[34]:=
r[t_]:={2 Cos[t],2 Sin[t],t^2}
In[35]:=
ParametricPlot3D[r[t],{t,0,2 Pi}];

In[36]:=
D[r[t],t]
Out[36]=
{-2 Sin[t], 2 Cos[t], 2 t}
In[37]:=
norm[D[r[t],t]]
Out[37]=
2 2 2
Sqrt[4 t + 4 Cos[t] + 4 Sin[t] ]
In[38]:=
Simplify[%]
Out[38]=
2
Sqrt[4 + 4 t ]
In[39]:=
Integrate[Sqrt[4+4 t^2],{t,0,2 Pi}]
Out[39]=
2
2 Pi Sqrt[1 + 4 Pi ] + ArcSinh[2 Pi]
Here I went through all the steps for you. You could just use:
In[40]:=
arclength[r,0,2 Pi]
Out[40]=
2
2 Pi Sqrt[1 + 4 Pi ] + ArcSinh[2 Pi]
Up to Arc Length