ORDINARY DIFFERENTIAL EQUATIONS POWERTOOLLesson 2 -- Separable EquationsProf. Douglas B. MeadeIndustrial Mathematics InstituteDepartment of MathematicsUniversity of South CarolinaColumbia, SC 29208
URL: http://www.math.sc.edu/~meade/E-mail: meade@math.sc.eduCopyright \251 2001 by Douglas B. MeadeAll rights reserved-------------------------------------------------------------------<Text-field layout="Heading 1" style="Heading 1">Outline for Lesson 2</Text-field>2.A General Solution Method for Separable ODEs2.B Cross-Check of Solutions2.C Closing Comment (separablesol and dsolve)<Text-field layout="Heading 1" style="Heading 1">Initialization</Text-field>restart;with( DEtools ):with( plots ):<Text-field bookmark="2.A" layout="Heading 1" style="Heading 1">2.A General Solution Method for Separable ODEs</Text-field>A separable differential equation is a differential equation that can be written in the formNiMvLSUlZGlmZkc2JC0lInlHNiMlInhHRioqJi0lImZHNiNGJyIiIi0lImdHRikhIiI= .or equivalently, in one of the formsNiMvKiYtJSJGRzYjLSUieUc2IyUieEciIiItJSN5J0dGKkYsLSUiR0dGKg==orNiMvKiYtJSJGRzYjJSJ5RyIiIiUjZHlHRikqJi0lIkdHNiMlInhHRiklI2R4R0YpFor example, consider the equationode := y(x)/x*diff( y(x), x ) = exp(x)/y(x);As discussed in Lesson 1 (Section E) , the odeadvisor command can be used to check the classification of an ODE. It yieldsodeadvisor(ode,[separable]);In this case, it is easily seen that the variables are separated in this ODE when it is multiplied by NiMqJi0lInlHNiMlInhHIiIiRidGKA==, resulting insep_var := ode * y(x)*x ;Once in separated form, the solution is obtained by integration of the separated equation with respect to the independent variable. The usual notation for this calculation involves the differential, the product of a derivative such as NiMvJSN5J0cqJiUjZHlHIiIiJSNkeEchIiI= and an increment such as NiMlI2R4Rw==. By definition, the differential NiMlI2R5Rw== is NiMqJiUjeSdHIiIiJSNkeEdGJQ==, so multiplication of the formNiMvKiYtJSJGRzYjLSUieUc2IyUieEciIiItJSN5J0dGKkYsLSUiR0dGKg==by the increment NiMlI2R4Rw== yields the formNiMvKiYtJSJGRzYjJSJ5RyIiIiUjZHlHRikqJi0lIkdHNiMlInhHRiklI2R4R0Ypwhich yields to antidifferentiation of both sides via the notationNiMvLSUkaW50RzYkLSUiRkc2IyUieUdGKi1GJTYkLSUiR0c2IyUieEdGMA==Since Maple does not have a true implementation of differentials, the differentials NiMlI2R5Rw== and NiMlI2R4Rw== are supplied my Maple's Int command, the inert form of the int command. Integration is mapped, or placed, on each side of the equation by the map command, yieldingint_sep_var := map( Int, sep_var, x );Evaluating these indefinite integrals, and adding a constant of integration to one side of the equation, leads to an implicit form of the general solution:gen_impl_soln := value( int_sep_var ) + (0=C);(Maple will add equations, so the constant of integration can be "added" to the right side of the implicit solution by the dodge of adding the "equation" NiMvIiIhJSJDRw==.)Of the three explicit expressions for NiMtJSJ5RzYjJSJ4Rw== that are obtained from this implicit solution viaall_expl_soln := solve( gen_impl_soln, {y(x)} );only one is real-valued, namely,real_expl_soln := op(op(remove( has, {all_expl_soln}, I )));Of course, the constant NiMqJiIiJCIiIiUiQ0dGJQ== could be replaced by a new constant, but this is not an essential step.If an initial condition ic := y(1) = 2;is provided, it can be used to determine a specific value for the constant in the general solution. First, substitute NiMvJSJ4RyIiIg== into the general solution to geteqn_for_C := subs(x=1,ic,real_expl_soln);then solve for NiMlIkNH to obtainsoln_C := solve( eqn_for_C, {C} );The resulting (explicit) particular solution to the IVP isreal_part_soln := subs( soln_C, real_expl_soln );A plot of this solution could be obtained withplot( rhs(real_part_soln), x=-1..3 );The initial condition can be applied earlier in the problem, at the time of the integration. This would require the following modification of the integration process, using definite instead of indefinite integrals. In Maple, integrating both sides of the equationsep_var;with respect to the independent variable is simplest. The requisite calculation isNiMvLSUkSW50RzYkKiYtJSJ5RzYjJSZhbHBoYUciIiMtJSVkaWZmRzYkRihGKyIiIi9GKztGMCUieEctRiU2JComLSUkZXhwR0YqRjBGK0YwRjE=where NiMlJmFscGhhRw== is the variable of integration.The evaluated form of this equation is obtained in Maple viadef_int_sep_var2 := map(int, sep_var, x=1.._x, continuous);Substitution of the initial conditionic;leads topart_impl_soln2 := subs( _x=x, ic, value( def_int_sep_var2 ) );Solving explicitly for the real branch of NiMtJSJ5RzYjJSJ4Rw== is implemented withreal_part_soln2 := op(op( remove( has, {solve( part_impl_soln2, {y(x)} )}, I ) ));Alternatively, the dependent variable can be used as the integration variable on the left, and the independent variable, on the right. Using NiMlJmFscGhhRw== as the variable of integration on both sides, the equationNiMvLSUkaW50RzYkLSUiRkc2IyUieUdGKi1GJTYkLSUiR0c2IyUieEdGMA==becomesNiMvLSUkaW50RzYkLSUiRkc2IyUmYWxwaGFHL0YqOyIiIyUieUctRiU2JC0lImdHRikvRio7IiIiJSJ4Rw==The simplest way to obtain this version of the integration is to rebuild the integrals via the tedious temp := eval(sep_var,{diff(y(x),x)=1,y(x)=alpha, x=alpha}):
new_form := Int(lhs(temp),alpha=rhs(ic)..y(x)) = Int(rhs(temp),alpha=op(lhs(ic))..x);Evaluation leads toeval_new_form := value(new_form);and isolating the dependent variable leads to the same real-valued solution as found earlier.op(op( remove( has, {solve( eval_new_form, {y(x)} )}, I ) ));<Text-field bookmark="2.B" layout="Heading 1" style="Heading 1">2.B Cross-Check of Solutions</Text-field>Observe that all solutions, implicit or explicit, satisfy the original ODE:odetest( gen_impl_soln, ode );
odetest( real_part_soln, ode );
odetest( part_impl_soln2, ode );
odetest( real_part_soln2, ode );<Text-field bookmark="2.C" layout="Heading 1" style="Heading 1">2.C Closing Remarks</Text-field>The DEtools package contains separablesol, a procedure designed specifically for the solution of separable ODEs. Applying it to the differential equationode;leads to separablesol( ode );The dsolve command returns the same result, but might not have used the same method, as we can see from infolevel[dsolve] := 3:dsolve( ode, y(x) );To force dsolve to use a specific method, an optional argument can be specified, as indsolve( ode, y(x), [separable] );infolevel[dsolve] := 0:For additional information about this syntax, please consult the help topic dsolve,education.[Back to ODE Powertool Table of Contents]