Calculus III - Mathematica Lab 1

Marcus McGuff
Austin Community College

(Note:  click on the little arrows to “open” each section.)

Curves

Curvature

For a curve r [t] , define a function κ[t] , the curvature function at time t (define it as a function).  Also, define functions aNorm[t] and aTan[t] that give the magnitude of the normal component and tangential component of acceleration, respectively.

Hint:  You can find the derivative of r[t] just by entering r'[t] and the second derivative by entering r''[t] (that is two apostrophe's, NOT quotation marks).  Also, you can test your curvature function by using it to find the curvature of r[t_]:={Cos[t], Sin[t], t}, which should be (1/2) (for all t).  You can find the magnitude of a vector by taking the square root of the dot product of the vector with itself.  (That is, |r[t]|=(Sqrt[r[t].r[t]]))

Graph r[t_]:={(t^4),(t^3),(t^2) Sin[4t]}, aNorm[t], aTan[t] and κ[t]  over the same domain for t (-1 to 1 should be okay).  Explain how these graphs relate to each other.  What important fact about the curve does the curvature graph make clear (it isn't at all obvious on the actual graph of r[t])?  What additional information do aNorm[t] and aTan[t] add to your understanding of the graph?

Hint:  You might find it useful to use Manipulate to investigate this further; that would allow you to see how things relate on the graphs.  Below is an example of using Manipulate to combine a 3-D graph with a 2-D graph below it.  Feel free to modify this code to help with your analysis.

Manipulate[Grid[{{ParametricPlot3D[{t,(t^2),(t^3)},{t,-1,tMax},PlotPoints->400,PlotRange->{{-1,1},{-1,1},{-1,1}}]},{Plot[{t,(t^2),(t^3)},{t,-1,tMax},PlotPoints->100,PlotStyle->{Red,Green,Blue},PlotRange->{{-1,1},{-1,1}}]}}],{tMax,-0.9,1}]

Curves on a surface

Many curves in 3 dimensions actually lie on surfaces of some sort.  For example, the curve:

r[t_]:={Cos[12t](Sqrt[1-(t^4)]),Sin[12t](Sqrt[1-(t^4)]),(t^2)}

lies on the surface of the unit sphere about the origin.  If you graph r and the unit sphere on the same axes, you can see this:

curve=ParametricPlot3D[Evaluate[r[t]],{t,-1,1},PlotPoints->200,PlotStyle->Thick]

This defines a unit sphere we can overlay this onto.  (You can use this definition later in the exercises if you wish.)

unitSphere=ParametricPlot3D[{Cos[u]Sin[v],Sin[u]Sin[v],Cos[v]},{u,0,2π},{v,0,π},Boxed->False,Mesh->False,Axes->False,PlotStyle->Opacity[0.5]]

Show[unitSphere,curve]

You can show algebraically that this does lie on the sphere by showing that its components satisfy the equation for a sphere:

(((Cos[12t](Sqrt[1-(t^4)])))^2)+(((Sin[12t](Sqrt[1-(t^4)])))^2)+((((t^2)))^2)-1//FullSimplify

This shows that (x^2)+(y^2)+(z^2)-1=0 as it should be for a sphere.  (It is usually easier to set the Cartesian equation equal to 0 to check it, especially on more complicated surfaces.)  For most of the surfaces we will be looking at, you should apply the //FullSimplify at the end of the line (it does things like take care of trig identities, etc.).

For each of the following, decide what surface it lies on.  Show this graphically and algebraically (as above).  For simplicity sake, you can assume that each surface will be as simple as possible (i.e., the coefficients are all 1).

You will probably need to set PlotPoints to 100 or 200 to get smooth looking curves here.  Also, you will probably need to experiment around with your domain for t a bit.  If the domain is too large, you will get a mess (too many line segments, which can give a false impression of the curve).  If it is too small, you may not be able to tell what surface the curve lies on.

1.

r[t_]:={Sin[(t^(1/3))]Cos[3 t],Sin[3t]Sin[(t^(1/3))],Cos[(t^(1/3))]}

2.

r[t_]:={((( Cos[Log[6(t^2)+1]]))^2), Cos[Sin[5t]]Cos[Log[6(t^2)+1]], Cos[Log[6(t^2)+1]]Sin[Sin[5t]]}

3.

r[t_]:={(Sqrt[1-(((Sin[(t^(1/2))]))^2)]),Cos[(t^(1/2))]Sin[1-(t^2)],Cos[(t^(1/2))]Cos[1-(t^2)]}

Surfaces

Functions

How does the shape of z=(x^2)+a (y^2)+x y depend on the value of a?  Clearly state your conclusion and illustrate it with an animation or two (use Manipulate).

Limits

Taking a limit of a function of two variables can be very difficult.  Mathematica can take limits of a function of a single variable relatively easy:

Limit[((Sin[(Sqrt[x])])/x),x->0]

However, it does not have a built-in command for finding the limit of a multi-variable function.  This is unforunate (though not really surprising, considering the complications that can arise in 3 dimensions).  

For limits of functions of two variables, it can often be useful to graph the function around the limit point first.  This can give you an idea of whether the limit exists or not.  If it looks like it doesn't exist, the graph may give you some good ideas of what paths to test the limit along to look for differing values.  If you can find two different paths with two different limits, then you're done (the limit does not exist).  Mathematica can also aid you in taking limits along these paths.  If it looks like the limit does exist, you might be able to use Mathematica to ease your suffering as you try to prove it really does exist (sadly, Mathematica won't prove it for you...).

As an example, let's examine (Underscript[Limit , (x,y)->(0,0)]) (((x^3)+ (y^2))/((x^2)+(y^2))):

Plot3D[(((x^3) +(y^2))/((x^2)+(y^2))),{x,-0.05,0.05},{y,-0.05,0.05},PlotPoints->40]

It can also be very useful to look at a contour plot over the same region:

ContourPlot[(((x^3) +(y^2))/((x^2)+(y^2))),{x,-0.05,0.05},{y,-0.05,0.05},PlotPoints->100]

Althought you can't really tell for certain here, it looks like the graph may approach different limits, depending upon what path you approach it on.

Explain how the contour plot shows you the limit probably doesn't exist.

Now, let's test this on paths of the form y=m x:

Limit[(((x^3) +(((m x))^2))/((x^2)+(((m x))^2))),x->0]

Since this depends upon m, the limit cannot exist.  On the other hand, consider (lim_((x,y)->(0,0)))((x (y^2))/((x^2)+(y^4))):

Plot3D[((x (y^2))/((x^2)+(y^4))),{x,-0.5,0.5},{y,-0.5,0.5},Mesh->False,PlotPoints->150]

ContourPlot[((x (y^2))/((x^2)+(y^4))),{x,-0.2,0.2},{y,-0.2,0.2},PlotPoints->150]

The limit doesn't appear to exist here.  Again, let's check all linear paths through this point:

Limit[((x (((m x))^2))/((x^2)+(((m x))^4))),x->0]

The contour lines here give you a clue:  they look (vaguely) parabolic.  So, let's try a parabolic path through the origin:

Limit[((x (((m (x^2)))^2))/((x^2)+(((m (x^2)))^4))),x->0]

Of course, the contours actually look more like parabolas of the form x=m (y^2):

Limit[(((m (y^2)) (y^2))/((((m (y^2)))^2)+(y^4))),x->0]

This goes to different limits for different values of m, so the original limit does not exist.  So, sometimes checking all lines isn't good enough.

Let's examine one more example:  (lim_((x,y)->(0,0)))(((x^2)-(y^2))/((x^4)+(y^4)))

Plot3D[((x (y^3))/((x^2)+(y^2))),{x,-0.5,0.5},{y,-0.5,0.5},PlotPoints->60,Mesh->False]

ContourPlot[((x (y^3))/((x^2)+(y^2))),{x,-0.5,0.5},{y,-0.5,0.5},PlotPoints->100]

Here, it looks like the limit DOES exist.  Notice that this doesn't actually prove this; you still have to figure out a way to do that.  Mathematica may or may not help to do this.  Hint:  for (x,y) close to (0,0), 0≤((| (y^3)|)/((x^2)+(y^2)))≤1

For each of the following, use Mathematica to decide whether the limit exists or not.  Support your decision with appropriate graphs.  If it doesn't exist, confirm this fact algebraically.

1.  (lim_((x,y)->(0,0))) ((Tan[(x^2)y])/(Sin[Tan[(x^2)y]]))

2.  (lim_((x,y)->(0,0)))((ln((x^2)+(y^4)))/(sin((x^6)+(y^2))))

Note:  Mathematica uses the function Log for the natural logarithm (rather than ln).

3.  (lim_((x,y)->(0,0)))((2x-(y^2))/(2(x^2)+y))

4.  (lim_((x,y)->(0,0)))((Cos[2x ]Sin[3y])/(Sin[6x]Cos[5y]))