Cell[CellGroupData[{Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"fcn", "===", "Log"}], "&&", RowBox[{"a", "<", ".001"}]}], ",", RowBox[{"a", "=", ".001"}]}], "]"}], ";", " ", RowBox[{"(*", RowBox[{ "set", " ", "height", " ", "of", " ", "inset", " ", "text", " ", "for", " ", "slope"}], "*)"}], " ", RowBox[{"m", "=", RowBox[{"Max", "[", RowBox[{ RowBox[{"Abs", "[", RowBox[{"fcn", "[", "5", "]"}], "]"}], ",", RowBox[{"Abs", "[", RowBox[{"fcn", "[", "6", "]"}], "]"}]}], "]"}]}], ";", " ", RowBox[{"(*", RowBox[{"change", " ", "domain", " ", "for", " ", "log"}], "*)"}], " ", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"fcn", "[", "2", "]"}], "==", RowBox[{"Log", "[", "2", "]"}]}], ",", RowBox[{"left", "=", ".001"}], ",", RowBox[{"left", "=", RowBox[{"-", "8"}]}]}], "]"}], ";", " ", RowBox[{"(*", RowBox[{ "change", " ", "plotrange", " ", "for", " ", "log", " ", "and", " ", "trig", " ", "functions"}], "*)"}], " ", RowBox[{"Which", "[", RowBox[{ RowBox[{ RowBox[{"fcn", "[", "2", "]"}], "==", RowBox[{"Log", "[", "2", "]"}]}], ",", RowBox[{"r", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "3"}], "}"}]}], ",", RowBox[{ RowBox[{"fcn", "[", RowBox[{"Pi", "/", "4"}], "]"}], "==", RowBox[{"Sin", "[", RowBox[{"Pi", "/", "4"}], "]"}]}], ",", RowBox[{"r", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", "2"}], "}"}]}], ",", "True", ",", RowBox[{"r", "=", "Automatic"}]}], "]"}], ";", " ", " ", RowBox[{ "GraphicsRow", "[", " ", " ", RowBox[{"(*", RowBox[{ RowBox[{"first", " ", "row"}], " ", "-", " ", "function"}], "*)"}], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"fcn", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "left", ",", "8"}], "}"}], ",", RowBox[{"PlotStyle", "->", RowBox[{"Thickness", "[", ".007", "]"}]}], ",", RowBox[{"ImageSize", "->", RowBox[{"Scaled", "[", ".7", "]"}]}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "8"}], ",", "12"}], "}"}], ",", "r"}], "}"}]}], ",", RowBox[{"PlotLabel", " ", "->", RowBox[{"Style", "[", RowBox[{ RowBox[{"Framed", "[", RowBox[{ RowBox[{"Row", "[", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "Italic"}], "]"}], ",", "\"\<(\>\"", ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "Italic"}], "]"}], ",", "\"\<)\>\"", ",", "\"\< = \>\"", ",", RowBox[{"ToString", "[", RowBox[{ StyleBox[ RowBox[{"fcn", "[", "x", "]"}], "WarholOrange"], ",", "TraditionalForm"}], StyleBox["]", "WarholOrange"]}]}], "}"}], "]"}], ",", RowBox[{"Background", "->", "LightGray"}]}], "]"}], ",", "14"}], "]"}]}], ",", RowBox[{"Epilog", "->", " ", RowBox[{"Inset", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"Row", "[", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{"\"\\"", ",", " ", "Italic"}], "]"}], ",", "\"\< = \>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"N", "[", RowBox[{ RowBox[{"fcn", "'"}], "[", "a", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"4", ",", "2"}], "}"}]}], "]"}]}], "}"}], "]"}], ",", "14", ",", RowBox[{"Background", "->", "LightRed"}]}], "]"}], ",", RowBox[{"{", RowBox[{"10", ",", RowBox[{"m", "/", "2"}]}], "}"}]}], "]"}]}]}], "]"}], ",", " ", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"a", ",", RowBox[{"fcn", "[", "a", "]"}]}], "}"}], "}"}], ",", RowBox[{"PlotStyle", "->", RowBox[{"{", RowBox[{"Black", ",", RowBox[{"PointSize", "[", "Large", "]"}]}], "}"}]}]}], "]"}], ",", " ", RowBox[{"Plot", "[", RowBox[{ RowBox[{ RowBox[{"fcn", "[", "a", "]"}], "+", RowBox[{ RowBox[{ RowBox[{"fcn", "'"}], "[", "a", "]"}], "*", RowBox[{"(", RowBox[{"x", "-", "a"}], ")"}]}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"a", "-", "2"}], ",", RowBox[{"a", "+", "2"}]}], "}"}], ",", " ", RowBox[{"PlotStyle", "->", RowBox[{"{", RowBox[{"Red", ",", RowBox[{"Thickness", "[", ".012", "]"}], ",", RowBox[{"Opacity", "[", ".6", "]"}]}], "}"}]}]}], "]"}], ",", RowBox[{"PlotRangePadding", "->", "1"}]}], "]"}], ",", " ", " ", RowBox[{"(*", RowBox[{ RowBox[{"second", " ", "row"}], " ", "-", " ", "derivative"}], "*)"}], " ", RowBox[{"Show", "[", " ", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{ RowBox[{"fcn", "'"}], "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "left", ",", "8"}], "}"}], ",", RowBox[{"PlotStyle", "->", RowBox[{"Thickness", "[", ".007", "]"}]}], " ", ",", RowBox[{"ImageSize", "->", RowBox[{"Scaled", "[", ".7", "]"}]}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "8"}], ",", "12"}], "}"}], ",", "r"}], "}"}]}], ",", RowBox[{"PlotLabel", " ", "->", RowBox[{"Style", "[", RowBox[{ RowBox[{"Framed", "[", RowBox[{ RowBox[{"Row", "[", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "Italic"}], "]"}], ",", "\"\<(\>\"", ",", RowBox[{"Style", "[", RowBox[{"\"\\"", ",", "Italic"}], "]"}], ",", "\"\<)\>\""}], "}"}], "]"}], ",", RowBox[{"Background", "->", "LightGray"}]}], "]"}], ",", "14"}], "]"}]}], ",", RowBox[{"Epilog", "->", " ", RowBox[{"Inset", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"Row", "[", RowBox[{"{", RowBox[{ RowBox[{"Style", "[", RowBox[{"\"\\"", ",", " ", "Italic"}], "]"}], ",", "\"\< = \>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"N", "[", RowBox[{ RowBox[{"fcn", "'"}], "[", "a", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"4", ",", "2"}], "}"}]}], "]"}]}], "}"}], "]"}], ",", "14", ",", RowBox[{"Background", "->", "LightRed"}]}], "]"}], ",", RowBox[{"{", RowBox[{"10", ",", RowBox[{ RowBox[{"fcn", "'"}], "[", "a", "]"}]}], "}"}]}], "]"}]}]}], "]"}], ",", " ", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{"Dashed", ",", "Red", ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{ RowBox[{"fcn", "'"}], "[", "a", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"a", ",", RowBox[{ RowBox[{"fcn", "'"}], "[", "a", "]"}]}], "}"}]}], "}"}], "]"}]}], "}"}], "]"}], ",", " ", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"a", ",", RowBox[{ RowBox[{"fcn", "'"}], "[", "a", "]"}]}], "}"}], "}"}], ",", RowBox[{"PlotStyle", "->", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "Large", "]"}], ",", "Red"}], "}"}]}]}], "]"}], ",", RowBox[{"PlotRangePadding", "->", "1"}]}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "->", RowBox[{"{", RowBox[{"600", ",", "300"}], "}"}]}]}], "]"}]}], ",", " ", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"a", ",", "1", ",", "\"\\""}], "}"}], ",", RowBox[{"Dynamic", "[", RowBox[{"If", "[", RowBox[{ RowBox[{"fcn", "===", "Log"}], ",", ".001", ",", RowBox[{"-", "8"}]}], "]"}], "]"}], ",", "8", ",", RowBox[{"Appearance", "->", "\"\\""}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"fcn", ",", RowBox[{ RowBox[{"(", RowBox[{"#", "^", "2"}], ")"}], "&"}], ",", "\"\\""}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"Identity", "->", RowBox[{"ToString", "[", RowBox[{"x", ",", "TraditionalForm"}], "]"}]}], ",", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"#", "^", "2"}], ")"}], "&"}], ")"}], "->", RowBox[{"ToString", "[", RowBox[{ RowBox[{"x", "^", "2"}], ",", "TraditionalForm"}], "]"}]}], ",", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"#", "^", "3"}], ")"}], "&"}], ")"}], "->", RowBox[{"ToString", "[", RowBox[{ RowBox[{"x", "^", "3"}], ",", "TraditionalForm"}], "]"}]}], ",", " ", RowBox[{"Sin", "->", RowBox[{"ToString", "[", RowBox[{ RowBox[{"Sin", "[", "x", "]"}], ",", "TraditionalForm"}], "]"}]}], ",", " ", RowBox[{"Cos", "->", RowBox[{"ToString", "[", RowBox[{ RowBox[{"Cos", "[", "x", "]"}], ",", "TraditionalForm"}], "]"}]}], ",", " ", RowBox[{"Exp", "->", RowBox[{"ToString", "[", RowBox[{ RowBox[{"Exp", "[", "x", "]"}], ",", "TraditionalForm"}], "]"}]}], ",", " ", RowBox[{"Log", "->", " ", RowBox[{"ToString", "[", RowBox[{ RowBox[{"Log", "[", "x", "]"}], ",", "TraditionalForm"}], "]"}]}]}], "}"}], ",", " ", RowBox[{"ControlType", "->", "SetterBar"}]}], "}"}], ",", RowBox[{"TrackedSymbols", "->", "Manipulate"}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, 3.4335128909306393`*^9, {3.433513000593799*^9, 3.433513001837318*^9}, {3.4335213265068927`*^9, 3.433521369234165*^9}, {3.4335214008913307`*^9, 3.4335214090251436`*^9}, {3.433596481726352*^9, 3.433596484997679*^9}, {3.4336944999703407`*^9, 3.433694570195362*^9}, {3.433694624098752*^9, 3.4336946685421963`*^9}, {3.4342142727869854`*^9, 3.4342142993596425`*^9}, 3.7607443467352257`*^9}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`a$$ = 1, $CellContext`fcn$$ = #^2& , Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`a$$], 1, "x"}, Dynamic[ If[$CellContext`fcn$$ === Log, 0.001, -8]], 8}, {{ Hold[$CellContext`fcn$$], #^2& , "function"}, { Identity -> "\!\(TraditionalForm\`x\)", (#^2& ) -> "\!\(TraditionalForm\`x\^2\)", (#^3& ) -> "\!\(TraditionalForm\`x\^3\)", Sin -> "\!\(TraditionalForm\`\(sin(x)\)\)", Cos -> "\!\(TraditionalForm\`\(cos(x)\)\)", Exp -> "\!\(TraditionalForm\`E\^x\)", Log -> "\!\(TraditionalForm\`\(log(x)\)\)"}}}, Typeset`size$$ = { 600., {148., 152.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`a$116893$$ = 0, $CellContext`fcn$116894$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`a$$ = 1, $CellContext`fcn$$ = #^2& }, "ControllerVariables" :> { Hold[$CellContext`a$$, $CellContext`a$116893$$, 0], Hold[$CellContext`fcn$$, $CellContext`fcn$116894$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> (If[ And[$CellContext`fcn$$ === Log, $CellContext`a$$ < 0.001], $CellContext`a$$ = 0.001]; $CellContext`m = Max[ Abs[ $CellContext`fcn$$[5]], Abs[ $CellContext`fcn$$[6]]]; If[$CellContext`fcn$$[2] == Log[2], $CellContext`left = 0.001, $CellContext`left = -8]; Which[$CellContext`fcn$$[2] == Log[2], $CellContext`r = {-2, 3}, $CellContext`fcn$$[Pi/4] == Sin[Pi/4], $CellContext`r = {-2, 2}, True, $CellContext`r = Automatic]; GraphicsRow[{ Show[ Plot[ $CellContext`fcn$$[$CellContext`x], {$CellContext`x, \ $CellContext`left, 8}, PlotStyle -> Thickness[0.007], ImageSize -> Scaled[0.7], PlotRange -> {{-8, 12}, $CellContext`r}, PlotLabel -> Style[ Framed[ Row[{"function ", Style["f", Italic], "(", Style["x", Italic], ")", " = ", ToString[ $CellContext`fcn$$[$CellContext`x], TraditionalForm]}], Background -> LightGray], 14], Epilog -> Inset[ Style[ Row[{ Style["m", Italic], " = ", NumberForm[ N[ Derivative[ 1][$CellContext`fcn$$][$CellContext`a$$]], {4, 2}]}], 14, Background -> LightRed], { 10, $CellContext`m/2}]], ListPlot[{{$CellContext`a$$, $CellContext`fcn$$[$CellContext`a$$]}}, PlotStyle -> {Black, PointSize[Large]}], Plot[$CellContext`fcn$$[$CellContext`a$$] + Derivative[ 1][$CellContext`fcn$$][$CellContext`a$$] \ ($CellContext`x - $CellContext`a$$), {$CellContext`x, \ $CellContext`a$$ - 2, $CellContext`a$$ + 2}, PlotStyle -> {Red, Thickness[0.012], Opacity[0.6]}], PlotRangePadding -> 1], Show[ Plot[ Derivative[ 1][$CellContext`fcn$$][$CellContext`x], {$CellContext`x, \ $CellContext`left, 8}, PlotStyle -> Thickness[0.007], ImageSize -> Scaled[0.7], PlotRange -> {{-8, 12}, $CellContext`r}, PlotLabel -> Style[ Framed[ Row[{"derivative ", Style["f'", Italic], "(", Style["x", Italic], ")"}], Background -> LightGray], 14], Epilog -> Inset[ Style[ Row[{ Style["y", Italic], " = ", NumberForm[ N[ Derivative[ 1][$CellContext`fcn$$][$CellContext`a$$]], {4, 2}]}], 14, Background -> LightRed], {10, Derivative[1][$CellContext`fcn$$][$CellContext`a$$]}]], Graphics[{Dashed, Red, Line[{{0, Derivative[ 1][$CellContext`fcn$$][$CellContext`a$$]}, \ {$CellContext`a$$, Derivative[ 1][$CellContext`fcn$$][$CellContext`a$$]}}]}], ListPlot[{{$CellContext`a$$, Derivative[1][$CellContext`fcn$$][$CellContext`a$$]}}, PlotStyle -> { PointSize[Large], Red}], PlotRangePadding -> 1]}, ImageSize -> {600, 300}]), "Specifications" :> {{{$CellContext`a$$, 1, "x"}, Dynamic[ If[$CellContext`fcn$$ === Log, 0.001, -8]], 8, Appearance -> "Labeled"}, {{$CellContext`fcn$$, #^2& , "function"}, { Identity -> "\!\(TraditionalForm\`x\)", (#^2& ) -> "\!\(TraditionalForm\`x\^2\)", (#^3& ) -> "\!\(TraditionalForm\`x\^3\)", Sin -> "\!\(TraditionalForm\`\(sin(x)\)\)", Cos -> "\!\(TraditionalForm\`\(cos(x)\)\)", Exp -> "\!\(TraditionalForm\`E\^x\)", Log -> "\!\(TraditionalForm\`\(log(x)\)\)"}, ControlType -> SetterBar}}, "Options" :> {TrackedSymbols -> Manipulate}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{645., {206., 212.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{3.35696210375764*^9, 3.43421431443315*^9, 3.760744346735499*^9}, CellID->82320775] }, {2}]]