ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL
Unit 19 -- 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 19
>
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
>
19.A Fundamental Set of Solutions
The first-order homogeneous linear ODE with constant coefficients
> ode1 := diff( y(t), t ) + a*y(t) = 0;
>
can be solved as a linear ODE by finding an integrating factor (or as a separable equation) to find that all solutions are constant multiples of an exponential:
> sol1 := dsolve( ode1, y(t), [linear] );
>
Given the differentiation properties of exponentials, it seems reasonable that exponential functions should also solve higher-order homogeneous linear ODEs with constant coefficients.
> ode2 := diff( y(t), t$2 ) + a * diff( y(t), t ) + b * y(t) = 0;
>
To investigate this conjecture, construct a proposed solution
> exp_guess := y(t) = exp( r*t );
>
and substitute it into the ODE
> q1 := factor( eval( ode2, exp_guess ) );
>
Because
, it is seen that
is a solution to the second-order ODE when
is chosen so that
> char_eqn := q1 / rhs( exp_guess );
>
This equation for
is called the characteristic equation for the ODE.
Note that the characteristic equation for a second-order ODE is a quadratic equation in
. The (two) solutions to this characteristic equation are called the characteristic roots of the ODE.
> char_roots := solve( char_eqn, {r} );
>
Each characteristic root corresponds to a solution of the ODE.
> char_soln := [seq( eval( exp_guess, cr ), cr=[char_roots] )];
>
To check that these solutions are linearly independent, compute their Wronskian
> wronsk := simplify( det( wronskian( map(rhs,char_soln), t ) ) );
>
Thus, these solutions are linearly independent provided
. That is, provided the characteristic equation has distinct roots, the two characteristic solutions are linearly independent on the entire real line. (The case with repeated roots will be discussed in more detail in
Section 19.C-2.)
Any set of linearly independent solutions to a homogeneous linear ODE is called a fundamental set of solutions for the ODE.
> fund_set2 := map(rhs,char_soln);
>
Maple provides a number of commands that simplify the determination of a fundamental set of solutions to a linear ODE. The constcoeffsols command in the DEtools package can be used to find a fundamental set of solutions to a linear ODE with constant coefficients :
> constcoeffsols( ode2, y(t) );
>
Similarly, the eulersols , expsols , polysols , and ratsols commands (all in the DEtools package) find linearly independent solutions of an appropriate form. In the case of this ODE, there are no Euler, polynomial, or rational solutions, all solutions are exponentials.
> eulersols( ode2, y(t) );
> expsols( ode2, y(t) );
> polysols( ode2, y(t) );
> ratsols( ode2, y(t) );
>
Lastly, in the most general case, the dsolve command with the optional argument output=basis can be used to find a fundamental set of solutions for the ODE :
> dsolve( ode2, y(t), output=basis );
>
For an
-th order linear ODE, the fundamental set of solutions contains
linearly independent solutions to the differential equation.
Consider the fourth-order linear ODE with constant coefficients
> ode3 := diff( y(t), t$4 ) - 3 * diff( y(t), t$2 ) + 2 * y(t) = 0;
>
Because this ODE has constant coefficients, all solutions are expected to be exponentials. This suggests that a fundamental set of solutions can be obtained using either
> expsols( ode3, y(t) );
>
or
> constcoeffsols( ode3, y(t) );
>
or
> fund_set3 := dsolve( ode3, y(t), output=basis );
>
Note that the all three commands produce the same collection of four functions. That these functions are solutions to the ODE is verified by
> seq( odetest( y(t)=Y, ode3 ), Y=fund_set3 );
>
and the test for linear independence is completed with a check that the Wronskian is not zero
> simplify( det( wronskian( fund_set3, t ) ) );
>
Next, consider the third-order ODE
> ode4 := t^3 * diff( y(t), t$3 ) + 3*t^2 * diff( y(t), t$2 ) - 2*t * diff( y(t), t ) + 2 * y(t) = 0;
>
Since this equation does not have constant coefficients, it is not surprising to see
> constcoeffsols( ode4, y(t) );
>
But, looking for polynomial solutions, shows that
> polysols( ode4, y(t) );
>
A fundamental set of solutions for this ODE must have 3 functions. Continuing the search for additional solutions,
> ratsols( ode4, y(t) );
> eulersols( ode4, y(t) );
>
Or, using the most general command
> fund_set4 := dsolve( ode4, y(t), output=basis );
>
That these three functions are solutions to the ODE is verified by
> seq( odetest( y(t)=Y, ode4 ), Y=fund_set4 );
>
To check for linear independence,
> simplify( det( wronskian( fund_set4, t ) ) );
>
is non-zero for
. Therefore, these 3 functions are a fundamental set of solutions for this ODE on any interval that does not contain the origin.
>
The Superposition Principle states that any linear combination of solutions to a homogeneous linear ODE is also a solution to the ODE. In fact, the general solution to a linear ODE with fundamental set of solutions {
,
, ...,
} is
.
>
Recall the first-order example from Section 19.A
> ode1;
>
The fundamental set of solutions was not explicitly stated at that time, but is obviously
> fund_set1 := dsolve( ode1, y(t), output=basis );
>
The general linear combination of fundamental solutions is
> gen_sol1 := y(t) = add( c[i] * fund_set1[i], i=1..nops(fund_set1) );
>
That these functions satisfy the differential equation is seen from
> odetest( gen_sol1, ode1 );
>
The general second-order ODE with constant coefficients
> ode2;
>
has, when
, a fundamental set of solutions
> fund_set2;
>
The general linear combination of fundamental solutions is
> gen_sol2 := y(t) = add( c[i] * fund_set2[i], i=1..nops(fund_set2) );
>
That these functions satisfy the differential equation is seen from
> odetest( gen_sol2, ode2 );
>
The fourth-order example introduced in Section 19.A-1
> ode3;
>
has a fundamental set of solutions consisting of
> fund_set3;
>
The general linear combination of fundamental solutions is
> gen_sol3 := y(t) = add( c[i] * fund_set3[i], i=1..nops(fund_set3) );
>
That these functions satisfy the differential equation is seen from
> odetest( gen_sol3, ode3 );
>
The third-order ODE with non-constant coefficients introduced in Section 19.A-2
> ode4;
>
has a fundamental set of solutions consisting of
> fund_set4;
>
The general linear combination of fundamental solutions is
> gen_sol4 := y(t) = add( c[i] * fund_set4[i], i=1..nops(fund_set4) );
>
That these functions satisfy the differential equation is seen from
> odetest( gen_sol4, ode4 );
>
19.B-5 Complex-Valued Characteristic Roots
The discussion of the case with repeated characteristic roots will be discussed in the next section. But, what about complex-valued roots?
Reconsider the general second-order linear ODE with constant coefficients
> ode2;
If
, then there are two distinct real-valued characteristic roots. The two exponential functions obtained from these roots are linearly independent, hence they form a fundamental set of solutions.
If
, then the characteristic root
has (algebraic) multiplicity two. This case will be resolved in the next section.
If
, then the characteristic roots are complex-valued. In fact, they are complex conjugates
and
where
and
are real-valued constants with
> 0.
>
> assume( alpha,real );
> assume( beta, real );
> assume( t, real );
>
The corresponding complex-valued solutions are
> c_sol1 := exp( (alpha + I*beta)*t );
> c_sol2 := exp( (alpha - I*beta)*t );
>
Two specific linear combinations of these complex-valued solutions are
> lin_comb1 := ( c_sol1 + c_sol2 ) / 2:
> lin_comb1 = evalc( lin_comb1 );
>
and
> lin_comb2 := ( c_sol1 - c_sol2 ) / (2*I):
> lin_comb2 = evalc( lin_comb2 );
>
Note that these two functions are real-valued!
Because they are linear combinations of a fundamental set of solutions, they are automatically solutions to the ODE. Because the Wronskian
> simplify( det( wronskian( [ lin_comb1, lin_comb2 ], t ) ) );
>
is non-zero (recall, that
> 0) on the entire real line, a fundamental set of (real-valued) solutions is
> fund_set2_real := map( evalc, [ lin_comb1, lin_comb2 ] );
>
and the corresponding general solution is
> gen_sol2_real := y(t) = add( c[i] * fund_set2_real[i], i=1..nops(fund_set2_real) ):
> gen_sol2_real;
> `` = factor( rhs(gen_sol2_real) );
>
The general rule of thumb is that if
is a characteristic root, then
and
are two real-valued linearly independent solutions to the ODE.
> unassign( 'alpha', 'beta', 't' ):
>
Reduction of order is a method for finding additional solutions to a linear ODE when one solution is known.
>
19.C-1 Example 1: Basic Concepts
The basic ideas behind Reduction of Order will be illustrated with an example. Consider the third-order linear ODE with non-constant coefficients
> ode4;
>
The fact that the coefficients are not constants means that the fundamental set will not consist of exponential functions. Fortunately, it is not too difficult to see one solution :
> yA := op( polysols( ode4, y(t) ) );
>
Reduction of Order principle dictates the search for additional solutions in the form
> reduce_form := y(t) = yA * x(t);
>
When this form for the solution is substituted into the original ODE (for y), a new ODE (for x) is obtained.
> reduce_ode := simplify( eval( ode4, reduce_form ) );
>
While this ODE is still third-order, note that it does not involve
, only the derivatives of
. When this ODE is expressed in terms of
> reduce_subs := diff( x(t), t ) = Xp(t);
>
the result is a second-order linear ODE for
.
> reduce_ode2 := eval( reduce_ode, reduce_subs );
>
The problem now reduces to finding a fundamental set of solutions to this reduced-order ODE -- hence the name Reduction of Order. A fundamental set of solutions to this ODE can be formed from powers of
.
> reduce_sol2 := dsolve( reduce_ode2, Xp(t), output=basis );
>
To conclude, it is necessary to reverse the substitutions to obtain the corresponding solutions to the original ODE (for y). First, to find the solutions to the third-order ODE for x, integrate each of the solutions to the second-order ODE for
.
> reduce_ode_sol := map( int, reduce_sol2, t );
>
Substituting each of these solutions into the reduction of order change of variables yields two additional solutions to the original ODE
> sol23 := map( x->yA*x, reduce_ode_sol );
>
Thus, a fundamental set of solutions to the original ODE is
> fund_set := [ yA, op(sol23) ];
>
To verify that this is, in fact, a fundamental set of solutions, observe that each function is a solution to the original ODE
> seq( odetest( y(t)=Y, ode4 ), Y = fund_set );
>
and the three functions are linearly independent on any interval not containing the origin
> simplify( det( wronskian( fund_set, t ) ) );
>
And, in conclusion, the fundamental set reported by Maple is
> dsolve( ode4, y(t), output=basis );
>
Two of the three functions,
and
, are the same as the one found via Reduction of Order. The third solution in the explicitly computed fundamental set,
, is a constant multiple of
, so the two fundamental sets are equivalent.
>
19.C-2 Example 2: Repeated Characteristic Roots
Recall, one final time, the general second-order linear ODE
> ode2;
>
A fundamental set of solutions has yet to be determined when
.
> ode2a := eval( ode2, b=a^2/4 );
>
The one solution obtained from an exponential guess is
> sol2a := exp( -a/2 * t );
>
Reduction of order calls for the search for a second linearly independent solution in the form
> sol2b := sol2a * x(t):
> guess2 := y(t) = sol2b;
>
When this conjecture is substituted into the ODE, the ODE reduces to
> q3 := simplify( eval( ode2a, guess2 ) );
>
Due to the non-vanishing of the first solution, the ODE simplifies even further:
> ode2x := q3 / sol2a;
>
The general solution to this ODE is
> sol2x := dsolve( ode2x, x(t) );
>
This suggests that a fundamental set of solutions is
> fund_set2C :=[ sol2a, eval( sol2b, sol2x ) ];
>
To verify that this is a fundamental set of solutions, observe that both functions are solutions
> seq( odetest( y(t)=Y, ode2a ), Y=fund_set2C );
>
and the Wronskian does not vanish on the real line
> simplify( det( wronskian( fund_set2C, t ) ) );
>
does not vanish on the real line provided _C1 is non-zero. Note that the term of the new solution corresponding that contains _C2 is simply the first fundamental solution. There is no need for this duplication. That is, choose _C2=0 . In conclusion, with _C1=1 and _C2=0 , the fundamental set of solutions obtained by reduction of order is
> fund_set2a :=eval( fund_set2C, [_C1=1,_C2=0] );
>
This result compares favorably with
> dsolve( ode2a, y(t), output=basis );
>
The general result for repeated characteristic roots is that additional linearly independent solutions are obtained by multiplying the corresponding exponential solution by powers of the independent variable. For example, the third-order ODE
> ode5 := diff( y(t), t$3 ) + 3 * diff( y(t), t$2 ) + 3 * diff( y(t), t ) + y(t) = 0;
>
has characteristic equation
> char_eqn5 := simplify( eval( ode5, exp_guess ) / rhs(exp_guess) );
>
The characteristic roots are
> char_roots5 := solve( char_eqn5, {r} );
>
Since
is a triple root for this problem, a fundamental set is
> fund_set5 := dsolve( ode5, y(t), output=basis );
>
The general solution to a nonhomogeneous linear ODE can be written as the sum of one solution to the nonhomogeneous equation and the general solution to the homogeneous equation. The general solution to the homogeneous equation is a linear combination of the solution in a fundamental set of solutions. There are a variety of methods for finding a particular solution. The Method of Undetermined Coefficients is a traditional favorite for hand computations but its applicability is quite limited. A much more powerful method is Variation of Parameters.
>
19.D-1 Method of Undetermined Coefficients
The Method of Undetermined Coefficients, or Judicious Guessing, is successful only if it is possible to determine the form of the particular solution. It is most commonly used for linear ODEs with constant coefficients when the forcing term consists of polynomials, exponentials, sine, and cosine and sums and products of these types of functions. To illustrate, consider
> ode6 := diff( y(t), t$2 ) + 3 * diff( y(t), t ) + 2 * y(t) = f(t);
>
with forcing functions
> rhsA := f(t) = 3*t^2;
> rhsB := f(t) = 2*exp(-4*t);
> rhsC := f(t) = sin(t);
> rhsD := f(t) = rhs( 4*rhsA - 3*rhsB + 10*rhsC );
> rhsE := f(t) = exp(-t);
>
The first step is to find a fundamental set of solutions
> fund_set6 := dsolve( eval( ode6, f(t)=0 ), y(t), output=basis );
>
and general homogeneous solutions
> homo_sol6 := dsolve( eval( ode6, f(t)=0 ), y(t) );
>
19.D-1A Example 1
The first example has a polynomial forcing function
> ode6A := eval( ode6, rhsA );
>
The appropriate form for a particular solution is a general polynomial of the same degree as the forcing function
> part_guessA := y(t) = A * t^2 + B * t + C;
>
Substitution of this guess into the ODE yields the algebraic equation
> part_eqnA := collect( eval( ode6A, part_guessA ), t );
>
This condition will be satisfied for all
when
> coeff_solA := solve( identity( part_eqnA, t ), { A, B, C } );
>
Thus, a particular solution is
> part_solA := eval( part_guessA, coeff_solA );
>
and the general solution to the nonhomogeneous ODE is
> gen_solA := y(t) = rhs( homo_sol6 ) + rhs( part_solA );
>
That this function is a solution to the original ODE is verified with
> odetest( gen_solA, ode6A );
>
When a nonhomogeneous ODE is passed to the dsolve command with output=basis , the result is a 2-element list in which the first element is a fundamental set of solutions and the second element is a particular solution
> infolevel[dsolve] := 3:
> dsolve( ode6A, y(t), output=basis );
> infolevel[dsolve] := 0:
trying linear constant coefficient
linear constant coefficient successful
>
Note that this is the same particular solution as the one found with the Method of Undetermined Coefficients.
Without output=basis , the result from dsolve is the general solution
> dsolve( ode6A, y(t) );
>
19.D-1B Example 2
When the forcing function is an exponential function,
> ode6B := eval( ode6, rhsB );
>
the general guess for a particular solution is an exponential function with the same growth/decay rate
> part_guessB := y(t) = A * exp(-4*t);
>
When this guess is substituted into the nonhomogeneous ODE,
> part_eqnB := collect( eval( ode6B, part_guessB ), t );
>
which is satisfied for all
when
> coeff_solB := solve( identity( part_eqnB, t ), { A } );
>
This produces the particular solution
> part_solB := eval( part_guessB, coeff_solB );
>
The corresponding general solution is
> gen_solB := y(t) = rhs( homo_sol6 ) + rhs( part_solB );
>
Verification that this is a solution is provided with
> odetest( gen_solB, ode6B );
>
The same results could have been obtained with the single command
> dsolve( ode6B, y(t), output=basis );
>
19.D-1C Example 3
When the forcing function is a sine (or cosine) function,
> ode6C := eval( ode6, rhsC );
>
it might seem natural to choose a particular solution of the same form
> part_guessC1 := y(t) = A * sin(t);
>
When this guess is substituted into the nonhomogeneous ODE,
> part_eqnC1 := collect( eval( ode6C, part_guessC1 ), t );
>
which is satisfied for all
when
> coeff_solC1 := solve( identity( part_eqnC1, t ), { A } );
>
Oops! There is no choice of the coefficient A that yields a solution to the nonhomogeneous ODE. The problem can be seen in the result of substituting the guess into the ODE; the derivatives of the guess involve both sin(t) and cos(t). The guess needs to include a second term that can be used to kill off the cos(t) terms on the LHS. A reasonable second guess for a particular solution is a linear combination of sine and cosine with the same frequency
> part_guessC2 := y(t) = A * sin(t) + B * cos(t);
>
When this guess is substituted into the nonhomogeneous ODE,
> part_eqnC2 := collect( eval( ode6C, part_guessC2 ), t );
>
which is satisfied for all
when
> coeff_solC2 := solve( identity( part_eqnC2, t ), { A, B } );
>
This produces the particular solution
> part_solC := eval( part_guessC2, coeff_solC2 );
>
The corresponding general solution is
> gen_solC := y(t) = rhs( homo_sol6 ) + rhs( part_solC );
>
Verification that this is a solution is provided with
> odetest( gen_solC, ode6C );
>
The same results could have been obtained with the single command
> dsolve( ode6C, y(t), output=basis );
>
19.D-1D Example 4
An important consequence of the linearity of the ODE is that when a particular solution is known for a collection of functions, then a particular solution when the forcing function is a linear combination of these functions is the same linear combination of the corresponding particular solutions. For example,
> rhsD;
>
is a linear combination of the three forcing functions previously considered for this problem. Therefore, a particular solution to
> ode6D := eval( ode6, rhsD );
>
is
> part_solD := y(t) = rhs( 4*part_solA - 3*part_solB + 10*part_solC );
>
and the corresponding general solution is
> gen_solD := y(t) = rhs( homo_sol6 ) + rhs( part_solD );
>
19.D-1E Example 5
As a final example, consider a forcing function that is a term in the homogeneous solution
> ode6E := eval( ode6, rhsE );
>
The natural guess is for a particular solution of the same form
> part_guessE1 := y(t) = A * exp(-t);
>
When this guess is substituted into the nonhomogeneous ODE,
> part_eqnE1 := collect( eval( ode6E, part_guessE1 ), t );
>
which clearly has no solution
> coeff_solE1 := solve( identity( part_eqnE1, t ), { A } );
>
The problem is that since the form of the particular solution is a solution to the homogeneous equation, the differential operator will have the value 0. To overcome this difficulty it is necessary to multiply the guess by the independent variable enough times to eliminate all homogeneous solutions from the form for the particular solution:
> part_guessE2 := y(t) = t * rhs( part_guessE1 );
>
When this guess is substituted into the nonhomogeneous ODE,
> part_eqnE2 := collect( eval( ode6E, part_guessE2 ), t );
>
which is satisfied for all
when
> coeff_solE2 := solve( identity( part_eqnE2, t ), { A } );
>
This produces the particular solution
> part_solE := eval( part_guessE2, coeff_solE2 );
>
The corresponding general solution is
> gen_solE := y(t) = rhs( homo_sol6 ) + rhs( part_solE );
>
Verification that this is a solution is provided with
> odetest( gen_solE, ode6E );
>
The same results could have been obtained with the single command
> dsolve( ode6E, y(t), output=basis );
>
19.D-2 Variation of Parameters
Variation of Parameters can be viewed as an extension of the Reduction of Order idea to nonhomogeneous equations. The basic idea is to look for a particular solution in the form of a "linear combination" of the fundamental set of solutions to the homogeneous equation in which the coefficients are allowed to be functions of the independent variable (this is the origin of the name of this method). When this proposed solution is inserted into the nonhomogeneouse ODE, it will be possible to obtain a (nonsingular) system of linear equations for the first derivatives of the coefficients. Once the solution to this system is obtained, it is a simple matter to reverse the substitutions to obtain a particular solution.
While it is possible to implement Variation of Parameters step-by-step, it is not practical. Also, because of the method's generality, it is generally easier to implement the general form for the solution. Suppose the differential equation is an
-th order linear ODE in which the coefficient of the highest-order derivative is one and the forcing term is
. Let {
,
), ...,
} be a fundamental set of solutions to the homogeneous ODE. Let
denote the determinant of the Wronskian matrix of the fundamental set and
denote the determinant of the Wronksian matrix with column
replaced by [ 0 0 ... 0
]
. Then, a particular solution is
Note that division by zero is not a concern because the fact that {
,
, ...,
} is a fundamental set of solutions means that
.
>
19.D-2A Example 1
For a first example, consider the nonhomogeneous ODE
> ode6;
>
The fundamental set of solutions was found to be
> fund_set6;
>
so that
> n := 2:
> for i from 1 to n do
> y||i := fund_set6[i];
> end do;
>
The Wronskian matrix
> W_matrix := wronskian( fund_set6, t );
>
has determinant
> W := simplify( det( W_matrix ) );
>
The determinants of the matrices in which a column of the Wronskian matrix is replaced with
> V := vector( n, [ 0$(n-1), f(t) ] );
>
are
> for i from 1 to n do
> W||i_matrix := augment( submatrix( W_matrix, 1..n, 1..(i-1) ),
> V,
> submatrix( W_matrix, 1..n, (i+1)..n ) );
> W||i := simplify( det( W||i_matrix ) );
> print( ` W`||i = W||i );
> end do:
>
Thus, for any function
, a particular solution is
> var_par_sol6 := y(t) = add( y||i * Int( W||i / W, t ), i=1..n );
>
When the forcing term is
> rhsE;
>
the particular solution obtained by Variation of Parameters is
> q4 := subs( rhsE, var_par_sol6 );
> part_solE_vp := simplify( value( q4 ) );
>
The particular solution obtained by the Method of Undetermined Coefficients is
> part_solE;
>
While these two particular solutions are not the same, their difference
> part_solE_diff := rhs( part_solE - part_solE_vp );
>
is seen to be a solution to the homogeneous equation and so the two particular solutions produce the same general solution.
> odetest( y(t) = part_solE_diff, lhs(ode6)=0 );
>
19.D-2B Example 2
For a second example of Variation of Parameters, consider the same ODE with forcing term
> rhsF := f(t) = 1 / ( 1 + exp(t) );
>
The Variation of Parameters formula for a particular solution is
> q5 := subs( rhsF, var_par_sol6 );
>
which evaluates to
> part_solF_vp := simplify( value( q5 ) );
>
This is the same result as is obtained from the dsolve command
> infolevel[dsolve] := 3:
> dsolve( eval(ode6,rhsF), y(t), output=basis );
> infolevel[dsolve] := 0:
trying linear constant coefficient
linear constant coefficient successful
>
Note that this particular solution could not have been handled using the the Method of Undetermined Coefficients.
>
19.D-2C Example 3
To illustrate Variation of Parameters on a higher-order ODE, consider
> ode4A := lhs(ode4) = f(t);
>
with fundamental set of solutions
> fund_set4;
>
so that
> n := 3:
> for i from 1 to n do
> y||i := fund_set4[i];
> end do;
>
The Wronskian matrix
> W_matrix := wronskian( fund_set4, t );
>
has determinant
> W := simplify( det( W_matrix ) );
>
The determinants of the matrices in which a column of the Wronskian matrix is replaced with
> V := vector( n, [ 0$(n-1), f(t) ] );
>
are
> for i from 1 to n do
> W||i_matrix := augment( submatrix( W_matrix, 1..n, 1..(i-1) ),
> V,
> submatrix( W_matrix, 1..n, (i+1)..n ) );
> W||i := simplify( det( W||i_matrix ) );
> print( ` W`||i = W||i );
> end do:
>
Thus, for any function
, a particular solution is
> var_par_sol4 := y(t) = add( y||i * Int( W||i / W, t ), i=1..n );
>
When the forcing term is
> rhsA;
>
the particular solution obtained by Variation of Parameters is
> q7 := subs( rhsA, var_par_sol4 );
> part_solA_vp := simplify( value( q7 ) );
>
The simplicity of this particular solution is somewhat misleading. In hindsight, it might have been reasonable to look for a particular solution in the form of a polynomial, but this is not as apparent as for the constant coefficient case.
> unassign( 'i', 'n' );
>
An example of a Cauchy-Euler, or equidimensional equation, is
> ode4;
The
-th order Cauchy-Euler equation has the form
> gen_euler_ode := Sum( a[i] * t^i * diff( y(t), t$i ), i=0..n ) = f(t);
>
where
,
, ...,
are constants. Notice that the power of
and the order of the derivative are the same in each term. Thus, power functions are likely candidates for solutions to Cauchy-Euler equations.
A function of the form
> euler_guess := y(t) = t^p;
>
will be a solution to
> ode4;
>
provided
> euler_char_eqn := factor( eval( ode4, euler_guess ) );
>
The solutions to this equation are
> euler_char_roots := solve( identity(euler_char_eqn,t), {p} );
>
The corresponding homogeneous solutions are
> euler_homo_sol1 := [seq( eval( euler_guess, P ), P=[euler_char_roots] )];
>
This process yields two solutions to the homogeneous equation. To find a third linearly independent solution observe that the characteristic value
has multiplicity 2. To find a second solution corresponding to this characteristic value, use Reduction of Order.
> yA := t^1;
> euler_reduce_form := y(t) = yA * x(t);
>
When this form for the solution is substituted into the original ODE (for y), a new ODE (for x) is obtained.
> euler_reduce_ode := simplify( eval( ode4, euler_reduce_form ) );
>
While this ODE is still third-order, note that it does not involve
, only the derivatives of
. When this ODE is expressed in terms of the derivative
> euler_reduce_subs := diff( x(t), t ) = Xp(t);
>
the result is a second-order linear ODE for
.
> q8 := eval( reduce_ode, reduce_subs );
>
Note that division by
converts this ODE to a second-order Cauchy-Euler ODE.
> euler_reduce_ode2 := simplify( q8 / t^2 );
>
As a Cauchy-Euler equation, solutions are sought in the form
> euler_reduce_guess := Xp(t) = t^p;
>
The characteristic polynomial for this reduced problem is
> euler_reduce_char_poly := factor( eval( euler_reduce_ode2, euler_reduce_guess ) );
>
which leads to the discovery of the characteristic values
> euler_reduce_char_roots := solve( identity( euler_reduce_char_poly, t ), { p } );
>
A fundamental set of solutions to the reduced ODE is
> euler_reduce_fund_set := [seq( eval( euler_reduce_guess, P ),
> P=[euler_reduce_char_roots] )];
>
To convert these solutions into solutions for the original third-order Cauchy-Euler ODE, integrate each solution to find
and then form
> q9 := map(xP->int(rhs(xP),t), euler_reduce_fund_set):
> q10 := eval(euler_reduce_form,x(t)=x):
> euler_homo_sol2 := [seq( q10, x=q9 )];
>
This process has now identified four solutions to the homogeneous third-order Cauchy-Euler ODE
> euler_homo_sol4 := [ op(euler_homo_sol1), op(euler_homo_sol2) ];
> map( odetest, euler_homo_sol4, ode4 );
>
This appears to be a problem until it is realized that these solutions are linearly dependent.
> simplify( det( wronskian( map(rhs,euler_homo_sol4), t ) ) );
>
Fortunately, it is not difficult to identify a subset of three solutions to the original ODE
> euler_homo_sol3 := subsop(3=NULL,euler_homo_sol4);
>
that are linearly independent on any interval not containing 0
> simplify( det( wronskian( map( rhs, euler_homo_sol3 ), t ) ) );
>
Hence, a fundamental set of solutions to the original ODE is
> euler_fund_set := map( rhs, euler_homo_sol3 );
>
This result is consistent with the fundamental set of solutions obtained in Section 19.A-2
> fund_set4;
>
[Back to ODE Powertool Table of Contents]
>