Differential Properties of Curves

Two examples of closed curves:

PrettyFlower[
        t_]  :=  ((1/4)  + (3/4) Cos[3  t]) { Cos[t]^3,  
          Sin[t]^3,  Sin[t] Cos[t]^2}

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

Defining Functions to Display Them

showcurve[VecFunc_  , tl_ ]  :=  
      ParametricPlot3D[Evaluate[VecFunc[tval]], {tval, 0, tl}, 
        Compiled -> False,  
DisplayFunction -> 
          Identity, 
        PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, 
        BoxRatios -> {1, 1, 1}]

showline[VecFunc_ , tl_ ]  :=  
      Graphics3D[{Thickness[0.01], Hue[1], 
          Line[{{0, 0, 0}, VecFunc[tl]}]}]

showcurveline[VecFunc_ ,  tl_ ]  :=  
      Show[{showcurve[VecFunc, tl], showline[VecFunc, tl]}, 
        DisplayFunction -> $DisplayFunction]

CurveLineSequence[VecFunc_ ]  := 
      Table[showcurveline[VecFunc, i], {i,  .1, 3 Pi,  .1}]

Animating the Curves with Their Parameter

CurveLineSequence[PrettyFlower];

CurveLineSequence[Bendy];

Calculating Arc Length and Re-parameritizing

dFlowerDt  =  D[Flower[t], t]

sFlower  = Integrate[Sqrt[dFlowerDt . dFlowerDt], t]

dBendyDt  =  D[Bendy[t], t]

sBendy  = Integrate[Sqrt[dBendyDt . dBendyDt], t]

sBendy /. t -> 0

Plot[sBendy, {t, 0, 2  Pi}]

Plot[
      Evaluate[NIntegrate[Sqrt[dBendyDt . dBendyDt], {t, 0, uplim}]], {uplim, 
        0, 6.4}]

Multivariable Calculus: Mathematica Review

AScalarFunction is defined everywhere in (x,y,z)

AScalarFunction[x_ ,  y_ ,  z_]  :=  
      SomeFunction[x, y, z]

AScalarFunction[x, y, z]

Print["derivative w/r to first argument is " ];   dFuncX  =  
      D[AScalarFunction[x, y, z], x]
Print["derivative w/r to second argument is " ];   dFuncY  =  
      D[AScalarFunction[x, y, z], y]
Print["derivative w/r to third argument is " ];   dFuncZ  =  
      D[AScalarFunction[x, y, z], z]

Derivative[1, 0, 0][SomeFunction][x, y, z]

x(w,v), y(w,v), z(w,v) is a restriction of all space to a surface parameterized by (w,v), AScalarFunction is now defined on the surface as a function of (w,v)

AScalarFunction[x[w, v],  y[w, v],  z[w, v]]

D[AScalarFunction[x[w, v], y[w, v], z[w, v]], x]

dFuncX /. {x -> x[w, v], y -> y[w, v], 
        z -> z[w, v]}

dFuncU  =  
      D[AScalarFunction[x[w, v],  y[w, v],  z[w, v]], w]

dFuncV  =  
      D[AScalarFunction[x[w, v],  y[w, v],  z[w, v]], v]

On the surface x(w,v), y(w,v), z(w,v), we can prescribe a curve w(t), v(t)
The following is a derivative of the function along the curve parameterized by t

dFuncT  =  
      D[AScalarFunction[x[w[t], v[t]],  y[w[t], v[t]],  z[w[t], v[t]]], 
        t]

Finally, we could skip the surface and just define a space curve x(t), y(t), z(t) and  take the derivative of AScalarFunc along  that curve:

dFuncT  =  D[AScalarFunction[x[t],  y[t], z[t]], t]

\(This\ last\ equation\ is\ \ the\ \(form : \ 
          dF\/dt\) = \ \(\(∂F\/∂x\) 
            dx\/dt\  + \ \(∂F\/∂y\) 
            dy\/dt\ \  + \ \(∂F\/∂z\) 
            dz\/dt\ \ which\ looks\ like\ a\ thermodynamic\ expression\ if\ we\ multiply\ both\ sides\ by\ \(dt : 

dF\) = \ \(∂F\/∂x\) 
            dx\  + \ \(∂F\/∂y\) 
            dy\ \  + \ \(∂F\/∂z\) 
            dz\)\)
\(Here, \ 
    dF\ is\ interpreted\ as\ any\ change\ in\ the\ scalar\ function\ if\ its\ variables\ are\ also\ changed\ dx, \ dy, \ dz\)

Getting Mathematica to represent a general change in a function--multidimensional versions of Taylor expansions

SmallChangeSeries  =  
      Expand[Series[
            AScalarFunction[x +  dx,  y  +  dy,  z  +  dz], {dx, 0, 
              1}, {dy, 0, 1},  {dz, 0, 1}]]  -  
        AScalarFunction[x, y, z]

dScalarFunction  =  Expand[Normal[SmallChangeSeries]]

dScalarFunction  =  dScalarFunction/.{dx dy  ->  
            0,  dy dz -> 0,  dx dz -> 0}

Example of using Taylor Expansion to turn a function of two variables into an approximating function of four  variables:

CrazyFun[x_,  
        y_]  :=  ((Sin[5  π x] Sin[5  π y] )/(x y))  + (( Sin[5  π (x - 1)] Sin[5  π (y - 1)])/((x - 1) ( y - 1)))

theplot  =  
      Plot3D[CrazyFun[x, y], {x, 0.1,  .9}, {y, 0.1,  .9}, 
        PlotRange -> All, Mesh -> False, Lighting -> False, 
        ColorFunction -> (RGBColor[0, 0, #] &)]

Approxfunction[x_,  y_ ,  xo_ ,  yo_]  :=  
      Series[CrazyFun[x, y], {x, xo, 2}, {y, yo, 2}] // Normal

anapprox  = 
      Plot3D[Evaluate[
          Approxfunction[x, 
            y,  .7,  .1]], {x,  .7 -  .1,  .7 +  .1}, {y,  .1 -  .1,  .1 +  .1}]

Show[theplot, anapprox]

Table[{xo[i] = Random[], yo[i] = Random[]}, {i, 1, 
          100}];

ApproxPlot[i_]  :=  
      Plot3D[Evaluate[Approxfunction[x, y, xo[i], yo[i]]], {x, xo[i] -  .1, 
          xo[i] +  .1}, {y, yo[i] -  .1, yo[i] +  .1}, PlotPoints -> 6, 
        ColorFunction -> (RGBColor[xo[i], yo[i], #] &), 
        Lighting -> False, 
        DisplayFunction ->  Identity]

GraphicsStack[0]  =  
      Show[ApproxPlot[1], DisplayFunction -> Identity, 
        Mesh -> False]

GraphicsStack[i_]  :=  GraphicsStack[i]  =  
        Show[GraphicsStack[i - 1],  ApproxPlot[i + 1]]

Show[
      GraphicsArray[{GraphicsStack[10], Show[GraphicsStack[10], theplot]}], 
      DisplayFunction -> $DisplayFunction]