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•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•Use initial conditionz⁡3=1−12+ln⁡2=−152−ln⁡2+C1•Solve for_C1C1=7+2⁢ln⁡2•Substitute_C1=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ⅆⅆ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•Use initial conditiony⁡0=11=−12−4⁢C1+12•Solution does not satisfy initial condition•Use initial conditiony⁡0=11=−12+4⁢C1+12•Solve for_C1C1=2•Substitute_C1=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•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•Use initial conditiony⁡a=bb=ⅇa⁢a2+2⁢C12•Solve for_C1C1=−ⅇa⁢a2−2⁢b2⁢ⅇa•Substitute_C1=−ⅇa⁢a2−2⁢b2⁢ⅇainto general solution and simplifyy⁡x=ⅇx⁢−a2+2⁢ⅇ−a⁢b+x22•Solution to the IVPy⁡x=ⅇx⁢−a2+2⁢ⅇ−a⁢b+x22
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document