(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.1' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. 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[ 8625, 270]*) (*NotebookOutlinePosition[ 9316, 294]*) (* CellTagsIndexPosition[ 9272, 290]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Symbolic Manipulation of Piecewise Functions", "Subsection"], Cell[TextData[{ "Throughout ", StyleBox["Mathematica", FontSlant->"Italic"], ", piecewise functions are now automatically supported in symbolic \ operations. ", StyleBox["Mathematica", FontSlant->"Italic"], " supports traditional 2D formatting of piecewise definitions, for both \ output and input." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(D[\ Max[x, \ x\^2], \ x\ ]\)], "Input", CellLabel->"In[1]:="], Cell[BoxData[ RowBox[{"\[Piecewise]", GridBox[{ {\(2\ x\), \(x < 0\)}, {"1", \(0 < x < 1\)}, {\(2\ x\), \(x > 1\)}, {"Indeterminate", TagBox["True", "PiecewiseDefault", AutoDelete->False, DeletionWarning->True]} }, ColumnSpacings->1.2, ColumnAlignments->{Left}]}]], "Output", CellLabel->"Out[1]="] }, Open ]], Cell[TextData[{ "Note: ", StyleBox["//TraditionalForm", FontFamily->"Courier"], " automatically converts output to TraditionalForm." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(D[Max[x, x\^2], x] // TraditionalForm\)], "Input", CellLabel->"In[2]:="], Cell[BoxData[ FormBox[ RowBox[{"\[Piecewise]", GridBox[{ {\(2\ x\), \(x < 0\)}, {"1", \(0 < x < 1\)}, {\(2\ x\), \(x > 1\)}, {"Indeterminate", TagBox["True", "PiecewiseDefault", AutoDelete->False, DeletionWarning->True]} }, ColumnSpacings->1.2, ColumnAlignments->{Left}]}], TraditionalForm]], "Output", CellLabel->"Out[2]//TraditionalForm="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Piecewise Integrals", "Subsection"], Cell[TextData[{ "Piecewise functions work with domain specification in ", StyleBox["Mathematica", FontSlant->"Italic"], " enabling close-form solutions to a broad range of problems." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Assuming[ x \[Element] Reals, \[Integral]Abs[2 - Abs[x]] \[DifferentialD]x]\)], "Input", CellLabel->"In[3]:="], Cell[BoxData[ FormBox[ RowBox[{"\[Piecewise]", GridBox[{ {\(\(-\(x\^2\/2\)\) - 2\ x\), \(x \[LessEqual] \(-2\)\)}, {\(x\^2\/2 + 2\ x + 4\), \(\(-2\) < x \[LessEqual] 0\)}, {\(\(-\(x\^2\/2\)\) + 2\ x + 4\), \(0 < x \[LessEqual] 2\)}, {\(x\^2\/2 - 2\ x + 8\), TagBox["True", "PiecewiseDefault", AutoDelete->False, DeletionWarning->True]} }, ColumnSpacings->1.2, ColumnAlignments->{Left}]}], TraditionalForm]], "Output", CellLabel->"Out[3]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Solving an Equation with Piecewise Elements", "Subsection"], Cell[TextData[{ "This differential equation involves two piecewise functions: the ", StyleBox["UnitStep", "Input", FontWeight->"Plain"], " \[Theta] and ", StyleBox["Max", "Input", FontWeight->"Plain"], ". " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"DSolve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{\(Max[t, t\^2]\ y[t]\), "+", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "[", "t", "]"}]}], "\[Equal]", \(UnitStep[t]\)}], "&&", \(y[0] \[Equal] 1\)}], ",", \(y[t]\), ",", "t"}], "]"}]], "Input", CellLabel->"In[4]:="], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{"{", RowBox[{\(y(t)\), "\[Rule]", RowBox[{\(\[ExponentialE]\^\(-\(t\^3\/3\)\)\), "+", \(\(1\/\(6\ t\^2\)\)\((\[ExponentialE]\^\(\(-\(t\^3\/3\)\) \ - 1\/6\)\ \((2\ \@3\%3\ \@\[ExponentialE]\%6\ \(\[CapitalGamma]( 1\/3, \(-\(t\^3\/3\)\))\)\ \((\(-t\^3\))\)\^\(2/3\) \ + 6\ t\^2 + 3\ \@\(2\ \[Pi]\)\ t\^2\ \(erfi( 1\/\@2)\) + \@3\%3\ \@\[ExponentialE]\%6\ t\^2\ \(\ \[CapitalGamma]( 1\/3, \(-\(1\/3\)\))\) - \[ImaginaryI]\ 3\^\(5/6\)\ \ \@\[ExponentialE]\%6\ t\^2\ \(\[CapitalGamma](1\/3, \(-\(1\/3\)\))\))\))\)\), "-", RowBox[{\(\[ExponentialE]\^\(-\(t\^3\/3\)\)\), " ", RowBox[{ InterpretationBox["\[Theta]", UnitStep, Editable->False, Selectable->False], "(", "t", ")"}]}], "+", RowBox[{ RowBox[{ InterpretationBox["\[Theta]", UnitStep, Editable->False, Selectable->False], "(", \(1 - t\), ")"}], " ", RowBox[{"(", RowBox[{ RowBox[{\(1\/2\), " ", \(\[ExponentialE]\^\(-\(t\^2\/2\)\)\), " ", \((\@\(2\ \[Pi]\)\ \(erfi(t\/\@2)\) + 2)\), " ", RowBox[{ InterpretationBox["\[Theta]", UnitStep, Editable->False, Selectable->False], "(", "t", ")"}]}], "-", \(\(1\/\(6\ \ t\^2\)\)\((\[ExponentialE]\^\(\(-\(t\^3\/3\)\) - 1\/6\)\ \((2\ \@3\%3\ \@\ \[ExponentialE]\%6\ \(\[CapitalGamma]( 1\/3, \(-\(t\^3\/3\)\))\)\ \ \((\(-t\^3\))\)\^\(2/3\) + 6\ t\^2 + 3\ \@\(2\ \[Pi]\)\ t\^2\ \(erfi( 1\/\@2)\) + \@3\%3\ \@\[ExponentialE]\%6\ \ t\^2\ \(\[CapitalGamma]( 1\/3, \(-\(1\/3\)\))\) - \[ImaginaryI]\ \ 3\^\(5/6\)\ \@\[ExponentialE]\%6\ t\^2\ \(\[CapitalGamma]( 1\/3, \(-\(1\/3\)\))\))\))\)\)}], ")"}]}]}]}], "}"}], "}"}], TraditionalForm]], "Output", CellLabel->"Out[4]="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Example: Expanding Piecewise Definitions", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[ \(PiecewiseExpand[Mod[x\^2, Ceiling[x]], 1 < x < 3]\)], "Input", CellLabel->"In[5]:="], Cell[BoxData[ FormBox[ RowBox[{"\[Piecewise]", GridBox[{ {\(x\^2\), \(x < \@2\)}, {\(x\^2 - 6\), \(x \[GreaterEqual] \@6\)}, {\(x\^2 - 4\), \(x \[LongEqual] 2\)}, {\(x\^2 - 3\), \(2 < x < \@6\)}, {\(x\^2 - 2\), TagBox["True", "PiecewiseDefault", AutoDelete->False, DeletionWarning->True]} }, ColumnSpacings->1.2, ColumnAlignments->{Left}]}], TraditionalForm]], "Output", CellLabel->"Out[5]="] }, Open ]] }, Open ]] }, FrontEndVersion->"5.1 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, WindowSize->{733, 651}, WindowMargins->{{Automatic, 134}, {0, Automatic}}, CellLabelAutoDelete->False, Magnification->1 ] (******************************************************************* 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[1776, 53, 66, 0, 38, "Subsection"], Cell[1845, 55, 329, 10, 52, "Text"], Cell[CellGroupData[{ Cell[2199, 69, 83, 2, 31, "Input"], Cell[2285, 73, 424, 13, 73, "Output"] }, Open ]], Cell[2724, 89, 154, 5, 33, "Text"], Cell[CellGroupData[{ Cell[2903, 98, 94, 2, 31, "Input"], Cell[3000, 102, 496, 14, 95, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[3545, 122, 41, 0, 38, "Subsection"], Cell[3589, 124, 204, 5, 33, "Text"], Cell[CellGroupData[{ Cell[3818, 133, 147, 4, 41, "Input"], Cell[3968, 139, 594, 14, 133, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[4611, 159, 65, 0, 38, "Subsection"], Cell[4679, 161, 236, 8, 33, "Text"], Cell[CellGroupData[{ Cell[4940, 173, 426, 11, 31, "Input"], Cell[5369, 186, 2424, 51, 200, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7842, 243, 62, 0, 38, "Subsection"], Cell[CellGroupData[{ Cell[7929, 247, 106, 2, 31, "Input"], Cell[8038, 251, 559, 15, 119, "Output"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)