ODE Steps for First Order IVPs
Overview
Examples
This help page gives a few examples of using the command ODESteps to solve first order initial value problems.
See Student[ODEs][ODESteps] for a general description of the command ODESteps and its calling sequence.
with⁡Student:-ODEs:
ivp1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢diff⁡z⁡t,t=0,z⁡3=1
ivp1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0,z⁡3=1
ODESteps⁡ivp1
Let's solvet2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0,z⁡3=1•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•Use initial conditionz⁡3=1−12+ln⁡2=−152−ln⁡2+c__1•Solve forc__1c__1=7+2⁢ln⁡2•Substitutec__1=7+2⁢ln⁡2into general solution and simplifyz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+7+2⁢ln⁡2•Solution to the IVPz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+7+2⁢ln⁡2
ivp2≔2⁢x⁢y⁡x−9⁢x2+2⁢y⁡x+x2+1⁢diff⁡y⁡x,x=0,y⁡0=1
ivp2≔2⁢x⁢y⁡x−9⁢x2+2⁢y⁡x+x2+1⁢ⅆⅆxy⁡x=0,y⁡0=1
ODESteps⁡ivp2
Let's solve2⁢x⁢y⁡x−9⁢x2+2⁢y⁡x+x2+1⁢ⅆⅆxy⁡x=0,y⁡0=1•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•Use initial conditiony⁡0=11=−12−4⁢c__1+12•Solve forc__1No solution•Solution does not satisfy initial condition•Use initial conditiony⁡0=11=−12+4⁢c__1+12•Solve forc__1c__1=2•Substitutec__1=2into general solution and simplifyy⁡x=−x22−12+x4+12⁢x3+2⁢x2+92•Solution to the IVPy⁡x=−x22−12+x4+12⁢x3+2⁢x2+92
ivp3≔diff⁡y⁡x,x−y⁡x−x⁢exp⁡x=0,y⁡a=b
ivp3≔ⅆⅆxy⁡x−y⁡x−x⁢ⅇx=0,y⁡a=b
ODESteps⁡ivp3
Let's solveⅆⅆxy⁡x−y⁡x−x⁢ⅇx=0,y⁡a=b•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•Use initial conditiony⁡a=bb=ⅇa⁢a22+c__1•Solve forc__1c__1=−ⅇa⁢a2−2⁢b2⁢ⅇa•Substitutec__1=−ⅇa⁢a2−2⁢b2⁢ⅇainto general solution and simplifyy⁡x=ⅇx⁢2⁢ⅇ−a⁢b−a2+x22•Solution to the IVPy⁡x=ⅇx⁢2⁢ⅇ−a⁢b−a2+x22
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document