Another service from Omega

Derivatives of Vector Functions


*****


How to Use Maple to Take Derivatives of Vector Functions

It is convenient to define the standard basis vectors: i,j and k and then express the vector functions in terms of them. Here is an example:


> i := vector([1,0,0]): j:=vector([0,1,0]): k:= vector([0,0,1]):





Now enter the vector function, the helix say..


> f := t -> cos(t)*i + sin(t)*j + t*k;


                      f := t -> cos(t) i + sin(t) j + t k



Its derivative can now be computed as with a real-valued function. You can use either the command "diff" or the command "D". Let's try both and see what we get,


> df := diff(f(t),t);


                        df := - sin(t) i + cos(t) j + k



This is an expression in t. You won't see the components unless you "evalm". The alternative is to use the differential operator "D" that returns not an expression but a function,


> Df := D(f);


                      Df := t -> - sin(t) i + cos(t) j + k



cool! The unit tangent direction to the helix when t=x is then given by


> Tx := Df(x)/sqrt(innerprod(Df(x),Df(x)));


                               - sin(x) i + cos(x) j + k
                        Tx := --------------------------
                                     2         2     1/2
                              (sin(x)  + cos(x)  + 1)



to simplify with trig knowledge just do:


> Tx := simplify(Tx,trig);


                        1/2                 1/2                 1/2
           Tx := - 1/2 2    sin(x) i + 1/2 2    cos(x) j + 1/2 2    k



If you want to transform and expression into a function you needto use the command "unapply". For example,


> T := unapply(Tx,x);


                          1/2                 1/2                 1/2
         T := x -> - 1/2 2    sin(x) i + 1/2 2    cos(x) j + 1/2 2    k



gives the unit tangent vector as a function of the parameter (in this case the letter "x" is used for the parameter).

Let's now try to solve the following problem:
Consider two points on the trajectory of the helix. For what points do the tangent lines at those points intersect?

Solution

Let t1 and t2 be the value of the parameter t at the two points on the helix. The tangent lines at these points are given by the vector functions L1 and L2 with equations,


> L1 := s -> f(t1) + s*Df(t1); L2 := t -> f(t2) + t*Df(t2);


                          L1 := s -> f(t1) + s Df(t1)

                          L2 := t -> f(t2) + t Df(t2)



To find out when these lines can intersect notice that we only need to find when
L1(s) = L2(t)
Or when,
f(t1) - f(t2) = t Df(t2) - s Df(t1)
i.e. f(t1) - f(t2) is on the plane generated by the direction vectors. Rememeber that this happens when the triple scalar product (the volume) of the vectors, f(t1)-f(t2), Df(t2), and Df(t1) is zero. Let's first simplify the notation with,


> alias(dot=innerprod, cross=crossprod);


                                 I, dot, cross



and we are now ready to compute the triple scalar product.


> vol := dot( f(t1)-f(t2), cross(Df(t1),Df(t2)) );

               2                              2          2
 vol := cos(t1)  - 2 cos(t1) cos(t2) + cos(t2)  + sin(t2)  - 2 sin(t2) sin(t1)

               2
      + sin(t1)  - t1 sin(t1) cos(t2) + t1 cos(t1) sin(t2) + t2 sin(t1) cos(t2)

      - t2 cos(t1) sin(t2)


> vol := simplify(vol,trig);

    vol := - 2 cos(t1) cos(t2) + 2 - 2 sin(t2) sin(t1) - t1 sin(t1) cos(t2)

         + t1 cos(t1) sin(t2) + t2 sin(t1) cos(t2) - t2 cos(t1) sin(t2)



The condition is then given by
vol = 0
This is a highly non-linear equation in t1 and t2. But if we fix one of them, t1=0 say, then we can try to find all the t2,


> vol1 := simplify(subs(t1=0,vol));


                      vol1 := - 2 cos(t2) + 2 - t2 sin(t2)


> T2 := solve(vol1,t2);

                                    T2 := 0



Now this is interesting. It seems that tangent lines either do not intersect or they are the same line. By the symmetry of the helix (there is no beginning or end) all points must have this property and not only when t1=0.


Link to the commands in this file
Carlos Rodriguez <carlos@math.albany.edu>
Last modified: Fri Oct 4 19:31:23 EDT 1996