(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 74439, 2197] NotebookOptionsPosition[ 69692, 2054] NotebookOutlinePosition[ 70057, 2070] CellTagsIndexPosition[ 70014, 2067] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[TextData[{ StyleBox["Lab 2C - Directional Derivatives, Gradients, and Vector Fields", FontSize->14, FontWeight->"Bold", FontVariations->{"Underline"->True}], "\nMath 2374 - University of Minnesota\nhttp://www.math.umn.edu/math2374\n\ Questions to: rogness@math.umn.edu" }], "Text", CellFrame->True, TextAlignment->Center, FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Introduction", FontSize->16]], "Section"], Cell[TextData[{ "This week's lab is sort of a mish-mash of a few different topics which are \ all interrelated: directional derivatives, gradients, and vector fields. \ These topics are all covered in your book, but ", StyleBox["Mathematica", FontSlant->"Italic"], " can help you visualize them in ways not possible on a blackboard or on a \ written page.\n\nWhen you started this class, you already knew about the \ plain-old single variable calculus derivative, i.e. the slope of the tangent \ line. Since then you've learned about two multivariable generalizations of \ the derivative, the \"partial derivative\" and the \"total derivative\" \ (which is also called the \"derivative matrix\" or \"Jacobian matrix\"). \ These two concepts are intertwined, of course, because the derivative matrix \ is composed of a bunch of partial derivatives. \n\nIn this lab, we're going \ to deal with variants of both of these ideas. The directional derivative is \ a generalization of a partial derivative. The gradient, meanwhile, is a \ special case of the Jacobian matrix. In what might seem to be either a \ bizarre coincidence or a stroke of good luck, the gradient is very useful for \ ", StyleBox["calculating", FontSlant->"Italic"], " the directional derivative. It also turns out that the gradient provides \ an example of a vector field, which will be an important new kind of function \ for the rest of the course.\n\nIf you're getting confused trying to keep \ track of all these connections, don't worry. You know what? This stuff ", StyleBox["is", FontSlant->"Italic"], " confusing! But the more you work with these ideas, the easier it gets. \ This lab can help, too, by showing you some visual examples, and explaining \ things that you've also learned about in lecture. Sometimes it can really \ help to read or hear a second explanation about a topic, even if the first \ one was very good!\n\nWith that in mind, this lab includes very few problems, \ but a lot of reading and a number of pictures. Above all, resist the \ temptation to scan over a few sentences here, gloss over this paragraph \ there, and just skim through the material about this or that. Gradients and \ vector fields, in particular, will be absolutely fundamental for the rest of \ the course, so it's important to learn these ideas. (That's why they're \ being covered in both lecture and lab.) If a sentence or paragraph is really \ confusing, read it over again, slowly, a few times. If you're still not sure \ what it says, ask your TA for help." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Directional Derivatives and Gradients", "Section", FontSize->16], Cell[TextData[{ "Let's go back to partial derivatives for a minute. Recall that if you're \ on a surface ", Cell[BoxData[ FormBox[ RowBox[{"z", "=", RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}]}], TraditionalForm]]], "above (or below) a point ", Cell[BoxData[ FormBox[ RowBox[{"(", RowBox[{"x", ",", "y"}], ")"}], TraditionalForm]]], ", then partial derivative of f with respect to x tells you how steep the \ surface is in the positive x-direction at that point. If it's positive, then \ the surface goes \"uphill\" in that direction. If it's negative, then the \ surface goes \"downhill.\" The partial derivative with respect to y tells \ you the same sort of information about what's happening in the positive \ y-direction.\n\nThat's all fine and good, but what about any of the other \ directions? To carry the previous metaphor a bit further, if you're a \ mountain climber on a 24,000ft mountain (the surface of which could be the \ graph of a function), you want to know what's going on in more than just the \ positive x- and y-direction. \n\n(Let's think of these directions as east \ and north, respectively; imagine you're looking down at the xy-plane, and \ think of the axes as lying on a compass. The x-axis points east, to the \ right, and the y-axis points up, to the north.)\n\nBack on the mountain \ you're climbing, you want to know: what about northeast? Or southsouthwest? \ Or any of the infinitely many directions in-between? That's where the ", StyleBox["directional derivative", FontSlant->"Italic"], " comes in. It can tell you how steep a surface is in any given direction, \ and whether that \"steepness\" goes up or down.\n\nTake a look at the \ following graph, which could represent a mountain and a valley, side-by-side \ in an otherwise nearly flat plain." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"2", " ", "y", " ", SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", SuperscriptBox["x", "2"]}], "-", SuperscriptBox["y", "2"]}]]}]}], "\n", RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"Boxed", "\[Rule]", "False"}]}], "]"}]}], "Input", CellChangeTimes->{{3.411777702338237*^9, 3.411777729769451*^9}, 3.4117778089820633`*^9}], Cell["\<\ Look at the point (1,0,0), which is almost exactly in the middle of the \ graph. A mountain climber at that point on the surface could walk either \ uphill or downhill -- or even in a path which keeps her flat, at the same \ height! Go to the following web page to see an interactive demonstration of \ the directional derivative using this surface: http://www.math.umn.edu/~rogness/multivar/dirderiv.shtml\ \>", "Text"], Cell[TextData[{ "Alternatively, you could expand the subsection below, evaluate the commands \ there to start the example from within ", StyleBox["Mathematica", FontSlant->"Italic"], ", and then close the subsection and continue reading here." }], "Text", CellFrame->True, Background->GrayLevel[0.833326]], Cell[TextData[{ "Here's what the example shows you. The green dot represents the mountain \ climber's position. As you change the bearing by sliding the blue dot \ around, you get an interactive look at the \"cross section\" of the surface \ through that point at the bearing. Now imagine fitting a tangent line to the \ curve representing the cross section. That's the red arrow, where the \ direction of the arrow shows you which direction the climber is facing.\n\nIf \ the arrow is pointing up, then the directional derivative in that direction \ is ", StyleBox["positive", FontSlant->"Italic"], ". If the arrow is pointing down, then the directional derivative is ", StyleBox["negative", FontSlant->"Italic"], ". An arrow which is pointing just ever so slightly up would indicate a \ small (but positive) value for the directional derivative, say 0.01. If the \ arrow is tilted more upward, the derivative has a much higher positive value.\ \n\nAs you can see, it's positive as you move from the east, through the \ north, to the west. From the west, to the south, and back to the east, it's \ negative." }], "Text"], Cell[CellGroupData[{ Cell["Directional Derivative Example", "Subsection"], Cell[TextData[{ "Don't bother trying to understand the commands here; it's just intended to \ let people run the interactive example without having to launch a web \ browser. If you'd prefer to do it from within ", StyleBox["Mathematica,", FontSlant->"Italic"], " simply evaluate the next cell. After the window with the picture has \ popped up, you can collapse this subsection again.\n" }], "Text", CellFrame->True, CellChangeTimes->{3.411778557181787*^9}, Background->GrayLevel[0.833326]], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"2", "y", "*", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "-", RowBox[{"y", "^", "2"}]}], "]"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"surface", "=", RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "2"}], ",", "2"}], "}"}], ",", RowBox[{"Boxed", "\[Rule]", "False"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"Directive", "[", RowBox[{"Opacity", "[", "0.5", "]"}], "]"}]}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}], ",", RowBox[{"Mesh", "\[Rule]", "15"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"point", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "1", ",", "0"}], "]"}], ",", RowBox[{"PointSize", "[", "0.03`", "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}], "]"}]}], "}"}]}], ";"}], "\n", RowBox[{ RowBox[{"n", "=", "22"}], ";"}], "\n", RowBox[{ RowBox[{"rmin", "=", RowBox[{"-", "2"}]}], ";", RowBox[{"rmax", "=", "2"}], ";"}], "\n", RowBox[{ RowBox[{"dr", "=", FractionBox[ RowBox[{"rmax", "-", "rmin"}], "n"]}], ";"}], "\n", RowBox[{ RowBox[{"section", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "0.01`", "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "+", RowBox[{"r", " ", RowBox[{"Cos", "[", "t", "]"}]}]}], ",", RowBox[{"r", " ", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"2", " ", "r", " ", RowBox[{"Sin", "[", "t", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", "1"}], "-", SuperscriptBox["r", "2"], "-", RowBox[{"2", " ", "r", " ", RowBox[{"Cos", "[", "t", "]"}]}]}]]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "+", RowBox[{ RowBox[{"(", RowBox[{"r", "+", "dr"}], ")"}], " ", RowBox[{"Cos", "[", "t", "]"}]}]}], ",", RowBox[{ RowBox[{"(", RowBox[{"r", "+", "dr"}], ")"}], " ", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"2", " ", RowBox[{"(", RowBox[{"r", "+", "dr"}], ")"}], " ", RowBox[{"Sin", "[", "t", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", "1"}], "-", SuperscriptBox[ RowBox[{"(", RowBox[{"r", "+", "dr"}], ")"}], "2"], "-", RowBox[{"2", " ", RowBox[{"(", RowBox[{"r", "+", "dr"}], ")"}], " ", RowBox[{"Cos", "[", "t", "]"}]}]}]]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"r", ",", "rmin", ",", RowBox[{"rmax", "-", "dr"}], ",", "dr"}], "}"}]}], "]"}]}], "}"}]}], ";"}], "\n", RowBox[{ RowBox[{"plane", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], ",", RowBox[{"Thickness", "[", "0.01`", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "+", RowBox[{"rmax", " ", RowBox[{"Cos", "[", "t", "]"}]}]}], ",", RowBox[{"rmax", " ", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"2", " ", "rmax", " ", RowBox[{"Sin", "[", "t", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", "1"}], "-", SuperscriptBox["rmax", "2"], "-", RowBox[{"2", " ", "rmax", " ", RowBox[{"Cos", "[", "t", "]"}]}]}]]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "+", RowBox[{"rmax", " ", RowBox[{"Cos", "[", "t", "]"}]}]}], ",", RowBox[{"rmax", " ", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"-", "1.5`"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "-", RowBox[{"rmax", " ", RowBox[{"Cos", "[", "t", "]"}]}]}], ",", RowBox[{ RowBox[{"-", "rmax"}], " ", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"-", "1.5`"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "-", RowBox[{"rmax", " ", RowBox[{"Cos", "[", "t", "]"}]}]}], ",", RowBox[{ RowBox[{"-", "rmax"}], " ", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"2", " ", RowBox[{"(", RowBox[{"-", "rmax"}], ")"}], " ", RowBox[{"Sin", "[", "t", "]"}], " ", SuperscriptBox["\[ExponentialE]", RowBox[{ RowBox[{"-", "1"}], "-", SuperscriptBox["rmax", "2"], "+", RowBox[{"2", " ", "rmax", " ", RowBox[{"Cos", "[", "t", "]"}]}]}]]}]}], "}"}]}], "}"}], "]"}]}], "}"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"gf", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{ SubscriptBox["\[PartialD]", "x"], RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}]}], ",", RowBox[{ SubscriptBox["\[PartialD]", "y"], RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}]}]}], "}"}]}], ";"}], "\n", RowBox[{ RowBox[{"vector", "=", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}], ",", RowBox[{"Thickness", "[", "0.01`", "]"}], ",", RowBox[{"Arrow3D", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", RowBox[{"Cos", "[", "t", "]"}]}], ",", RowBox[{"-", RowBox[{"Sin", "[", "t", "]"}]}], ",", RowBox[{"-", FractionBox[ RowBox[{"2", " ", RowBox[{"Sin", "[", "t", "]"}]}], "\[ExponentialE]"]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "+", RowBox[{"1", " ", RowBox[{"Cos", "[", "t", "]"}]}]}], ",", RowBox[{"1", " ", RowBox[{"Sin", "[", "t", "]"}]}], ",", FractionBox[ RowBox[{"2", " ", RowBox[{"Sin", "[", "t", "]"}]}], "\[ExponentialE]"]}], "}"}]}], "]"}]}], "}"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{ RowBox[{"g", "[", "t_", "]"}], "=", RowBox[{"Graphics3D", "[", RowBox[{ RowBox[{"{", RowBox[{"point", ",", "vector", ",", "section", ",", "plane"}], "}"}], ",", RowBox[{"Boxed", "\[Rule]", "False"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "3.15`"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.5`"}], ",", "1`"}], "}"}]}], "}"}]}], ",", RowBox[{"ViewPoint", "\[Rule]", RowBox[{"{", RowBox[{"2", ",", RowBox[{"-", "3"}], ",", "1.5`"}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"g", "[", "t", "]"}], ",", "surface"}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"t", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", RowBox[{"2", "Pi"}]}], "}"}]}], "]"}]}], "Input", CellChangeTimes->{{3.411778395200658*^9, 3.4117784918191423`*^9}, { 3.411778526366139*^9, 3.411778532173129*^9}}] }, Closed]], Cell[CellGroupData[{ Cell["Calculating Directional Derivatives", "Subsection"], Cell[TextData[{ "So how do we calculate direction derivatives? Well, first it's important \ to understand when we can even talk about them. ", StyleBox["We can only use directional derivatives for a function with one \ output; that is, a function ", FontSlant->"Italic"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], "\[Rule]", "\[DoubleStruckCapitalR]"}], TraditionalForm]]], ". The reason for this is that a directional derivative measures the change \ in that one output per unit change in some given direction on the input side \ of things. (In English, using the mountain climbing metaphor: the \ directional derivative measures the slope of the mountain, i.e. the \ instantaneous change in height per change in ", StyleBox["(x,y)", FontSlant->"Italic"], " position, where the ", StyleBox["(x,y)", FontSlant->"Italic"], " position is changing in some given direction.)\n\nIn most cases, we'll \ only work with directional derivatives for functions ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], "\[Rule]", "\[DoubleStruckCapitalR]"}], TraditionalForm]]], ", in other words, functions like ", Cell[BoxData[ FormBox[ RowBox[{"z", "=", RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}]}], TraditionalForm]]], ". But you could use the same ideas to calculate a directional derivative \ for a function ", Cell[BoxData[ FormBox[ RowBox[{"f", "(", RowBox[{"x", ",", "y", ",", "z"}], ")"}], TraditionalForm]]], ", or ", Cell[BoxData[ FormBox[ RowBox[{"f", "(", RowBox[{ SubscriptBox["x", "1"], ",", " ", SubscriptBox["x", "2"], ",", "\[Ellipsis]", ",", SubscriptBox["x", "n"]}], ")"}], TraditionalForm]]], ".\n\nLike all derivatives, the directional derivative has a limit \ definition, which you can find in your textbook. It's got vectors in it, so \ it's a little messier than your normal, everyday limit definition of ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "'"}], RowBox[{"(", "x", ")"}]}], TraditionalForm]]], " in single variable calculus, and we're going to forget about it here. \ Instead we'll concentrate on a different way to calculate the directional \ derivative.\n\nSuppose we've got a function ", Cell[BoxData[ FormBox[ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], TraditionalForm]]], ", and we're interested in the point ", Cell[BoxData[ FormBox[ RowBox[{"x", "=", "a"}], TraditionalForm]]], ". In the example above, this was the point (1,0), but it could be \ anything. Now suppose we want to look in a certain direction, whether it's \ east, west, or 8.29 degrees west of southsouthwest. We specify a direction \ by choosing a vector. For example, we'd say \"in the direction of the vector \ (3,4).\" In that case, we can easily find the directional derivative of ", Cell[BoxData[ FormBox["f", TraditionalForm]]], " at the point ", Cell[BoxData[ FormBox[ RowBox[{"x", "=", "a"}], TraditionalForm]]], "." }], "Text"], Cell[TextData[{ StyleBox["Theorem", FontWeight->"Bold", FontSlant->"Italic"], ": The directional derivative of ", Cell[BoxData[ FormBox["f", TraditionalForm]]], " at the point ", Cell[BoxData[ FormBox[ RowBox[{"x", "=", "a"}], TraditionalForm]]], ", in the direction of a vector ", Cell[BoxData[ FormBox[ OverscriptBox["v", "\[RightVector]"], TraditionalForm]]], ", is given by\n\t\t\t\t", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["D", OverscriptBox["u", "\[RightVector]"]], RowBox[{"f", "(", "a", ")"}]}], " ", "=", " ", RowBox[{ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], RowBox[{"f", "(", "a", ")"}]}], "\[CenterDot]", OverscriptBox["u", "\[RightVector]"]}]}], TraditionalForm]], FontSize->16], ",\n\t\t\t\t\nwhere ", Cell[BoxData[ FormBox[ OverscriptBox["u", "\[RightVector]"], TraditionalForm]]], " is a unit vector in the direction of ", Cell[BoxData[ FormBox[ OverscriptBox["v", "\[RightVector]"], TraditionalForm]]], ", given by", StyleBox[" ", FontSize->18], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ OverscriptBox["u", "\[RightVector]"], TraditionalForm], "=", FractionBox[ FormBox[ OverscriptBox["v", "\[RightVector]"], TraditionalForm], RowBox[{"||", OverscriptBox["v", "\[RightVector]"], "||"}]]}], TraditionalForm]], FontSize->16], ", and ", Cell[BoxData[ FormBox[ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], RowBox[{"f", "(", "a", ")"}]}], TraditionalForm]]], " is the gradient of ", Cell[BoxData[ FormBox["f", TraditionalForm]]], " evaluated at the point ", StyleBox["a", FontSlant->"Italic"], ". " }], "Text", CellFrame->True, Background->RGBColor[1, 1, 0.588235]], Cell[TextData[{ "One thing in that theorem requires some explanation, namely the \"gradient \ of ", StyleBox["f", FontSlant->"Italic"], " at the point ", StyleBox["a", FontSlant->"Italic"], ". For a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], "\[Rule]", "\[DoubleStruckCapitalR]"}], TraditionalForm]]], " with just one output, the gradient of ", StyleBox["f", FontSlant->"Italic"], " is:" }], "Text"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], "f"}], " ", "=", " ", RowBox[{"(", RowBox[{ FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", SubscriptBox["x", "1"]}]], ",", FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", SubscriptBox["x", "2"]}]], ",", "\[Ellipsis]", ",", FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", SubscriptBox["x", "n"]}]]}], ")"}]}], TraditionalForm]], "Text", TextAlignment->Center, FontSize->16], Cell[TextData[{ "In most cases, we'll only work with two or three dimensions, in which case, \ ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], "f"}], " ", "=", " ", RowBox[{"(", RowBox[{ FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", "x"}]], ",", FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", "y"}]]}], ")"}]}], FontSize->18], TraditionalForm]], TextAlignment->Center, FontSize->16], " or ", Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], "f"}], " ", "=", " ", RowBox[{"(", RowBox[{ FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", "x"}]], ",", FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", "y"}]], ",", FractionBox[ RowBox[{"\[PartialD]", "f"}], RowBox[{"\[PartialD]", "z"}]]}], ")"}]}], FontSize->18], TraditionalForm]], TextAlignment->Center, FontSize->16], ", respectively. " }], "Text"], Cell[TextData[{ "Note how similar the gradient is to the Jacobian matrix. Write down the \ definitions for the Jacobian matrix of a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}], "\[Rule]", "\[DoubleStruckCapitalR]"}], TraditionalForm]]], ". The only real difference is whether we think of it as a vector or a \ 1-column matrix; the entries themselves are exactly the same!\n\nWhy, you \ might ask, do we have two names for the identical thing? That's a good \ question, and probably has more to do with traditions -- and the difficulty \ of changing traditions -- than anything else." }], "Text", CellFrame->True, Background->GrayLevel[0.833326]], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " can compute gradients using the ", StyleBox["Grad", FontWeight->"Bold"], " function:" }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}], "-", "z"}]}], "\[IndentingNewLine]", RowBox[{"Grad", "[", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}]}], "Input"], Cell[TextData[{ "There's a catch, unfortunately; ", StyleBox["Mathematica", FontSlant->"Italic"], " only works with three dimensional gradients. Notice how it tacks on an \ extra zero at the end of the following gradient." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "3"}]}]}], "\[IndentingNewLine]", RowBox[{"Grad", "[", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}]}], "Input"], Cell[TextData[{ "We've defined a special command called ", StyleBox["Grad2D", FontWeight->"Bold"], " to let you compute two dimensional gradients:" }], "Text"], Cell[BoxData[ RowBox[{"Grad2D", "[", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}]], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Example", "Subsection"], Cell["\<\ Let's use the same function as before, and find the directional derivative at \ the point (1,0) in the direction of the vector (3,4).\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"2", "y", "*", RowBox[{"Exp", "[", RowBox[{ RowBox[{"-", RowBox[{"x", "^", "2"}]}], "-", RowBox[{"y", "^", "2"}]}], "]"}]}]}]], "Input"], Cell["From our handy-dandy theorem, we know that:", "Text"], Cell[TextData[Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox["D", OverscriptBox["u", "\[RightVector]"]], RowBox[{"f", "(", "a", ")"}]}], " ", "=", " ", RowBox[{ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], RowBox[{"f", "(", "a", ")"}]}], "\[CenterDot]", OverscriptBox["u", "\[RightVector]"]}]}], TraditionalForm]]]], "Text", TextAlignment->Center, FontSize->16], Cell[TextData[{ "First we should compute ", Cell[BoxData[ FormBox[ OverscriptBox["u", "\[RightVector]"], TraditionalForm]]], ", which is a unit vector in the direction of the vector ", Cell[BoxData[ FormBox[ FormBox[ OverscriptBox["v", "\[RightVector]"], TraditionalForm], TraditionalForm]], FontSize->16], "=(3,4). We can use the formula ", StyleBox[" ", FontSize->18], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ OverscriptBox["u", "\[RightVector]"], TraditionalForm], "=", FractionBox[ FormBox[ OverscriptBox["v", "\[RightVector]"], TraditionalForm], RowBox[{"||", OverscriptBox["v", "\[RightVector]"], "||"}]]}], TraditionalForm]], FontSize->16], ", where the double bars mean \"length of\" a vector, which is also called \ the \"norm\" of a vector." }], "Text"], Cell[BoxData[ RowBox[{"u", "=", RowBox[{ RowBox[{"{", RowBox[{"3", ",", "4"}], "}"}], "/", RowBox[{"Sqrt", "[", RowBox[{ RowBox[{"3", "^", "2"}], "+", RowBox[{"4", "^", "2"}]}], "]"}]}]}]], "Input"], Cell[TextData[{ "We can do that a little more automatically by defining a function like \ this, which will take a vector and return a unit vector in that direction. \ Note that we're also using the function ", StyleBox["Norm", FontWeight->"Bold"], " here, instead of doing the square root bit by hand in the denominator." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"unitvec", "[", "v_", "]"}], "=", RowBox[{"v", "/", RowBox[{"Norm", "[", "v", "]"}]}]}], "\[IndentingNewLine]", RowBox[{"u", "=", RowBox[{"unitvec", "[", RowBox[{"{", RowBox[{"3", ",", "4"}], "}"}], "]"}]}]}], "Input"], Cell[TextData[{ "We also need the gradient of ", StyleBox["f", FontSlant->"Italic"], ", and then we're ready to compute:" }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"gradf", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"Grad2D", "[", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}]}], "\[IndentingNewLine]", RowBox[{"gradf", "[", RowBox[{"1", ",", "0"}], "]"}], "\[IndentingNewLine]", "u", "\[IndentingNewLine]", RowBox[{ RowBox[{"gradf", "[", RowBox[{"1", ",", "0"}], "]"}], ".", "u"}]}], "Input"], Cell[TextData[{ "So the slope in that direction is about ", StyleBox["8/(5e)", FontSize->16, FontSlant->"Italic"], ", or about 0.59. If you look back at the interactive example, does that \ seem correct?\n\nFrom the picture it seems the steepest the incline can be is \ when the bearing is about northnorthwest, or (roughly) in the direction of \ the vector (-1,2). In that direction, the directional derivative is:" }], "Text"], Cell[BoxData[{ RowBox[{"u", "=", RowBox[{"unitvec", "[", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"gradf", "[", RowBox[{"1", ",", "0"}], "]"}], ".", "u"}], "\[IndentingNewLine]", RowBox[{"N", "[", "%", "]"}]}], "Input"], Cell["\<\ Our eyes weren't deceiving us -- it really is steeper in that direction. If \ you go in the direction of (-1,-1) instead, you'll go downhill:\ \>", "Text"], Cell[BoxData[{ RowBox[{"u", "=", RowBox[{"unitvec", "[", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}]}], "}"}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"gradf", "[", RowBox[{"1", ",", "0"}], "]"}], ".", "u"}], "\[IndentingNewLine]", RowBox[{"N", "[", "%", "]"}]}], "Input"], Cell[TextData[{ StyleBox["Exercise 1", FontSize->14, FontWeight->"Bold"], "\n\nSuppose there is a spaceship in three-dimensional space, with our sun \ located at the origin, (0,0,0). The temperature near the sun is extremely \ hot, of course -- about 6000K -- and it drops rapidly as one moves away. \ Suppose the temperate at any point is space is given by ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"T", "(", RowBox[{"x", ",", "y", ",", "z"}], ")"}], "=", RowBox[{"6000", "/", RowBox[{"(", RowBox[{"1", "+", RowBox[{ RowBox[{"(", RowBox[{ SuperscriptBox["x", "2"], "+", SuperscriptBox["y", "2"], "+", SuperscriptBox["z", "2"]}], ")"}], "/", "5"}]}], ")"}]}]}], TraditionalForm]]], ", where x, y, and z measured in units of 10 million miles. (Here we're \ assuming the spaceship will never get close enough to other stars to notice \ their heat, so effectively our sun is the only heat-producer in the \ universe.)\n\nSuppose now that the spaceship is located on the Earth, about \ 93 million miles away, at the point (9,2,1). What is the directional \ derivative (change in K per change in position) if the spaceship were to move \ in the direction of the vector (-4,-3,5)?\n\n(If you're interested in how to \ find the surface temperature of a star, look at\n\ http://zebu.uoregon.edu/~soper/Stars/color.html., or any of the other pages \ you can find on Google by searching for \"Star Temperature Color\" or \ something similar.)\n\n", StyleBox["Exercise 2", FontSize->14, FontWeight->"Bold"], "\n\nUsing the same setup as in Example 1, suppose the spaceship flies from \ the point (4,-2,8) to the point (-4,3,7). Would the initial change in \ temperature be an increase or a decrease?" }], "Text", CellFrame->True, Background->RGBColor[1, 0.501961, 0.501961]] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Vector Fields", FontSize->16]], "Section"], Cell[TextData[{ "A Vector Field is one of the most fundamental concepts in Multivariable \ Calculus and Vector Analysis. One of the main reason this course exists is \ to teach you four specific theorems: the Fundamental Theorem of Line \ Integrals, Green's Theorem, Stokes' Theorem, and the Divergence Theorem. ", StyleBox["Every single one of these theorems involves vector fields!", FontSlant->"Italic"], " If you take a little time now to understand what a vector field is, \ you'll save yourself some time and grief later on.\n\nIn lecture you've \ already talked about linear transformations, so you should hopefully be \ comfortable with the idea of a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], "\[Rule]", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], TraditionalForm]]], ". This notation means that ", Cell[BoxData[ FormBox["f", TraditionalForm]]], " takes two inputs and has two outputs. You've also learned that a linear \ transformation with two inputs and outputs can be represented by a 2 by 2 \ matrix.\n\nA (two-dimensional) vector field is simply a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], "\[Rule]", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], TraditionalForm]]], ", but there are two key differences: (1) ", Cell[BoxData[ FormBox["f", TraditionalForm]]], " is not necessarily a linear function, so it might or might not be possible \ to represent it using a matrix, and (2) we interpret the inputs and outputs \ in a different way." }], "Text"], Cell[CellGroupData[{ Cell["Graphing a Vector Field", "Subsection"], Cell[TextData[{ "Let's look at an example. Traditionally we represent vector fields with \ capital letters, so we'll call our first field ", Cell[BoxData[ FormBox["F", TraditionalForm]]], " instead of ", Cell[BoxData[ FormBox["f", TraditionalForm]]], "." }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{"-", "y"}], ",", "x"}], "}"}]}]], "Input"], Cell[TextData[{ "Here's the key to understanding vector fields: we think of the inputs as ", StyleBox["points", FontSlant->"Italic"], ", and the outputs as ", StyleBox["vectors", FontSlant->"Italic"], ". For example, ", Cell[BoxData[ FormBox[ RowBox[{"F", "(", RowBox[{"2", ",", "1"}], ")"}], TraditionalForm]]], "is the vector (-1,2):" }], "Text"], Cell[BoxData[ RowBox[{"F", "[", RowBox[{"2", ",", "1"}], "]"}]], "Input"], Cell[TextData[{ "To draw a picture of the vector field, we simply draw the vector (-1,2) -- \ the ", StyleBox["output", FontSlant->"Italic"], " -- beginning at the point (2,1) -- the ", StyleBox["input", FontSlant->"Italic"], ". In other words, we draw a vector which goes from (2,1) to (1,3). (Check \ my arithmetic here!) \n\n Here are a whole bunch of values of the vector \ field:" }], "Text"], Cell[BoxData[{ RowBox[{"F", "[", RowBox[{"0", ",", "0"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"1", ",", "0"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"2", ",", "0"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"0", ",", "1"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"1", ",", "1"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"2", ",", "1"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"0", ",", "2"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"1", ",", "2"}], "]"}], "\[IndentingNewLine]", RowBox[{"F", "[", RowBox[{"2", ",", "2"}], "]"}], "\[IndentingNewLine]"}], "Input"], Cell["\<\ And here's a picture where we've drawn in each of these vectors, starting at \ their respective points. (You don't have to understand this command, \ although if you look at it long enough you can probably kind of figure out \ what's going on.)\ \>", "Text"], Cell[BoxData[ RowBox[{"Show", "[", RowBox[{ RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "3"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Arrow", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "4"}], "}"}]}], "}"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"Axes", "\[Rule]", "True"}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}]], "Input", CellChangeTimes->{{3.4117787849213667`*^9, 3.411778818782364*^9}}], Cell[TextData[{ "While that's somewhat interesting, it's awfully tedious, and it would take \ forever to tell what the \"big picture\" is. Fortunately ", StyleBox["Mathematica", FontSlant->"Italic"], " includes a command to graph vector fields for you. Here's a picture of ", Cell[BoxData[ FormBox["F", TraditionalForm]]], ", first with just the vectors and then with axes." }], "Text", CellChangeTimes->{{3.4117799969457607`*^9, 3.411780010152781*^9}}], Cell[BoxData[{ RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "y"}], ",", "x"}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}]}], "]"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}], "Input", CellChangeTimes->{{3.411778836574607*^9, 3.411778862324936*^9}, { 3.411779622552363*^9, 3.4117796635429907`*^9}, {3.411779945203264*^9, 3.411779995601639*^9}}], Cell[TextData[{ "Wow! Imagine having to draw each of those arrows by hand. This is \ definitely a case where a computer can make your life easier, BUT... you need \ to be careful, because ", StyleBox["Mathematica", FontSlant->"Italic"], " is hiding some of the details from you. Look above at the picture we \ constructed \"manually.\" At the point (1,1) you can see the vector (-1,1), \ which has length ", Cell[BoxData[ FormBox[ SqrtBox["2"], TraditionalForm]]], ". But if you look at the computer generated picture, the vector starting \ at (1,1) is so short that you can only see the arrow head! ", StyleBox["Mathematica", FontSlant->"Italic"], " is scaling the vectors, trying to make the picture easier to look at; \ while that's a noble goal, it means you do lose some information -- namely, \ exactly how long those vectors are.\n\nEvaluate the next cell to show the \ vectors at full length. We've added the ", StyleBox["ScaleFactor->None", FontWeight->"Bold"], " option to turn off the scaling, and added a semi-colon at the end of the \ first command to block the picture which only has the vectors without the \ axes." }], "Text", CellChangeTimes->{{3.411780054620503*^9, 3.4117800803951607`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"VectorFieldPlots`VectorFieldPlot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "y"}], ",", "x"}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"ScaleFactor", "\[Rule]", "None"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}], "Input", CellChangeTimes->{ 3.411779691530487*^9, {3.4117800238869953`*^9, 3.411780032748908*^9}, { 3.4117801051099358`*^9, 3.4117801190349007`*^9}}], Cell[TextData[{ "That's a much different picture! So now you can see that ", StyleBox["Mathematica", FontSlant->"Italic"], " was really distorting your view of what's going on. However, you can also \ see what the designers of ", StyleBox["Mathematica", FontSlant->"Italic"], " were thinking; if you show the whole vectors, it can get very crowded. \ You can use the ", StyleBox["ScaleFactor", FontWeight->"Bold"], " option to fiddle around with a picture to suit your own tastes. You've \ already seen what setting this option to ", StyleBox["None", FontWeight->"Bold"], " can do; if you set it to a number instead, then ", StyleBox["Mathematica", FontSlant->"Italic"], " will rescale the longest vector in the picture to have that length. For \ this particular vector field (with this range of x and y) it seems like \ scaling the vectors to have length 2 or less is a nice compromise." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "y"}], ",", "x"}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"ScaleFactor", "\[Rule]", "2"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}], "Input", CellChangeTimes->{{3.4117801338467627`*^9, 3.4117801474401817`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["Why Vector Fields are Useful", "Subsection"], Cell[TextData[{ "The last picture looks like it represents some sort of circular motion, and \ that's a clue about why vector fields are important. Very often we'll think \ of vector fields as representing fluid flow, in which case this vector field \ would represent some kind of whirlpool or drain.\n\nSometimes we'll also \ think of a vector field as a ", StyleBox["force", FontSlant->"Italic"], " field; in other words, each vector represents some kind of force, whether \ from an explosion, or gravity, etc.\n\nHere are a few examples of vector \ fields for you took look at. Look at the functions and try to understand why \ the picture looks the way it does. Also play around with the ", StyleBox["ScaleFactor", FontWeight->"Bold"], " option to see how it affects the pictures. Which works better, the ", StyleBox["Automatic", FontWeight->"Bold"], " or ", StyleBox["None", FontWeight->"Bold"], " setting?" }], "Text"], Cell[CellGroupData[{ Cell["The \"Blowup\" or \"Super Nova\" Vector Field", "Subsubsection"], Cell[BoxData[{ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"F", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"ScaleFactor", "\[Rule]", "Automatic"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}], "Input", CellChangeTimes->{{3.411780161690337*^9, 3.41178017447572*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["The \"Black Hole\" Vector Field", "Subsubsection"], Cell[TextData[{ "Can you explain what happens when you set ", StyleBox["ScaleFactor", FontWeight->"Bold"], " to ", StyleBox["None", FontWeight->"Bold"], " here?" }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{"-", "x"}], ",", RowBox[{"-", "y"}]}], "}"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"F", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"ScaleFactor", "\[Rule]", "Automatic"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}], "Input", CellChangeTimes->{{3.411780188419092*^9, 3.411780209281443*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["The \"Important\" Vector Field", "Subsubsection"], Cell["\<\ This vector field looks a lot like the very first example we worked with. \ See if you can tell how it's different. This particular vector field has \ some very unique characteristics, which you'll learn about in lecture. \ That's why we called it \"important\" here; it also has a tendency to show up \ in textbooks and on exams.\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "y"}], "/", RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}]}], ",", RowBox[{"x", "/", RowBox[{"(", RowBox[{ RowBox[{"x", "^", "2"}], "+", RowBox[{"y", "^", "2"}]}], ")"}]}]}], "}"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"F", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"ScaleFactor", "\[Rule]", "Automatic"}], ",", RowBox[{"PlotPoints", "\[Rule]", "16"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}], "Input", CellChangeTimes->{{3.41178021690097*^9, 3.411780227143161*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["The \"Curving River\"", "Subsubsection"], Cell[BoxData[{ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"{", RowBox[{"1", ",", RowBox[{"Sin", "[", "x", "]"}]}], "}"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"F", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{ RowBox[{"-", "Pi"}], "/", "2"}], ",", RowBox[{"Pi", "/", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{ RowBox[{"-", "Pi"}], "/", "2"}], ",", RowBox[{"Pi", "/", "2"}]}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}]}], "Input", CellChangeTimes->{{3.4117802408845453`*^9, 3.411780249890973*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Vector Fields in 3D", "Subsection"], Cell[TextData[{ "Many -- maybe most -- of the vector fields you'll work with this semester \ are three-dimensional. That means we have a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"F", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "3"]}], "\[Rule]", SuperscriptBox["\[DoubleStruckCapitalR]", "3"]}], TraditionalForm]]], "instead of ", Cell[BoxData[ FormBox[ RowBox[{ SuperscriptBox["\[DoubleStruckCapitalR]", "2"], "\[Rule]", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], TraditionalForm]]], ". Everything else you've learned goes the same way: the three inputs are \ the (x,y,z) coordinates of a point, and the output is a three dimensional \ vector which you draw beginning at the input point (x,y,z).\n\n", StyleBox["Mathematica", FontSlant->"Italic"], " can draw 3D vector fields, but you'll quickly see why we tend to \ concentrate on 2D examples when we're talking about these ideas. It just \ gets too messy when you look at a three dimensional picture. Look at this \ example of a 3D vector field, which is almost the same as the first 2D vector \ field we considered above:" }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_", ",", "z_"}], "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{"-", "y"}], ",", "x", ",", "z"}], "}"}]}], "\[IndentingNewLine]", RowBox[{"VectorFieldPlot3D", "[", RowBox[{ RowBox[{"F", "[", RowBox[{"x", ",", "y", ",", "z"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}]}], "]"}]}], "Input", CellChangeTimes->{{3.4117802774553137`*^9, 3.411780285915859*^9}}], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " is trying valiantly to keep things from getting too messy. It's scaling \ the vectors, as before, and it's also removed the arrows at the end of the \ vectors. While the missing arrows make things a little less cluttered, it's \ a big loss of information because you have no way of knowing which directions \ things are heading in.\n\nIf you'd like to put the arrows back in, you can \ use the ", StyleBox["VectorHeads", FontWeight->"Bold"], " option. We've done that in the next command here, along with turning the \ scaling off." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_", ",", "z_"}], "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{"-", "y"}], ",", "x", ",", "z"}], "}"}]}], "\[IndentingNewLine]", RowBox[{"VectorFieldPlot3D", "[", RowBox[{ RowBox[{"F", "[", RowBox[{"x", ",", "y", ",", "z"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"VectorHeads", "\[Rule]", "True"}], ",", RowBox[{"ScaleFactor", "\[Rule]", "None"}]}], "]"}]}], "Input", CellChangeTimes->{{3.411780312640188*^9, 3.4117803200215673`*^9}}], Cell["\<\ Now you can see why, although we work with 3D vector fields all the time, we \ very rarely draw pictures of them!\ \>", "Text"], Cell[CellGroupData[{ Cell["Gravity", "Subsubsection"], Cell[TextData[{ "One 3D vector field that ", StyleBox["can", FontSlant->"Italic"], " be drawn fairly easily is the gravitational force field on the surface of \ the earth. Of course, the only reason we can draw it is because it's such a \ simple force field. Look at the function and see if you can guess what the \ picture will look like before evaluating the cell." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"F", "[", RowBox[{"x_", ",", "y_", ",", "z_"}], "]"}], "=", RowBox[{"{", RowBox[{"0", ",", "0", ",", RowBox[{"-", "9.8"}]}], "}"}]}], "\[IndentingNewLine]", RowBox[{"VectorFieldPlot3D", "[", RowBox[{ RowBox[{"F", "[", RowBox[{"x", ",", "y", ",", "z"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "50"}], ",", "50"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "50"}], ",", "50"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", "0", ",", "50"}], "}"}], ",", RowBox[{"VectorHeads", "\[Rule]", "True"}], ",", RowBox[{"ScaleFactor", "\[Rule]", "False"}], ",", RowBox[{"PlotPoints", "\[Rule]", "5"}]}], "]"}]}], "Input", CellChangeTimes->{{3.411780333033505*^9, 3.411780340622108*^9}}] }, Open ]] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["The Gradient Revisited; Tying it all Together", FontSize->16]], "Section"], Cell[TextData[{ "Now let's combine the two previous sections. If we have a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], "\[Rule]", "\[DoubleStruckCapitalR]"}], TraditionalForm]]], ", we can take its gradient, which is a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[Del]", RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}]}], "\[Rule]", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], TraditionalForm]]], ". Read that again -- it's tricky. ", StyleBox["f", FontSlant->"Italic"], " takes two inputs, and its gradient takes the same two inputs, and gives \ you two outputs back -- namely, the two partial derivatives.\n\nBut wait! If \ the gradient is a function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"\[Del]", RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}]}], "\[Rule]", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], TraditionalForm]]], ", then we can think of the gradient of a function as a ", StyleBox["vector field", FontSlant->"Italic"], "! And thus the idea of a \"gradient vector field\" is born. You'll run \ across that term fairly often. It just means a vector field which happens to \ be the gradient of some (possibly unknown!) function." }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"x", "*", "y"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"gradf", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{"Grad2D", "[", RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], "]"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"gradfieldpic", "=", RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"gradf", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"%", ",", RowBox[{"Axes", "\[Rule]", "True"}]}], "]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.4117803660260973`*^9, 3.411780377175612*^9}}], Cell[TextData[{ "Gradient vector fields are important because they have a property called \ \"path independence,\" which you'll learn about later in this course. For \ today we'll concentrate on a different idea, the fact that gradients are \ perpendicular (or \"orthogonal,\" or \"normal,\" all of which mean the same \ thing) to level sets of a function. This will help us tie a few loose ends \ with the directional derivative, too.\n\nRemember that, for a function ", Cell[BoxData[ FormBox[ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], TraditionalForm]]], ", a level set is the set of all points (x,y) such that ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], "=", "c"}], TraditionalForm]]], ", where ", StyleBox["c", FontSlant->"Italic"], " is some constant number you've already chosen. For example, with our \ function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], "=", RowBox[{"x", "*", "y"}]}], TraditionalForm]]], " that we just used,\n\n\t", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], "=", RowBox[{ RowBox[{"x", " ", "y"}], " ", "=", " ", "1"}]}], TraditionalForm]]], " is the same as y=1/x, which is a hyperbola,\n\t", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], "=", RowBox[{ RowBox[{"x", " ", "y"}], " ", "=", " ", "2"}]}], TraditionalForm]]], " is the same as y=2/x, which is a hyperbola,\n\t", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], "=", RowBox[{ RowBox[{"x", " ", "y"}], " ", "=", " ", "3"}]}], TraditionalForm]]], " is the same as y=3/x, which is a hyperbola,\n\nand so on. Essentially \ we're finding all of the points where the height of the surface ", Cell[BoxData[ FormBox[ RowBox[{"z", "=", RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}]}], TraditionalForm]]], " is equal to 1 (or 2, or 3). We could plot these together:" }], "Text"], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "/", "x"}], ",", RowBox[{"2", "/", "x"}], ",", RowBox[{"3", "/", "x"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", "5"}], "}"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}]], "Input"], Cell[TextData[{ "But wait! If we're looking for points where the height has a certain \ values, then we're really looking for ", StyleBox["contour lines", FontSlant->"Italic"], ". Remember ", StyleBox["ContourPlot", FontWeight->"Bold"], "? It can generate a nice picture of this function. (Go look at Lab 1B if \ you don't remember this command.) It shows us the various \"elevation \ lines\" of the graph, including those for negative elevation." }], "Text"], Cell[BoxData[ RowBox[{"contourpic", "=", RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"Contours", "\[Rule]", "20"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.411780492988249*^9, 3.411780511298435*^9}}], Cell["\<\ Now let's look at the contour plot and the gradient field together. There's \ an extra option here to make the arrows blue in the picture of the vector \ field; you don't need to worry about figuring that out.\ \>", "Text", CellChangeTimes->{{3.411780466402102*^9, 3.4117804673036203`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"gradfieldpic", "=", RowBox[{"VectorFieldPlot", "[", RowBox[{ RowBox[{"gradf", "[", RowBox[{"x", ",", "y"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "4"}], ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "4"}], ",", "4"}], "}"}], ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"(", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], "&"}], ")"}]}], ",", RowBox[{"PlotPoints", "\[Rule]", "10"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"contourpic", ",", "gradfieldpic"}], "]"}]}], "Input", CellChangeTimes->{{3.411780433588132*^9, 3.4117804753216677`*^9}}], Cell["\<\ Notice that the blue vectors in the picture are perpendicular to the level \ curves (i.e. the contour lines). This is no accident! In fact, it's always \ true that\ \>", "Text"], Cell[TextData[{ "If the point (x,y) is on the level curve ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}], "=", "c"}], TraditionalForm]]], ", then ", Cell[BoxData[ FormBox[ RowBox[{"\[Del]", RowBox[{"f", "(", RowBox[{"x", ",", "y"}], ")"}]}], TraditionalForm]]], "will be perpendicular to the level curve." }], "Text", CellFrame->True, Background->RGBColor[1, 1, 0.588006]], Cell[TextData[{ "(More technically, if you draw the tangent line which touches the curve at \ the point (x,y), then the gradient vector at that point will be perpendicular \ to the tangent line.)\n\nThe same is true in any dimension. If you have a \ function ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"f", ":", SuperscriptBox["\[DoubleStruckCapitalR]", "3"]}], "\[Rule]", "\[DoubleStruckCapitalR]"}], TraditionalForm]]], ", then the level sets will be level ", StyleBox["surfaces", FontSlant->"Italic"], ", and the gradient will be perpendicular to the level surfaces. That is, \ if ", Cell[BoxData[ FormBox[ RowBox[{"(", RowBox[{"x", ",", "y", ",", "z"}], ")"}], TraditionalForm]]], " is on some level surface, then the gradient ", Cell[BoxData[ FormBox[ RowBox[{"\[Del]", RowBox[{"f", "(", RowBox[{"x", ",", "y", ",", "z"}], ")"}]}], TraditionalForm]]], " will be perpendicular -- or \"normal\" -- to the tangent plane which \ touches the surface at ", StyleBox["(x,y,z)", FontSlant->"Italic"], ". \n\nIf this sounds familiar, it's because you already used it last week \ to find the cartesian equation of a tangent plane!\n\nThere's a little more \ to be said about the picture above. Remember that ", StyleBox["ContourPlot", FontWeight->"Bold"], " shades the low areas with dark colors, and the high areas with bright \ colors. Notice how the gradient vectors always seem to point straight \ uphill. Once again, that's no accident. Remember," }], "Text"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ SubscriptBox["D", OverscriptBox["u", "\[RightVector]"]], RowBox[{"f", "(", "a", ")"}]}], " ", "=", " ", RowBox[{ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], RowBox[{"f", "(", "a", ")"}]}], "\[CenterDot]", OverscriptBox["u", "\[RightVector]"]}]}], ","}], TraditionalForm]], "DisplayFormula", TextAlignment->Center, FontSize->16], Cell[TextData[{ "and if we combine that with the definition of a dot product, along with the \ fact that ", Cell[BoxData[ FormBox[ OverscriptBox["u", "\[RightVector]"], TraditionalForm]]], "is a unit vector (and therefore has length one):" }], "Text"], Cell[BoxData[{ FormBox[ RowBox[{ RowBox[{ SubscriptBox["D", OverscriptBox["u", "\[RightVector]"]], RowBox[{"f", "(", "a", ")"}]}], " ", "=", " ", RowBox[{ RowBox[{ RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], RowBox[{"f", "(", "a", ")"}]}], "\[CenterDot]", OverscriptBox["u", "\[RightVector]"]}], "=", RowBox[{"||", RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], RowBox[{"f", "(", "a", ")"}]}], "||", " ", "||", OverscriptBox["u", "\[RightVector]"], "||", " ", RowBox[{"cos", "(", "\[Theta]", ")"}]}]}]}], TraditionalForm], "\[IndentingNewLine]", FormBox[ RowBox[{"=", " ", RowBox[{"||", RowBox[{ OverscriptBox["\[Del]", "\[RightVector]"], RowBox[{"f", "(", "a", ")"}]}], "||", RowBox[{"cos", "(", "\[Theta]", ")"}]}]}], TraditionalForm]}], "DisplayFormula", TextAlignment->Center, FontSize->16], Cell[TextData[{ "where \[Theta] is the angle between the gradient vector and the vector ", Cell[BoxData[ FormBox[ OverscriptBox["u", "\[RightVector]"], TraditionalForm]]], ", i.e. the angle between the gradient and the direction that we're going. \ The largest this can be is when cos(\[Theta])=1, which happens for \ \[Theta]=0. In other words,\n\n", StyleBox["\"The largest the directional derivative can be is when the angle \ between the gradient and our direction is 0 -- in other words, when we're \ looking in the direction of the gradient vector.\"\n", FontSlant->"Italic"], "\nRephrased one more time:\n\n", StyleBox["\"The largest value of the directional derivative is in the \ direction of the gradient; equivalently, the gradient points in the direction \ of the largest increase.\"", FontSlant->"Italic"], "\n" }], "Text"], Cell[TextData[{ StyleBox["Exercise 3", FontSize->14, FontWeight->"Bold"], "\n\nRecall the setup for Exercises 1 and 2:\n\nSuppose there is a spaceship \ in three-dimensional space, with our sun located at the origin, (0,0,0). The \ temperature near the sun is extremely hot, of course -- about 6000K -- and it \ drops rapidly as one moves away. Suppose the temperate at any point is space \ is given by ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"T", "(", RowBox[{"x", ",", "y", ",", "z"}], ")"}], "=", RowBox[{"6000", "/", RowBox[{"(", RowBox[{"1", "+", RowBox[{ RowBox[{"(", RowBox[{ SuperscriptBox["x", "2"], "+", SuperscriptBox["y", "2"], "+", SuperscriptBox["z", "2"]}], ")"}], "/", "5"}]}], ")"}]}]}], TraditionalForm]]], ", where x, y, and z measured in units of 10 million miles. (Here we're \ assuming the spaceship will never get close enough to other stars to notice \ their heat, so effectively our sun is the only heat-producer in the \ universe.)\n\nLet's assume again that the spaceship is located on the Earth, \ about 93 million miles away, at the point (9,2,1). In what direction is the \ largest increase in temperature? Why is this not the least bit surprising? \ In which direction could the spaceship go to remain at the same temperature? \ (This is much harder than the first question in this paragraph.)\n\n(If \ you're assigned this problem, it's not worthy of a separate writeup. You \ should include your answer as an \"interesting aside\" in your answer to \ Exercise 1.)\n\n", StyleBox["Exercise 4", FontSize->14, FontWeight->"Bold"], "\n\nAssuming the spaceship is at the point (4,-2,8). In which direction \ should the spacecraft move in order to ", StyleBox["decrease", FontSlant->"Italic"], " the temperature as quickly as possible. What direction could the \ spacecraft go to keep the temperature constant?\n\nIf you're assigned this \ problem, you should include your answers as part of your writeup to Exercise \ 2, instead of doing a separate problem." }], "Text", CellFrame->True, Background->RGBColor[1, 0.501961, 0.501961]], Cell[CellGroupData[{ Cell["Credits", "Subsection"], Cell[TextData[{ "This lab was written entirely from scratch in January 2004. We had an \ opening in the lab schedule, and students had been having difficulty with the \ directional derivative, as well as using gradients to find tangent planes. \ That last topic is covered in another lab, but with this introduction it will \ hopefully work a little better.\n\nUpdate Fall 2004: renumbered to 2C, minor \ changes made. Also, they've already done the tangent plane lab (which used \ to come after this one) so the introduction to gradients no longer helps with \ that. Ah well.\n\nUpdates in Spring 2008 for ", StyleBox["Mathematica", FontSlant->"Italic"], " 6.0.\n\nThis lab is copyright 2004-2008 by Jonathan Rogness \ (rogness@math.umn.edu) and is protected by the Creative Commons \ Attribution-NonCommercial-ShareAlike License. You can find more information \ on this license at http://creativecommons.org/licenses/by-nc-sa/1.0/\n\n\ Although it's not specifically required by the license, I'd appreciate it if \ you let me know if you use parts of our labs, just so I can keep track of it. \ Please send me any questions or comments!" }], "Text", CellChangeTimes->{{3.411780543540044*^9, 3.411780555666745*^9}}] }, Closed]] }, Closed]] }, AutoGeneratedPackage->None, WindowSize->{791, 810}, WindowMargins->{{35, Automatic}, {Automatic, 17}}, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (April 20, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[568, 21, 394, 11, 89, "Text"], Cell[CellGroupData[{ Cell[987, 36, 66, 1, 63, "Section"], Cell[1056, 39, 2575, 40, 371, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[3668, 84, 71, 1, 33, "Section"], Cell[3742, 87, 1852, 34, 266, "Text"], Cell[5597, 123, 710, 22, 51, "Input"], Cell[6310, 147, 433, 8, 86, "Text"], Cell[6746, 157, 312, 8, 57, "Text"], Cell[7061, 167, 1138, 20, 176, "Text"], Cell[CellGroupData[{ Cell[8224, 191, 52, 0, 34, "Subsection"], Cell[8279, 193, 501, 11, 87, "Text"], Cell[8783, 206, 8547, 252, 480, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[17367, 463, 57, 0, 26, "Subsection"], Cell[17427, 465, 3127, 81, 269, "Text"], Cell[20557, 548, 1796, 68, 117, "Text"], Cell[22356, 618, 504, 19, 41, "Text"], Cell[22863, 639, 612, 20, 55, "Text"], Cell[23478, 661, 1175, 42, 60, "Text"], Cell[24656, 705, 740, 16, 102, "Text"], Cell[25399, 723, 169, 7, 26, "Text"], Cell[25571, 732, 296, 9, 43, "Input"], Cell[25870, 743, 240, 6, 41, "Text"], Cell[26113, 751, 286, 9, 43, "Input"], Cell[26402, 762, 164, 5, 26, "Text"], Cell[26569, 769, 111, 3, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[26717, 777, 29, 0, 34, "Subsection"], Cell[26749, 779, 157, 3, 26, "Text"], Cell[26909, 784, 261, 9, 27, "Input"], Cell[27173, 795, 59, 0, 26, "Text"], Cell[27235, 797, 422, 13, 37, "Text"], Cell[27660, 812, 850, 30, 58, "Text"], Cell[28513, 844, 230, 8, 27, "Input"], Cell[28746, 854, 339, 7, 41, "Text"], Cell[29088, 863, 274, 8, 43, "Input"], Cell[29365, 873, 138, 5, 26, "Text"], Cell[29506, 880, 415, 12, 73, "Input"], Cell[29924, 894, 437, 9, 75, "Text"], Cell[30364, 905, 316, 9, 58, "Input"], Cell[30683, 916, 166, 3, 26, "Text"], Cell[30852, 921, 337, 10, 58, "Input"], Cell[31192, 933, 1880, 42, 307, "Text"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[33121, 981, 67, 1, 33, "Section"], Cell[33191, 984, 1674, 35, 182, "Text"], Cell[CellGroupData[{ Cell[34890, 1023, 45, 0, 34, "Subsection"], Cell[34938, 1025, 276, 9, 26, "Text"], Cell[35217, 1036, 170, 6, 27, "Input"], Cell[35390, 1044, 370, 13, 41, "Text"], Cell[35763, 1059, 77, 2, 27, "Input"], Cell[35843, 1063, 408, 11, 71, "Text"], Cell[36254, 1076, 726, 18, 163, "Input"], Cell[36983, 1096, 269, 5, 41, "Text"], Cell[37255, 1103, 2419, 75, 73, "Input"], Cell[39677, 1180, 465, 10, 41, "Text"], Cell[40145, 1192, 616, 17, 43, "Input"], Cell[40764, 1211, 1237, 26, 136, "Text"], Cell[42004, 1239, 699, 20, 43, "Input"], Cell[42706, 1261, 926, 22, 86, "Text"], Cell[43635, 1285, 602, 18, 43, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[44274, 1308, 50, 0, 34, "Subsection"], Cell[44327, 1310, 945, 21, 131, "Text"], Cell[CellGroupData[{ Cell[45297, 1335, 70, 0, 25, "Subsubsection"], Cell[45370, 1337, 739, 22, 58, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[46146, 1364, 56, 0, 25, "Subsubsection"], Cell[46205, 1366, 182, 8, 26, "Text"], Cell[46390, 1376, 780, 24, 58, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[47207, 1405, 55, 0, 25, "Subsubsection"], Cell[47265, 1407, 357, 6, 56, "Text"], Cell[47625, 1415, 1079, 34, 58, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[48741, 1454, 46, 0, 25, "Subsubsection"], Cell[48790, 1456, 829, 26, 58, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[49668, 1488, 41, 0, 34, "Subsection"], Cell[49712, 1490, 1156, 25, 122, "Text"], Cell[50871, 1517, 683, 21, 43, "Input"], Cell[51557, 1540, 619, 13, 101, "Text"], Cell[52179, 1555, 789, 23, 58, "Input"], Cell[52971, 1580, 137, 3, 26, "Text"], Cell[CellGroupData[{ Cell[53133, 1587, 32, 0, 25, "Subsubsection"], Cell[53168, 1589, 386, 8, 56, "Text"], Cell[53557, 1599, 819, 22, 58, "Input"] }, Open ]] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[54437, 1628, 99, 1, 33, "Section"], Cell[54539, 1631, 1381, 35, 122, "Text"], Cell[55923, 1668, 928, 28, 88, "Input"], Cell[56854, 1698, 2119, 60, 206, "Text"], Cell[58976, 1760, 476, 15, 27, "Input"], Cell[59455, 1777, 473, 11, 56, "Text"], Cell[59931, 1790, 467, 13, 27, "Input"], Cell[60401, 1805, 302, 5, 41, "Text"], Cell[60706, 1812, 801, 22, 58, "Input"], Cell[61510, 1836, 189, 4, 41, "Text"], Cell[61702, 1842, 447, 16, 57, "Text"], Cell[62152, 1860, 1530, 38, 224, "Text"], Cell[63685, 1900, 447, 15, 31, "DisplayFormula"], Cell[64135, 1917, 259, 7, 43, "Text"], Cell[64397, 1926, 933, 29, 55, "DisplayFormula"], Cell[65333, 1957, 854, 18, 193, "Text"], Cell[66190, 1977, 2189, 48, 382, "Text"], Cell[CellGroupData[{ Cell[68404, 2029, 29, 0, 34, "Subsection"], Cell[68436, 2031, 1228, 19, 221, "Text"] }, Closed]] }, Closed]] } ] *) (* End of internal cache information *)