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.
withStudent:-ODEs:
ivp1≔t2zt+1+zt2t−1diffzt,t=0,z3=1
ivp1≔t2zt+1+zt2t−1ⅆⅆtzt=0,z3=1
ODEStepsivp1
Let's solvet2zt+1+zt2t−1ⅆⅆtzt=0,z3=1•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•Use initial conditionz3=1−12+ln2=−152−ln2+C1•Solve for_C1C1=7+2ln2•Substitute_C1=7+2ln2into general solution and simplifyzt22−zt+lnzt+1=−t22−t−lnt−1+7+2ln2•Solution to the IVPzt22−zt+lnzt+1=−t22−t−lnt−1+7+2ln2
ivp2≔2xyx−9x2+2yx+x2+1diffyx,x=0,y0=1
ivp2≔2xyx−9x2+2yx+x2+1ⅆⅆxyx=0,y0=1
ODEStepsivp2
Let's solve2xyx−9x2+2yx+x2+1ⅆⅆxyx=0,y0=1•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•Use initial conditiony0=11=−12−4C1+12•Solution does not satisfy initial condition•Use initial conditiony0=11=−12+4C1+12•Solve for_C1C1=2•Substitute_C1=2into general solution and simplifyyx=−x22−12+x4+12x3+2x2+92•Solution to the IVPyx=−x22−12+x4+12x3+2x2+92
ivp3≔diffyx,x−yx−xexpx=0,ya=b
ivp3≔ⅆⅆxyx−yx−xⅇx=0,ya=b
ODEStepsivp3
Let's solveⅆⅆxyx−yx−xⅇx=0,ya=b•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•Use initial conditionya=bb=ⅇaa2+2C12•Solve for_C1C1=−ⅇaa2−2b2ⅇa•Substitute_C1=−ⅇaa2−2b2ⅇainto general solution and simplifyyx=ⅇx−a2+2ⅇ−ab+x22•Solution to the IVPyx=ⅇx−a2+2ⅇ−ab+x22
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document