Math 121 Lab 1, Part 1: 
Review, and
Parametric plots in 2D and 3D

© Copyright by T.I. Lakoba,
based on Labs by Helen P. Read.
Last modified  2022-09-01

NOTE:  You may adjust the text size for viewing the assignment by selecting the magnification scale at the bottom right corner of this window. For example, I sometimes find it most convenient to set the magnification factor to 125%.

Clear["`*"]

The above command “clears the workspace”. This means the following. When you execute commands (i.e., do some work) in Mathematica, it keeps (the latest) values of all variables that you have used. Sometimes, you want Mathematica to “forget” all the work that it has done in a given session. Then you execute the above command. (If you are new to Mathematica, then please read the next rubric on how one “executes” commands.)

Getting started

In this Part 1 of the Lab you will find a summary of useful commands that you learned in Calculus I and II. 

If you are new to Mathematica, you must read all the instructions in this Part. If the instructions ask you to do something, then you must do it. If you are stuck, first try to find a resolution to your predicament in the preceding instructions. If doing so (say, for three minutes) does not help, ask the instructor.

If you are familiar with Mathematica, you may (but do not have to) skip this “Getting started” section. However, I still want you to at least browse the sections up to “Parametric plots in 2D” and read carefully from that point on. The reason is that all questions that you may have later in Part 2 are addressed in Part 1. 

If you see a sentence or a paragraph highlighted in red, this means that this piece of text is especially important. You must read it and make sure that you understand what it says.

Please do the work for all Labs, starting with this one, in the same Mathematica notebook where you read the instructions. Please do NOT do any Lab work, and do NOT submit, a “regular” notebook that Mathematica opens by default!

Mathematica allows one to typeset symbols and formulas in the same nice form that you see in books. You do not actually need this feature to do any of the Labs successfully, but if you would like to do it, here is how. Open up the Classroom Assistant palette if it is not already open. Look for it under Palettes on the Mathematica menu at the top of the screen. In the Classroom Assistant palette, open up the “Calculator” (Advanced view) and also, two lines below, the “Basic Commands” (you will be on the (Sqrt[x]) tab by default, but you can navigate to other tabs). Then you click on any symbol or formula box there, and it will appear in the Mathematica notebook where you are currently working. (For example, you are currently working in this notebook, where you are reading these words.) You may also go to the tab “Typesetting”, found below “Basic Commands” tab in the Classroom Assistant or Basic Math Assistant palettes, and follow your nose. For example, with this method I have produced:
 ((∂ (((y )^(1/3))- (x^2)))/(∂x)) = -2.
 (You will learn the yet-unfamiliar notation “∂” later in this course.)
 However, for practical purposes, the “plain” form of the above formula will work just fine:
 D[y^(1/3)-x^2, x] = -2. 
 (Again, all unfamiliar notations will be explained as we need them.)
 


Let us start off by explaining how one makes Mathematica do a calculation (a.k.a., “execute a command”). Look at the upper left corner of this window (just under tabs “File”, “Edit”, “Insert”); you should see a small drop-down box there. (If not, read the next paragraph.) Move the cursor over this paragraph and click on it. You should see “Text” appear in that drop-down box. This means that you “are” in the “Text” mode. That is, you can type anything, e.g., 1+2, but Mathematica will regard it as text, as opposed to a command, and will not compute anything. 

If you did not see a little drop-down box in the upper left corner of this window, go to “Window” in the menu at the top of the screen, click on it, select “Toolbar” and then “Formatting”. The drop-down box should appear (again, in the left corner of the toolbar), along with a few other buttons.

In order to make Mathematica actually compute 1+2 (i.e., “execute the command” 1+2), you have to “be” in the “Input” mode. Left-click anywhere in this paragraph and notice that the cursor appears as a vertical bar. Now, move the cursor down and notice that right after the end of this paragraph, it becomes a horizontal bar instead. (If you look to the right, you see that this happens right after the end of the bracket embracing this text.) At this point, click on the cursor and press “Enter”. A bluish box should appear, just as the one that you can see a few lines below. Type “1+2” (without the quotes!) in that box and press “Shift+Enter” (i.e., those two keys together).

Expectedly enough, you should see Mathematica return “3” (again, without quotes) as the answer. 

So, remember, that to make Mathematica compute anything (i.e., “execute a command”), you always need two things:
1) You must enter your command/expression in the “Input” mode and not in any other mode. (The list of modes is in that little drop-down box in the upper left corner.)
2) You must press “Shift+Enter” rather than just “Enter”.
Note:  Sometimes the instructions will ask you to “evaluate” an expression. This is the same thing as “execute” or “compute”.

You may type in commands and expressions either all by yourself or using the Classroom Assistant palette. For example,

10*(5^(1/4) + Sqrt[7] - 2^3)/6

which I have typed by myself, and

((10((5^(1/4)) + (Sqrt[7])-(2^3)))/6)

which I have typed with the Classroom Assistant, generate the same output. Click in the above input windows and press Shift+Enter to see it.

You must adhere to the important Mathematica conventions: 

1) Names of all built-in functions (e.g., Sin, Log, Sqrt) must always start with a capital letter. For example, Sqrt[2], and NOT sqrt[2].
(Names of a user-defined function may start with any letter.)

2) The argument of any (i.e. both built-in and user-defined) function must be enclosed in square brackets, [ ].
The round brackets, or parentheses ( ), are reserved for grouping terms.
The curly brackets { } are used only for lists (see below) and as options in some commands.

Compare the five expressions below and notice that only one of them, according to the above conventions, gives you a correct answer. Press Shift+Enter anywhere in the “Input” window below:

Sin(Pi/3)
Sin[pi/3]
Sin[Pi/3]
sin(Pi/3)
Sin{Pi/3}

Before moving on, reflect on what is wrong in each of the four incorrect expressions above. This will save you much frustration in your experience with Mathematica.

If you want to put a note (for example, explaining the work you have done), use one of the following ways:

1.  
1) Move the cursor until it becomes horizontal;
2) Left-click on it;
3) Move the cursor into the little drop-down box in the upper left corner and select “Text”, or “(Sub)section”, or “AnswerBox”, etc, from the list. You are now in the text-typing mode and can type your note. 
If you want it to stand out against the rest of the text, choose “Highlight” in the drop-down box, or go to “Format” in the menu at the top of the screen and follow your nose to add color or some other bells and whistles to your text. 

2. 
In the same Input cell where you have done your calculations, type your note within 
(* ... *). For example:

sin(Pi/3)   
(* Why is "sin" different color than "Pi" and "3"? Is Mathematica trying to tell me something by using colors? I hope I'll find out as I proceed. *)

Assigning names

You should get into the good habit of assigning a name to an expression that you anticipate to reuse later on. The way to assign a name is to type a name at the beginning of a line, then an equal sign followed by your expression:

name = expression

For example:

ab32=Sqrt[1.21]+x^2+Sin[x/3]

You can use whatever names you like. A good idea, though, is to use lower case letters for your assigned names so that you avoid any conflict with Mathematica’s built-in functions and commands, which begin with capital letters.

Example (here and in other Examples below, read the assignments and the explanations; then follow the steps given in the explanations)

(a) Find the exact value (not a decimal) of cos(((5π)/12)).

Following Mathematica’s conventions described above in red, enter cos(((5π)/12)) in the Input mode and evaluate it. Make sure to use the correct syntax! Copy and paste your answer into the gray AnswerBox below that you see below.

(b) Find a decimal approximation for cos(((5π)/12)) to 8 significant digits.

First, assign a name (let's call it a) to the value you found in part (a). To do this, go back and edit your input so that it looks like this:   
a=Cos[((5π)/12)] 
and evaluate it again. Now start a new input cell, and put in 
N[a,8]. 
Copy and paste your answer into the AnswerBox:

Click on the little arrow on the left of the word “Answers” below to check your answers:

Answers

(a) cos(((5π)/12))=((-1+(Sqrt[3]))/(2 (Sqrt[2]))) (exact answer)
(b) cos(((5π)/12))≈0.2588190451025207394`8. (to 8 significant digits)

Defining functions

Example: 

Define a function  f(x)=3+4x sin((x/3)).

To begin, start a new input cell. Then, enter in it

f[x_]=3+4x*Sin[x/3]

and evaluate (i.e., press “Shift + Enter”).

Notice an important Mathematica notation:

The first time you define a function, its argument on the left-hand side (and  the left-hand side ONLY) must have the underscore symbol. Let me break this down into a few clarifying statements:

1)  If you forget the underscore, i.e., if you type 
f[x] = 3 + 4 x * Sin[x/3]
instead of what is shown above, this will NOT define a function.

2)  You should NOT use the underscore on the right-hand side. That is, do NOT write:
f[x_] = 3 + 4 x_ * Sin[x_/3]

3)  When you use f[x] (see the next section, “The Plot command”), you should NOT use the underscore. For example, type
Plot[f[x],{x,0,1}] ,
but NOT
Plot[f[x_],{x,0,1}] 

4)  When referring to a function which you have previously defined as f[x] (following the above syntax), you must keep referring to it as f[x] and not as just f. 
For example, you should type
Plot[f[x],{x,0,1}]
but NOT
Plot[f,{x,0,1}] 
or, similarly, you should type
g[x_] = 2*f[x] - 3
but NOT
g[x_] = 2*f - 3 
While “f” and “f[x]” may look the same to you, they mean different things to Mathematica. Therefore, if you mean to use “f[x]”, you must write it exactly like that (without the quotes, of course).

An alternative way is to use the “Define Function” tab from the palette. (It's on the Calculator portion of the palette, in the Advanced view.) Try it. Fill in  f  for the name of the function,  x  for the variable, and   3+4x Sin[(x/3)]  for the expression, so that it looks like above. Be sure to type either a space or the multiplication symbol, *, between  x  and  Sin[(x/3)]. That is, do not run "xSin" all together in one word! Once it is all okay, go ahead and evaluate. 


Remember: The argument of a function must always be included in square brackets! 

You have probably noticed a difference between the results of the two commands: the one you typed on your own and that supplied by the “Define Function” tab. Namely, the latter command, which is used by Mathematica as the default option, produces no output (but you get an “In” number to the left of the cell). This is because Mathematica’s default syntax uses the delayed evaluation sign, “ : = ” (as opposed to just “=”).  
This delayed evaluation sign tells Mathematica not to evaluate the function of  x  until we ask for it and, actually, is rarely needed. 
Thus, do NOT to use “ : = ” unless necessary, and use the regular “=” instead. The reason was demonstrated above:  Using “=” you have the opportunity to see the output of your command, but using “ : = ”, you do not. 
For example, if you accidentally type

ff[x_]=Sin(3x)

and look at the expression that Mathematica has returned (3Sin x), you may notice that something is wrong with it. If, however, you had typed

ff[x_]:=Sin(3x)

you will see no output and hence will likely miss your mistake.

So:  Do NOT use the “:=” unless you really need it. (Such cases will occur very rarely, and when they do, they will be pointed out to you explicitly and conspicuously.)

We now continue with the above Example.

Substitute a value into your function

To substitute a value into your function, just plug in the value, with square brackets around whatever the function is "of". For example, to find f(0), type in  f[0]  and evaluate it. Go ahead and try it. (What should the answer be?)

Try finding f(π). Find the exact value, and also a decimal approximation to 8 significant digits. Copy and paste your answers into the gray AnswerBox. See below to check your answers.

Answers

f(π)=3+2 (Sqrt[3]) π  (exact)
f(π)≈13.882796 to 8 signficant digits.

Clear the definition of f[x] before you go on. To do this, type Clear[f]  in the Input mode. 
(If you have forgotten what “Input mode” means, go back to section “Getting started” and find the paragraph that begins with the sentence “   In order to make Mathematica actually compute  1+2, ... ”.) 

Execute the Clear[f] command (in the same way as you execute any other command in Mathematica).

The Plot command

Example 

Plot f(x)=sin x for x from -2π to 2π  and and g(x)=cos x  for x from  - π  to 3π.

First, Clear[f] (if have not yet done so), then go ahead and define functions for  f(x)=sin x  and  g(x)=cos x. (Remember to use the correct Mathematica syntax described in the previous sections!) Then, in the “Input” mode, type:    

Plot[f[x],{x,-2π,2π}]

Alternatively (i.e., if you don’t remember the syntax), you may select the 2D tab on the Basic Commands area of the palette, pick Plot, and fill in f[x] for the function, x for the variable, and -2π and 2π for the min and max values of x (this specifies a domain for the plot). 

Once you have that working, make a plot of g(x).

Plot f(x) and g(x) together.

One way to do it is by using the palette. For that, open up the More drop-down menu next to Plot and select the first item, which is a template for plotting more than one function at a time. Use this to plot f(x) and g(x) together. However, this method is not preferred. 

A much better way is to assign a separate name to each plot and then combine them using the command “Show”:

f[x_]=Sin[x]
g[x_]=Cos[x]

p1 = Plot[f[x],{x,-2π,2π}];
p2 = Plot[g[x],{x,-π,3π}];
Show[p1,p2]

Note two useful things: 
- First, the semicolon after any command suppresses its output. 
- Second, “Show” cuts off the upper x-limit of the second plot. To overcome that, one has two options:

	Option1:  specify the limits explicitly:

Show[p1,p2,PlotRange->{-2Pi, 3Pi}]

or
	Option 2: use the syntax:

Show[p1,p2,PlotRange->All]

If you want the plots to be of different color, specify so before combining them with “Show”:

p1 = Plot[f[x],{x,-2π,2π},PlotStyle->Red];
p2 = Plot[g[x],{x,-π,3π},PlotStyle->Green];
Show[p1,p2]

Other allowed color names are found at the end of the “2D” tab of the “Basic Commands” tab in the palette.

Parametric plots in 2D

The most versatile form to use for plotting a curve in the plane is a parametric form in terms of some parameter  t. You studied this in Calculus II, and we will study more of it in Chapter 13 in this course. 
The parametric equations of a curve have the form

           x = f(t),  y = g(t) 

where f(t) and g(t) are two functions that describe the two coordinates of the point in terms of the variable parameter t. 

Mathematica’s command for plotting a parametric curve in the plane is: 

     ParametricPlot[ {f[t], g[t]} , {t, tmin, tmax} ] 

There are many options you can use for this command; the syntax then is 

     ParametricPlot[ {f[t], g[t]} , {t, tmin, tmax} , Options...] 

where you have to specify precisely which "Options" you want.  To find a list of the possible options, use the command

Options[ParametricPlot]

Most of these options are self-explanatory, and you can ask for "Help" (in the main menu’s tab) on any others that you are unclear about.  For example, "AspectRatio" sets the ratio between the sizes of the vertical horizontal axes.  Putting "AspectRatio ->Automatic" as an option tells Mathematica you really want the actual lengths along those axes.  

Example 

Parametric equations 
    x = 5 + 2 t,    y = -3 + t 
(so  that  f(t) = 5 + 2 t  and  g(t) = -3 + t ) define a straight line in 2D. (This should remind you of the parametric equations of a line in 3D, covered in Sec. 12.5, which are:  x = x0 + a t,   y = y0  + b t,   z = z0 + c t.)  To visualize that line, type:

ParametricPlot[{5 + 2*t, -3+ t}, {t,-2,2},PlotStyle->RGBColor[1,0,0],AxesOrigin->{0,0}]

The “PlotStyle” option used above gives you yet another way to define the color of the curve. Read about the RGB color system on the Internet if you are interested. 

The above command plots the portion of the straight line for the values of  t  varying from t = -2  (which gives the point (1,-5) )  to t = 2  (which gives the point (9,-1) ).

Practice on your own: 
Modify the previous command to plot the straight line for t = 0 to t = 1.  This plots the line segment between which two points? Modify the command further to make the graph appear green.

Food for thought: 
Which 2D vector is this line parallel to? How are the coefficients in front of  t  in  f(t) and  g(t)  related to the components of this vector?

Canonical equation of an ellipse in 2D

If you have not dealt with equations of ellipses before, please read pp. A19-A22 in Appendix C of your textbook. They have pictures of ellipses centered at the origin (p. A19) and elsewhere (p. A22). 
(In the e-book, it may be easier to navigate to Appendices, then Appendix C, and then the material you need is found after Figure 7 and before Figure 15.)
Figures 8 - 12 and 14 on those pages will help you to understand the notations a and b used below and will help get you started.

An ellipse centered at a point  ((Subscript[x, 0]), (Subscript[y, 0]))  has the so-called canonical equation                          

       ((((x-(Subscript[x, 0])))^2)/(a^2))+  ((((y-(Subscript[y, 0])))^2)/(b^2))= 1 . 		(E-1)
      
The constants  a  and  b  in Equation (E-1) determine the “semi-axes” (i.e., half of the length) of the ellipse:  a  is the semi-axis along the x-axis, and   b  is the semi-axis along the y-axis. Thus, the total length of the ellipse along the x-axis is  2a, and along the the y-axis the total length is  2b . 

On a piece of paper, sketch the ellipse defined by Equation (E-1) and label where  a  and  b  are in this sketch. (Do it! You’ll have great difficulty doing the rest of this Lab is you skip this step. Consult the aforementioned pages in the textbook as needed.)


For simplicity, in the following we will assume that the ellipse is centered at the origin, so that   ((Subscript[x, 0])=0 , (Subscript[y, 0])=0) .


Note that if one is instead given an equation

       ((x^2)/(a^2))+  ((y^2)/(b^2))  = (c^2),				(E-2)

it can be reduced to the canonical form by dividing both sides by  (c^2),  which yields: 
      
          ((x^2)/(((a c))^2))+  ((y^2)/(((b c))^2))= 1.	 		(E-3)	
                  
Make sure that you have understood the above transformation from Equation (E-2) to Equation (E-3). You will have to do this transformation multiple times in Part 2 of this Lab as well as in Lab 3. If you have difficulty understanding how this transformation occurred, do a derivation (see the sentence after (E-2)) on a piece of paper. If you are still unclear, ask the instructor.

In the AnswerBox below, state the semi-axes of the ellipse defined by the above equation. (If you have difficulty doing this, read the text after Equation (E-1); try to see what in that equation tells you that  a  and  b are the semi-axes along the x- and y-axes, respectively.)

Answers

ac  and  bc

Parametric equations of an ellipse in 2D

It is inconvenient to use the canonical equation -- i.e., any of the equations (E-1), (E-2), or (E-3) -- to plot an ellipse. Indeed, this would involve solving a quadratic equation for  y  in terms of x, which will have an expression with a ±(Sqrt[ ]). Instead, for plotting ellipses, one uses their parametric equations, which are described next. 

A trigonometric identity                
      
                                    (sin^2)t + (cos^2)t = 1
                                    
allows one to write down parametric equations of the ellipse in the form:
      
       x(t) = a cos(t),      y(t) = b sin(t),    0 < t < 2π .
       
Indeed, if you substitute these parametric equations into the canonical equation of the ellipse, you will obtain the trigonometric identity shown above. Do it on paper (you do not need to turn in this piece of work). However, do not worry if you cannot get that substitution to work: we will do this in class together when we cover Sec. 12.6. 


If the center of an ellipse is not at the origin but at a point ((Subscript[x, 0]), (Subscript[y, 0])), the parametric equations become:

       x(t) = (Subscript[x, 0]) + a cos(t),      y(t) = (Subscript[y, 0]) + b sin(t),    0 < t < 2π .


Here is an example of plotting an ellipse:

ParametricPlot[ {2Cos[t]+5,3Sin[t]-7}, {t,0,2Pi}, AspectRatio->Automatic]

Practice on your own:
What is the canonical equation of the ellipse that you have just plotted? You need to answer this question to be able to successfully do a part in Exercise 1 of Part 2 of this Lab.

Answer

((((x-5))^2)/4)+  ((((y+7))^2)/9)= 1

Practice on your own:
What is the parametric equation of the ellipse whose canonical equation is (E-2) above? You need to answer this question to be able to successfully do a part of Lab 3 in a not-so-distant future.

Answer

x(t) = ac cos(t),      y(t) = bc sin(t),    0 < t < 2π .

Canonical and parametric equations of a hyperbola in 2D

The form of the equation of a hyperbola that you may be most used to is

           y = (k/x),

where  k  is some constant. However, in this course we will more often see a different form. For future references, it is convenient to distinguish between two types of hyperbolas:

Canonical equation of a hyperbola,  type I :

      ((x^2)/(a^2)) -  ((y^2)/(b^2))= 1	                                                   (Type I)
          
Canonical equation of a hyperbola,  type II :
      
         ((x^2)/(a^2)) -  ((y^2)/(b^2))= -1    or      ((y^2)/(b^2)) -  ((x^2)/(a^2))= 1      	 (Type II)
      

If you have not worked with these equations of a hyperbola before, look at the figures on pp. A20-21 in Appendix C of your textbook. 

Similarly to how it was done for an ellipse, one can transform an equation
      
        ((x^2)/(a^2)) -  ((y^2)/(b^2))  = (c^2) 		(H-2)                                           
into the canonical form by dividing it through by  (c^2): 
      
          ((x^2)/(((a c))^2)) -  ((y^2)/(((b c))^2))= 1.		(H-3)     
      
Again, make sure that you understand the transformation from (H-2) to (H-3): you will have to use it multiple times. Review the section about the canonical equation of an ellipse if you have difficulty.


While it is possible to plot a hyperbola using its Cartesian equation, it is much easier to do so using parametric equations. To that end, we need to employ an identity that you studied in Calculus I or II (see Sec. 3.11 in your textbook):
      
         		   (cosh^2)t - (sinh^2)t = 1
            
Parametric equations of hyperbolas are:   
   
      Type I:                             
      
      x(t) = +/- a cosh(t),      y(t) = b sinh(t),          -∞ < t < ∞
      
      Type II:                        
      
      x(t) = a sinh(t),            y(t) =+/-  b cosh(t),     -∞ < t < ∞
      
To verify, simply substitute them into the canonical equation of the hyperbola of the corresponding type. You will then end up with the hyperbolic identity stated above. Try it on paper (you do not need to turn in your calculation).

Practice on your own:
What is the parametric equation of the hyperbola whose canonical equation is (H-2) above? You need to answer this question to be able to successfully do Exercise 2 of Part 2 of this Lab.

Answer

x(t) = +/- ac cosh(t),      y(t) = bc sinh(t),     -∞ < t < ∞ .

From now on in this course, we will use parametric equations to plot hyperbolas of both Type I and Type II. You should NOT use Cartesian/canonical equations to plot hyperbolas! Instead, convert a given canonical equation into the parametric form and then plot the latter. 

For example, here is a plot of the hyperbola with the canonical equation

  ((x^2)/4) -  ((y^2)/9)= 1

First, examining the forms of the canonical equations of Types I and II stated above, you conclude that this is a Type-I hyperbola. Then, you use the corresponding Type of the parametric equations, also given above, to plot this curve:

graph4type1=ParametricPlot[ {{2Cosh[t],3Sinh[t]},{-2Cosh[t],3Sinh[t]}}, {t,-3,3}, AspectRatio->Automatic]

Note that we have combined two branches of the hyperbola, with positive and negative  x - values, in a single plot.

Here is another example:

graph4type2=ParametricPlot[ {{2Sinh[t],3Cosh[t]},{2Sinh[t],-3Cosh[t]}}, {t,-3,3}, AspectRatio->Automatic]

Practice on your own:
What is the canonical equation of the hyperbola that you have just plotted? You need to answer this question to be able to successfully do a part in Exercise 2 of Part 2 of this Lab. So, do NOT move on without answering this question or, at least, understanding the answer given below.

Answer

((y^2)/9) - ((x^2)/4)= 1,    or equivalently,      ((x^2)/4) - ((y^2)/9)= -1

Some WRONG parametric equations for hyperbolas 
that you should NOT use

You can skip this section on the first reading. Return to it when you work on Exercise 2 of Part 2 for this Lab and also on Lab 3 in a couple of weeks.

In Exercise 2 of Part 2 of this Lab, as well as in Lab 3, you will be asked to plot hyperbolas. Of course, I expect you to use their parametric equations shown above. However, in the past I have seen some students use different equations:
	x(t) = +/- a sec(t),      y(t) = b tan(t),              (WRONG EQUATIONS) 
which they must have found online. 
You may recall that in the syllabus, I wrote that any material that you will ever need in this course is what you will find on the course page. In particular, the  (WRONG EQUATIONS)   are not the ones suggested in the previous section, and based just on that, you should not use them. 
Nonetheless, given the past experience where people used them, I’ll now explain why they should not be used. 
Let’s try to plot a hyperbola using them for  a=2 and  b=3 :

wrongeqs = ParametricPlot[ {{-2Sec[t],3Tan[t]},{2Sec[t],3Tan[t]}}, {t,-3,3}, AspectRatio->Automatic]

Looks pretty much like the graph4type1 earlier. So, it must be good?...
Before jumping to that conclusion, let’s make the same plot, but with the option PlotRange -> All, which you will need to use a lot in Lab 3. (This option forces Mathematica to display the entire graph, not just the part of it that it “likes”. You have seen this option in the section on the Plot command, where you had to plot two graphs together.)

wrongeqsMod = ParametricPlot[ {{-2Sec[t],3Tan[t]},{2Sec[t],3Tan[t]}}, {t,-3,3}, PlotRange->All]

Oops... Two questions:
1. What is that / what is going on here??
and
2. Will this weird behavior also happen with the sinh and cosh parametric equations if we use PlotRange -> All ?
Let’s try to answer the second question first:

graph4type1Mod=ParametricPlot[ {{2Cosh[t],3Sinh[t]},{-2Cosh[t],3Sinh[t]}}, {t,-3,3}, PlotRange->All]

So, the sinh and cosh parametric equations produce the same correct picture even with PlotRange -> All, but the sec and tan parametric equations produce apparent garbage. 

To answer the first question above, let’s try to re-plot the  wrongeqsMod  using different limits for  t:

wrongeqsMod2= ParametricPlot[ {{-2Sec[t],3Tan[t]},{2Sec[t],3Tan[t]}}, {t,-2,2}, PlotRange->All]

Not much better... Try one more:

wrongeqsMod3= ParametricPlot[ {{-2Sec[t],3Tan[t]},{2Sec[t],3Tan[t]}}, {t, -1,1}, PlotRange->All]

This one actually looks correct, except that it is a smaller part of the hyperbola (which isn’t surprising, given that the range for  t  is smaller). What is surprising is that a seemingly innocuous change of the limits for  t, from [-2, 2]  to  [-1, 1],  leads to such a dramatic change of the graph. You can also easily verify that there is no such a dramatic change if you use the sinh and cosh parametric equations.

I will not explain here the underlying reason. My points is different. Namely, if you use the sinh and cosh parametric equations that I recommended, you may vary the range of  t  and obtain predictable results. If, however, you use the sec and tan parametric equations, you may obtain weird results unexpectedly.

Therefore, simply DO NOT USE the  sec  and  tan  parametric equations.

Parametric plots of curves and lines in 3D

Plotting curves (and lines in particular) in 3D is similar to that in 2D. For example:

ParametricPlot3D[ {2t,5-t,3}, {t,-2,2},AxesLabel->{"X","Y","Z"}]

plots a curve with parametric equations 

       x = 2t,      y=5-t,     z=3 .

As you learn in Sec. 12.5, this is a straight line that passes through the point  P = (0,5,3)  and is parallel to the vector   (Overscript[v, →]) = (2,-1,0) . 

Of interest to us now are two circumstances about this line. 
- First, it lies in the plane  z=3 , which is a horizontal plane 3 units above the xy-plane.  
- Second, from the above 3D plot  this line does not appear to be parallel to the xy-plane, as it should be. The culprit is the default view point set by Mathematica. To find a better view point: Click inside the view box in the above plot, hold the cursor, and rotate the box by moving the cursor.

Side note 
You may set different proportions of the axes of the view box as follows:

ParametricPlot3D[ {t,5-t,3}, {t,-2,2},BoxRatios->{1.5,1,1}]

Similarly, one can define a curve (line) that lies in a plane parallel to any other coordinate plane. For example,

ParametricPlot3D[ {-4, 2t,5-t}, {t,-2,2},AxesLabel->{"X","Y","Z"},PlotRange->{{-10,1},{-5,5},{1,6}}]

defines a line that lies in the plane  x = -4, which is a vertical plane 4 units away from the yz-plane.

In Chapter 13 you will encounter fancier curves. Here are just a few examples of different kinds of spirals:

ParametricPlot3D[ {Sin[t], Cos[t],t/2}, {t,-10,10},AxesLabel->{"X","Y","Z"}] 
(* This is a HELIX. *)

ParametricPlot3D[ {(3+Cos[20*t])*Sin[t],(3+Cos[20*t])* Cos[t],Sin[20*t]}, {t,-10,10},AxesLabel->{"X","Y","Z"}] 
(* This is a TOROIDAL SPIRAL. *)

ParametricPlot3D[ {(3+Cos[20*t])*Sin[t],t+Sin[20*t],(3+Cos[20*t])* Cos[t]}, {t,-10,10},AxesLabel->{"X","Y","Z"}] 
(* This is a cross-breed of the two. *)

Delete your output

In the main menu bar, go to “Cell” and select “Delete all output”. This will delete all “Out” cells that your work has produced. The purpose is to reduce the size of your file, which is really a big deal when you have a lot of graphics. This may not be so in this lab, but will be the case in future labs, so get into the habit of deleting output now. When I receive your lab with deleted output, I can restore it by going to the tab “Evaluation” in the main menu bar and selecting “Evaluate notebook”. (Of course, you should NOT manually delete any of the Answer Boxes -- those are not restorable.)

Clear everything before you continue on to Part 2

Clear everything by executing the global clear command, which clears all of the names and functions you have defined up to this point:

Clear["`*"]

The end of Part 1