(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 9.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 17234, 497] NotebookOptionsPosition[ 16478, 468] NotebookOutlinePosition[ 16837, 484] CellTagsIndexPosition[ 16794, 481] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Domain and Range", "Title", CellChangeTimes->{{3.5666066674381123`*^9, 3.56660667007513*^9}}, TextAlignment->Center], Cell["\<\ by Ruth Dover Illinois Mathematics and Science Academy\ \>", "Subsubtitle", CellChangeTimes->{{3.6925544130802107`*^9, 3.692554426152443*^9}}], Cell[TextData[{ "Edit the first two lines below in each example to enter \.08your own \ function and values for ", StyleBox["xmin", FontSlant->"Italic"], " and ", StyleBox["xmax", FontSlant->"Italic"], ". Execute the cell by pressing Shift-Enter. The range is shown in ", StyleBox["magenta", FontColor->RGBColor[1, 0, 1]], " along the ", StyleBox["y", FontSlant->"Italic"], "-axis. \nSeveral examples are shown to allow you to see different types of \ functions (and to make editing easier).\n", StyleBox["Important Note:", FontColor->RGBColor[1, 0, 0]], " You\[CloseCurlyQuote]ll have to figure out the endpoints for yourself!\n\ ", StyleBox["Another Important Note:", FontColor->RGBColor[1, 0, 0]], " There are some functions where this just doesn\[CloseCurlyQuote]t work \ well! (Sorry!)" }], "Text", CellChangeTimes->{{3.566738606114092*^9, 3.566738726405675*^9}, { 3.5667388721612377`*^9, 3.5667388726013002`*^9}, {3.566738921734202*^9, 3.566738957919281*^9}, {3.5667390472223587`*^9, 3.566739049075735*^9}, { 3.566739199930016*^9, 3.566739228423428*^9}, {3.692554289574316*^9, 3.692554312432042*^9}, {3.692554775425734*^9, 3.692554783468959*^9}, { 3.692554817142475*^9, 3.692554829247233*^9}}], Cell[TextData[StyleBox["Example 1", FontColor->RGBColor[1, 0, 0]]], "Text", CellChangeTimes->{{3.5667387831488667`*^9, 3.566738785187373*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", RowBox[{ SuperscriptBox["x", "2"], "-", RowBox[{"2", "x"}], "+", "3"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"xmin", "=", RowBox[{"-", "1"}]}], ";", RowBox[{"xmax", "=", "4"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"stepsize", "=", RowBox[{ RowBox[{"(", RowBox[{"xmax", "-", "xmin"}], ")"}], "/", "1000."}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mypl", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", "xmin", ",", " ", "xmax"}], "}"}], ",", " ", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", " ", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mypts", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"Magenta", ",", RowBox[{"PointSize", "[", "Large", "]"}], ",", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"NumberQ", "[", RowBox[{"f", "[", "k", "]"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"0", ",", RowBox[{"f", "[", "k", "]"}]}], "}"}], "]"}]}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"k", ",", " ", "xmin", ",", "xmax", ",", " ", "stepsize"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"mypl", ",", " ", RowBox[{"Graphics", "[", "mypts", "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.5667390679067783`*^9, 3.5667390745045233`*^9}, { 3.56673912871327*^9, 3.56673918547882*^9}, {3.56673924753957*^9, 3.566739248586151*^9}, {3.566739363123518*^9, 3.566739436273593*^9}, { 3.6925547228543043`*^9, 3.69255472374049*^9}, {3.692554795036317*^9, 3.692554798815055*^9}}], Cell[TextData[StyleBox["Example 2", FontColor->RGBColor[1, 0, 0]]], "Text", CellChangeTimes->{{3.566738787893441*^9, 3.566738794622238*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", RowBox[{"Floor", "[", "x", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"xmin", "=", RowBox[{"-", "1"}]}], ";", RowBox[{"xmax", "=", "4"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"stepsize", "=", RowBox[{ RowBox[{"(", RowBox[{"xmax", "-", "xmin"}], ")"}], "/", "1000."}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mypl", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", "xmin", ",", " ", "xmax"}], "}"}], ",", " ", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", " ", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mypts", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"Magenta", ",", RowBox[{"PointSize", "[", "Large", "]"}], ",", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"NumberQ", "[", RowBox[{"f", "[", "k", "]"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"0", ",", RowBox[{"f", "[", "k", "]"}]}], "}"}], "]"}]}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"k", ",", " ", "xmin", ",", "xmax", ",", " ", "stepsize"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"mypl", ",", " ", RowBox[{"Graphics", "[", "mypts", "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.566739253779066*^9, 3.566739254817965*^9}, { 3.692554856339755*^9, 3.692554857722674*^9}}], Cell[TextData[{ StyleBox["Example 3", FontColor->RGBColor[1, 0, 0]], ": Piecewise functions, including disconnected domains" }], "Text", CellChangeTimes->{{3.56673879869228*^9, 3.56673880081092*^9}, { 3.56673888867267*^9, 3.566738912054328*^9}, {3.5667390045014668`*^9, 3.5667390049093018`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", TagBox[GridBox[{ {"\[Piecewise]", GridBox[{ { RowBox[{"x", "-", "1"}], RowBox[{"x", "\[LessEqual]", "0"}]}, {"x", RowBox[{"x", ">", "2"}]}, {"Undefined", "True"} }, AllowedDimensions->{2, Automatic}, Editable->True, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.84]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}, Selectable->True]} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.35]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "Piecewise", DeleteWithContents->True, Editable->False, SelectWithContents->True, Selectable->False]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"xmin", "=", RowBox[{"-", "1"}]}], ";", RowBox[{"xmax", "=", "4"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"stepsize", "=", RowBox[{ RowBox[{"(", RowBox[{"xmax", "-", "xmin"}], ")"}], "/", "1000."}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mypl", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", "xmin", ",", " ", "xmax"}], "}"}], ",", " ", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", " ", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mypts", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"Magenta", ",", RowBox[{"PointSize", "[", "Large", "]"}], ",", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"NumberQ", "[", RowBox[{"f", "[", "k", "]"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"0", ",", RowBox[{"f", "[", "k", "]"}]}], "}"}], "]"}]}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"k", ",", " ", "xmin", ",", "xmax", ",", " ", "stepsize"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"mypl", ",", " ", RowBox[{"Graphics", "[", "mypts", "]"}]}], "]"}]}], "Input", CellChangeTimes->{{3.566739259683053*^9, 3.5667392607464733`*^9}, { 3.6925548708531427`*^9, 3.692554872472105*^9}}], Cell[CellGroupData[{ Cell["Version 2: For connected domains and ranges only", "Subtitle", CellChangeTimes->{{3.566734121302785*^9, 3.566734141037298*^9}, 3.5667385880040903`*^9, {3.5667390210681*^9, 3.566739022228278*^9}}], Cell[TextData[{ "Edit the first two lines below to enter \.08your own function and values \ for ", StyleBox["xmin", FontSlant->"Italic"], " and ", StyleBox["xmax", FontSlant->"Italic"], ". The domain is shown in ", StyleBox["purple", FontColor->RGBColor[0.5, 0, 0.5]], " and the range is shown in ", StyleBox["magenta", FontColor->RGBColor[1, 0, 1]], " along the respective axes.\nExecute the cell by pressing Shift-Enter. \ Then use the sliders to view the domain and range over subintervals of the \ entire graph." }], "Text", CellChangeTimes->{{3.566606677568398*^9, 3.566606712271985*^9}, { 3.566606754094748*^9, 3.5666068116842737`*^9}, {3.566607041277651*^9, 3.5666070812896357`*^9}, {3.566649195173007*^9, 3.5666491962436037`*^9}, { 3.566650959193967*^9, 3.566651014613235*^9}, {3.5666511667997503`*^9, 3.566651174524809*^9}, {3.566651224910095*^9, 3.566651237883163*^9}, { 3.566732978498595*^9, 3.566732982184987*^9}, {3.5667341457730083`*^9, 3.566734146188847*^9}, {3.692554967404297*^9, 3.692555022204525*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", RowBox[{ SuperscriptBox["x", "3"], "-", RowBox[{"3", "x"}], "+", "1"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"xmin", "=", RowBox[{"-", "2"}]}], ";", RowBox[{"xmax", "=", "2.5"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Leave", " ", "the", " ", "rest", " ", "of", " ", "the", " ", "coding", " ", RowBox[{"alone", "!"}]}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"a", "=", RowBox[{ RowBox[{"(", RowBox[{"xmax", "-", "xmin"}], ")"}], "/", "25"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{"{", RowBox[{"x", ",", " ", RowBox[{"Min", "[", RowBox[{ RowBox[{"-", "0.1"}], ",", RowBox[{"xmin", "-", "a"}]}], "]"}], ",", " ", RowBox[{"Max", "[", RowBox[{"0.1", ",", RowBox[{"xmax", "+", "a"}]}], "]"}]}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", "Thick"}], ",", " ", RowBox[{"AxesOrigin", " ", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], ",", RowBox[{"Epilog", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Thickness", "[", ".015", "]"}], ",", " ", "Purple", ",", " ", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"leftx", "+", ".01"}], ",", " ", "0"}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"rightx", "-", ".01"}], ",", "0"}], "}"}]}], "}"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"Thickness", "[", ".015", "]"}], ",", " ", "Magenta", ",", " ", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", " ", RowBox[{ RowBox[{"First", "[", RowBox[{"NMinimize", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{ "leftx", "\[LessEqual]", "x", "\[LessEqual]", "rightx"}]}], "}"}], ",", " ", "x"}], "]"}], "]"}], "+", ".01"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{"0", ",", " ", RowBox[{ RowBox[{"First", "[", RowBox[{"NMaximize", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{ "leftx", "\[LessEqual]", "x", "\[LessEqual]", " ", "rightx"}]}], "}"}], ",", "x"}], "]"}], "]"}], "-", ".01"}]}], "}"}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"ColorData", "[", "\"\\"", "]"}], "[", "\"\\"", "]"}], ",", " ", RowBox[{"Opacity", "[", ".5", "]"}], ",", " ", RowBox[{"Rectangle", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Min", "[", RowBox[{"leftx", ",", "0"}], "]"}], ",", " ", RowBox[{"First", "[", RowBox[{"NMinimize", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{ "leftx", "\[LessEqual]", "x", "\[LessEqual]", "rightx"}]}], "}"}], ",", " ", "x"}], "]"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"Max", "[", RowBox[{"0", ",", "rightx"}], "]"}], ",", " ", RowBox[{"First", "[", RowBox[{"NMaximize", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", " ", RowBox[{ "leftx", "\[LessEqual]", "x", "\[LessEqual]", " ", "rightx"}]}], "}"}], ",", "x"}], "]"}], "]"}]}], "}"}]}], "]"}]}], "}"}]}], "}"}]}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{"leftx", ",", " ", "xmin", ",", " ", RowBox[{"rightx", "-", ".1"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"rightx", ",", "xmax"}], "}"}], ",", RowBox[{"leftx", "+", ".1"}], ",", " ", "xmax"}], "}"}]}], "]"}]}], "Input", CellChangeTimes->CompressedData[" 1:eJwdyk0ogwEAh/E3c0CslcNM2GYstSLb7KAoTZLLNvIxYbbMt7iMXBCjZQqj JZPvNkMOEpNMY8tHiThgvdiB0lyQN1Li/e/w9Ls8fF17sT6MIAgeHawaEOx4 LMG8ij7CBY1Zm/uwxmf0QMKmPIO14/Jz6GJRjzDilPUMt7vj3qBuyf8OO4fM 7ENaRUOAD5tEqTJoIg25sF75IYfH3PsCeMu0K6C3i6OGVHpfNWz+XdbAEUt0 I+ztqjPAqNhRC5xvFU7An1KODZKO1Rk41bb3A7/JVtYR7a5NnQDFmdokaE0t EUJ2rz5kGdMkhmF3UgmcJcunb2jjvV82OCaYXIAdOTI7PMmv9sBCqd0HkwLZ fnhBaR/glGb1CZqSe17gpUryButehim48udg3NIq2aJwGGPWRcBK/UMk5LvN XOgyZPAgtS5NgdYJd8ihK90ijD5Yc4a+hJoNOMdwbsEKc9AFP8m0Q6gRJqp+ +1/zAtdFIVtE2WXQujyohv/WvB8T "]] }, Open ]] }, Open ]] }, WindowSize->{950, 773}, WindowMargins->{{185, Automatic}, {Automatic, 2}}, FrontEndVersion->"11.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (September \ 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 124, 2, 92, "Title"], Cell[706, 26, 153, 4, 49, "Subsubtitle"], Cell[862, 32, 1241, 30, 106, "Text"], Cell[2106, 64, 144, 2, 30, "Text"], Cell[2253, 68, 1962, 55, 159, "Input"], Cell[4218, 125, 142, 2, 30, "Text"], Cell[4363, 129, 1720, 50, 159, "Input"], Cell[6086, 181, 305, 7, 30, "Text"], Cell[6394, 190, 3277, 94, 195, "Input"], Cell[CellGroupData[{ Cell[9696, 288, 206, 2, 51, "Subtitle"], Cell[9905, 292, 1054, 24, 68, "Text"], Cell[10962, 318, 5488, 146, 306, "Input"] }, Open ]] }, Open ]] } ] *)