ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL
Unit 4 -- First-Order Linear 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 of Unit 4
4.A Structure of Solutiosn to Linear ODEs
4.B Integrating Factor for a First-Order Linear ODE
>
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
>
4.A Structure of Solutions to Linear ODEs
The general first-order linear ODE is
> lin_ode := diff( x(t), t ) + p(t) * x(t) = f(t);
>
Note that, in general, this is not a separable ODE.
> odeadvisor( lin_ode, [separable] );
>
If
and
are both constants, then the ODE is separable. In this case, the solution can be found as in
Unit 3. The solution that is found is
> lin_ode_const := subs( p(t)=a, f(t)=b, lin_ode );
> odeadvisor( lin_ode_const, [separable] );
>
> infolevel[dsolve] := 3:
> lin_ode_const_soln := dsolve( lin_ode_const, x(t) );
> infolevel[dsolve] := 0:
Methods for first order ODEs:
Trying to isolate the derivative dx/dt...
Successful isolation of dx/dt
-> Trying classification methods
trying a quadrature
trying 1st order linear
1st order linear successful
>
The structure of this solution is important. The term involving the constant of integration
> soln_h := x(t) = coeff(rhs(lin_ode_const_soln),_C1);
>
is a solution of the homogenous ODE (i.e.,
)
> odetest( soln_h, subs( b=0, lin_ode_const ) );
>
The constant term
> soln_p := x(t) = subs( _C1=0, rhs(lin_ode_const_soln) );
>
is a solution to the non-homogeneous ODE
> odetest( soln_p, lin_ode_const );
>
Any solution that satisfies the full ODE is called a particular solution. It is a general property of linear equations that the general solution can be written as the sum of the general solution to the homogeneous equation and any solution to the non-homogeneous equation. This structure will appear again when higher-order ODEs and systems of ODEs are studied.
>
4.B Integrating Factor for a First-Order Linear ODE
Knowledge of the structure of solutions to linear ODEs is important, but does not provide too much information about finding solutions to the general first-order linear ODE.
> lin_ode;
>
The general procedure for solving a first-order linear ODE is to find an integrating factor,
, for the ODE. That is, find a function
such that when the ODE is multiplied by
the left-hand side of the resulting equation can be written as the derivative of the product
. The general formula for the integrating factor for this ODE is
.
The advantage that this presents is that the differential equation now has the form
,
where
and
. The explicit general solution of this equation can be found by direct integration to be
=
=
.
To conclude, the solution to the original ODE is found using
. Instead of writing the general formula, implement this approach for a specific problem.
Consider the ODE
> lin_ode1 := diff( x(t), t ) + x(t)/(t+1) = ln(t)/(t+1);
>
In this problem,
and
. Thus, the integrating factor is
> int_fact := mu(t) = exp( Int( 1/(t+1), t ) );
> int_fact1 := value( int_fact );
>
The DEtools package contains intfactor , a procedure that will find an integrating factor for problems of this type.
> intfactor( lin_ode1 );
>
> ode2 := subs( int_fact1, mu(t)*lin_ode1 );
>
While this equation is rather complicated, the definition of the integrating factor allows us to replace the left-hand side with a single derivative
> ode3 := subs( int_fact1, Diff( mu(t)*x(t), t ) ) = rhs(ode2);
>
This differential equation can be solved by direct integration
> int_ode3 := map(Int, ode3, t );
>
The left-hand side is trivial to evaluate, Maple does a fine job with the right-hand side. The result, after adding the constant of integration, is
> q1 := subs( int_fact1, mu(t)*x(t) ) = int( rhs(ode3), t ) + C;
>
The explicit general solution to this first-order linear ODE is
> expl_soln := op(solve( q1, {x(t)} ));
>
That this solution satisfies the original differential equation is confirmed with
> odetest( expl_soln, lin_ode1 );
>
To emphasize the structure of this solution, the homogeneous and particular solutions are
> soln_h := x(t) = coeff( rhs(expl_soln), C );
> soln_p := x(t) = subs( C=0, rhs(expl_soln));
>
as confirmed by
> odetest( soln_h, lhs(lin_ode1)=0 );
> odetest( soln_p, lin_ode1 );
>
[Back to ODE Powertool Table of Contents]
>