ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL
Unit 2 -- Separable Equations
Industrial Mathematics Institute
Columbia, SC 29208
URL: http://www.math.sc.edu/~meade/
E-mail: meade@math.sc.edu
Copyright © 2001 by Douglas B. Meade
All rights reserved
-------------------------------------------------------------------
>
Outline for Unit 2
>
Initialization
> restart;
> with( DEtools ):
> with( plots ):
> with( linalg ):
Warning, the name changecoords has been redefined
Warning, the name adjoint has been redefined
Warning, the protected names norm and trace have been redefined and unprotected
>
2.A General Solution Method for Separable ODEs
A separable differential equation is a differential equation that can be written in the form
.
> ode := y(x)/x*diff( y(x), x ) = exp(x)/y(x);
>
As discussed in Unit 1 (Section E), the odeadvisor command can be used to check the classification of an ODE.
> odeadvisor(ode,[separable]);
>
In this case, it is easily seen that the variables are separated in this ODE when it is multiplied by y(x)*x :
> sep_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:
> int_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);
>
Of the three explicit expressions for y(x) that are obtained from this implicit solution
> all_expl_soln := solve( gen_impl_soln, {y(x)} );
>
only one is real-valued:
> real_expl_soln := op(op(remove( has, {all_expl_soln}, I )));
>
Of course, the constant
could be replaced by a new constant, but this is not an essential step.
>
If an initial condition is provided,
> ic := y(1)=2;
>
it can be used to determine a specific value for the constant in the solution:
> eqn_for_C := subs(x=1,ic,real_expl_soln);
> soln_C := solve( eqn_for_C, {C} );
>
The resulting (explicit) particular solution to the IVP is
> real_part_soln := subs( soln_C, real_expl_soln );
>
A plot of this solution could be obtained with
> plot( 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 previous solution procedure:
> int_sep_var2 := map( Int, sep_var, x=1.._x );
> part_impl_soln2 := subs( _x=x, ic, value( int_sep_var2 ) );
>
In the above two commands, note i) the use of the dummy name, _x, as the upper limit of integration and ii) that it was not necessary to introduce an integration constant. The real-valued solution to this equation is, as before,
>
> real_part_soln2 := op(op( remove( has, {solve( part_impl_soln2, {y(x)} )}, I ) ));
>
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 );
>
The DEtools package contains separablesol , a procedure designed specifically for the solution of separable ODEs.
> separablesol( ode );
>
The dsolve command returns the same result, but might not have used the same method.
> infolevel[dsolve] := 3:
> dsolve( ode, y(x) );
Methods for first order ODEs:
Trying to isolate the derivative dy/dx...
Successful isolation of dy/dx
-> Trying classification methods
trying a quadrature
trying 1st order linear
trying Bernoulli
Bernoulli successful
>
To force dsolve to use a specific method, an optional argument can be specified:
> dsolve( ode, y(x), [separable] );
> infolevel[dsolve] := 0:
Classification methods on request
Methods to be used are: [separable]
Trying to isolate the derivative dy/dx...
Successful isolation of dy/dx
----------------------------
* Tackling ODE using method: separable
-> Trying classification methods
trying separable
separable successful
>
For additional information about this syntax, please consult the help topic dsolve,education .
>
[Back to ODE Powertool Table of Contents]
>