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.
with⁡Student:-ODEs:
ode1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢diff⁡z⁡t,t=0
ode1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0
ODESteps⁡ode1
Let's solvet2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0•Highest derivative means the order of the ODE is1ⅆⅆtz⁡t•Solve for the highest derivativeⅆⅆtz⁡t=−t2⁢z⁡t+1z⁡t2⁢t−1•Separate variablesⅆⅆtz⁡t⁢z⁡t2z⁡t+1=−t2t−1•Integrate both sides with respect tot∫ⅆⅆtz⁡t⁢z⁡t2z⁡t+1ⅆt=∫−t2t−1ⅆt+c__1•Evaluate integralz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+c__1
ode2≔diff⁡y⁡x,xf⁡x+y⁡x+g⁡x=0
ode2≔ⅆⅆxy⁡xf⁡x+y⁡x+g⁡x=0
ODESteps⁡ode2
Let's solveⅆⅆxy⁡xf⁡x+y⁡x+g⁡x=0•Highest derivative means the order of the ODE is1ⅆⅆxy⁡x•Solve for the highest derivativeⅆⅆxy⁡x=−y⁡x+g⁡x⁢f⁡x•Collect w.r.t.y⁡xand simplifyⅆⅆxy⁡x=−f⁡x⁢y⁡x−f⁡x⁢g⁡x•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODEⅆⅆxy⁡x+f⁡x⁢y⁡x=−f⁡x⁢g⁡x•The ODE is linear; multiply by an integrating factorμ⁡xμ⁡x⁢ⅆⅆxy⁡x+f⁡x⁢y⁡x=−μ⁡x⁢f⁡x⁢g⁡x•Assume the lhs of the ODE is the total derivativeⅆⅆxy⁡x⁢μ⁡xμ⁡x⁢ⅆⅆxy⁡x+f⁡x⁢y⁡x=ⅆⅆxy⁡x⁢μ⁡x+y⁡x⁢ⅆⅆxμ⁡x•Isolateⅆⅆxμ⁡xⅆⅆxμ⁡x=μ⁡x⁢f⁡x•Solve to find the integrating factorμ⁡x=ⅇ∫f⁡xⅆx•Integrate both sides with respect tox∫ⅆⅆxy⁡x⁢μ⁡xⅆx=∫−μ⁡x⁢f⁡x⁢g⁡xⅆx+c__1•Evaluate the integral on the lhsy⁡x⁢μ⁡x=∫−μ⁡x⁢f⁡x⁢g⁡xⅆx+c__1•Solve fory⁡xy⁡x=∫−μ⁡x⁢f⁡x⁢g⁡xⅆx+c__1μ⁡x•Substituteμ⁡x=ⅇ∫f⁡xⅆxy⁡x=∫−ⅇ∫f⁡xⅆx⁢f⁡x⁢g⁡xⅆx+c__1ⅇ∫f⁡xⅆx•Simplifyy⁡x=ⅇ−∫f⁡xⅆx⁢−∫ⅇ∫f⁡xⅆx⁢f⁡x⁢g⁡xⅆx+c__1
ode3≔diff⁡y⁡x,xy⁡x+1+g⁡xy⁡x=0
ode3≔ⅆⅆxy⁡xy⁡x+1+g⁡xy⁡x=0
ODESteps⁡ode3
Let's solveⅆⅆxy⁡xy⁡x+1+g⁡xy⁡x=0•Highest derivative means the order of the ODE is1ⅆⅆxy⁡x•Solve for the highest derivativeⅆⅆxy⁡x=−1−g⁡xy⁡x⁢y⁡x•Collect w.r.t.y⁡xand simplifyⅆⅆxy⁡x=−y⁡x−g⁡x•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODEⅆⅆxy⁡x+y⁡x=−g⁡x•The ODE is linear; multiply by an integrating factorμ⁡xμ⁡x⁢ⅆⅆxy⁡x+y⁡x=−μ⁡x⁢g⁡x•Assume the lhs of the ODE is the total derivativeⅆⅆxy⁡x⁢μ⁡xμ⁡x⁢ⅆⅆxy⁡x+y⁡x=ⅆⅆxy⁡x⁢μ⁡x+y⁡x⁢ⅆⅆxμ⁡x•Isolateⅆⅆxμ⁡xⅆⅆxμ⁡x=μ⁡x•Solve to find the integrating factorμ⁡x=ⅇx•Integrate both sides with respect tox∫ⅆⅆxy⁡x⁢μ⁡xⅆx=∫−μ⁡x⁢g⁡xⅆx+c__1•Evaluate the integral on the lhsy⁡x⁢μ⁡x=∫−μ⁡x⁢g⁡xⅆx+c__1•Solve fory⁡xy⁡x=∫−μ⁡x⁢g⁡xⅆx+c__1μ⁡x•Substituteμ⁡x=ⅇxy⁡x=∫−ⅇx⁢g⁡xⅆx+c__1ⅇx•Simplifyy⁡x=ⅇ−x⁢−∫ⅇx⁢g⁡xⅆx+c__1
ode4≔2⁢x⁢y⁡x−9⁢x2+2⁢y⁡x+x2+1⁢diff⁡y⁡x,x=0
ode4≔2⁢x⁢y⁡x−9⁢x2+2⁢y⁡x+x2+1⁢ⅆⅆxy⁡x=0
ODESteps⁡ode4
Let's solve2⁢x⁢y⁡x−9⁢x2+2⁢y⁡x+x2+1⁢ⅆⅆxy⁡x=0•Highest derivative means the order of the ODE is1ⅆⅆxy⁡x▫Check if ODE is exact◦ODE is exact if the lhs is the total derivative of aC2functionⅆⅆxG⁡x,y⁡x=0◦Compute derivative of lhs∂∂xG⁡x,y+∂∂yG⁡x,y⁢ⅆⅆxy⁡x=0◦Evaluate derivatives2⁢x=2⁢x◦Condition met, ODE is exact•Exact ODE implies solution will be of this formG⁡x,y=c__1,M⁡x,y=∂∂xG⁡x,y,N⁡x,y=∂∂yG⁡x,y•Solve forG⁡x,yby integratingM⁡x,ywith respect toxG⁡x,y=∫−9⁢x2+2⁢x⁢yⅆx+_F1⁡y•Evaluate integralG⁡x,y=−3⁢x3+x2⁢y+_F1⁡y•Take derivative ofG⁡x,ywith respect toyN⁡x,y=∂∂yG⁡x,y•Compute derivativex2+2⁢y+1=x2+ⅆⅆy_F1⁡y•Isolate forⅆⅆy_F1⁡yⅆⅆy_F1⁡y=2⁢y+1•Solve for_F1⁡y_F1⁡y=y2+y•Substitute_F1⁡yinto equation forG⁡x,yG⁡x,y=−3⁢x3+x2⁢y+y2+y•SubstituteG⁡x,yinto the solution of the ODE−3⁢x3+x2⁢y+y2+y=c__1•Solve fory⁡xy⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢c__1+12,y⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢c__1+12
ode5≔diff⁡y⁡x,x−y⁡x−x⁢exp⁡x=0
ode5≔ⅆⅆxy⁡x−y⁡x−x⁢ⅇx=0
ODESteps⁡ode5
Let's solveⅆⅆxy⁡x−y⁡x−x⁢ⅇx=0•Highest derivative means the order of the ODE is1ⅆⅆxy⁡x•Solve for the highest derivativeⅆⅆxy⁡x=y⁡x+x⁢ⅇx•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODEⅆⅆxy⁡x−y⁡x=x⁢ⅇx•The ODE is linear; multiply by an integrating factorμ⁡xμ⁡x⁢ⅆⅆxy⁡x−y⁡x=μ⁡x⁢x⁢ⅇx•Assume the lhs of the ODE is the total derivativeⅆⅆxy⁡x⁢μ⁡xμ⁡x⁢ⅆⅆxy⁡x−y⁡x=ⅆⅆxy⁡x⁢μ⁡x+y⁡x⁢ⅆⅆxμ⁡x•Isolateⅆⅆxμ⁡xⅆⅆxμ⁡x=−μ⁡x•Solve to find the integrating factorμ⁡x=ⅇ−x•Integrate both sides with respect tox∫ⅆⅆxy⁡x⁢μ⁡xⅆx=∫μ⁡x⁢x⁢ⅇxⅆx+c__1•Evaluate the integral on the lhsy⁡x⁢μ⁡x=∫μ⁡x⁢x⁢ⅇxⅆx+c__1•Solve fory⁡xy⁡x=∫μ⁡x⁢x⁢ⅇxⅆx+c__1μ⁡x•Substituteμ⁡x=ⅇ−xy⁡x=∫ⅇ−x⁢x⁢ⅇxⅆx+c__1ⅇ−x•Evaluate the integrals on the rhsy⁡x=x22+c__1ⅇ−x•Simplifyy⁡x=ⅇx⁢x22+c__1
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document