(*********************************************************************** 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[ 5917, 169]*) (*NotebookOutlinePosition[ 6625, 194]*) (* CellTagsIndexPosition[ 6581, 190]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Functions and Derivatives; Which is Which?\ \>", "Title", CellFrame->True, TextAlignment->Center, Background->RGBColor[0, 1, 0]], Cell["\<\ This notebook is by Steven Amgott. Please send any questions or comments to \ samgott1@swarthmore.edu. Feel free to use and distribute this notebook, but \ keep this author information in any copy you use or distribute.\ \>", "SmallText"], Cell[CellGroupData[{ Cell["\<\ Initialization. (Can be skipped, if you answer \"Yes\" to the initialization \ request.)\ \>", "Section"], Cell["\<\ The cells in this section are initialization cells, and will be automatically \ evaluated if you answer \"Yes\" to the initialization request. If you do not \ answer \"Yes\" to this request, you must evaluate them before creating the \ graphs in the second section below.\ \>", "Text"], Cell[BoxData[{ \(Clear[x, fnList]\), "\n", \(\(fnList = {{\((x - 2)\)\^2\ \[ExponentialE]\^\(\(-x\) + 2\) - .5, {1, 5.1}}, {\[ExponentialE]\^\(-x\)\ Sin[x], {1, 5.1}}, { .5\ InterpolatingPolynomial[{0, 2, 1, 3, \(-2\)}, x], {1, 5.1}}, { .5\ InterpolatingPolynomial[{\(-2\), 3, 7, \(-2\), \(-1\), 4}, x], {1, 5.1}}, { .5\ InterpolatingPolynomial[{3, 4, 2, \(-1\), 1, 3, \(-2\)}, x], {1, 5.1}}, { .5\ InterpolatingPolynomial[{3, \(-4\), 2, 1, \(-2\), 1, \(-1\)}, x], {1, 7.1}}, { .5\ InterpolatingPolynomial[{3, 4, 2, \(-1\), 5, 3, \(-2\)}, x], {1, 7.1}}};\)\)}], "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell["On to the quiz... (We're sorry, but no monetary prizes.)", "Section"], Cell[TextData[{ "The next cell picks a random function from a list of functions (in the \ initialization section) and plots the function, the first derivative, and the \ second derivative on the same sets of axes, using a random choice of colors \ ", StyleBox["red", FontColor->RGBColor[1, 0, 0]], ", ", StyleBox["green", FontColor->RGBColor[0, 1, 0]], ", and ", StyleBox["blue", FontColor->RGBColor[0, 0, 1]], " for the three curves." }], "Text"], Cell[BoxData[{ \(Clear[f, x, choice, nRand]\), "\n", \(\(choice = fnList[\([Random[Integer, {1, Length[fnList]}]]\)];\)\), "\n", \(\(f[x_] = choice[\([1]\)];\)\), "\n", \(\(Plot[{f[x], \(f'\)[x], \(f''\)[ x]}, {x, \(choice[\([2]\)]\)[\([1]\)], \ \(choice[\([2]\)]\)[\([2]\)]}, PlotStyle \[Rule] \(Permutations[{RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}]\)[\([nRand = Random[Integer, {1, 6}]]\)]];\)\)}], "Input"], Cell["\<\ Which graph is that of the function, which is that of the derivative, and \ which is that of the second derivative?\ \>", "Text"], Cell["ANS:", "Text", CellFrame->True, Background->GrayLevel[0.849989]], Cell["Is that your final answer?", "Text"], Cell["To check your answer, evaluate the next cell.", "Text"], Cell[BoxData[ RowBox[{"TableForm", "[", RowBox[{ RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{\({"\", "\", "\"}\), ",", RowBox[{ RowBox[{"Permutations", "[", RowBox[{"{", RowBox[{"\"\<\!\(\* StyleBox[\\\"red\\\",\\nFontColor->RGBColor[1, 0, 0]]\)\>\"", ",", "\"\<\!\(\* StyleBox[\\\"green\\\",\\nFontColor->RGBColor[0, 1, 0]]\)\>\"", ",", "\"\<\!\(\* StyleBox[\\\"blue\\\",\\nFontColor->RGBColor[0, 0, 1]]\)\>\""}], "}"}], "]"}], "[", \([nRand]\), "]"}]}], "}"}], "]"}], ",", RowBox[{"TableHeadings", "\[Rule]", RowBox[{"{", RowBox[{\({"\<\>"}\), ",", RowBox[{"{", RowBox[{"\"\<\!\(\* StyleBox[\\\"Graph\\\",\\nFontColor->RGBColor[0.500008, 0, 0.250004]]\)\>\"", ",", "\"\<\!\(\* StyleBox[\\\"Color\\\",\\nFontColor->RGBColor[0.500008, 0, \ 0.250004]]\)\>\""}], "}"}]}], "}"}]}]}], "]"}]], "Input"] }, Closed]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 720}}, AutoGeneratedPackage->None, WindowToolbars->"EditBar", WindowSize->{519, 563}, WindowMargins->{{0, Automatic}, {Automatic, 3}} ] (*********************************************************************** 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[CellGroupData[{ Cell[1739, 51, 144, 6, 211, "Title"], Cell[1886, 59, 250, 4, 60, "SmallText"], Cell[CellGroupData[{ Cell[2161, 67, 116, 3, 74, "Section"], Cell[2280, 72, 296, 5, 71, "Text"], Cell[2579, 79, 791, 14, 232, "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell[3407, 98, 76, 0, 33, "Section"], Cell[3486, 100, 473, 14, 71, "Text"], Cell[3962, 116, 510, 10, 170, "Input"], Cell[4475, 128, 139, 3, 52, "Text"], Cell[4617, 133, 74, 2, 49, "Text"], Cell[4694, 137, 42, 0, 33, "Text"], Cell[4739, 139, 62, 0, 33, "Text"], Cell[4804, 141, 1085, 24, 90, "Input"] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)