(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 31957, 1176]*) (*NotebookOutlinePosition[ 32661, 1201]*) (* CellTagsIndexPosition[ 32617, 1197]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ "An Introduction to ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Title", TextAlignment->Center, Background->RGBColor[0, 1, 1]], Cell[TextData[{ "What you are reading is called a ", StyleBox["Mathematica", FontSlant->"Italic"], " notebook. It consists of text, ", StyleBox["Mathematica", FontSlant->"Italic"], " commands, graphics, and other types of cells. A cell is a ", StyleBox["Mathematica", FontSlant->"Italic"], " \"unit,\" bordered by a bracket on the right side of the screen. The \ words \"Introduction to ", StyleBox["Mathematica", FontSlant->"Italic"], "\" above are in one cell, while the rest of the text you are currently \ reading is in another cell. What you are currently reading is a text cell." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Perhaps the most important type of cell is an input cell, such as \ the one below.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(2 + 2\)], "Input", AspectRatioFixed->True], Cell["\<\ You might notice that the brackets at the right bordering the two \ cells above are slightly different. The type of bracket is one way to see \ what type the cell is.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "Input cells are your way to tell ", StyleBox["Mathematica", FontSlant->"Italic"], " to do something. If you click anywhere in the input cell containing 2+2 \ above, and press the enter key on the number pad at the lower right side of \ the keyboard (NOT the return key on a Macintosh or the Enter key next to the \ single and double quote marks on a Windows machine!), something should \ happen. ", StyleBox["Do so now.", FontColor->RGBColor[1, 0, 1]] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "What (hopefully) happened is that ", StyleBox["Mathematica", FontSlant->"Italic"], " started its Kernel, which is the portion of the program used to perform \ calculations. After a short(?) while, the arithmetic you requested should \ have been done, and the sum of 2 and 2 displayed. ", StyleBox["Mathematica", FontSlant->"Italic"], " often does not start the Kernel until you request a calculation to be \ done. (This is a memory and time saving feature, in case you are only typing \ in text and commands which you are not interested in evaluating \ immediately.)" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "To create a new cell, simply move your cursor to a place just between two \ cells, before the first cell in the notebook, or after the last cell in the \ notebook. The cursor will change from vertical to horizontal. If you click \ the mouse, you will get a horizontal line across the window, marking a new \ cell into which you can type or paste. You can choose (or change) the type \ of a cell using the ", StyleBox["Format..Style", FontColor->RGBColor[0, 0, 1]], " menu item. (By default, ", StyleBox["Mathematica", FontSlant->"Italic"], " creates an input cell, unless you tell it otherwise. If the toolbar is \ open at the top of the notebook, you can also choose the cell type by using \ the drop-down box at the left of the toolbar.) ", StyleBox[ "Create a text cell just following this cell, and type something profound \ in it.", FontColor->RGBColor[1, 0, 1]] }], "Text"], Cell[TextData[{ "By the way, if you forgot to choose the cell type for a cell when you \ created it, you can change the cell type by clicking on the cell bracket at \ the right of the cell, and either using the ", StyleBox["Format..Style", FontColor->RGBColor[0, 0, 1]], " menu item or the drop-down box on the toolbar (if it is present at the \ top of the notebook)." }], "Text"], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " allows you to \"group\" cells together. This gives a \"table of contents\ \" look to the screen. Groups of cells have their cell brackets enclosed by \ additional brackets. To open up a group of cells, you can double-click the \ bracket which includes a \"filled-in\" triangle at the bottom of the bracket. \ You can re-close the group by double-clicking the bracket enclosing the \ group while the group is open. For example, the cell you are currently \ reading is the first cell of a group of two cells. To open the group, ", StyleBox[ "double-click the bracket at the right of this cell that has the \ \"filled-in\" triangle (the rightmost bracket). ", FontColor->RGBColor[1, 0, 1]], "Then close the group by ", StyleBox["double-clicking the bracket enclosing both cells.", FontColor->RGBColor[1, 0, 1]] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[StyleBox["Boo!!!", Evaluatable->False, AspectRatioFixed->True, FontSize->72, FontColor->RGBColor[0, 1, 0]]], "SmallText", Evaluatable->False, AspectRatioFixed->True, FontSize->12] }, Closed]], Cell[TextData[{ "The remainder of this notebook consists of groups of cells you will need \ to open in order to read. Notice that there is also a hierarchy of text \ cell types (Title, Subtitle, Section, Subsection, etc.) that are used in \ organizinge notebooks. The cell types are used by ", StyleBox["Mathematica", FontSlant->"Italic"], " if the ", StyleBox["Automatic Grouping", FontColor->RGBColor[0, 0, 1]], " option is chosen in the ", StyleBox["Cell..Cell Grouping", FontColor->RGBColor[0, 0, 1]], " menu item. If the toolbar is open at the top of the notebook, you can \ easily see the type of cell by clicking in the cell, and looking in the \ drop-down box at the left of the toolbar." }], "Text"], Cell[CellGroupData[{ Cell["Palettes", "Section"], Cell[TextData[{ "Several of the commands you will need to use can be found in the palettes, \ available from the ", StyleBox["File..Palettes", FontColor->RGBColor[0, 0, 1]], " menu item. An example is the ", StyleBox["BasicInput", FontColor->RGBColor[0, 0, 1]], " palette. If it is not open, you might wish to open it now. It has \ buttons for exponents, square roots, a few Calculus operations, and many \ symbols. Other palettes include ", StyleBox["AlgebraicManipulation", FontColor->RGBColor[0, 0, 1]], ", ", StyleBox["Calculus", FontColor->RGBColor[0, 0, 1]], ", ", StyleBox["LinearAlgebra", FontColor->RGBColor[0, 0, 1]], ", ", StyleBox["Multivariable", FontColor->RGBColor[0, 0, 1]], " (Calculus), ", StyleBox["DifferentialEquations", FontColor->RGBColor[0, 0, 1]], ", and ", StyleBox["Plotting", FontColor->RGBColor[0, 0, 1]], "." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Arithmetic in ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Section"], Cell[TextData[{ "The basic operations of arithmetic are easy to do in ", StyleBox["Mathematica", FontSlant->"Italic"], ". You already have seen how to add. Subtraction, multiplication, \ division, and exponentiation are shown below. ", StyleBox[ " For each of the input cells below, click anywhere in the cell and press \ enter to evaluate the cell.", FontColor->RGBColor[1, 0, 1]] }], "Text"], Cell["Subtraction is straightforward.", "Text"], Cell[BoxData[ \(7 - 4\)], "Input"], Cell[TextData[{ "We can either use a space or use an asterix (", StyleBox["*", FontColor->RGBColor[1, 0, 0]], ") to tell ", StyleBox["Mathematica", FontSlant->"Italic"], " to multiply. " }], "Text"], Cell[BoxData[ \(3\ 5\)], "Input"], Cell[BoxData[ \(3*5\)], "Input"], Cell[TextData[{ "Division can be done either by the palette symbol ", Cell[BoxData[ FormBox[ StyleBox[\(\[Placeholder]\/\[Placeholder]\), FontColor->RGBColor[1, 0, 0]], TraditionalForm]]], ", or by using ", StyleBox["/", FontColor->RGBColor[1, 0, 0]], ". " }], "Text"], Cell[BoxData[ \(8\/2\)], "Input"], Cell[BoxData[ \(8/2\)], "Input"], Cell[TextData[{ "Exponentiation can be done either by the palette symbol ", Cell[BoxData[ FormBox[ StyleBox[\(\[Placeholder]\^\[Placeholder]\), FontColor->RGBColor[1, 0, 0]], TraditionalForm]]], "or by using ", StyleBox["^", FontColor->RGBColor[1, 0, 0]], "." }], "Text"], Cell[BoxData[ \(3\^4\)], "Input"], Cell[BoxData[ \(3^4\)], "Input"], Cell[TextData[{ "Unless we say otherwise, ", StyleBox["Mathematica", FontSlant->"Italic"], " will do exact arithmetic. For example" }], "Text"], Cell[BoxData[ \(4\/3\)], "Input"], Cell[TextData[{ "What you get is a fraction, not a decimal. ", StyleBox["Mathematica", FontSlant->"Italic"], " will even do rational arithmetic." }], "Text"], Cell[BoxData[ \(4\/3 + 7\/5\)], "Input"], Cell[TextData[{ "In order to get a decimal, we need to tell ", StyleBox["Mathematica", FontSlant->"Italic"], " that we want approximate arithmetic. We can do this in any of three \ ways:" }], "Text"], Cell[BoxData[ \(N[4\/3]\)], "Input"], Cell[BoxData[ \(4\/3 // N\)], "Input"], Cell[BoxData[ \(4. \/3. \)], "Input"], Cell[TextData[{ "As long as one number in the expression has a decimal point, ", StyleBox["Mathematica", FontSlant->"Italic"], " will return decimal answers." }], "Text"], Cell[BoxData[ \(4. \/3\)], "Input"], Cell[TextData[{ "Using ", StyleBox["N", FontColor->RGBColor[1, 0, 0]], " we can control the number of significant figures displayed, but the \ details are pretty annoying, and I don't completely understand them. For \ instance, if we want 20 significant figures of \[Pi]/4, we use" }], "Text"], Cell[BoxData[ \(N[Pi/4, 20]\)], "Input"], Cell["\<\ However, if you ask for fewer than 17 figures, you get only \ 6:\ \>", "Text"], Cell[BoxData[ \(N[Pi/4, 16]\)], "Input"], Cell[TextData[{ "Also, if you enter any numbers as decimals with fewer than 18 figures, ", StyleBox["Mathematica", FontSlant->"Italic"], " will only give you 6 digits in the answer. " }], "Text"], Cell[BoxData[ \(N[Pi/1.2345678901234567, 25]\)], "Input"], Cell[BoxData[ \(N[Pi/1.23456789012345678, 18]\)], "Input"], Cell[TextData[{ "Also, if you enter numbers as decimals, ", StyleBox["Mathematica", FontSlant->"Italic"], " will not give you more digits in the output than you had in the input:" }], "Text"], Cell[BoxData[ \(N[Pi/1.23456789012345678, 25]\)], "Input"], Cell[BoxData[ \(N[Pi/1.234567890123456789012345, 25]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Grouping in expressions", "Section"], Cell[TextData[{ "In order to group in expressions to set the order of evaluation, you must \ use parentheses ", StyleBox["( )", FontColor->RGBColor[1, 0, 0]], ". Square brackets ", StyleBox["[ ]", FontColor->RGBColor[1, 0, 0]], " are reserved by ", StyleBox["Mathematica", FontSlant->"Italic"], " for arguments to functions, and curly braces ", StyleBox["{ }", FontColor->RGBColor[1, 0, 0]], " are reserved for lists (see the sections Functions and Lists below). ", StyleBox["Evaluate the cells below to see what happens.", FontColor->RGBColor[1, 0, 1]] }], "Text"], Cell[BoxData[ \(3 \((6 - 2)\)\)], "Input"], Cell[BoxData[ \(3[6 - 2]\)], "Input"], Cell[BoxData[ \(3 {6 - 2}\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Built-in functions and variable values", "Section"], Cell[TextData[{ "Built-in ", StyleBox["Mathematica", FontSlant->"Italic"], " functions and constants start with CAPITAL letters, and use square \ brackets ", StyleBox["[ ]", FontColor->RGBColor[1, 0, 0]], " to enclose the arguments. (This is the only place where you use square \ brackets.) For example, the function sin(x) is denoted in ", StyleBox["Mathematica", FontSlant->"Italic"], " by ", StyleBox["Sin[x]", FontColor->RGBColor[1, 0, 0]], ". The number 3.1415.... is denoted by ", StyleBox["Pi", FontColor->RGBColor[1, 0, 0]], " or by the palette symbol ", StyleBox["\[Pi]", FontColor->RGBColor[1, 0, 0]], " , and 2.71828... by ", StyleBox["E", FontColor->RGBColor[1, 0, 0]], " or the palette symbol ", StyleBox["\[ExponentialE]", FontColor->RGBColor[1, 0, 0]], ". Several functions are available as buttons in the ", StyleBox["Calculus", FontColor->RGBColor[0, 0, 1]], " and ", StyleBox["Multivariable", FontColor->RGBColor[0, 0, 1]], " palettes. You may wish to open the ", StyleBox["Calculus", FontColor->RGBColor[0, 0, 1]], " palette and take a look at it now." }], "Text"], Cell[BoxData[ \(Sin[\[Pi]\/3]\)], "Input"], Cell[TextData[{ "Square roots can be done either by the palette symbol ", Cell[BoxData[ FormBox[ StyleBox[\(\@\[Placeholder]\), FontColor->RGBColor[1, 0, 0]], TraditionalForm]]], " or by the function ", StyleBox["Sqrt[ ]", FontColor->RGBColor[1, 0, 0]], "." }], "Text"], Cell[BoxData[ \(\@9\)], "Input"], Cell[BoxData[ \(Sqrt[9]\)], "Input"], Cell["Why is the result of the next cell not x?", "Text"], Cell[BoxData[{ \(Clear[x]\), "\n", \(\@x\^2\)}], "Input"], Cell[TextData[{ "(The ", StyleBox["Clear[ ]", FontColor->RGBColor[1, 0, 0]], " command is used just in case x had been assigned a value earlier. When \ working with a letter or name that you want to represent a variable, it is \ often good practice to ", StyleBox["Clear", FontColor->RGBColor[1, 0, 0]], " it first.)" }], "Text"], Cell[TextData[{ "The base e logarithm is given by ", StyleBox["Log[x]", FontColor->RGBColor[1, 0, 0]], ". For logarithms with base b, use ", StyleBox["Log[b,x]", FontColor->RGBColor[1, 0, 0]], ". " }], "Text"], Cell[BoxData[ \(Log[3]\)], "Input"], Cell[BoxData[ \(N[Log[3]]\)], "Input"], Cell[BoxData[ \(Log[10, 3]\)], "Input"], Cell[BoxData[ \(N[Log[10, 3]]\)], "Input"], Cell[BoxData[ \(Log[\[ExponentialE]]\)], "Input"], Cell[BoxData[ \(Log[10, 10]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Defining your own functions and variable values", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We can assign values to variables using ", StyleBox["=", FontColor->RGBColor[1, 0, 0]], " or ", StyleBox[":=", FontColor->RGBColor[1, 0, 0]], "." }], "Text"], Cell[BoxData[ \(a = 4\)], "Input"], Cell[BoxData[ \(a\)], "Input"], Cell[BoxData[ \(b := 3\)], "Input"], Cell[BoxData[ \(b\)], "Input"], Cell[TextData[{ StyleBox[":=", FontColor->RGBColor[1, 0, 0]], " is called \"delayed execution.\" The right hand side is not immediately \ evaluated by ", StyleBox["Mathematica", FontSlant->"Italic"], ", but is instead evaluated only when you later evaluate a cell containing \ the left hand side. Notice that ", StyleBox["Mathematica", FontSlant->"Italic"], " does not give any output when you evaluate the cell with ", StyleBox[":=", FontColor->RGBColor[1, 0, 0]], " in it. The difference from the first method is a little subtle, but you \ can see the effect using the following example. ", StyleBox["Random[ ]", FontColor->RGBColor[1, 0, 0]], " is a ", StyleBox["Mathematica", FontSlant->"Italic"], " function choosing a pseudorandom number." }], "Text"], Cell[BoxData[ \(r1 = Random[\ ]\)], "Input"], Cell[BoxData[ \(r1\)], "Input"], Cell[BoxData[ \(r1\)], "Input"], Cell[BoxData[ \(r2 := Random[\ ]\)], "Input"], Cell[BoxData[ \(r2\)], "Input"], Cell[BoxData[ \(r2\)], "Input"], Cell[TextData[{ "As you can see, if we use ", StyleBox["=", FontColor->RGBColor[1, 0, 0]], " there is a final assignment to the variable r1, and every time you input \ r1 you get the same answer. Using ", StyleBox[":=", FontColor->RGBColor[1, 0, 0]], ", ", StyleBox["Mathematica", FontSlant->"Italic"], " waits until you evaluate a cell with r2 in it, and then finds a value. \ You can get different answers each time you evaluate r2." }], "Text"], Cell[TextData[{ "Functions are often defined by mathematical formulas like f(x) = ", Cell[BoxData[ \(TraditionalForm\`x\^2\)]], " sin(", Cell[BoxData[ \(TraditionalForm\`1\/x\)]], "). To input this function into ", StyleBox["Mathematica", FontSlant->"Italic"], " and name it f[x], we evaluate the input cell" }], "Text", Evaluatable->False, AspectRatioFixed->True, FontSize->12], Cell[BoxData[{ \(Clear[f, x]\), "\n", \(f[x_] = x\^2\ Sin[1\/x]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "Note the underscore after the x on the left. That has to be there. It \ tells ", StyleBox["Mathematica", FontSlant->"Italic"], " that x is only serving as a placeholder when you define the function \ rule, and that you are defining a function rather than just a variable. We \ also use ", StyleBox["Clear[ ]", FontColor->RGBColor[1, 0, 0]], " just in case f and x had been given some previous meaning (they haven't, \ but ", StyleBox["Clear[ ]", FontColor->RGBColor[1, 0, 0]], "'ing is a good habit to get in to as we noticed earlier)." }], "Text", Evaluatable->False, AspectRatioFixed->True, FontSize->12], Cell["\<\ Having defined the function f[x], you can now use it just like the \ built in functions:\ \>", "Text", Evaluatable->False, AspectRatioFixed->True, FontSize->12], Cell[BoxData[ \(f[ .5]\)], "Input", AspectRatioFixed->True], Cell[BoxData[{ \(Clear[t]\), "\n", \(f[t]\)}], "Input", AspectRatioFixed->True], Cell[BoxData[ \(f[x\^2]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "Actually, we can also use the ", StyleBox[":=", FontColor->RGBColor[1, 0, 0]], " method for defining functions." }], "Text"], Cell[BoxData[{ \(Clear[new, z]\), "\n", \(new[z_] := z\/\(z\^2 + 1\)\)}], "Input"], Cell[BoxData[ \(new[2]\)], "Input"], Cell[BoxData[ \(new[x\^2]\)], "Input"], Cell[TextData[{ "Most user defined functions in ", StyleBox["Mathematica", FontSlant->"Italic"], " should start with a lower case letter to avoid any possible conflict with \ a built-in ", StyleBox["Mathematica", FontSlant->"Italic"], " function. Although there are times when it is important to use ", StyleBox["=", FontColor->RGBColor[1, 0, 0]], " instead of ", StyleBox[":=", FontColor->RGBColor[1, 0, 0]], " and vice-versa, as a rule of thumb most people use ", StyleBox[":=", FontColor->RGBColor[1, 0, 0]], " in defining new functions." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Lists", "Section"], Cell[TextData[{ "In order to tell Mathematica that what you are typing in is a list, you \ enclose it in braces ", StyleBox["{ }", FontColor->RGBColor[1, 0, 0]], ". For example, here is a list of numbers we will call \"ourlist\"." }], "Text"], Cell[BoxData[{ \(Clear[ourlist]\), "\n", \(ourlist = {1, 2, 3, 4, 5}\)}], "Input"], Cell["\<\ We can apply functions to lists the same way we apply functions to \ numbers.\ \>", "Text"], Cell[BoxData[ \(Log[{1, 2, 3, 4, 5}]\)], "Input"], Cell["\<\ Notice we can use the name we gave the list as well (provided we \ have evaluated the cell above defining \"ourlist\").\ \>", "Text"], Cell[BoxData[ \(Log[ourlist]\)], "Input"], Cell[TextData[{ "As you can see, Mathematica is doing everything symbolically. If we want \ numerical approximations to the result, we can use ", StyleBox["N[ ]", FontColor->RGBColor[1, 0, 0]], " or ", StyleBox["//N", FontColor->RGBColor[1, 0, 0]], "." }], "Text"], Cell[BoxData[ \(N[Log[{1, 2, 3, 4, 5}]]\)], "Input"], Cell["\<\ As before, we can also get numerical approximations by including a \ decimal point as part of the number.\ \>", "Text"], Cell[BoxData[ \(Log[{1. , 2. , 3. , 4. , 5. }]\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " will also do arithmetic operations on lists when the lists have the same \ size and shape, or when a constant is being used. For instance, to add 3 to \ everything in our list, we can use (provided we have evaluated the cell \ defining \"ourlist\")" }], "Text"], Cell[BoxData[ \(3 + ourlist\)], "Input"], Cell["Here are some other arithmetic operations", "Text"], Cell[BoxData[ \(5 + {0, 2, 4}\)], "Input"], Cell[BoxData[ \({1, 2, 3} + {4, 5, 6}\)], "Input"], Cell[BoxData[ \(2\ {1, 1, 2, 3, 5}\)], "Input"], Cell[BoxData[ \({1, 2, 3, 4, 5}\ {2, 4, 6, 8, 10}\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Plotting (two dimensional)", "Section"], Cell[TextData[{ "Graphs are done using the many Plotting commands. Some of these are \ available as buttons on the ", StyleBox["Plotting", FontColor->RGBColor[0, 0, 1]], " palette. For example, to draw the graph of Sin[x] on the interval [-2 \ \[Pi], 2 \[Pi]], you could use the following command:" }], "Text"], Cell[BoxData[ \(Plot[Sin[x], {x, \(-2\)\ \[Pi], \ 2\ \[Pi]}]\)], "Input"], Cell[TextData[{ "Note that the variable and the interval are given as a list; remember that \ ", StyleBox["Mathematica", FontSlant->"Italic"], " requires curly braces { } around any list.\nBy the way, to get \ information on a command, you can highlight it with the mouse, and choose the \ ", StyleBox["Help...Find in Help", FontColor->RGBColor[0, 0, 1]], " menu item. ", StyleBox["Try this with the word ", FontColor->RGBColor[1, 0, 1]], StyleBox["Plot", FontColor->RGBColor[1, 0, 0]], StyleBox[" in the cell above", FontColor->RGBColor[1, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], "(not the whole line, just the word!)." }], "Text"], Cell[TextData[{ "Another way to get some information is to input ? or ?? before the name of \ the command. ", StyleBox["Try this in the cells below, and see what happens.", FontColor->RGBColor[1, 0, 1]] }], "Text"], Cell[BoxData[ \(\(?Plot\)\)], "Input"], Cell[BoxData[ \(?? Plot\)], "Input"], Cell[TextData[{ "If you evaluated the ", StyleBox["??Plot", FontColor->RGBColor[1, 0, 0]], " cell, you also saw that there are many, many options to the ", StyleBox["Plot", FontColor->RGBColor[1, 0, 0]], " command. You also saw the \"default\" settings of those options. You \ can change these defaults, as you can see in the More plotting subsection \ below." }], "Text"], Cell["\<\ One way to plot two graphs on the same set of axes is to use a list \ of functions in place of the single function. For instance, to plot both \ sin(t) and sin(2t) on the same set of axes, we can use\ \>", "Text"], Cell[BoxData[ \(\(Plot[{Sin[t], Sin[2\ t]}, {t, \(-2\)\ \[Pi], 2\ \[Pi]}];\)\)], "Input",\ AspectRatioFixed->True], Cell[CellGroupData[{ Cell["More plotting (a few of the options)", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "In order to draw a graph, ", StyleBox["Mathematica", FontSlant->"Italic"], " makes some choices for you. You may not always be pleased with the \ choices it makes. In the following plot, ", StyleBox["Mathematica", FontSlant->"Italic"], " chooses a scale that chops off the upper part of the graph." }], "Text", Evaluatable->False], Cell[BoxData[ \(\(Plot[x\^2\ 4\^x, {x, \(-4\), 2}];\)\)], "Input"], Cell[TextData[{ "You can insist that ", StyleBox["Mathematica", FontSlant->"Italic"], " display the whole thing like this:" }], "Text", Evaluatable->False], Cell[BoxData[ \(\(Plot[x\^2\ 4\^x, {x, \(-4\), 2}, PlotRange \[Rule] All];\)\)], "Input"], Cell["\<\ All this rescaling to make things fit can be undesirable when the \ graph is supposed to represent geometric objects. For example, the following \ circle probably doesn't look very round to you.\ \>", "Text", Evaluatable->False], Cell[BoxData[{ \(\(top = \@\(1 - x\^2\);\)\), "\n", \(\(bottom = \(-top\);\)\), "\n", \(\(Plot[{top, bottom}, {x, \(-1\), 1}];\)\)}], "Input"], Cell[TextData[{ "You can force ", StyleBox["Mathematica", FontSlant->"Italic"], " to use the same scale on the horizontal and vertical axes with the \ directive ", StyleBox["AspectRatio\[Rule]Automatic", FontColor->RGBColor[1, 0, 0]], "." }], "Text", Evaluatable->False], Cell[BoxData[ \(\(Plot[{top, bottom}, {x, \(-1\), 1}, AspectRatio \[Rule] Automatic];\)\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Exercises (do only if you feel you want the practice)", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Numerical Calculations", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["1)\tHave ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[" calculate the following: 5+12, 5x12, 5/12 , and ", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(TraditionalForm\`5\^12\)]] }], "Text", Evaluatable->False], Cell["2)\tCalculate decimal value of sin(1) .", "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[TextData[{ StyleBox[ "3) \t(Adapted from Skeel and Keiper, Elementary Numerical Computing with ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Plain"], StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Plain", FontSlant->"Italic"], StyleBox[")", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Plain"] }], "Text", Evaluatable->False], Cell["\tHere are two numbers:", "Text", Evaluatable->False], Cell[BoxData[{ \(\(a = 3764847038432651\ E; \)\), \(\(b = 3257556411651706\ \[Pi]; \)\)}], "Input"], Cell["\tWhich one is bigger? Note: they're NOT equal.", "Text", Evaluatable->False] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Plotting", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["1)\tIntersections of two graphs", "Text"], Cell[TextData[{ "Estimate the point where the graphs of", StyleBox[" f(x) = ", FontSize->13], Cell[BoxData[ \(TraditionalForm\`x\^2\)], FontSize->12], StyleBox[" and g(x) =", FontSize->12], Cell[BoxData[ \(TraditionalForm\`2\^x\)], FontSize->12], " cross. You can do this by \t\tplotting the two graphs together and \ \"zooming\" in on the points of intersection. For example:" }], "Text", Evaluatable->False], Cell[BoxData[ \(Plot[{x\^2, 2\^x}, {x, \(-3\), 3}]\)], "Input"], Cell["\<\ This graph shows an intersection near (2,4) (you should have \ expected that one) and another \tnear x = -1. So narrow the domain (i.e. \ zoom):\ \>", "Text", Evaluatable->False], Cell[BoxData[ \(Plot[{x\^2, 2\^x}, {x, \(-1\), 0}]\)], "Input"], Cell["\<\ Do this a few times until you have determined the point of \ intersection to two places after the \tdecimal point.\ \>", "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell["2) \tLocal Linearity", "Text", Evaluatable->False], Cell["\<\ By zooming in near the given point, illustrate that the following \ function is locally linear \t\tand estimate the slope near the given point.\ \ \>", "Text", Evaluatable->False], Cell[TextData[{ "\t", Cell[BoxData[ \(TextForm\`\(\tf \((x)\)\ = \ \(x\^2\ near\ x = \(-3\)\)\)\)]] }], "Text"], Cell["", "Text"], Cell["\t", "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["A Calculus exercise.", "Subsection"], Cell[TextData[{ "Use ", StyleBox["Mathematica", FontSlant->"Italic"], "'s derivative command, ", Cell[BoxData[ FormBox[ RowBox[{ StyleBox[\(\[PartialD]\_\[Placeholder]\ \[Placeholder]\), FontColor->RGBColor[1, 0, 0]], ",", " ", \((on\ the\)}], TraditionalForm]]], StyleBox["BasicInput", FontColor->RGBColor[0, 0, 1]], " or ", StyleBox["Calculus", FontColor->RGBColor[0, 0, 1]], " palette), and the ", StyleBox["Factor", FontColor->RGBColor[1, 0, 0]], " command (", StyleBox["AlgebraicManipulation", FontColor->RGBColor[0, 0, 1]], " palette) to find all critical points and inflection points of the graph \ of the polynomial\n ", Cell[BoxData[ \(x\^4\/2\)], FontFamily->"Times"], Cell[BoxData[ \(\(+\(x\^3\/3\)\)\)], FontFamily->"Times"], Cell[BoxData[ \(\(-\(\(7\ x\^2\)\/2\)\)\)], FontFamily->"Times"], "- 6 x + 2.\nFor the derivative command, the small box just to the right of \ the ", Cell[BoxData[ FormBox[ StyleBox[\(\[PartialD]\ \), FontColor->RGBColor[1, 0, 0]], TraditionalForm]]], "is for the variable you are using for the function (in this case x) and \ the larger box is for the function. Make sure you put parentheses around the \ function following the ", Cell[BoxData[ FormBox[ StyleBox[\(\[PartialD]\_\[Placeholder]\), FontColor->RGBColor[1, 0, 0]], TraditionalForm]]], ".\nTry to use ", StyleBox["Mathematica", FontSlant->"Italic"], "'s ", StyleBox["Solve", FontColor->RGBColor[1, 0, 0]], " command to find the x-intercepts of the graph. (Look in the ", StyleBox["BasicCalculations", FontColor->RGBColor[0, 0, 1]], " palette, under ", StyleBox["Algebra", FontColor->RGBColor[0, 0, 1]], ", then ", StyleBox["Solving Equations", FontColor->RGBColor[0, 0, 1]], ", to find this command.) Once you have done this, sketch the graph on a \ piece of paper, labeling all intercepts, critical points, and points of \ inflection. Then plot the polynomial using the ", StyleBox["Plot", FontColor->RGBColor[1, 0, 0]], " command, and compare your graph with ", StyleBox["Mathematica", FontSlant->"Italic"], "'s. Do your work in cells below this one. " }], "Text"] }, Closed]] }, Closed]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, WindowToolbars->"EditBar", CellGrouping->Manual, WindowSize->{725, 609}, WindowMargins->{{17, Automatic}, {Automatic, 10}} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1717, 49, 162, 6, 131, "Title"], Cell[1882, 57, 683, 18, 71, "Text", Evaluatable->False], Cell[2568, 77, 154, 5, 33, "Text", Evaluatable->False], Cell[2725, 84, 64, 2, 30, "Input"], Cell[2792, 88, 239, 6, 52, "Text", Evaluatable->False], Cell[3034, 96, 546, 13, 71, "Text", Evaluatable->False], Cell[3583, 111, 665, 15, 90, "Text", Evaluatable->False], Cell[4251, 128, 929, 19, 128, "Text"], Cell[5183, 149, 390, 8, 71, "Text"], Cell[CellGroupData[{ Cell[5598, 161, 964, 19, 128, "Text", Evaluatable->False], Cell[6565, 182, 207, 7, 97, "SmallText", Evaluatable->False] }, Closed]], Cell[6787, 192, 740, 16, 87, "Text"], Cell[CellGroupData[{ Cell[7552, 212, 27, 0, 59, "Section"], Cell[7582, 214, 920, 29, 90, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[8539, 248, 101, 4, 39, "Section"], Cell[8643, 254, 413, 10, 52, "Text"], Cell[9059, 266, 47, 0, 33, "Text"], Cell[9109, 268, 38, 1, 30, "Input"], Cell[9150, 271, 216, 8, 33, "Text"], Cell[9369, 281, 37, 1, 30, "Input"], Cell[9409, 284, 36, 1, 30, "Input"], Cell[9448, 287, 306, 10, 36, "Text"], Cell[9757, 299, 37, 1, 42, "Input"], Cell[9797, 302, 36, 1, 30, "Input"], Cell[9836, 305, 309, 10, 33, "Text"], Cell[10148, 317, 37, 1, 30, "Input"], Cell[10188, 320, 36, 1, 30, "Input"], Cell[10227, 323, 154, 5, 33, "Text"], Cell[10384, 330, 37, 1, 42, "Input"], Cell[10424, 333, 168, 5, 33, "Text"], Cell[10595, 340, 44, 1, 42, "Input"], Cell[10642, 343, 210, 6, 33, "Text"], Cell[10855, 351, 40, 1, 42, "Input"], Cell[10898, 354, 42, 1, 42, "Input"], Cell[10943, 357, 41, 1, 42, "Input"], Cell[10987, 360, 180, 5, 33, "Text"], Cell[11170, 367, 39, 1, 42, "Input"], Cell[11212, 370, 304, 7, 52, "Text"], Cell[11519, 379, 44, 1, 30, "Input"], Cell[11566, 382, 88, 3, 33, "Text"], Cell[11657, 387, 44, 1, 30, "Input"], Cell[11704, 390, 206, 5, 33, "Text"], Cell[11913, 397, 61, 1, 30, "Input"], Cell[11977, 400, 62, 1, 30, "Input"], Cell[12042, 403, 201, 5, 33, "Text"], Cell[12246, 410, 62, 1, 30, "Input"], Cell[12311, 413, 69, 1, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[12417, 419, 42, 0, 39, "Section"], Cell[12462, 421, 607, 17, 71, "Text"], Cell[13072, 440, 46, 1, 30, "Input"], Cell[13121, 443, 41, 1, 30, "Input"], Cell[13165, 446, 42, 1, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13244, 452, 57, 0, 39, "Section"], Cell[13304, 454, 1180, 37, 90, "Text"], Cell[14487, 493, 46, 1, 40, "Input"], Cell[14536, 496, 307, 10, 33, "Text"], Cell[14846, 508, 36, 1, 32, "Input"], Cell[14885, 511, 40, 1, 30, "Input"], Cell[14928, 514, 57, 0, 33, "Text"], Cell[14988, 516, 66, 2, 53, "Input"], Cell[15057, 520, 348, 10, 52, "Text"], Cell[15408, 532, 228, 8, 33, "Text"], Cell[15639, 542, 39, 1, 30, "Input"], Cell[15681, 545, 42, 1, 30, "Input"], Cell[15726, 548, 43, 1, 30, "Input"], Cell[15772, 551, 46, 1, 30, "Input"], Cell[15821, 554, 53, 1, 30, "Input"], Cell[15877, 557, 44, 1, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[15958, 563, 114, 2, 39, "Section", Evaluatable->False], Cell[16075, 567, 192, 8, 33, "Text"], Cell[16270, 577, 38, 1, 30, "Input"], Cell[16311, 580, 34, 1, 30, "Input"], Cell[16348, 583, 39, 1, 30, "Input"], Cell[16390, 586, 34, 1, 30, "Input"], Cell[16427, 589, 810, 22, 90, "Text"], Cell[17240, 613, 48, 1, 30, "Input"], Cell[17291, 616, 35, 1, 30, "Input"], Cell[17329, 619, 35, 1, 30, "Input"], Cell[17367, 622, 49, 1, 30, "Input"], Cell[17419, 625, 35, 1, 30, "Input"], Cell[17457, 628, 35, 1, 30, "Input"], Cell[17495, 631, 475, 13, 52, "Text"], Cell[17973, 646, 416, 14, 55, "Text", Evaluatable->False], Cell[18392, 662, 112, 3, 63, "Input"], Cell[18507, 667, 658, 18, 71, "Text", Evaluatable->False], Cell[19168, 687, 176, 6, 33, "Text", Evaluatable->False], Cell[19347, 695, 65, 2, 30, "Input"], Cell[19415, 699, 90, 3, 50, "Input"], Cell[19508, 704, 66, 2, 31, "Input"], Cell[19577, 708, 151, 5, 33, "Text"], Cell[19731, 715, 91, 2, 61, "Input"], Cell[19825, 719, 39, 1, 30, "Input"], Cell[19867, 722, 42, 1, 31, "Input"], Cell[19912, 725, 596, 18, 71, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[20545, 748, 24, 0, 39, "Section"], Cell[20572, 750, 253, 6, 52, "Text"], Cell[20828, 758, 91, 2, 50, "Input"], Cell[20922, 762, 101, 3, 33, "Text"], Cell[21026, 767, 53, 1, 30, "Input"], Cell[21082, 770, 143, 3, 33, "Text"], Cell[21228, 775, 45, 1, 30, "Input"], Cell[21276, 778, 283, 9, 33, "Text"], Cell[21562, 789, 56, 1, 30, "Input"], Cell[21621, 792, 130, 3, 33, "Text"], Cell[21754, 797, 63, 1, 30, "Input"], Cell[21820, 800, 334, 7, 52, "Text"], Cell[22157, 809, 44, 1, 30, "Input"], Cell[22204, 812, 57, 0, 33, "Text"], Cell[22264, 814, 46, 1, 30, "Input"], Cell[22313, 817, 54, 1, 30, "Input"], Cell[22370, 820, 51, 1, 30, "Input"], Cell[22424, 823, 66, 1, 30, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[22527, 829, 45, 0, 39, "Section"], Cell[22575, 831, 322, 7, 52, "Text"], Cell[22900, 840, 77, 1, 30, "Input"], Cell[22980, 843, 690, 20, 71, "Text"], Cell[23673, 865, 223, 5, 52, "Text"], Cell[23899, 872, 42, 1, 30, "Input"], Cell[23944, 875, 40, 1, 30, "Input"], Cell[23987, 878, 392, 10, 52, "Text"], Cell[24382, 890, 224, 4, 52, "Text"], Cell[24609, 896, 121, 3, 30, "Input"], Cell[CellGroupData[{ Cell[24755, 903, 106, 2, 47, "Subsection", Evaluatable->False], Cell[24864, 907, 367, 10, 52, "Text", Evaluatable->False], Cell[25234, 919, 70, 1, 31, "Input"], Cell[25307, 922, 167, 6, 33, "Text", Evaluatable->False], Cell[25477, 930, 93, 1, 31, "Input"], Cell[25573, 933, 240, 5, 52, "Text", Evaluatable->False], Cell[25816, 940, 156, 3, 73, "Input"], Cell[25975, 945, 290, 10, 33, "Text", Evaluatable->False], Cell[26268, 957, 113, 2, 30, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[26430, 965, 120, 2, 39, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[26575, 971, 92, 2, 47, "Subsection", Evaluatable->False], Cell[26670, 975, 398, 14, 33, "Text", Evaluatable->False], Cell[27071, 991, 77, 1, 33, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[27173, 996, 445, 17, 33, "Text", Evaluatable->False], Cell[27621, 1015, 61, 1, 33, "Text", Evaluatable->False], Cell[27685, 1018, 108, 2, 50, "Input"], Cell[27796, 1022, 86, 1, 33, "Text", Evaluatable->False] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[27931, 1029, 78, 2, 31, "Subsection", Evaluatable->False], Cell[CellGroupData[{ Cell[28034, 1035, 47, 0, 33, "Text"], Cell[28084, 1037, 453, 15, 47, "Text", Evaluatable->False], Cell[28540, 1054, 67, 1, 31, "Input"], Cell[28610, 1057, 191, 5, 46, "Text", Evaluatable->False], Cell[28804, 1064, 67, 1, 31, "Input"], Cell[28874, 1067, 160, 4, 46, "Text", Evaluatable->False] }, Closed]], Cell[CellGroupData[{ Cell[29071, 1076, 58, 1, 30, "Text", Evaluatable->False], Cell[29132, 1079, 191, 5, 46, "Text", Evaluatable->False], Cell[29326, 1086, 122, 4, 31, "Text"], Cell[29451, 1092, 16, 0, 30, "Text"], Cell[29470, 1094, 18, 0, 30, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[29537, 1100, 42, 0, 31, "Subsection"], Cell[29582, 1102, 2347, 70, 191, "Text"] }, Closed]] }, Closed]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)