Cell[CellGroupData[{Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"1", ",", "x_"}], "]"}], "=", RowBox[{ RowBox[{"-", RowBox[{"(", RowBox[{"x", "-", "3"}], ")"}]}], RowBox[{"(", RowBox[{"x", "+", "1"}], ")"}]}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"2", ",", "x_"}], "]"}], "=", RowBox[{ RowBox[{"3", RowBox[{"(", RowBox[{"x", "+", "1"}], ")"}], RowBox[{"(", RowBox[{"x", "-", "1"}], ")"}], RowBox[{"(", RowBox[{"x", "-", "2"}], ")"}]}], "-", "2.25"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"3", ",", "x_"}], "]"}], "=", RowBox[{"4", "*", RowBox[{"Sin", "[", "x", "]"}]}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"4", ",", "x_"}], "]"}], "=", RowBox[{ RowBox[{".5", "*", "x"}], "-", RowBox[{"3", "*", RowBox[{"Cos", "[", "x", "]"}]}]}]}], ";"}]}], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, InitializationCell->True, CellChangeTimes->{{3.6089168628386946`*^9, 3.608916862844695*^9}, { 3.609166832985671*^9, 3.609166842298811*^9}, {3.609179477283901*^9, 3.609179478113915*^9}, 3.760790607761705*^9}, CellID->221014081], Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"M", ",", "Sol"}], "}"}], ",", " ", RowBox[{ RowBox[{"M", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"1", ",", "4"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "0.21525043770181904"}], ",", "4.08783537276714"}], "}"}], ",", RowBox[{"{", RowBox[{"1.5485837707261638", ",", RowBox[{"-", "4.143390928322696"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "3"}], RowBox[{"\[Pi]", "/", "2"}]}], ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"\[Pi]", "/", "2"}], ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "\[Pi]"}], "/", "2"}], ",", RowBox[{"-", "4"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"3", RowBox[{"\[Pi]", "/", "2"}]}], ",", RowBox[{"-", "4"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "2.9741445743701416"}], ",", "1.470967604364756"}], "}"}], ",", RowBox[{"{", RowBox[{"3.3090407328060634", ",", "4.6125602579545495"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.16744807986871543"}], ",", RowBox[{"-", "3.0417639311596525"}]}], "}"}]}], "}"}]}], "}"}]}], ";", " ", RowBox[{"Sol", "=", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"m", "==", "4"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"d", ">", RowBox[{"f", "[", RowBox[{"4", ",", "5"}], "]"}]}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"x", "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"4", ",", "x"}], "]"}], "==", "d"}], ",", RowBox[{"{", RowBox[{"x", ",", "i"}], "}"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"{", RowBox[{"2", ",", "5"}], "}"}]}], "}"}]}], "]"}], ",", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"d", ">", RowBox[{ RowBox[{"FindMaximum", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"4", ",", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}]}], "}"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"x", "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"4", ",", "x"}], "]"}], "==", "d"}], ",", RowBox[{"{", RowBox[{"x", ",", "i"}], "}"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"{", "2", "}"}]}], "}"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"d", "<", RowBox[{ RowBox[{"FindMinimum", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"4", ",", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0"}], "}"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"x", "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"4", ",", "x"}], "]"}], "==", "d"}], ",", RowBox[{"{", RowBox[{"x", ",", "i"}], "}"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"{", RowBox[{"-", "4"}], "}"}]}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"x", "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"4", ",", "x"}], "]"}], "==", "d"}], ",", RowBox[{"{", RowBox[{"x", ",", "i"}], "}"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "}"}]}], "]"}]}], "]"}]}], "]"}]}], "]"}], ",", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"m", "==", "3"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"x", "/.", RowBox[{"FindRoot", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], "==", "d"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"i", "*", "\[Pi]"}]}], "}"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "]"}], ",", " ", RowBox[{"x", "/.", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], "==", "d"}], ",", "x", ",", "Reals"}], "]"}]}]}], "]"}]}], "]"}]}], ";", " ", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", "5"}], "}"}]}], ",", RowBox[{"PlotStyle", "->", "Thick"}], ",", " ", RowBox[{"AxesLabel", "->", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], ",", RowBox[{"AxesStyle", "->", "Gray"}], ",", RowBox[{"PlotLabel", "->", RowBox[{"Style", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"s", "==", "0"}], ",", RowBox[{"Row", "[", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{"\"\\"", " ", ",", "Italic"}], "]"}], ",", "\"\<(\>\"", ",", "c", ",", "\"\<) = \>\"", ",", RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], ",", "x"}], "]"}], "/.", RowBox[{"x", "->", "c"}]}]}], "}"}], "]"}], ",", RowBox[{"Row", "[", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "Italic"}], "]"}], ",", "\"\< = 0\>\""}], "}"}], "]"}]}], "]"}], ",", "16", ",", "Red"}], "]"}]}], ",", RowBox[{"ImageSize", "->", RowBox[{"350", RowBox[{"{", RowBox[{"1.5", ",", "1"}], "}"}]}]}], ",", RowBox[{"Epilog", "->", RowBox[{"{", RowBox[{ RowBox[{"EdgeForm", "[", "Black", "]"}], ",", "Black", ",", RowBox[{"PointSize", "[", "Large", "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"Point", "[", RowBox[{"{", RowBox[{ RowBox[{"Sol", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "d"}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "Sol", "]"}]}], "}"}]}], "]"}], ",", "Thick", ",", RowBox[{"Opacity", "[", RowBox[{"1", "-", "s"}], "]"}], ",", "Red", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"c", "-", "5"}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], "/.", RowBox[{"x", "->", "c"}]}], ")"}], "-", RowBox[{"5", "*", RowBox[{"(", RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], ",", "x"}], "]"}], "/.", RowBox[{"x", "->", "c"}]}], ")"}]}]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"c", "+", "5"}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], "/.", RowBox[{"x", "->", "c"}]}], ")"}], "+", RowBox[{"5", "*", RowBox[{"(", RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], ",", "x"}], "]"}], "/.", RowBox[{"x", "->", "c"}]}], ")"}]}]}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"c", ",", RowBox[{ RowBox[{"f", "[", RowBox[{"m", ",", "x"}], "]"}], "/.", RowBox[{"x", "->", "c"}]}]}], "}"}], "]"}], ",", "Dashed", ",", RowBox[{"Opacity", "[", "1", "]"}], ",", RowBox[{"Darker", "@", "Gray"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", "d"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "d"}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Opacity", "[", "s", "]"}], ",", "Red", ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"Point", "[", RowBox[{ RowBox[{"M", "[", RowBox[{"[", "m", "]"}], "]"}], "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", RowBox[{"M", "[", RowBox[{"[", "m", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"M", "[", RowBox[{"[", "m", "]"}], "]"}], "[", RowBox[{"[", "i", "]"}], "]"}], "-", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], ",", RowBox[{ RowBox[{ RowBox[{"M", "[", RowBox[{"[", "m", "]"}], "]"}], "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", RowBox[{"M", "[", RowBox[{"[", "m", "]"}], "]"}], "]"}]}], "}"}]}], "]"}]}], "}"}]}]}], "]"}]}]}], " ", "]"}], ",", " ", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{ RowBox[{"{", " ", RowBox[{ RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"m", ",", "1", ",", RowBox[{"Row", "[", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{"f", ",", "Italic"}], "]"}], ",", "\"\<(\>\"", ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "Italic"}], "]"}], ",", "\"\<) =\>\""}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"1", "->", RowBox[{"TraditionalForm", "[", RowBox[{"Expand", "[", RowBox[{"f", "[", RowBox[{"1", ",", "x"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"2", "->", RowBox[{"TraditionalForm", "[", RowBox[{"Expand", "[", RowBox[{"f", "[", RowBox[{"2", ",", "x"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"3", "->", RowBox[{"TraditionalForm", "[", RowBox[{"f", "[", RowBox[{"3", ",", "x"}], "]"}], "]"}]}], ",", RowBox[{"4", "->", RowBox[{"TraditionalForm", "[", RowBox[{"f", "[", RowBox[{"4", ",", "x"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"ControlType", "->", "PopupMenu"}]}], "}"}], "]"}], ",", RowBox[{"Spacer", "[", "40", "]"}], ",", " ", RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"d", ",", "1", ",", RowBox[{"Row", "[", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{"y", ",", "Italic"}], "]"}], ",", "\"\< value\>\""}], "}"}], "]"}]}], "}"}], ",", RowBox[{"-", "4"}], ",", "4", ",", ".5", ",", RowBox[{"Appearance", "->", "\"\\""}]}], "}"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"s", ",", "0", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"0", "->", "\"\\""}], ",", RowBox[{"1", "->", "\"\\""}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"Spacer", "[", "40", "]"}], ",", " ", RowBox[{"Control", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"c", ",", "0", ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "Italic"}], "]"}]}], "}"}], ",", RowBox[{"-", "5"}], ",", "5", ",", ".01", ",", RowBox[{"Appearance", "->", "\"\\""}], ",", RowBox[{"Enabled", "->", RowBox[{"Dynamic", "[", RowBox[{"If", "[", RowBox[{ RowBox[{"s", "==", "0"}], ",", "True", ",", "False"}], "]"}], "]"}]}]}], "}"}], "]"}]}], "}"}]}], "}"}], "]"}], ",", RowBox[{"SaveDefinitions", "->", "True"}], ",", RowBox[{"TrackedSymbols", ":>", RowBox[{"{", RowBox[{"m", ",", "d", ",", "s", ",", "c"}], "}"}]}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.6088875372746744`*^9, {3.6088879227112865`*^9, 3.60888794055803*^9}, {3.6088879998235693`*^9, 3.6088881462635856`*^9}, {3.6088882674779167`*^9, 3.608888280394965*^9}, {3.608888385852993*^9, 3.608888407381407*^9}, {3.6088884505942383`*^9, 3.608888464540906*^9}, {3.6088885006088*^9, 3.60888858433561*^9}, { 3.608888641120702*^9, 3.6088887589029665`*^9}, { 3.608888796452889*^9, 3.6088887991985416`*^9}, { 3.6088888846101847`*^9, 3.6088888865602217`*^9}, { 3.6088889459349637`*^9, 3.608889003609273*^9}, { 3.6088890852924433`*^9, 3.608889101984764*^9}, { 3.6088891616715126`*^9, 3.6088891893152437`*^9}, { 3.608889601241165*^9, 3.608889643330775*^9}, { 3.6088897056227727`*^9, 3.6088897722672544`*^9}, { 3.608890268949606*^9, 3.608890286609145*^9}, { 3.6088909939277477`*^9, 3.608890995206972*^9}, { 3.6088910287164164`*^9, 3.6088910809774213`*^9}, { 3.608891113550848*^9, 3.608891174126813*^9}, { 3.6088912808172646`*^9, 3.608891292252284*^9}, { 3.6088921683963327`*^9, 3.6088921832790194`*^9}, { 3.6088922448730054`*^9, 3.6088922764636126`*^9}, 3.6088923318134775`*^9, {3.608892640215808*^9, 3.6088926936780357`*^9}, {3.608893122643487*^9, 3.6088931254827414`*^9}, 3.608893238397713*^9, { 3.6088933242309647`*^9, 3.6088934301570015`*^9}, { 3.608893804924614*^9, 3.608893814908806*^9}, {3.608893848246647*^9, 3.6088938628173265`*^9}, {3.608894899623666*^9, 3.6088949720558586`*^9}, {3.6088950398235617`*^9, 3.608895044004442*^9}, {3.6088951074040613`*^9, 3.608895108012473*^9}, {3.6088962792327347`*^9, 3.608896371914117*^9}, 3.608896420789857*^9, { 3.6088964682927704`*^9, 3.6088964807730103`*^9}, { 3.608897132315742*^9, 3.6088971347493887`*^9}, { 3.6088971662931957`*^9, 3.608897235761331*^9}, { 3.6089071908441715`*^9, 3.60890724794127*^9}, { 3.608907364818717*^9, 3.6089074306051826`*^9}, { 3.6089075045350037`*^9, 3.6089075709454813`*^9}, { 3.6089076208664412`*^9, 3.608907643206071*^9}, { 3.6089079122251616`*^9, 3.6089079152828207`*^9}, { 3.6089168865940695`*^9, 3.6089169809485044`*^9}, { 3.609079739056542*^9, 3.609079795239184*^9}, {3.609179278514633*^9, 3.6091792790016212`*^9}, {3.609179457886779*^9, 3.6091795058924637`*^9}, 3.760790607748468*^9}, CellID->49321202], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`c$$ = 0, $CellContext`d$$ = 1, $CellContext`m$$ = 1, $CellContext`s$$ = 0, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`m$$], 1, Row[{ Style[$CellContext`f, Italic], "(", Style["x", Italic], ") ="}]}, { 1 -> TraditionalForm[3 + 2 $CellContext`x - $CellContext`x^2], 2 -> TraditionalForm[ 3.75 - 3 $CellContext`x - 6 $CellContext`x^2 + 3 $CellContext`x^3], 3 -> TraditionalForm[4 Sin[$CellContext`x]], 4 -> TraditionalForm[ 0.5 $CellContext`x - 3 Cos[$CellContext`x]]}}, {{ Hold[$CellContext`d$$], 1, Row[{ Style[$CellContext`y, Italic], " value"}]}, -4, 4, 0.5}, {{ Hold[$CellContext`s$$], 0, "solutions"}, { 0 -> "find", 1 -> "show"}}, {{ Hold[$CellContext`c$$], 0, Style["c", Italic]}, -5, 5, 0.01}, { Hold[ Grid[{{ Manipulate`Place[1], Spacer[40], Manipulate`Place[2]}, { Manipulate`Place[3], Spacer[40], Manipulate`Place[4]}}]], Manipulate`Dump`ThisIsNotAControl}}, Typeset`size$$ = { 525., {173., 177.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`m$968$$ = False, $CellContext`d$969$$ = 0, $CellContext`s$970$$ = False, $CellContext`c$971$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 2, StandardForm, "Variables" :> {$CellContext`c$$ = 0, $CellContext`d$$ = 1, $CellContext`m$$ = 1, $CellContext`s$$ = 0}, "ControllerVariables" :> { Hold[$CellContext`m$$, $CellContext`m$968$$, False], Hold[$CellContext`d$$, $CellContext`d$969$$, 0], Hold[$CellContext`s$$, $CellContext`s$970$$, False], Hold[$CellContext`c$$, $CellContext`c$971$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`M$, $CellContext`Sol$}, $CellContext`M$ = \ {{{1, 4}}, {{-0.21525043770181904`, 4.08783537276714}, { 1.5485837707261638`, -4.143390928322696}}, {{(-3) (Pi/2), 4}, {Pi/2, 4}, {(-Pi)/2, -4}, { 3 (Pi/2), -4}}, {{-2.9741445743701416`, 1.470967604364756}, {3.3090407328060634`, 4.6125602579545495`}, {-0.16744807986871543`, \ -3.0417639311596525`}}}; $CellContext`Sol$ = If[$CellContext`m$$ == 4, If[$CellContext`d$$ > $CellContext`f[4, 5], Table[ ReplaceAll[$CellContext`x, FindRoot[$CellContext`f[ 4, $CellContext`x] == $CellContext`d$$, \ {$CellContext`x, $CellContext`i}]], {$CellContext`i, {2, 5}}], If[$CellContext`d$$ > Part[ FindMaximum[ $CellContext`f[ 4, $CellContext`x], {$CellContext`x, -3}], 1], Table[ ReplaceAll[$CellContext`x, FindRoot[$CellContext`f[ 4, $CellContext`x] == $CellContext`d$$, \ {$CellContext`x, $CellContext`i}]], {$CellContext`i, {2}}], If[$CellContext`d$$ < Part[ FindMinimum[ $CellContext`f[ 4, $CellContext`x], {$CellContext`x, 0}], 1], Table[ ReplaceAll[$CellContext`x, FindRoot[$CellContext`f[ 4, $CellContext`x] == $CellContext`d$$, \ {$CellContext`x, $CellContext`i}]], {$CellContext`i, {-4}}], Table[ ReplaceAll[$CellContext`x, FindRoot[$CellContext`f[ 4, $CellContext`x] == $CellContext`d$$, \ {$CellContext`x, $CellContext`i}]], {$CellContext`i, {-4, -2, 2}}]]]], If[$CellContext`m$$ == 3, Table[ ReplaceAll[$CellContext`x, FindRoot[$CellContext`f[$CellContext`m$$, \ $CellContext`x] == $CellContext`d$$, {$CellContext`x, $CellContext`i Pi}]], {$CellContext`i, -1, 1}], ReplaceAll[$CellContext`x, Solve[$CellContext`f[$CellContext`m$$, $CellContext`x] == \ $CellContext`d$$, $CellContext`x, Reals]]]]; Plot[ $CellContext`f[$CellContext`m$$, $CellContext`x], \ {$CellContext`x, -5, 5}, PlotRange -> {-5, 5}, PlotStyle -> Thick, AxesLabel -> {$CellContext`x, $CellContext`y}, AxesStyle -> Gray, PlotLabel -> Style[ If[$CellContext`s$$ == 0, Row[{ Style["f'", Italic], "(", $CellContext`c$$, ") = ", ReplaceAll[ D[ $CellContext`f[$CellContext`m$$, $CellContext`x], \ $CellContext`x], $CellContext`x -> $CellContext`c$$]}], Row[{"Solutions to ", Style["f'(x)", Italic], " = 0"}]], 16, Red], ImageSize -> 350 {1.5, 1}, Epilog -> { EdgeForm[Black], Black, PointSize[Large], Table[ Point[{ Part[$CellContext`Sol$, $CellContext`i], \ $CellContext`d$$}], {$CellContext`i, Length[$CellContext`Sol$]}], Thick, Opacity[1 - $CellContext`s$$], Red, Line[{{$CellContext`c$$ - 5, ReplaceAll[ $CellContext`f[$CellContext`m$$, $CellContext`x], \ $CellContext`x -> $CellContext`c$$] - 5 ReplaceAll[ D[ $CellContext`f[$CellContext`m$$, $CellContext`x], \ $CellContext`x], $CellContext`x -> $CellContext`c$$]}, \ {$CellContext`c$$ + 5, ReplaceAll[ $CellContext`f[$CellContext`m$$, $CellContext`x], \ $CellContext`x -> $CellContext`c$$] + 5 ReplaceAll[ D[ $CellContext`f[$CellContext`m$$, $CellContext`x], \ $CellContext`x], $CellContext`x -> $CellContext`c$$]}}], Point[{$CellContext`c$$, ReplaceAll[ $CellContext`f[$CellContext`m$$, $CellContext`x], \ $CellContext`x -> $CellContext`c$$]}], Dashed, Opacity[1], Darker[Gray], Line[{{-5, $CellContext`d$$}, {5, $CellContext`d$$}}], Opacity[$CellContext`s$$], Red, Table[ Point[ Part[ Part[$CellContext`M$, $CellContext`m$$], \ $CellContext`i]], {$CellContext`i, 1, Length[ Part[$CellContext`M$, $CellContext`m$$]]}], Table[ Line[{Part[ Part[$CellContext`M$, $CellContext`m$$], \ $CellContext`i] - {1, 0}, Part[ Part[$CellContext`M$, $CellContext`m$$], \ $CellContext`i] + {1, 0}}], {$CellContext`i, 1, Length[ Part[$CellContext`M$, $CellContext`m$$]]}]}]], "Specifications" :> {{{$CellContext`m$$, 1, Row[{ Style[$CellContext`f, Italic], "(", Style["x", Italic], ") ="}]}, { 1 -> TraditionalForm[ 3 + 2 $CellContext`x - $CellContext`x^2], 2 -> TraditionalForm[ 3.75 - 3 $CellContext`x - 6 $CellContext`x^2 + 3 $CellContext`x^3], 3 -> TraditionalForm[4 Sin[$CellContext`x]], 4 -> TraditionalForm[ 0.5 $CellContext`x - 3 Cos[$CellContext`x]]}, ControlType -> PopupMenu, ControlPlacement -> 1}, {{$CellContext`d$$, 1, Row[{ Style[$CellContext`y, Italic], " value"}]}, -4, 4, 0.5, Appearance -> "Labeled", ControlPlacement -> 2}, {{$CellContext`s$$, 0, "solutions"}, { 0 -> "find", 1 -> "show"}, ControlPlacement -> 3}, {{$CellContext`c$$, 0, Style["c", Italic]}, -5, 5, 0.01, Appearance -> "Labeled", Enabled -> Dynamic[ If[$CellContext`s$$ == 0, True, False]], ControlPlacement -> 4}, Grid[{{ Manipulate`Place[1], Spacer[40], Manipulate`Place[2]}, { Manipulate`Place[3], Spacer[40], Manipulate`Place[4]}}]}, "Options" :> { TrackedSymbols :> {$CellContext`m$$, $CellContext`d$$, \ $CellContext`s$$, $CellContext`c$$}}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{570., {233., 239.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`M = {{{1, 4}}, {{-0.21525043770181904`, 4.08783537276714}, { 1.5485837707261638`, -4.143390928322696}}, {{((-3) Pi)/2, 4}, {Pi/2, 4}, {(-Pi)/2, -4}, {(3 Pi)/ 2, -4}}, {{-2.9741445743701416`, 1.470967604364756}, { 3.3090407328060634`, 4.6125602579545495`}, {-0.16744807986871543`, \ -3.0417639311596525`}}}, $CellContext`Sol = { 1 - Sqrt[3], 1 + Sqrt[3]}, $CellContext`f[1, Pattern[$CellContext`x, Blank[]]] = (3 - $CellContext`x) ( 1 + $CellContext`x), $CellContext`f[2, Pattern[$CellContext`x, Blank[]]] = -2.25 + (( 3 (-2 + $CellContext`x)) (-1 + $CellContext`x)) ( 1 + $CellContext`x), $CellContext`f[3, Pattern[$CellContext`x, Blank[]]] = 4 Sin[$CellContext`x], $CellContext`f[4, Pattern[$CellContext`x, Blank[]]] = 0.5 $CellContext`x - 3 Cos[$CellContext`x], Attributes[PlotRange] = {ReadProtected}}; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{{3.609519445459961*^9, 3.6095194601850157`*^9}, 3.7607906077487373`*^9}, CellID->1227154290] }, {3}]]