firint - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


DEtools

  

firint

  

calculate first integrals for exact ODEs

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

firint(ODE, y(x), _mu = .., basis = [.., ...], method = formal)

Parameters

ODE

-

an ODE that is either linear, or exact, or otherwise an integrating factor for it shall also be indicated using the _mu = ... option

y(x)

-

(optional) required if the exact_ODE contains derivatives of more than one function

_mu = ..

-

(optional) to indicate an integrating factor for ODE when it is not exact

method = formal

-

(optional) only for linear ODEs, to request the computation of a complete set of first integrals

basis = [...]

-

(optional) only for linear ODEs, a basis of solutions for ODE, to be used to compute a complete set of first integrals

Description

• 

The firint command receives an nth order ODE, that could be: 1) linear or nonlinear but in exact form, that is, satisfying ODE=dRdx, 2) not in exact form but an integrating factor for it is indicated using the option _mu = ..., 3) the ODE is linear together with the option method = formal. The output of firint for these problems consists of a related first integral (the ODE R, of order n1, in ODE=dRdx), or a complete set of them in case 3). The dependent variable y(x), is required only when the ODE contains derivatives of more than one function. Typically, the given ODE is exact; for calculating integrating factors to use with the option _mu = ... see intfactor.

• 

The optional arguments can be given alone or in conjunction, and in any order.

• 

When a linear ODE is given and the option method = formal is indicated, firint attempts computing a complete basis of solutions for the ODE, or uses a given one if passed with the optional argument basis = [...], and from it computes a complete set of first integrals, that is as many as the differential order and all independent from each other.

• 

This function is part of the DEtools package, and so it can be used in the form firint(..) only after executing the command with(DEtools). However, it can always be accessed through the long form of the command by using DEtools[firint](..).

Examples

Nonlinear and linear ODEs

  

The general first order linear ODE and its integrating factor

withDEtools:

L_ODEdiffyx,x=Axyx+Bx

L_ODEⅆⅆxyx=Axyx+Bx

(1)

ΜintfactorL_ODE

ΜⅇAxⅆx

(2)
  

A related first integral can now be obtained either using the option _μ=Μ, as in: firint(L_ODE, _mu = Mu), or multiplying directly L_ODE by Mu (by construction, Mu*L_ODE is exact)

firintΜL_ODE

ⅇAxⅆxyxⅇAxⅆxBxⅆx+_C1=0

(3)
  

The most general first order ODE reducible by an integrating factor depending only on x is a Linear ODE (see redode):

reducible_ODEredodeμx,yx

reducible_ODEⅆⅆxyx=ⅆⅆxμxyx+_F1xμx

(4)
  

An exact nonlinear ODE which also has integrating factors of the form μx,y

ode2xyxdiffyx,x,x+xdiffyx,x2+ayxdiffyx,x+fx

ode2xyxⅆ2ⅆx2yx+xⅆⅆxyx2+ayxⅆⅆxyx+fx

(5)

odeadvisorode2

_2nd_order,_exact,_nonlinear,_2nd_order,_reducible,_mu_xy

(6)
  

Two integrating factors and the related first integrals

μintfactorode2

μ1,xax

(7)

firintode2

yx2a12+xⅆⅆxyxyx+fxⅆx+_C1=0

(8)

firintμ2ode2

xayxⅆⅆxyx+xafxxⅆx+_C1=0

(9)
  

The answer to ode2 can be built from these two first integrals interactively, or by calling dsolve with extra arguments, indicating the use of the integrating factor scheme mu_xy:

dsolveode2,mu_xy

yx=2a1x1axafxxⅆx+x1ac__1fxⅆxc__2a1,yx=2a1x1axafxxⅆx+x1ac__1fxⅆxc__2a1

(10)
  

A third order ODE, an integrating factor for it, and the related first integral.

ode3diffyx,x,x,x=2diffyx,x2yxdiffyx,x,xdiffyx,x2expdiffyx,x,x

ode3ⅆ3ⅆx3yx=2ⅆⅆxyx2yxⅆ2ⅆx2yxⅆⅆxyx2ⅇⅆ2ⅆx2yx

(11)

Μintfactorode3

Μⅇⅆ2ⅆx2yx

(12)

firintΜode3

yxⅆⅆxyx+ⅇⅆ2ⅆx2yx+x+c__1=0

(13)

Linear ODEs and method = formal

  

The firint command treats linear and nonlinear ODEs in equal footing, unless the optional method = formal, valid only for linear equations, is indicated. Consider

ode4diffyx,x,x=6x6x3x+2diffyx,x+6x3x+2yx6x3x+2

ode4ⅆ2ⅆx2yx=6x6ⅆⅆxyxx3x+2+6yxx3x+26x3x+2

(14)
  

Calling firint without optional arguments will result in an error message telling ode4 is not exact. Passing method = formal, you instead get a complete set of independent first integrals obtained by first computing a basis of the solution space

firintode4,method=formal

ⅆⅆxyxxⅆⅆxyx+yx1x33x+2,ⅆⅆxyxx+2yx23x+2

(15)
  

A textbook example: the most general 2nd order non-homogeneous linear ODE having for solution basis g1x and g2x, for the homogeneous part, and g0x as particular solution of the whole non-homogeneous equation, so the basis of solutions is g1x,g2x,g0x

PDEtoolsdeclareyx,gx,prime=x

yxwill now be displayed asy

gxwill now be displayed asg

derivatives with respect toxof functions of one variable will now be displayed with '

(16)

Basisg1x,g2x,g0x

Basisg1,g2,g0

(17)

ode5diffyx,x,x=diffg1x,x,xg2xg1xdiffg2x,x,xg2xdiffg1x,xg1xdiffg2x,xdiffyx,x+diffg1x,xdiffg2x,x,xdiffg1x,x,xdiffg2x,xg2xdiffg1x,xg1xdiffg2x,xyx+diffg2x,x,xg0xdiffg1x,x+g2xdiffg0x,x,xdiffg1x,xdiffg0x,x,xg1xdiffg2x,x+diffg2x,xg0xdiffg1x,x,xg2xdiffg0x,xdiffg1x,x,x+diffg0x,xg1xdiffg2x,x,xg2xdiffg1x,xg1xdiffg2x,x

ode5y''=g1''g2g1g2''y'g2g1 'g1g2 '+g1 'g2''g1''g2 'yg2g1 'g1g2 '+g2''g0g1 '+g2g0''g1 'g0''g1g2 '+g2 'g0g1''g2g0 'g1''+g0 'g1g2''g2g1 'g1g2 '

(18)
  

Verify that Basis is a complete basis for the solutions of ode5: from Basis construct the general solution then test it using odetest

sol5yx=_C1g1x+_C1g2x+g0x

sol5y=c__1g1+c__1g2+g0

(19)

odetestsol5,ode5

0

(20)
  

A complete set of first integrals for ode5 computed from Basis

firintode5,yx,basis=Basis

yg0g2 'g2y'g0 'g1g2 'g2g1 ',y+g0g1 '+g1y'g0 'g1g2 'g2g1 '

(21)
  

Verify this result

mapfirtest,,ode5,yx

0,0

(22)

See Also

DEtools

DEtools[firtest]

DEtools[intfactor]

DEtools[redode]

dsolve

PDEtools

PDEtools[declare]