Finding Arc Length

Let's do the usual calculus thing and approximate arc length using line segments. We'll use the curve below.


  
  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}


  curve=ParametricPlot[r[t],{t,0,5}];


  
  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.


  l=Table[norm[r[i+1/n]-r[i]],{i,0,5-1/n,1/n}];
  N[Sum[l[[i]],{i,1,Length[l]}]]

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:


  r[t_]:={Cos[t],Sin[t]}


  ParametricPlot[r[t],{t,0,2 Pi},AspectRatio->Automatic];


  Integrate[norm[D[r[t],t]],{t,0,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.


  r[t_]:={2 Cos[t],2 Sin[t],t^2}


  ParametricPlot3D[r[t],{t,0,2 Pi}];


  D[r[t],t]


  norm[D[r[t],t]]


  Simplify[%]


  Integrate[Sqrt[4+4 t^2],{t,0,2 Pi}]

Here I went through all the steps for you. You could just use:


  arclength[r,0,2 Pi]

Up to Arc Length