ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL
Unit 10 -- Substitution and Change of Variables
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 of Unit 10
>
Initialization
> restart;
> with( DEtools ):
> with( plots ):
Warning, the name changecoords has been redefined
> with( linalg ):
Warning, the name adjoint has been redefined
Warning, the protected names norm and trace have been redefined and unprotected
> with( PDEtools ):
>
10.A Example 1: Homogeneous Equations
A homogeneous differential equation has the general form
> ode1 := M(x,y(x)) + N(x,y(x)) * diff( y(x),x ) = 0;
>
where the functions M and N are both homogeneous of the same degree. That is, there exists a constant
such that
and
.
For example, consider
> M := (x,y) -> x^2+y^2;
> N := (x,y) -> x^2-x*y;
>
which produce the differential equation
> ode1;
>
To check that this is a homogeneous ODE, observe that
> `M(tx,ty)` = simplify( M(t*x,t*y) / M(x,y) ) * `M(x,y)`;
> `N(tx,ty)` = simplify( N(t*x,t*y) / N(x,y) ) * `N(x,y)`;
>
To find the general solution to this ODE, introduce the change of variables
> ch_of_var := y(x) = x * u(x);
>
The ODE becomes
> q1 := dchange( ch_of_var, ode1, [u(x)] );
>
This simplifies to
> sep_ode1 := simplify( isolate( q1, diff(u(x),x) ) );
>
which is easily seen to be a separable equation
> odeadvisor( sep_ode1 );
>
The (implicit) solution to this equation is
> sol_u := dsolve( sep_ode1, u(x), [separable], implicit );
>
Reversing the change of variables, the solution to the original ODE is
> sol_y := dchange( isolate(ch_of_var,u(x)), sol_u, [y(x)] );
>
That this equation defines a solution is confirmed with
> odetest( sol_y, ode1 );
>
Note that Maple's builtin commands can be used to classify this ODE as homogeneous
> odeadvisor( ode1 );
>
and to find the general solution
> expl_sol := genhomosol( ode1 );
>
except that most people are not familiar with the Lambert W function. To obtain the solution of this homogeneous ODE in an implicit form
> dsolve( ode1, y(x), [homogeneous], implicit );
>
which is seen to be equivalent to the previous solution.
>
10.B Example 2: Bernoulli Equations
A Bernoulli equation has the form
> diff( x(t), t ) = f(t) * x(t) + g(t) * x(t)^alpha;
>
for known functions f and g and a constant
(not equal to 0 or 1).
For example, consider the differential equation
> ode2 := diff( x(t), t ) = a * x(t) - b * x(t)^3;
>
where
and
are real constants with
. This is a Bernoulli equation with
> alpha := 3;
>
To convert the Bernoulli equation into a first-order linear ODE, consider the substitution
> ch_of_var := x(t) = u(t)^(1/(1-alpha));
>
The ODE for the new function
is
> q1 := dchange( ch_of_var, ode2, [u(t)] );
>
which simplifies to
> lin_ode := simplify( isolate( q1, diff(u(t),t) ));
>
The solution to this linear ODE is
> lin_sol := dsolve( lin_ode, u(t), [linear] );
>
and the corresponding implicit solution for the original function x(t) is
> sol2 := dchange( isolate(ch_of_var,u(t)), lin_sol, [x(t)] );
>
To verify that this is a solution of the original ODE:
> odetest( sol2, ode2 );
>
The solution might be a little more useful in the form
> sol2a := map( u->simplify(1/u), sol2 );
>
Immediate access to the solution to this Bernoulli equations can be obtained with the single command:
> dsolve( ode2, x(t), [Bernoulli], implicit );
>
from which either of the above implicit solutions, or the explicit solution, can be derived.
The bernoullisol command yields the two branches of the square root that are solutions:
> bernoullisol( ode2 );
>
The choice of branch depends on the signs of
,
, and the initial condition.
>
10.C Example 3: Reduction to Separation of Variables
Any ODE of the form
> Diff( y, x ) = F( a*x + b*y + c );
>
with
can be reduced to a separable ODE via the substitution
.
For example,
> ode3 := diff( y(x), x ) = ( x+y(x)+ 2)^2;
>
is of the appropriate form with
,
,
, and
. Thus, the substitution
> ch_of_var := u(x) = x + y(x) + 2;
>
leads to a differential equation for
:
> u_ode := dchange( isolate(ch_of_var,y(x)), ode3, [u(x)] );
>
which is easily seen to be separable
> odeadvisor( u_ode, [separable] );
>
The implicit general solution to this separable differential equation is
> u_sol := dsolve( u_ode, u(x), [separable], implicit );
>
The corresponding explicit solution is
> u_sol_expl := dsolve( u_ode, u(x), [separable] );
>
Reversing the substitution to obtain the implicit general solution to the differential equation for
:
> sol3 := dchange( ch_of_var, u_sol, [y(x)] );
>
The corresponding explicit solution can be obtained from
> sol3_expl := isolate( sol3, y(x) );
>
Note that simply using
> dchange( ch_of_var, u_sol_expl, [y(x)] );
>
does not produce an explicit formula for the general solution. It is still necessary to use isolate , or something similar:
> isolate( dchange( ch_of_var, u_sol_expl, [y(x)] ), y(x) );
>
That these functions are solutions to the original ODE is seen from
> odetest( sol3, ode3 );
> odetest( sol3_expl, ode3 );
>
Immediate access to the implicit and explicit solutions can be obtained using
> dsolve( ode3, y(x), implicit );
> dsolve( ode3, y(x) );
>
10.D Example 4: Riccati Equations
A Riccati equation has the form
> diff( x(t), t ) = f(t) * x(t)^2 + g(t) * x(t) + h(t);
>
for given functions f, g, and h. The solution of a Ricatti equation requires knowledge of a particular solution to the ODE.
For example, consider
> ode4 := diff( x(t), t ) = -x(t)^2 + 2*t*x(t) - t^2+5;
>
which has as one solution
> X := t-2;
>
That this is a solution is confirmed by
> odetest( x(t)=X, ode4 );
>
To solve a Riccati equation, define a new function
such that,
> ch_of_var := u(t) = x(t) - X;
>
This substitution translates the ODE for
into one for the new function
:
> ode_u := dchange( isolate(ch_of_var,x(t)), ode4, [u(t)] );
>
which simplifies to
> bern_ode := collect( isolate( ode_u, diff(u(t),t) ), u(t) );
>
Upon inspection, this ODE is seen to be a Bernoulli equation
> odeadvisor( bern_ode, [Bernoulli] );
>
which has solution
> bern_sol := dsolve( bern_ode, u(t), [Bernoulli] );
>
Reversing the substitution,
> sol4 := dchange( ch_of_var, bern_sol, [x(t)] );
>
To check that this is a solution to the original ODE,
> odetest( sol4, ode4 );
>
Note that the original equation can be classified as a Riccati equation using
> odeadvisor( ode4, [Riccati] );
>
and solved in one step using either
> riccatisol( ode4 );
>
or
> dsolve( ode4, x(t), [Riccati] );
>
[Back to ODE Powertool Table of Contents]
>