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•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+C1•Evaluate integralz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+C1
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•Isolate the derivativeⅆⅆ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ⅆⅆxμ⁡x⁢y⁡xμ⁡x⁢ⅆⅆxy⁡x+f⁡x⁢y⁡x=ⅆⅆxμ⁡x⁢y⁡x+μ⁡x⁢ⅆⅆxy⁡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∫ⅆⅆxμ⁡x⁢y⁡xⅆx=∫−μ⁡x⁢f⁡x⁢g⁡xⅆx+C1•Evaluate the integral on the lhsμ⁡x⁢y⁡x=∫−μ⁡x⁢f⁡x⁢g⁡xⅆx+C1•Solve fory⁡xy⁡x=∫−μ⁡x⁢f⁡x⁢g⁡xⅆx+C1μ⁡x•Substituteμ⁡x=ⅇ∫f⁡xⅆxy⁡x=∫−ⅇ∫f⁡xⅆx⁢f⁡x⁢g⁡xⅆx+C1ⅇ∫f⁡xⅆx•Simplifyy⁡x=ⅇ−∫f⁡xⅆx⁢−∫ⅇ∫f⁡xⅆx⁢f⁡x⁢g⁡xⅆx+C1
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•Isolate the derivativeⅆⅆ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ⅆⅆxμ⁡x⁢y⁡xμ⁡x⁢ⅆⅆxy⁡x+y⁡x=ⅆⅆxμ⁡x⁢y⁡x+μ⁡x⁢ⅆⅆxy⁡x•Isolateⅆⅆxμ⁡xⅆⅆxμ⁡x=μ⁡x•Solve to find the integrating factorμ⁡x=ⅇx•Integrate both sides with respect tox∫ⅆⅆxμ⁡x⁢y⁡xⅆx=∫−μ⁡x⁢g⁡xⅆx+C1•Evaluate the integral on the lhsμ⁡x⁢y⁡x=∫−μ⁡x⁢g⁡xⅆx+C1•Solve fory⁡xy⁡x=∫−μ⁡x⁢g⁡xⅆx+C1μ⁡x•Substituteμ⁡x=ⅇxy⁡x=∫−ⅇx⁢g⁡xⅆx+C1ⅇx•Simplifyy⁡x=ⅇ−x⁢−∫ⅇx⁢g⁡xⅆx+C1
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ⅆⅆxF⁡x,y⁡x=0◦Compute derivative of lhs∂∂xF⁡x,y+∂∂yF⁡x,y⁢ⅆⅆxy⁡x=0◦Evaluate derivatives2⁢x=2⁢x◦Condition met, ODE is exact•Exact ODE implies solution will be of this formF⁡x,y=C1,M⁡x,y=∂∂xF⁡x,y,N⁡x,y=∂∂yF⁡x,y•Solve forF⁡x,yby integratingM⁡x,ywith respect toxF⁡x,y=∫−9⁢x2+2⁢x⁢yⅆx+_F1⁡y•Evaluate integralF⁡x,y=−3⁢x3+x2⁢y+_F1⁡y•Take derivative ofF⁡x,ywith respect toyN⁡x,y=∂∂yF⁡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 forF⁡x,yF⁡x,y=−3⁢x3+x2⁢y+y2+y•SubstituteF⁡x,yinto the solution of the ODE−3⁢x3+x2⁢y+y2+y=C1•Solve fory⁡xy⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12,y⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+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•Isolate the 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ⅆⅆxμ⁡x⁢y⁡xμ⁡x⁢ⅆⅆxy⁡x−y⁡x=ⅆⅆxμ⁡x⁢y⁡x+μ⁡x⁢ⅆⅆxy⁡x•Isolateⅆⅆxμ⁡xⅆⅆxμ⁡x=−μ⁡x•Solve to find the integrating factorμ⁡x=ⅇ−x•Integrate both sides with respect tox∫ⅆⅆxμ⁡x⁢y⁡xⅆx=∫μ⁡x⁢x⁢ⅇxⅆx+C1•Evaluate the integral on the lhsμ⁡x⁢y⁡x=∫μ⁡x⁢x⁢ⅇxⅆx+C1•Solve fory⁡xy⁡x=∫μ⁡x⁢x⁢ⅇxⅆx+C1μ⁡x•Substituteμ⁡x=ⅇ−xy⁡x=∫ⅇ−x⁢x⁢ⅇxⅆx+C1ⅇ−x•Evaluate the integrals on the rhsy⁡x=x22+C1ⅇ−x•Simplifyy⁡x=ⅇx⁢x2+2⁢C12
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document