Popular in Course
Popular in Mathematics (M)
This 7 page Class Notes was uploaded by Claudine Friesen on Monday September 28, 2015. The Class Notes belongs to MATH241 at University of Pennsylvania taught by Staff in Fall. Since its upload, it has received 7 views. For similar materials see /class/215399/math241-university-of-pennsylvania in Mathematics (M) at University of Pennsylvania.
Reviews for CALCULUSIV
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 09/28/15
dsolve The basic Maple command for solving differential equations is quotdsolve quot The basic syntax of dsolve is the usual dsolve quotwhatquot quothowquot syntax of most basic Maple commands quotWhatquot refers to the differential equation or system of differential equations together with any initial conditions there might be if there is more than just one equation with no conditions this must be enclosed in braces The quotHowquot part like most solve routines in Maple indicates the name of the variable or function to be solved for It is useful to give names to all of the equations and initial conditions you are going to use in dsolve it makes the statements easier to read and can often save some typing For example gt eqdiffyx x xyX 6 eq 16Yxx x x gt inity 2 1 init y2 1 Now eq is the name of the differential equation we will solve and init is the name of the initial condition It is important that we use y x rather than just y this indicates to Maple that we are thinking of y as the dependent variable and x as the independent one To solve the equation WITHOUT the initial condition ie to find the general solution we gt dsolveeqyx 2 yxel2x 7C Page 1 Notice the Cl that is Maple s way of producing an quotarbitrary constantquot To solve the initialvalue problem we must group the equation and initial condition together in braces gt dsolveeqinit yx e12 yx 2 C This last output is an equation if you wish to assign the output to a name so that you can use it for further work or to plot it etc it is possible to use the quot rhs quot righthand side command and the double quote which refers to the last previous output gt ansrhsquot e12 61713 2 e Sometime Maple will give the answer in an quotimplicitquot form an equation that relates the dependent and independent variables instead of just an expression for the independent variable gt dsolve diff yx x y x quot2 y X x 7C1 yx But it is clear that one can solve easily for yX to force Maple to do this use the quot explicit quot option in dsolve gt dsolvediff yx x yx quot2 yx explicit 1 yx xiC Page 2 That s better More advanced uses of dsolve There are five additional ways to use dsolve for situations other than single firstorder differential equations and initialvalue problems 1 Equations of higher order Second and higher order equations can be solved with dsolve To do this recall that higher derivatives of a function are taken as follows in Maple this is the third derivative of fX gt difffx x3 63 fx 6x3 So we can set up a secondorder equation as follows gt ean diff y x x2 3diff y x x 2y x exp x 7 6 2 J x eanr 6x2yx 3 axyx 2yx e The general solution of this equation is gt dsolve eqnz yx l yx g ex 7C e 2 x 7C2 eh Notice that there are two constants Cl and C2 as to be expected in the solution The appropriate initialvalue problem requires two initial conditions one on the value of y at some value of X and the other on the value of the derivative at the point For this problem we will specify values of y at xl gt initsy12 Dy 14 Page 3 initsyl2Dyl4 gt dsolveeqnzinits yx 2 1 1ex 6 e3 6e2 e e 3e248e yx6 ex Sometimes these things get somewhat complicated 2 Systems of differential equations In many applications systems of differential equations arise The syntax for these is the same as for initialvalue problems even when no initial values are specified braces around the problem are required AND braces around the list of functions to be solved for We do one example of an initial value problem for a system of two firstorder equations gt eqnsdiffyx xdiffzx xx diff yx x 2diffz x x xquot2 6 6 6 6 2 eqns yxazxx yx 2 zxx gt inits y01 z02 initsy0lz02 gt dsolveeqnsinits yx z x l 1 12 1 3 2 12 13 x x xzx x x y 3 9 6 9 3 Numerical solutions Very often it is impossible to obtain the solution to a differential equation in closed form In this case one must resort to a numerical approximation method Maple knows a lot of these to invoke them use the quot numeric quot option of dsolve as follows gt eqnzdiff y x x exp yx xquot32sin x inity 0 2 6 eqn yx eym x3 2 sinx 6x Page 4 im39t y0 2 gt Fdsolveeqninit yx numeric F procrkf457x end Your output for the preceeding statement might be slightly different The output means that Maple has defined a function called F that will output the value of y x corresponding to a given numerical value of x For example gt F 2 x 2 yx 7815970926289340 It is often useful to plot the numericallyobtained solution of a differential equation To do this you need to apply the Maple command odeplot to the result F in this case of the dsolve numeric statement The odeplot command is in the plots library and so must be loaded using the statement gt with plots odeplot odeplot To plot the solution use the following syntaX gt odeplotF xyx 2 2 In this statement the quotFquot is the function that resulted from dsolve numeric The second argument indicates to Maple which variables should be on which aXis sometimes it is useful to plot X versus the derivative of yX or yX versus the derivative of yX The final aXis gives the domain of the independent variable X in this case over which the plot should be made Page 5 The most important things to notice are a You must assign the result of dsolve numeric to a NAME b You must use the odeplot function from the plots library to plot the result of dsolve numeric The syntax is as above and you can see some more examples in Maple help 4 You can also use dsolve to get power series solutions of differential equations It is usually best to specify an initialvalue problem to do this The order to which the series is computed is determined by the system variable Order just as for the taylor command For example to solve the initial value problem y xy0 y0l by series you enter gt dsolvediff yx x xyx 0 y01 yx series 1 l x l x2 x40 x6 y 2 8 If you want more terms gt Orderz14z dsolvediffyx x xyx0 y01yx series 1 l l l l l yxl x2 x4 x6 x8 x10 2 8 48 384 3840 46080 x 0x14 The result of this operation is a Maple quotseriesquot with the quotbigOquot term see the discussion ofthis in the taylor section of this manual 5 for Math 241 dsolve can also be used to solve differential equations by Laplace transform methods The setup is similar to getting power series solutions as above except instead of using the option quotseries quot we use quotmethodlaplace quot For example gt dsolve diff y x x y x Dirac x 1 y 0 0 yx methodlaplace Page 6 yx Heavisidex le x 1 The Dirac and Heaviside functions are the Dirac delta and unit step functions respectively see Chapter 4 of the Math 241 textbook For more information about Laplace transforms in Maple see the section on the laplace command Errors The most common error one makes when using dsolve is to use the dependent variable the quotyquot above without specifying the dependence on the independent variable in other words using the y without writing y x Unexpected results often happen when you do this The other kinds of errors are like the ones that go wrong whenever you use a solving or plotting routine e g the variables being solved for have already been assigned values that may have been forgotten etc Page 7