Calculus with curves

Basics

Here’s a curve x that is called the twisted cubic. (Feel free to change x to some other curve.)

Clear[t];
x = {t, t^2, t^3};
ParametricPlot3D[x, {t, -1, 1}]

Here’s the velocity v.

v = D[x, t]
ParametricPlot3D[v, {t, -1, 1}]

Here’s the acceleration a.

a = D[v, t]
ParametricPlot3D[a, {t, -1, 1}]

Arc length

If we imagine a curve x to be the trajectory of a particle or other object, then arc length is the distance travelled by that object. It is the integral of speed.

Clear[t];
x = {t, t^2, t^3};
v = D[x, t];
speed = Sqrt[v . v]
Plot[speed, {t, -1, 1}]

In most cases, it is not possible to symbolically integrate the speed. For the twisted cubic, Mathematica thinks for a little while and then gives up.

Integrate[speed, {t, -1, 1}]

Fortunately, we can get an approximate answer by numerically integrating.

NIntegrate[speed, {t, -1, 1}]

Here’s another example, where we compute the arc length of an ellipse. It’s not easy. The exact answer is expressible in terms of elliptic functions (so named because of their role in this problem). Fortunately, Mathematica can give us an approximate numerical answer rapidly.

x = {Cos[t], 5 Sin[t]};
v = D[x, t];
speed = Sqrt[v . v]
Integrate[speed, {t, 0, 2 Pi}]
NIntegrate[speed, {t, 0, 2 Pi}]

By the way, the concepts of velocity, acceleration, speed, and arc length work in any dimension. But the concepts in the folllowing sections are specific to three-dimensional space.

Curvature and torsion in (R^3)

Curvature is a non-nonnegative number that measures how curved a three-dimensional curve is. It’s the magnitude of the rate of change of the unit tangent vector with respect to arc length. There are a couple of other ways to compute it.

Clear[t];
x = {t, t^2, t^3};
v = D[x, t];
a = D[v, t];
speed = Simplify[Sqrt[v . v]];
vCrossA = Simplify[Cross[v, a]];
curvature = Simplify[Sqrt[vCrossA . vCrossA] / speed^3]
Plot[curvature, {t, -1, 1}]

Torsion is a number that measures how twisty the curve is. It can be positive, negative, or zero. It is undefined where the curvature is zero.

torsion = Simplify[(vCrossA . D[a, t]) / (vCrossA . vCrossA)]
Plot[torsion, {t, -1, 1}]

These concepts are best understood in terms of the following section. Roughly speaking, curvature is how quickly the velocity vector rotates, and torsion is how quickly the binormal vector rotates.

Frenet frame in (R^3)

The Frenet frame of a three-dimensional curve consists of the unit tangent vector t, unit normal vector n, and unit binormal vector b. It serves as a moving coordinate system, sometimes simplifying calculations along the trajectory. I’ve written a little bit of Mathematica code to compute this frame numerically, for any curve x at any chosen time (Subscript[t, 0]). Activate the following cell to load this code into Mathematica’s memory.

Clear[frame, t]
frame[x_, t0_] :=
Module[{v, tangent, normal, binormal},
v = D[x, t];
tangent = Simplify[v / Norm[v], Element[t, Reals]];normal = D[tangent, t] / Norm[D[tangent, t]];tangent = N[tangent /. {t -> t0}];normal = N[normal /. {t -> t0}];binormal = Cross[tangent, normal];{tangent, normal, binormal}];

Here is an interactive animation of the Frenet frame moving along the twisted cubic. Depending on how fast your computer is, you might have to move the slider slowly, to get a smooth response.

x = {t, t^2, t^3};
interval = {-1, 1};
Manipulate[
Show[
ParametricPlot3D[x, {t, interval[[1]], interval[[2]]}],
ParametricPlot3D[{(x /. {t -> t0}), (x /. {t -> t0}), (x /. {t -> t0})} + u frame[x, t0], {u, 0, 1}, PlotStyle->{Thick, Orange}]], 
{t0, interval[[1]], interval[[2]]}]

Here’s a fancier example: a helix winding around a torus k times.

k = 10;
x = {(2 + Cos[k t]) Cos[t], (2 + Cos[k t]) Sin[t], Sin[k t]};
interval = {0, 2 Pi};
Manipulate[
Show[
ParametricPlot3D[x, {t, interval[[1]], interval[[2]]}],
ParametricPlot3D[{(x /. {t -> t0}), (x /. {t -> t0}), (x /. {t -> t0})} + u frame[x, t0], {u, 0, 1}, PlotStyle->{Thick, Orange}]], 
{t0, interval[[1]], interval[[2]]}]

These concepts are used in aeronautics (to describe how a plane rotates as it moves along its flight path), biology (to describe how a double helix of DNA curves and twists), and other fields.