Calculus with curves

Multivariable Calculus, Math 211, Carleton College, Fall 2023, Joshua R. Davis, jdavis@carleton.edu

Basics

Here’s a curve x, which is called the twisted cubic. The manipulator animates how this curve is traced out by a particle moving through space. You’ve seen this kind of thing in earlier notebooks. What’s new in this notebook is that the manipulator also shows the velocity vector v of that particle.

Clear[t];
x = {t, t^2, t^3};
Manipulate[Show[
ParametricPlot3D[x, {t, -1, 1}], 
ListPointPlot3D[{x /. t -> s}, PlotStyle->PointSize[Large]], 
ParametricPlot3D[(
x /. t -> s) + u (D[x, t] /. t -> s), {u, 0, 1}, PlotStyle->Orange]],
{s, -1, 1}]

Here’s the velocity v, viewed as a curve in its own right.

v = D[x, t]
Manipulate[Show[
ParametricPlot3D[v, {t, -1, 1}, PlotStyle->Orange], 
ListPointPlot3D[{v /. t -> s}, PlotStyle->{Orange, PointSize[Large]}]],
{s, -1, 1}]

Here’s the velocity v again, but now plotted with its velocity, which is the acceleration a of the original curve x.

v = D[x, t]
Manipulate[Show[
ParametricPlot3D[v, {t, -1, 1}, PlotStyle->Orange], 
ListPointPlot3D[{v /. t -> s}, PlotStyle->{Orange, PointSize[Large]}], 
ParametricPlot3D[(
v /. t -> s) + u (D[v, t] /. t -> s), {u, 0, 1}, PlotStyle->Red]],
{s, -1, 1}]

Here’s that acceleration a on its own.

a = D[v, t]
Manipulate[Show[
ParametricPlot3D[a, {t, -1, 1}, PlotStyle->Red], 
ListPointPlot3D[{a /. t -> s}, PlotStyle->{Red, PointSize[Large]}]],
{s, -1, 1}]

This version shows position x, velocity v, and acceleration a all together.

x = {t, t^2, t^3};
v = D[x, t];
a = D[v, t];
Manipulate[Show[
ParametricPlot3D[x, {t, -1, 1}], 
ListPointPlot3D[{x /. t -> s}, PlotStyle->PointSize[Large]], 
ParametricPlot3D[(
x /. t -> s) + u (v /. t -> s), {u, 0, 1}, PlotStyle->Orange], 
ParametricPlot3D[(
x /. t -> s) + u (a /. t -> s), {u, 0, 1}, PlotStyle->Red]],
{s, -1, 1}]

Arc length

If we continue to 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, where speed is the magnitude |v| of the velocity v. Here’s a plot of speed, which you should compare to the plots above.

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

To compute arc length, we must integrate speed. In most cases, it is not possible to anti-differentiate speed symbolically. For the twisted cubic, Mathematica thinks for a little while and then gives up. (If it takes too long, then cancel the computation by pressing Command-. on macOS or Alt-. on Windows.)

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 following sections are specific to three-dimensional space.

Delicate example in (R^2)

In single-variable calculus, the function f(x) defined piecewise by 
	f(x) = e^(-x^-1)		if x > 0
	f(x) = 0			if x <= 0
is famous, because it is smooth (that is, f is infinitely differentiable everywhere) but not analytic (that is, f doesn’t equal its Taylor series). This is possible because every derivative of f at x = 0 is 0. Here’s a graph.

Show[
Plot[E^(-x^-1), {x, 0, 10}, PlotRange->{{-1, 1}, {-1, 1}}], 
Plot[0, {x, -10, 0}, PlotRange->{{-1, 1}, {-1, 1}}]]

We can use this famous f to cook up parametrized curves with surprising behavior. For example, the following curve y is smooth, even though its trajectory has a sharp corner.

y = If[t < 0, {0, E^(t^-1)}, If[t == 0, {0, 0}, {E^(-t^-1), 0}]]
Manipulate[Show[
ParametricPlot[y, {t, -1, 1}, AxesOrigin->{0, 0}, AxesLabel->{y1, y2}], 
ListPlot[{y /. t -> s}, PlotStyle->PointSize[Large]]], 
{s, -1, 1}]

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.

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->Orange]], 
{t0, interval[[1]], interval[[2]]}]

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

k = 10;
y = {(2 + Cos[k t]) Cos[t], (2 + Cos[k t]) Sin[t], Sin[k t]};
interval = {0, 2 Pi};
Manipulate[
Show[
ParametricPlot3D[y, {t, interval[[1]], interval[[2]]}],
ParametricPlot3D[
{(y /. {t -> t0}), (y /. {t -> t0}), (y /. {t -> t0})} + u frame[y, t0], {u, 0, 1}, PlotStyle->{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.