(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of 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[ 5242, 186]*) (*NotebookOutlinePosition[ 6080, 213]*) (* CellTagsIndexPosition[ 6036, 209]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Using DSolve", "Title"], Cell[TextData[{ "The command DSolve solves certain ordinary differential equations. The \ general form is\nDSolve[differential equation for the function y[t],y[t],t]. \ Points to note:\n1. Equations have two equal signs in ", StyleBox["Mathematica", FontSlant->"Italic"], ".\n2. The argument t must be included wherever the unknown function y \ appears.\n\nExample for the equation y'=y:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[\(y'\)[t] == y[t], y[t], t]\)], "Input"], Cell[BoxData[ \({{y[t] \[Rule] E\^t\ C[1]}}\)], "Output"] }, Open ]], Cell[TextData[{ "The solution is a constant times exp(t). ", StyleBox["Mathematica", FontSlant->"Italic"], " uses C[1],C[2] etc. to denote arbitrary constants appearing in a \ solution. If initial conditions are given, you replace the differential\n\ equation by {differential equation, initial condition(s)}. For example, if \ the differential equation\nabove is to be solved with initial condition \ y(0)=1, we write" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[{\(y'\)[t] == y[t], y[0] == 1}, y[t], t]\)], "Input"], Cell[BoxData[ \({{y[t] \[Rule] E\^t}}\)], "Output"] }, Open ]], Cell["Here is what happens if you forget the argument t.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[y' == y, y[t], t]\)], "Input"], Cell[BoxData[ \(DSolve::"nvld" \( : \ \) "The description of the equations appears to be ambiguous or \ invalid."\)], "Message"], Cell[BoxData[ \(DSolve::"deqx" \( : \ \) "Supplied equations are not differential equations of the given \ functions."\)], "Message"], Cell[BoxData[ RowBox[{"DSolve", "[", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "==", "y"}], ",", \(y[t]\), ",", "t"}], "]"}]], "Output"] }, Open ]], Cell["\<\ Sometimes you want to use the solution of your differential \ equation in further calculations. You therefore want to define a function which equals the solution of the \ differential equation. This can be done as follows:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(y[t_] = y[t] /. DSolve[{\(y'\)[t] == y[t], y[0] == 1}, y[t], t]\)], "Input"], Cell[BoxData[ \({E\^t}\)], "Output"] }, Open ]], Cell["\<\ Now y[t] is the exponential function, i.e. the solution of your \ differential equation, and it can be used for further calculations. Suppose, \ e.g. you want to know y'(10):\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(y'\)[10]\)], "Input"], Cell[BoxData[ \({E\^10}\)], "Output"] }, Open ]], Cell["Now let us solve a second differential equation, say y'=y^2.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[\(y'\)[t] == y[t]^2, y[t], t]\)], "Input"], Cell[BoxData[ \(General::"ivar" \( : \ \) "\!\(E\^t\) is not a valid variable."\)], "Message"], Cell[BoxData[ \(Solve[{E\^\(2\ t\) == E\^t}, {E\^t}]\)], "Output"] }, Open ]], Cell["\<\ Oops. The computer still thinks y(t) is the exponential function, \ and so we get nonsense. If we do not want to introduce a new symbol for the \ variable, we must make the computer forget that y is the exponential \ function. \ \>", "Text"], Cell[BoxData[ \(Clear[y]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[\(y'\)[t] == y[t]^2, y[t], t]\)], "Input"], Cell[BoxData[ \({{y[t] \[Rule] 1\/\(\(-t\) + C[1]\)}}\)], "Output"] }, Open ]] }, Open ]] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 640}, {0, 460}}, WindowSize->{520, 365}, WindowMargins->{{4, Automatic}, {Automatic, 1}}, MacintoshSystemPageSetup->"\<\ 0@00D01804P000000]X2:?oQon82n@96D005:0?l0040D01804P000000]X2:000 0000I0000000000000000BL?00400@00000000000000000B0002I0000aP00000 8W800@0100<00P0000000000oU`10000\>" ] (*********************************************************************** 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[1731, 51, 29, 0, 98, "Title"], Cell[1763, 53, 410, 8, 112, "Text"], Cell[CellGroupData[{ Cell[2198, 65, 67, 1, 27, "Input"], Cell[2268, 68, 61, 1, 27, "Output"] }, Open ]], Cell[2344, 72, 441, 9, 80, "Text"], Cell[CellGroupData[{ Cell[2810, 85, 80, 1, 27, "Input"], Cell[2893, 88, 55, 1, 27, "Output"] }, Open ]], Cell[2963, 92, 66, 0, 30, "Text"], Cell[CellGroupData[{ Cell[3054, 96, 57, 1, 27, "Input"], Cell[3114, 99, 139, 3, 37, "Message"], Cell[3256, 104, 144, 3, 37, "Message"], Cell[3403, 109, 218, 6, 26, "Output"] }, Open ]], Cell[3636, 118, 246, 6, 62, "Text"], Cell[CellGroupData[{ Cell[3907, 128, 99, 2, 27, "Input"], Cell[4009, 132, 40, 1, 27, "Output"] }, Open ]], Cell[4064, 136, 198, 4, 46, "Text"], Cell[CellGroupData[{ Cell[4287, 144, 43, 1, 27, "Input"], Cell[4333, 147, 41, 1, 28, "Output"] }, Open ]], Cell[4389, 151, 76, 0, 30, "Text"], Cell[CellGroupData[{ Cell[4490, 155, 69, 1, 27, "Input"], Cell[4562, 158, 101, 2, 23, "Message"], Cell[4666, 162, 70, 1, 28, "Output"] }, Open ]], Cell[4751, 166, 251, 5, 62, "Text"], Cell[5005, 173, 41, 1, 27, "Input"], Cell[CellGroupData[{ Cell[5071, 178, 69, 1, 27, "Input"], Cell[5143, 181, 71, 1, 44, "Output"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)