The file FirstOrderODEs.mth defines functions for finding exact solutions to first order ordinary differential equations.  The function definitions in the file are automatically loaded when any of its functions are first used.


The file begins with methods taught in second-year calculus and elementary differential equations courses.  Following the elementary methods are advanced methods that may succeed when the more elementary methods are inapplicable.


Functions with names having the suffix GEN return a general solution in terms of a symbolic constant.  Functions with names without the suffix GEN return a specific solution when given numeric initial conditions, or they return a general solution in terms of symbolic initial conditions when given unassigned variables for the initial conditions.


With either type of function, the result is usually an algebraic equation implicitly defining the dependent variable in terms of the independent variable.  This equation may contain integrals that Derive could not determine exactly.  However, such implicit solutions are still considered solutions of differential equations even if integrals remain.  If an implicit solution does not contain an integral involving the dependent variable, you can use the Solve > Expression command1PET_XA in an attempt to find one or more explicit solutions.


In this section as well as in Second-order Ordinary Differential EquationsOB7SLO and the corresponding utility files, the variable x denotes the independent variable, and the variable y denotes the dependent variable.  Also the variable x0 denotes the initial value of x, and the variable y0 denotes the corresponding initial value of y.  Do not use x or y as function names.  In this section and in Second-order Ordinary Differential EquationsOB7SLO, dy/dx is abbreviated as y' for descriptive purposes only.  In Derive the apostrophe or single-quote mark can not be used to denote derivatives.


If you want to find a specific solution for symbolic or numeric initial conditions, it is best to use a function that directly returns specific solutions.  Otherwise, after finding a general solution, you must substitute x0 and y0 into the general solution, solve for c, and then substitute that value of c back into the general solution.

Elementary Methods


DSOLVE1_GEN(p, q, x, y, c) simplifies to a general solution of an equation having the form

p(x, y) + q(x, y)·y' = 0

in terms of symbolic constant c.  Note that most first order differential equations can be put in the above form.


DSOLVE1_GEN can solve exact, linear, separable, homogeneous or generalized-homogeneous equations, and equations having an integrating factor that depends only on x or only on y.  In other words, DSOLVE1_GEN is a general-purpose function that can solve most first order equations that occur in second-year calculus or elementary differential equations courses.


If the equation is not one of the above forms, DSOLVE1_GEN returns the word "inapplicable".  In this case, consider seeing if one of the advanced methods described in the next subsection is applicable to the equation.


DSOLVE1(p, q, x, y, x0, y0) is similar to DSOLVE1_GEN, but simplifies to a specific solution for the initial condition y=y0 at x=x0.  These initial conditions can be numbers, variables, or general expressions.


For example, to solve the differential equation 2·x·y + (1 + x²)·y' = 0 for the initial condition y=1 at x=0, enter and simplify the expression

DSOLVE1(2·x·y, 1 + x^2, x, y, 0, 1)

to produce the implicit algebraic solution

 2           
x ·y + y = 1 


To verify that it satisfies the initial condition, substitute x=0 and y=1 into this implicit solution, and then see that it simplifies to 0=0.


The implicit differentiation function IMP_DIF defined in the file DifferentiationApplications.mthAUKXVG may be helpful for verifying an implicit solution of a differential equation.  For example, to verify the above implicit solution, enter the expression

2·x·y + (1 + x^2)·IMP_DIF(x^2·y + y - 1, x, y)

and see that it simplifies to 0.


If it is necessary to obtain an explicit solution of a differential equation, use the Solve > Expression command1PET_XA to solve the implicit solution for y.  For example, solving the above implicit solution for y gives

        1    
y = ———————— 
      2      
     x  + 1  


To verify that this explicit solution satisfies the differential equation, substitute the solution for y in the unsimplified difference of the two sides of the differential equation and see that the result simplifies to 0.  For example, substituting 1/(x²+1) for y in

              2  d    
2·x·y + (1 + x )·—— y 
                 dx   

and then simplifying the result gives 0.


The remaining functions in this subsection are for solving specific forms of differential equations.  They are included primarily for educational purposes.


SEPARABLE_GEN(p, q, x, y, c) simplifies to a general implicit solution of an equation having the form y' = p(x)·q(y), where p(x) is an expression free of y and q(y) is an expression free of x.  The right side may require factoring and/or applying various trigonometric, logarithmic, or exponential transformations to transform it to separable form.


SEPARABLE(p, q, x, y, x0, y0) is similar to SEPARABLE_GEN, but simplifies to a specific solution for the initial condition y=y0 at x=x0.


LINEAR1(p, q, x, y, x0, y0) simplifies to an explicit solution of the linear monic differential equation y' + p(x)·y = q(x).  A differential equation is monic if the coefficient of its highest order derivative is 1.  Note that this equation does not have to be linear in x: only linear in y and its derivative.


LINEAR1_GEN(p, q, x, y, c) is similar to LINEAR1, but simplifies to a general solution in terms of symbolic constant c.


HOMOGENEOUS(r, x, y, x0, y0) simplifies to an implicit solution of an equation having the form y' = r(x, y)  if r is homogeneous, otherwise it returns "inapplicable".  In this context, an expression is homogeneous if substituting k·x or x and k·y for y in the expression yields an equivalent expression.  Often homogeneous expressions consist of a ratio of two polynomials in x and y, with exponents of x and y totaling the same constant in every term.  The arguments of any irrational subexpressions must also be homogeneous.  For example,

r = (x²·y - x·y²)/(x³ - y³) + sin(x/y)

is homogeneous.


HOMOGENEOUS_GEN(r, x, y, c) is similar to HOMOGENEOUS, but simplifies to a general solution in terms of symbolic constant c if r is homogeneous.


EXACT(p, q, x, y, x0, y0) simplifies to an implicit solution of an equation of the form p(x, y) + q(x, y) y' = 0 if this differential equation is exact, otherwise it returns "inapplicable".  This equation is exact if and only if dp/dy - dq/dx is equivalent to 0.  


EXACT_GEN(p, q, x, y, c) is similar to EXACT, but simplifies to a general solution in terms of symbolic constant c.


INTEGRATING_FACTOR(p, q, x, y, x0, y0) simplifies to an implicit solution of an equation of the form p(x, y) + q(x, y)·y' = 0 if this equation is exact when multiplied by an integrating factor free of x or free of y, otherwise it returns "inapplicable".


INTEGRATING_FACTOR_GEN(p, q, x, y, c) is similar to INTEGRATING_FACTOR, but simplifies to a general solution in terms of symbolic constant c.

Advanced Methods


MONOMIAL_TEST(p, q, x, y) simplifies to an integrating factor of the form x^m·y^n to the equation p(x, y) + q(x, y)·y' = 0, otherwise it returns "inapplicable".  Thus if MONOMIAL_TEST returns a monomial, multiply the equation by this monomial and solve the resulting exact differential equation using EXACT or DSOLVE1.


BERNOULLI_ODE(p, q, k, x, y, x0, y0) simplifies to an implicit solution of the Bernoulli equation  y' + p(x)·y = q(x)·y^k,  where k is a constant.


BERNOULLI_ODE_GEN(p, q, k, x, y, c) is similar to BERNOULLI, but simplifies to a general solution in terms of symbolic constant c.


GEN_HOM(r, x, y, x0, y0) simplifies to an implicit solution of an equation of the form  y' = r(x, y)  if r is generalized homogenous, otherwise it returns "inapplicable".  r is a generalized homogeneous expression if and only if

t·d(t·r)/dx
—————
d(t·r)/dy

is free of x and y, where t=x/y.


GEN_HOM_GEN(r, x, y, c) is similar to GEN_HOM, but simplifies to a general solution in terms of symbolic constant c.


FUN_LIN_CCF(r, p, q, k, x, y, x0, y0) simplifies to an implicit solution of an equation of the form y' = r(u), where r is a function of linear constant coefficients:  u = p·x + q·y + k,  with p, q, and k independent of x and y.


FUN_LIN_CCF_GEN(r, p, q, k, x, y, c) is similar to FUN_LIN_CCF, but simplifies to a general solution in terms of symbolic constant c.


LIN_FRAC(r, a, b, d, p, q, k, x, y, x0, y0) simplifies to an implicit solution of a linear fractional equation  y' = r·((a·x+b·y+d)/(p·x+q·y+k)).  However if q·a-p·b=0, instead use FUN_LIN_CCF described above.


LIN_FRAC_GEN(r, a, b, d, p, q, k, x, y, c) is similar to LIN_FRAC, but simplifies to a general solution in terms of symbolic constant c.


ALMOST_LIN(r, b, p, q, x, y, x0, y0) simplifies to an implicit solution of an equation of the form  r(x, y)·y' + p(x)·b(y) = q(x), if the equation is almost-linear, otherwise it returns "inapplicable".  The differential equation is almost-linear if (db/dy)/r is free of y.


ALMOST_LIN_GEN (r, b, p, q, x, y, c) is similar to ALMOST_LIN, but simplifies to a general solution in terms of symbolic constant c.


The above functions are for quasi-linear equations, meaning linear in y'.  If an equation is not quasi-linear, represent y' by a variable v and try solving for v to transform the equation into one or more alternate quasi-linear equations.  Alternatively, the following method is directly applicable to some equations that are not quasi-linear, and this method may be preferable even if you can solve for v:


CLAIRAUT(p, q, x, y, v, c) solves the generalized Clairaut equation, which has the form p(x·v - y) = q(v), where p and q are any functions and v is a variable representing y'.  CLAIRAUT returns a vector:  The first component is a general solution containing an arbitrary constant c.  The second component is an equation that you can attempt to solve algebraically for v.  If you succeed, substitute this expression for v in the differential equation to obtain a singular solution.  


For example, to solve the differential equation (x·y' - y)² = (y')² + 1, enter

CLAIRAUT((x·v - y)^2, v^2+1, x, y, v)

which simplifies to

  2  2              2    2                  2                 
[c ·x  - 2·c·x·y + y  - c  - 1 = 0,   2·(v·x  - x·y - v) = 0] 


Solving the second component for v in terms of x and y gives

       x·y   
v = ———————— 
      2      
     x  - 1  


Substituting the right side of this result for y' in the original differential equation gives the implicit singular solution

      2           2  2        
     y           x ·y         
——————————— = ——————————— + 1 
   2     2       2     2      
 (x  - 1)      (x  - 1)       


Other Utility File LibraryG5BS2R 

Created with the Personal Edition of HelpNDoc: Full-featured EPub generator