\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)

Vector Valued Functions

 1 Set-Up

We are going to be working with vectors, so we should load in the vector library and set-up a few helper
functions to make life easier:

(%i13) load("vect")$
mag(u):=sqrt(u.u)$ /*Gives the magnitude of a vector u*/
infix("##")$ /*Defines ## as an operator*/
"##"(u,v):=express(u~v)$ /*Sets ## as the cross product*/
i:[1,0,0]$
j:[0,1,0]$
k:[0,0,1]$
hat(u):=u/mag(u)$ /*Unitizing function for vectors*/

 2 Vector Valued Functions and Derivatives

We saw in the vector arithmetic lesson that vectors are simply lists of values like:

(%i1) [1,3,5];
\[\tag{%o1} [1,3,5]\]

It is easy to convert this idea into one of a vector valued function using the := operator.  For instance:

(%i15) r(t):=[cos(t),sin(t),t];
\[\tag{%o15} \operatorname{r}(t):=[\cos{(t)},\sin{(t)},t]\]

The above gives the vector valued function for a helix in 3D.  We can differentiate it in the obvious way
to get the velocity:

(%i16) diff(r(t),t);
\[\tag{%o16} [-\sin{(t)},\cos{(t)},1]\]

And we can catch those derivatives in the obvious way using define().  For instance, let's compute
the velocity and the acceleration of the above helix and store the results as v(t) and a(t) respectively:

(%i18) define(v(t),diff(r(t),t));
define(a(t),diff(r(t),t,2));
\[\tag{%o17} \operatorname{v}(t):=[-\sin{(t)},\cos{(t)},1]\] \[\tag{%o18} \operatorname{a}(t):=[-\cos{(t)},-\sin{(t)},0]\]

Note that we could have used i,j,k (if we have already bound them to the unit basis) to define the above:

(%i20) r(t):=cos(t)*i+sin(t)*j+t*k;
\[\tag{%o20} \operatorname{r}(t):=\cos{(t)} i+\sin{(t)} j+t k\]
(%i22) define(v(t),diff(r(t),t));
define(a(t),diff(r(t),t,2));
\[\tag{%o21} \operatorname{v}(t):=[-\sin{(t)},\cos{(t)},1]\] \[\tag{%o22} \operatorname{a}(t):=[-\cos{(t)},-\sin{(t)},0]\]

Notice that the result is the same no matter how you define r(t).

 3 Speed and the Unit Tangent

 3.1 Speed

Recall that the speed of a particle travelling with trajectory r(t) is the magnitude of r'(t).  This is easily computed with Maxima.
Let's look at an example:

(%i23) r(t):=[t^2,sqrt(t),t^3+5];
\[\tag{%o23} \operatorname{r}(t):=[{{t}^{2}},\sqrt{t},{{t}^{3}}+5]\]
(%i24) define(v(t),diff(r(t),t));
\[\tag{%o24} \operatorname{v}(t):=[2 t,\frac{1}{2 \sqrt{t}},3 {{t}^{2}}]\]
(%i25) define(s(t),sqrt(v(t).v(t)));
\[\tag{%o25} \operatorname{s}(t):=\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+\frac{1}{4 t}}\]

We note that since we have already defined the mag() function that gives the magnitude of a vector, the above could be
shortened to:

(%i26) define(s(t),mag(v(t)));
\[\tag{%o26} \operatorname{s}(t):=\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+\frac{1}{4 t}}\]

Or the entire thing can be condensed into:

(%i27) define(s(t),mag(diff(r(t),t)));
\[\tag{%o27} \operatorname{s}(t):=\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+\frac{1}{4 t}}\]

 3.2 The Unit Tangent

The unit tangent is simply the unit velocity vector.  Using the helix as a model, this can be computed from scratch via:

(%i30) r(t):=[cos(t),sin(t),t];
define(v(t),diff(r(t),t));
\[\tag{%o29} \operatorname{r}(t):=[\cos{(t)},\sin{(t)},t]\] \[\tag{%o30} \operatorname{v}(t):=[-\sin{(t)},\cos{(t)},1]\]
(%i31) define(T(t),v(t)/sqrt(v(t).v(t)));
\[\tag{%o31} \operatorname{T}(t):=[-\frac{\sin{(t)}}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}},\frac{\cos{(t)}}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}},\frac{1}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}}]\]

While that's right, we note that the trig still needs to be simplified, so we try again with:

(%i32) define(T(t),trigsimp(v(t)/sqrt(v(t).v(t))));
\[\tag{%o32} \operatorname{T}(t):=[-\frac{\sin{(t)}}{\sqrt{2}},\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\]

That's better.  If we use the hat() function that we defined above this is more simply obtained via:

(%i37) r(t):=[cos(t),sin(t),t];
define(v(t),diff(r(t),t));
define(T(t),trigsimp(hat(v(t))));
\[\tag{%o35} \operatorname{r}(t):=[\cos{(t)},\sin{(t)},t]\] \[\tag{%o36} \operatorname{v}(t):=[-\sin{(t)},\cos{(t)},1]\] \[\tag{%o37} \operatorname{T}(t):=[-\frac{\sin{(t)}}{\sqrt{2}},\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\]

We note that we can jump straight to T(t) (though this is not really advised in general):

(%i38) define(T(t),trigsimp(hat(diff([cos(t),sin(t),t],t))));
\[\tag{%o38} \operatorname{T}(t):=[-\frac{\sin{(t)}}{\sqrt{2}},\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\]

 3.3 A Quick Example of the Unit Tangent

Let's just say that we want to see the unit tangent for a vector function, and we aren't really all that
interested in saving it or working with it later.  Let's say that the function is: r(t) = [t,t^2,t^3].
We can compute the unit tangent directly via:

(%i39) hat(diff([t,t^2,t^3],t));
\[\tag{%o39} [\frac{1}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{2 t}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{3 {{t}^{2}}}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}}]\]

If we later decide that we *do* want to have access to the unit tangent, we simply sneak in the
following line to our calculation and re-run:

(%i43) hat(diff([t,t^2,t^3],t))$
define(T(t),%);
\[\tag{%o43} \operatorname{T}(t):=[\frac{1}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{2 t}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{3 {{t}^{2}}}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}}]\]

Now we can use T(t) whenever we want!  For example, here are a bunch of unit tangents
for different values of t:

(%i46) T(0); T(1); T(sqrt(7));
\[\tag{%o44} [1,0,0]\] \[\tag{%o45} [\frac{1}{\sqrt{14}},\frac{2}{\sqrt{14}},\frac{3}{\sqrt{14}}]\] \[\tag{%o46} [\frac{1}{\sqrt{470}},\frac{2 \sqrt{7}}{\sqrt{470}},\frac{21}{\sqrt{470}}]\]

 4 The Normal Vector (N)

The binormal vector is what you get when you differentiate the unit tangent and then normalize the result.  In other words:

N(t) = T'(t)/|T'(t)|

Usually we work around this using r' and r'' since the calculation tends to be difficult, but since the computer is doing the heavy lifting, there is no need for using anything other than the above.  So, let's start with the helix and find T(t) and N(t):

(%i49) r(t):=[cos(t),sin(t),t];
define(T(t),hat(diff(r(t),t)));
define(N(t),hat(diff(T(t),t)));
\[\tag{%o47} \operatorname{r}(t):=[\cos{(t)},\sin{(t)},t]\] \[\tag{%o48} \operatorname{T}(t):=[-\frac{\sin{(t)}}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}},\frac{\cos{(t)}}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}},\frac{1}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}}]\] \[\tag{%o49} \operatorname{N}(t):=[-\frac{\cos{(t)}}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}\, \sqrt{\frac{{{\sin{(t)}}^{2}}}{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}+\frac{{{\cos{(t)}}^{2}}}{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}}},-\frac{\sin{(t)}}{\sqrt{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}\, \sqrt{\frac{{{\sin{(t)}}^{2}}}{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}+\frac{{{\cos{(t)}}^{2}}}{{{\sin{(t)}}^{2}}+{{\cos{(t)}}^{2}}+1}}},0]\]

Ok, that's right, but ugh!  That's a mess.  Let's use trigsimp() to quiet that down a little:

(%i54) r(t):=[cos(t),sin(t),t];
hat(diff(r(t),t))$
define(T(t),trigsimp(%));
hat(diff(T(t),t))$
define(N(t),trigsimp(%));
\[\tag{%o50} \operatorname{r}(t):=[\cos{(t)},\sin{(t)},t]\] \[\tag{%o52} \operatorname{T}(t):=[-\frac{\sin{(t)}}{\sqrt{2}},\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\] \[\tag{%o54} \operatorname{N}(t):=[-\cos{(t)},-\sin{(t)},0]\]

Much better!  Notice that we opted to chain the calculations above to avoid having to navigate commands nested in commands and parentheses nested in parentheses!

We should check that: (1) |N(t)|=1, |T(t)|=1 and (2) N(t) and T(t) are orthogonal:

(%i59) trigsimp(mag(N(t)));
trigsimp(mag(T(t)));
trigsimp(N(t).T(t));
\[\tag{%o57} 1\] \[\tag{%o58} 1\] \[\tag{%o59} 0\]

Let's find the unit tangent and the normal vector for a particularly nasty curve: r(t)=[t,t^2,t^3].
We will compute them by chaining calculations:

(%i69) r(t):=[t,t^2,t^3];
diff(r(t),t)$
define(T(t),ratsimp(hat(%)));
diff(T(t),t)$
define(N(t),ratsimp(hat(%)));
\[\tag{%o65} \operatorname{r}(t):=[t,{{t}^{2}},{{t}^{3}}]\] \[\tag{%o67} \operatorname{T}(t):=[\frac{1}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{2 t}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{3 {{t}^{2}}}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}}]\] \[\tag{%o69} \operatorname{N}(t):=[-\frac{\left( 18 {{t}^{3}}+4 t\right) \, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}}{{{\left( 9 {{t}^{4}}+4 {{t}^{2}}+1\right) }^{\frac{3}{2}}}\, \sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}},-\frac{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}\, \left( 18 {{t}^{4}}-2\right) }{\sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}\, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}},\frac{\left( 12 {{t}^{3}}+6 t\right) \, \sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}}{\sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}\, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}}]\]

Note that the ratsimp() performs the same role as trigsimp() for algebraic expressions, keeping things "reasonably readable."  The above is still awful, but it's better than what it would be without the call to simplify!  Let's check our answer:

(%i72) ratsimp(mag(T(t)));
ratsimp(mag(N(t)));
ratsimp(T(t).N(t));
\[\tag{%o70} 1\] \[\tag{%o71} 1\] \[\tag{%o72} 0\]

Noice!

 5 The Binormal Vector (B)

Recall that the binormal vector B is given by the cross product of the unit tangent and the normal vector.  So we can simply
do that here to get B(t).  For the helix:

(%i77) r(t):=[cos(t),sin(t),t];
hat(diff(r(t),t))$
define(T(t),trigsimp(%));
hat(diff(T(t),t))$
define(N(t),trigsimp(%));
\[\tag{%o73} \operatorname{r}(t):=[\cos{(t)},\sin{(t)},t]\] \[\tag{%o75} \operatorname{T}(t):=[-\frac{\sin{(t)}}{\sqrt{2}},\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\] \[\tag{%o77} \operatorname{N}(t):=[-\cos{(t)},-\sin{(t)},0]\]
(%i78) B(t):=express(T(t)~N(t));
\[\tag{%o78} \operatorname{B}(t):=\operatorname{express}\left( \operatorname{T}(t)\mbox{\sim }\operatorname{N}(t)\right) \]
(%i79) B(t);
\[\tag{%o79} [\frac{\sin{(t)}}{\sqrt{2}},-\frac{\cos{(t)}}{\sqrt{2}},\frac{{{\sin{(t)}}^{2}}}{\sqrt{2}}+\frac{{{\cos{(t)}}^{2}}}{\sqrt{2}}]\]

Ok, a few things here:  we should probably also call trigsimp() to pare down that last expression:

(%i80) B(t):=trigsimp(express(T(t)~N(t)));
\[\tag{%o80} \operatorname{B}(t):=\operatorname{trigsimp}\left( \operatorname{express}\left( \operatorname{T}(t)\mbox{\sim }\operatorname{N}(t)\right) \right) \]
(%i81) B(t);
\[\tag{%o81} [\frac{\sin{(t)}}{\sqrt{2}},-\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\]

Also, recall that if we define the cross product using ## we can write:

(%i84) B(t):=trigsimp(T(t)##N(t));
\[\tag{%o84} \operatorname{B}(t):=\operatorname{trigsimp}\left( \operatorname{T}(t)\mathit{ \neq \neq }\operatorname{N}(t)\right) \]
(%i85) B(t);
\[\tag{%o85} [\frac{\sin{(t)}}{\sqrt{2}},-\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\]

Finally, note that when we use := to define B(t), Maxima throws the symbolic definition back to us at first.
We can side-step this using define():

(%i87) define(B(t),trigsimp(T(t)##N(t)));
\[\tag{%o87} \operatorname{B}(t):=[\frac{\sin{(t)}}{\sqrt{2}},-\frac{\cos{(t)}}{\sqrt{2}},\frac{1}{\sqrt{2}}]\]

We should probably check that |B(t)|=1 and that B is orthogonal to both T(t) and N(t).

(%i90) trigsimp(mag(B(t)));
trigsimp(B(t).N(t));
trigsimp(B(t).T(t));
\[\tag{%o88} 1\] \[\tag{%o89} 0\] \[\tag{%o90} 0\]

Nailed it!

 5.1 The Frenet Basis for [t,t^2,t^3]

The Frenet Basis is simply the three unit vectors {T,N,B} that ride along the curve r(t).
This is precisely what we computed above for the helix.  Now let's do it for [t,t^2,t^3].

(%i107) r(t):=[t,t^2,t^3];
diff(r(t),t)$
ratsimp(hat(%))$
define(T(t),%);

diff(T(t),t)$
ratsimp(hat(%))$
define(N(t),%);

ratsimp(T(t)##N(t))$
define(B(t),%);
\[\tag{%o99} \operatorname{r}(t):=[t,{{t}^{2}},{{t}^{3}}]\] \[\tag{%o102} \operatorname{T}(t):=[\frac{1}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{2 t}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}},\frac{3 {{t}^{2}}}{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}}]\] \[\tag{%o105} \operatorname{N}(t):=[-\frac{\left( 18 {{t}^{3}}+4 t\right) \, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}}{{{\left( 9 {{t}^{4}}+4 {{t}^{2}}+1\right) }^{\frac{3}{2}}}\, \sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}},-\frac{\sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}\, \left( 18 {{t}^{4}}-2\right) }{\sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}\, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}},\frac{\left( 12 {{t}^{3}}+6 t\right) \, \sqrt{9 {{t}^{4}}+4 {{t}^{2}}+1}}{\sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}\, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}}]\] \[\tag{%o107} \operatorname{B}(t):=[\frac{3 {{t}^{2}}\, \sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}\, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}}{162 {{t}^{8}}+234 {{t}^{6}}+108 {{t}^{4}}+26 {{t}^{2}}+2},-\frac{\sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}\, \left( 27 {{t}^{5}}+12 {{t}^{3}}+3 t\right) }{\left( 18 {{t}^{4}}+18 {{t}^{2}}+2\right) \, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}},\frac{\left( 9 {{t}^{4}}+4 {{t}^{2}}+1\right) \, \sqrt{36 {{t}^{4}}+36 {{t}^{2}}+4}}{\left( 18 {{t}^{4}}+18 {{t}^{2}}+2\right) \, \sqrt{81 {{t}^{8}}+72 {{t}^{6}}+34 {{t}^{4}}+8 {{t}^{2}}+1}}]\]

Woof!  That's pretty ugly.  Let's see if it's right.  We'll use a Maxima function called map() that applies a function
to every element in a list to make things go faster:

(%i109) ratsimp(map(mag,[T(t),N(t),B(t)]));
\[\tag{%o109} [1,1,1]\]

Ok, so everybody is a unit vector.  Now for orthogonality:

(%i110) ratsimp([T(t).N(t),B(t).N(t),T(t).B(t)]);
\[\tag{%o110} [0,0,0]\]

Yes!  Everyone is orthogonal too!  Our calculation is correct!  So let's say that we want the Frenet basis
at the values of t=0, 1, and 2.  These are easily calculated:

At t=0:

(%i113) T(0);N(0);B(0);
\[\tag{%o111} [1,0,0]\] \[\tag{%o112} [0,1,0]\] \[\tag{%o113} [0,0,1]\]

At t=1:

(%i116) T(1);N(1);B(1);
\[\tag{%o114} [\frac{1}{\sqrt{14}},\frac{2}{\sqrt{14}},\frac{3}{\sqrt{14}}]\] \[\tag{%o115} [-\frac{11}{\sqrt{14}\, \sqrt{19}},-\frac{8}{\sqrt{14}\, \sqrt{19}},\frac{9}{\sqrt{14}\, \sqrt{19}}]\] \[\tag{%o116} [\frac{3}{\sqrt{19}},-\frac{3}{\sqrt{19}},\frac{1}{\sqrt{19}}]\]

At t=2:

(%i119) T(2);N(2);B(2);
\[\tag{%o117} [\frac{1}{\sqrt{161}},\frac{4}{\sqrt{161}},\frac{12}{\sqrt{161}}]\] \[\tag{%o118} [-\frac{76}{\sqrt{161}\, \sqrt{181}},-\frac{143}{\sqrt{161}\, \sqrt{181}},\frac{54}{\sqrt{161}\, \sqrt{181}}]\] \[\tag{%o119} [\frac{12}{\sqrt{181}},-\frac{6}{\sqrt{181}},\frac{1}{\sqrt{181}}]\]

Let's say we wanted numerical approximations for that last one:

(%i124) float(T(2));float(N(2));float(B(2));
\[\tag{%o122} [0.07881104062391,0.31524416249564,0.94573248748692]\] \[\tag{%o123} [-0.44520636718103,-0.83769092772221,0.31633083983915]\] \[\tag{%o124} [0.89195297549659,-0.44597648774829,0.074329414624716]\]
Created with wxMaxima.