ODE Steps for First Order ODEs
Overview
Examples
This help page gives a few examples of using the command ODESteps to solve first order ordinary differential equations.
See Student[ODEs][ODESteps] for a general description of the command ODESteps and its calling sequence.
withStudent:-ODEs:
ode1≔t2zt+1+zt2t−1diffzt,t=0
ode1≔t2zt+1+zt2t−1ⅆⅆtzt=0
ODEStepsode1
Let's solvet2zt+1+zt2t−1ⅆⅆtzt=0•Highest derivative means the order of the ODE is1ⅆⅆtzt•Separate variablesⅆⅆtztzt2zt+1=−t2t−1•Integrate both sides with respect tot∫ⅆⅆtztzt2zt+1ⅆt=∫−t2t−1ⅆt+C1•Evaluate integralzt22−zt+lnzt+1=−t22−t−lnt−1+C1
ode2≔diffyx,xfx+yx+gx=0
ode2≔ⅆⅆxyxfx+yx+gx=0
ODEStepsode2
Let's solveⅆⅆxyxfx+yx+gx=0•Highest derivative means the order of the ODE is1ⅆⅆxyx•Isolate the derivativeⅆⅆxyx=−fxyx−fxgx•Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODEⅆⅆxyx+fxyx=−fxgx•The ODE is linear; multiply by an integrating factorμxμxⅆⅆxyx+fxyx=−μxfxgx•Assume the lhs of the ODE is the total derivativeⅆⅆxμxyxμxⅆⅆxyx+fxyx=ⅆⅆxμxyx+μxⅆⅆxyx•Isolateⅆⅆxμxⅆⅆxμx=μxfx•Solve to find the integrating factorμx=ⅇ∫fxⅆx•Integrate both sides with respect tox∫ⅆⅆxμxyxⅆx=∫−μxfxgxⅆx+C1•Evaluate the integral on the lhsμxyx=∫−μxfxgxⅆx+C1•Solve foryxyx=∫−μxfxgxⅆx+C1μx•Substituteμx=ⅇ∫fxⅆxyx=∫−ⅇ∫fxⅆxfxgxⅆx+C1ⅇ∫fxⅆx•Simplifyyx=ⅇ−∫fxⅆx−∫ⅇ∫fxⅆxfxgxⅆx+C1
ode3≔diffyx,xyx+1+gxyx=0
ode3≔ⅆⅆxyxyx+1+gxyx=0
ODEStepsode3
Let's solveⅆⅆxyxyx+1+gxyx=0•Highest derivative means the order of the ODE is1ⅆⅆxyx•Isolate the derivativeⅆⅆxyx=−yx−gx•Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODEⅆⅆxyx+yx=−gx•The ODE is linear; multiply by an integrating factorμxμxⅆⅆxyx+yx=−μxgx•Assume the lhs of the ODE is the total derivativeⅆⅆxμxyxμxⅆⅆxyx+yx=ⅆⅆxμxyx+μxⅆⅆxyx•Isolateⅆⅆxμxⅆⅆxμx=μx•Solve to find the integrating factorμx=ⅇx•Integrate both sides with respect tox∫ⅆⅆxμxyxⅆx=∫−μxgxⅆx+C1•Evaluate the integral on the lhsμxyx=∫−μxgxⅆx+C1•Solve foryxyx=∫−μxgxⅆx+C1μx•Substituteμx=ⅇxyx=∫−ⅇxgxⅆx+C1ⅇx•Simplifyyx=ⅇ−x−∫ⅇxgxⅆx+C1
ode4≔2xyx−9x2+2yx+x2+1diffyx,x=0
ode4≔2xyx−9x2+2yx+x2+1ⅆⅆxyx=0
ODEStepsode4
Let's solve2xyx−9x2+2yx+x2+1ⅆⅆxyx=0•Highest derivative means the order of the ODE is1ⅆⅆxyx▫Check if ODE is exact◦ODE is exact if the lhs is the total derivative of aC2functionⅆⅆxFx,yx=0◦Compute derivative of lhs∂∂xFx,y+∂∂yFx,yⅆⅆxyx=0◦Evaluate derivatives2x=2x◦Condition met, ODE is exact•Exact ODE implies solution will be of this formFx,y=C1,Mx,y=∂∂xFx,y,Nx,y=∂∂yFx,y•Solve forFx,yby integratingMx,ywith respect toxFx,y=∫−9x2+2xyⅆx+_F1y•Evaluate integralFx,y=−3x3+x2y+_F1y•Take derivative ofFx,ywith respect toyNx,y=∂∂yFx,y•Compute derivativex2+2y+1=x2+ⅆⅆy_F1y•Isolate forⅆⅆy_F1yⅆⅆy_F1y=2y+1•Solve for_F1y_F1y=y2+y•Substitute_F1yinto equation forFx,yFx,y=−3x3+x2y+y2+y•SubstituteFx,yinto the solution of the ODE−3x3+x2y+y2+y=C1•Solve foryxyx=−x22−12−x4+12x3+2x2+4C1+12,yx=−x22−12+x4+12x3+2x2+4C1+12
ode5≔diffyx,x−yx−xexpx=0
ode5≔ⅆⅆxyx−yx−xⅇx=0
ODEStepsode5
Let's solveⅆⅆxyx−yx−xⅇx=0•Highest derivative means the order of the ODE is1ⅆⅆxyx•Isolate the derivativeⅆⅆxyx=yx+xⅇx•Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODEⅆⅆxyx−yx=xⅇx•The ODE is linear; multiply by an integrating factorμxμxⅆⅆxyx−yx=μxxⅇx•Assume the lhs of the ODE is the total derivativeⅆⅆxμxyxμxⅆⅆxyx−yx=ⅆⅆxμxyx+μxⅆⅆxyx•Isolateⅆⅆxμxⅆⅆxμx=−μx•Solve to find the integrating factorμx=ⅇ−x•Integrate both sides with respect tox∫ⅆⅆxμxyxⅆx=∫μxxⅇxⅆx+C1•Evaluate the integral on the lhsμxyx=∫μxxⅇxⅆx+C1•Solve foryxyx=∫μxxⅇxⅆx+C1μx•Substituteμx=ⅇ−xyx=∫ⅇ−xxⅇxⅆx+C1ⅇ−x•Evaluate the integrals on the rhsyx=x22+C1ⅇ−x•Simplifyyx=ⅇxx2+2C12
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document