(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "NeXT Mathematica Notebook Front End Version 2.2"; NeXTStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e8, 24, "Times"; ; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e6, 18, "Times"; ; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, L1, e6, 14, "Times"; ; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L1, a20, 18, "Times"; ; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L1, a15, 14, "Times"; ; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L1, a12, 12, "Times"; ; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 10, "Times"; ; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L1, 12, "Courier"; ; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; ; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1, 12, "Courier"; ; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L1, 12, "Courier"; ; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, L1, 10, "Times"; ; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1, 12, "Times"; ; fontset = leftheader, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1, 12, "Times"; ; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, L1, 12, "Times"; ; fontset = leftfooter, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, L1, 12, "Times"; ; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12, "Courier"; ; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1, 12; paletteColors = 128; showRuler; automaticGrouping; currentKernel; ] :[font = input; preserveAspect] :[font = title; inactive; preserveAspect; startGroup] Separable Differential Equations :[font = subtitle; inactive; preserveAspect] Steve Dunbar Department of Mathematics and Statistics University of Nebraska-Lincoln Lincoln, NE 68588-0323 sdunbar@mathlab01.unl.edu Fall Semester, 1993 :[font = subsubtitle; inactive; preserveAspect] Covers Nagle & Saff, Section 2.2 :[font = section; inactive; Cclosed; preserveAspect; startGroup] A Simple Example of Solution by Separation :[font = text; inactive; preserveAspect] Solve the initial value problem dy t2 --- = -------- dt 1 + y5 By inspection, we can see that the differential equation is separable. The idea is to force Mathematica to set up and solve the equation by mimicing what we do on paper. This example is easy enough to do "in our head". ;[s] 7:0,0;45,1;46,2;79,3;80,4;176,5;187,6;304,-1; 7:1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] lhs = (1 + y[t]^5) y'[t] :[font = input; preserveAspect] rhs = t^2 :[font = input; preserveAspect] implicitsoln = Integrate[lhs, t] == Integrate[rhs,t] + C :[font = text; inactive; preserveAspect] Because the left side is a high degree polynomial in y, there is not much hope of explicitly solving for y. Nevertheless, we can look at the solution curves defined implicitly by the implicit solution. :[font = input; preserveAspect] cp = ContourPlot[ y + y^6/6 - t^3/3, {t, -2,2}, {y,-2,2}, ContourShading-> False ] :[font = text; inactive; preserveAspect] Note that we get a whole family of solution curves. Which solution curve we want is defined by an initial condition. :[font = input; preserveAspect] vf = PlotVectorField[ {1, t^2/(1 +y^5)}, {t,-2,2}, {y,-2,2}, Axes-> True] :[font = input; preserveAspect; endGroup] Show[cp, vf] :[font = section; inactive; Cclosed; preserveAspect; startGroup] Another Example of Solution by Separation :[font = text; inactive; preserveAspect] Solve the initial value problem (1 + t2) (dy/dt) = t y3/(1 + t2)1/2 with y(0) = 1. By inspection, we can see that the differential equation is separable. The idea is to force Mathematica to set up and solve the equation by mimicing what we do on paper. Set up the differential equation with a name: ;[s] 11:0,0;39,1;42,2;55,3;56,4;63,5;64,6;65,7;68,8;187,9;198,10;311,-1; 11:1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] Clear[ de, y, t, implicitsoln] :[font = input; preserveAspect] de = Sqrt[1 + t^2] * D[y[t], t] == t*y[t]^3/Sqrt[1 + t^2] :[font = input; preserveAspect] Divide through to put the equation in separated form: Do this in your head or on scratch paper, there is no convenient way to force Mathemtica to do this operation! :[font = input; preserveAspect] (1/y[t]^3) D[y[t],t] == t/(1 + t^2) :[font = input; preserveAspect] lhs = Integrate[ y'[t]/y[t]^3, t] :[font = input; preserveAspect] rhs = Integrate[t/(1 + t^2), t] :[font = input; preserveAspect] implicitsoln = lhs == rhs + C :[font = input; preserveAspect] Solve[ implicitsoln, y[t]] :[font = text; inactive; preserveAspect] Note the presence of the Imaginary constant ( I = Sqrt[-1]) in here. This occurs because Mathematica is formula-driven (not heurisitic) in solving for y[t]. Note that there are two solution formulas. Which solution formula is chosen depends on the initital conditions. ;[s] 3:0,0;89,1;100,2;942,-1; 3:1,11,8,Times,0,12,0,0,0;1,10,8,Times,2,12,0,0,0;1,11,8,Times,0,12,0,0,0; :[font = input; preserveAspect] implicitsoln /. { t -> 0, y[t] -> 1} :[font = input; preserveAspect] impsolnwithIC = implicitsoln /. { C -> -1/2} :[font = smalltext; inactive; preserveAspect] /. is the Mathematica symbol for evaluation. See the Mathematica book page 74. ;[s] 5:0,0;10,1;21,2;54,3;65,4;79,-1; 5:1,9,7,Times,0,10,0,0,0;1,9,7,Times,2,10,0,0,0;1,9,7,Times,0,10,0,0,0;1,9,7,Times,2,10,0,0,0;1,9,7,Times,0,10,0,0,0; :[font = input; preserveAspect] Solve[ impsolnwithIC, y[t]] :[font = input; preserveAspect] Plot[ 1/(Sqrt[ 1- Log[1+t^2]]), {t, -2,2}] :[font = text; inactive; preserveAspect] Why is Mathematica complaining with all of the error messages? What is the domain of the solution? ;[s] 3:0,0;7,1;18,2;98,-1; 3:1,10,8,Times,1,12,0,0,0;1,10,8,Times,3,12,0,0,0;1,10,8,Times,1,12,0,0,0; :[font = input; preserveAspect] < True] :[font = text; inactive; preserveAspect] The normal form for the differential equation is dy t y3 ---- = ----- dt 1 + t2 ;[s] 4:0,0;71,1;72,2;119,3;120,-1; 4:1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0;1,11,8,Times,0,12,0,0,0;1,11,8,Times,32,12,0,0,0; :[font = text; inactive; preserveAspect] Does the graph of the solution agree with what you guess from the direction fields? ;[s] 1:0,0;83,-1; 1:1,10,8,Times,1,12,0,0,0; :[font = input; preserveAspect] ?DSolve :[font = smalltext; inactive; preserveAspect] ?Command is a way of getting information about a command. See the Mathematica book page 374. ;[s] 3:0,0;67,1;78,2;93,-1; 3:1,9,7,Times,0,10,0,0,0;1,9,7,Times,2,10,0,0,0;1,9,7,Times,0,10,0,0,0; :[font = input; preserveAspect; endGroup; endGroup] DSolve[de, y[t],t] ^*)