ODE Steps for Second Order ODEs
Overview
Examples
This help page gives a few examples of using the command ODESteps to solve second order ordinary differential equations.
See Student[ODEs][ODESteps] for a general description of the command ODESteps and its calling sequence.
with⁡Student:-ODEs:
ode1≔2⁢x⁢diff⁡y⁡x,x−9⁢x2+2⁢diff⁡y⁡x,x+x2+1⁢diff⁡y⁡x,x,x=0
ode1≔2⁢x⁢ⅆⅆxy⁡x−9⁢x2+2⁢ⅆⅆxy⁡x+x2+1⁢ⅆ2ⅆx2y⁡x=0
ODESteps⁡ode1
Let's solve2⁢x⁢ⅆⅆxy⁡x−9⁢x2+2⁢ⅆⅆxy⁡x+x2+1⁢ⅆ2ⅆx2y⁡x=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Make substitutionu=ⅆⅆxy⁡xto reduce order of ODE2⁢x⁢u⁡x−9⁢x2+2⁢u⁡x+x2+1⁢ⅆⅆxu⁡x=0▫Check if ODE is exact◦ODE is exact if the lhs is the total derivative of aC2functionⅆⅆxF⁡x,u⁡x=0◦Compute derivative of lhs∂∂xF⁡x,u+∂∂uF⁡x,u⁢ⅆⅆxu⁡x=0◦Evaluate derivatives2⁢x=2⁢x◦Condition met, ODE is exact•Exact ODE implies solution will be of this formF⁡x,u=C1,M⁡x,u=∂∂xF⁡x,u,N⁡x,u=∂∂uF⁡x,u•Solve forF⁡x,uby integratingM⁡x,uwith respect toxF⁡x,u=∫2⁢u⁢x−9⁢x2ⅆx+_F1⁡u•Evaluate integralF⁡x,u=x2⁢u−3⁢x3+_F1⁡u•Take derivative ofF⁡x,uwith respect touN⁡x,u=∂∂uF⁡x,u•Compute derivativex2+2⁢u+1=x2+ⅆⅆu_F1⁡u•Isolate forⅆⅆu_F1⁡uⅆⅆu_F1⁡u=2⁢u+1•Solve for_F1⁡u_F1⁡u=u2+u•Substitute_F1⁡uinto equation forF⁡x,uF⁡x,u=x2⁢u−3⁢x3+u2+u•SubstituteF⁡x,uinto the solution of the ODEx2⁢u−3⁢x3+u2+u=C1•Solve foru⁡xu⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12,u⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12•Solve 1st ODE foru⁡xu⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12•Make substitutionu=ⅆⅆxy⁡xⅆⅆxy⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12•Integrate both sides to solve fory⁡x∫ⅆⅆxy⁡xⅆx=∫−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2•Compute lhsy⁡x=∫−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2•Solve 2nd ODE foru⁡xu⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12•Make substitutionu=ⅆⅆxy⁡xⅆⅆxy⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12•Integrate both sides to solve fory⁡x∫ⅆⅆxy⁡xⅆx=∫−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2•Compute lhsy⁡x=∫−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2
ode2≔diff⁡y⁡x,x,x−diff⁡y⁡x,x−x⁢exp⁡x=0
ode2≔ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−x⁢ⅇx=0
ODESteps⁡ode2
Let's solveⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−x⁢ⅇx=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Isolate 2nd derivativeⅆ2ⅆx2y⁡x=ⅆⅆxy⁡x+x⁢ⅇx•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x=x⁢ⅇx•Characteristic polynomial of homogeneous ODEr2−r=0•Factor the characteristic polynomialr⁢r−1=0•Roots of the characteristic polynomialr=0,1•1st solution of the homogeneous ODEy1⁡x=1•2nd solution of the homogeneous ODEy2⁡x=ⅇx•General solution of the ODEy⁡x=C1⁢y1⁡x+C2⁢y2⁡x+yp⁡x•Substitute in solutions of the homogeneous ODEy⁡x=C1+C2⁢ⅇx+yp⁡x▫Find a particular solutionyp⁡xof the ODE◦Use variation of parameters to findypheref⁡xis the forcing functionyp⁡x=−y1⁡x⁢∫y2⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx+y2⁡x⁢∫y1⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx,f⁡x=x⁢ⅇx◦Wronskian of solutions of the homogeneous equationW⁡y1⁡x,y2⁡x=1ⅇx0ⅇx◦Compute WronskianW⁡y1⁡x,y2⁡x=ⅇx◦Substitute functions into equation foryp⁡xyp⁡x=−∫x⁢ⅇxⅆx+ⅇx⁢∫xⅆx◦Compute integralsyp⁡x=ⅇx⁢1−x+12⁢x2•Substitute particular solution into general solution to ODEy⁡x=C1+C2⁢ⅇx+ⅇx⁢1−x+12⁢x2
ode3≔diff⁡y⁡x,x,x+5⁢diff⁡y⁡x,x2y⁡x=0
ode3≔ⅆ2ⅆx2y⁡x+5⁢ⅆⅆxy⁡x2y⁡x=0
ODESteps⁡ode3
Let's solveⅆ2ⅆx2y⁡x+5⁢ⅆⅆxy⁡x2y⁡x=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Define new dependent variableuu⁡x=ⅆⅆxy⁡x•Computeⅆ2ⅆx2y⁡xⅆⅆxu⁡x=ⅆ2ⅆx2y⁡x•Use chain rule on the lhsⅆⅆxy⁡x⁢ⅆⅆyu⁡y=ⅆ2ⅆx2y⁡x•Substitute in the definition ofuu⁡y⁢ⅆⅆyu⁡y=ⅆ2ⅆx2y⁡x•Make substitutionsⅆⅆxy⁡x=u⁡y,ⅆ2ⅆx2y⁡x=u⁡y⁢ⅆⅆyu⁡yto reduce order of ODEu⁡y⁢ⅆⅆyu⁡y+5⁢u⁡y2y=0•Separate variablesⅆⅆyu⁡yu⁡y=−5y•Integrate both sides with respect toy∫ⅆⅆyu⁡yu⁡yⅆy=∫−5yⅆy+C1•Evaluate integralln⁡u⁡y=−5⁢ln⁡y+C1•Solve foru⁡yu⁡y=ⅇC1y5•Solve 1st ODE foru⁡yu⁡y=ⅇC1y5•Revert to original variables with substitutionu⁡y=ⅆⅆxy⁡x,y=y⁡xⅆⅆxy⁡x=ⅇC1y⁡x5•Separate variablesⅆⅆxy⁡x⁢y⁡x5=ⅇC1•Integrate both sides with respect tox∫ⅆⅆxy⁡x⁢y⁡x5ⅆx=∫ⅇC1ⅆx+C2•Evaluate integraly⁡x66=ⅇC1⁢x+C2•Solve fory⁡xy⁡x=6⁢ⅇC1⁢x+6⁢C216,y⁡x=−6⁢ⅇC1⁢x+6⁢C216
ode4≔diff⁡y⁡x,x,x−diff⁡y⁡x,x−6⁢y⁡x=0
ode4≔ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−6⁢y⁡x=0
ODESteps⁡ode4
Let's solveⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−6⁢y⁡x=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Characteristic polynomial of ODEr2−r−6=0•Factor the characteristic polynomialr+2⁢r−3=0•Roots of the characteristic polynomialr=−2,3•1st solution of the ODEy1⁡x=ⅇ−2⁢x•2nd solution of the ODEy2⁡x=ⅇ3⁢x•General solution of the ODEy⁡x=C1⁢y1⁡x+C2⁢y2⁡x•Substitute in solutionsy⁡x=C1⁢ⅇ−2⁢x+C2⁢ⅇ3⁢x
ode5≔diff⁡y⁡x,x,x−diff⁡y⁡x,x=x2+6⁢y⁡x
ode5≔ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x=x2+6⁢y⁡x
ODESteps⁡ode5
Let's solveⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x=x2+6⁢y⁡x•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Isolate 2nd derivativeⅆ2ⅆx2y⁡x=ⅆⅆxy⁡x+x2+6⁢y⁡x•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−6⁢y⁡x=x2•Characteristic polynomial of homogeneous ODEr2−r−6=0•Factor the characteristic polynomialr+2⁢r−3=0•Roots of the characteristic polynomialr=−2,3•1st solution of the homogeneous ODEy1⁡x=ⅇ−2⁢x•2nd solution of the homogeneous ODEy2⁡x=ⅇ3⁢x•General solution of the ODEy⁡x=C1⁢y1⁡x+C2⁢y2⁡x+yp⁡x•Substitute in solutions of the homogeneous ODEy⁡x=C1⁢ⅇ−2⁢x+C2⁢ⅇ3⁢x+yp⁡x▫Find a particular solutionyp⁡xof the ODE◦Use variation of parameters to findypheref⁡xis the forcing functionyp⁡x=−y1⁡x⁢∫y2⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx+y2⁡x⁢∫y1⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx,f⁡x=x2◦Wronskian of solutions of the homogeneous equationW⁡y1⁡x,y2⁡x=ⅇ−2⁢xⅇ3⁢x−2⁢ⅇ−2⁢x3⁢ⅇ3⁢x◦Compute WronskianW⁡y1⁡x,y2⁡x=5⁢ⅇx◦Substitute functions into equation foryp⁡xyp⁡x=ⅇ5⁢x⁢∫x2⁢ⅇ−3⁢xⅆx−∫x2⁢ⅇ2⁢xⅆx⁢ⅇ−2⁢x5◦Compute integralsyp⁡x=−16⁢x2+118⁢x−7108•Substitute particular solution into general solution to ODEy⁡x=C1⁢ⅇ−2⁢x+C2⁢ⅇ3⁢x−x26+x18−7108
ode6≔diff⁡y⁡x,x,x+4⁢y⁡x=−4⁢diff⁡y⁡x,x
ode6≔ⅆ2ⅆx2y⁡x+4⁢y⁡x=−4⁢ⅆⅆxy⁡x
ODESteps⁡ode6
Let's solveⅆ2ⅆx2y⁡x+4⁢y⁡x=−4⁢ⅆⅆxy⁡x•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Isolate 2nd derivativeⅆ2ⅆx2y⁡x=−4⁢y⁡x−4⁢ⅆⅆxy⁡x•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2y⁡x+4⁢y⁡x+4⁢ⅆⅆxy⁡x=0•Characteristic polynomial of ODEr2+4⁢r+4=0•Factor the characteristic polynomialr+22=0•Root of the characteristic polynomialr=−2•1st solution of the ODEy1⁡x=ⅇ−2⁢x•Repeated root, multiplyy1⁡xbyxto ensure linear independencey2⁡x=x⁢ⅇ−2⁢x•General solution of the ODEy⁡x=C1⁢y1⁡x+C2⁢y2⁡x•Substitute in solutionsy⁡x=C1⁢ⅇ−2⁢x+C2⁢x⁢ⅇ−2⁢x
ode7≔5⁢diff⁡y⁡x,x,x+20⁢y⁡x+15⁢sin⁡x=−20⁢diff⁡y⁡x,x
ode7≔5⁢ⅆ2ⅆx2y⁡x+20⁢y⁡x+15⁢sin⁡x=−20⁢ⅆⅆxy⁡x
ODESteps⁡ode7
Let's solve5⁢ⅆ2ⅆx2y⁡x+20⁢y⁡x+15⁢sin⁡x=−20⁢ⅆⅆxy⁡x•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Isolate 2nd derivativeⅆ2ⅆx2y⁡x=−4⁢y⁡x−3⁢sin⁡x−4⁢ⅆⅆxy⁡x•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2y⁡x+4⁢y⁡x+4⁢ⅆⅆxy⁡x=−3⁢sin⁡x•Characteristic polynomial of homogeneous ODEr2+4⁢r+4=0•Factor the characteristic polynomialr+22=0•Root of the characteristic polynomialr=−2•1st solution of the homogeneous ODEy1⁡x=ⅇ−2⁢x•Repeated root, multiplyy1⁡xbyxto ensure linear independencey2⁡x=x⁢ⅇ−2⁢x•General solution of the ODEy⁡x=C1⁢y1⁡x+C2⁢y2⁡x+yp⁡x•Substitute in solutions of the homogeneous ODEy⁡x=C1⁢ⅇ−2⁢x+C2⁢x⁢ⅇ−2⁢x+yp⁡x▫Find a particular solutionyp⁡xof the ODE◦Use variation of parameters to findypheref⁡xis the forcing functionyp⁡x=−y1⁡x⁢∫y2⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx+y2⁡x⁢∫y1⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx,f⁡x=−3⁢sin⁡x◦Wronskian of solutions of the homogeneous equationW⁡y1⁡x,y2⁡x=ⅇ−2⁢xx⁢ⅇ−2⁢x−2⁢ⅇ−2⁢xⅇ−2⁢x−2⁢x⁢ⅇ−2⁢x◦Compute WronskianW⁡y1⁡x,y2⁡x=ⅇ−4⁢x◦Substitute functions into equation foryp⁡xyp⁡x=3⁢ⅇ−2⁢x⁢∫sin⁡x⁢x⁢ⅇ2⁢xⅆx−x⁢∫sin⁡x⁢ⅇ2⁢xⅆx◦Compute integralsyp⁡x=12⁢cos⁡x25−9⁢sin⁡x25•Substitute particular solution into general solution to ODEy⁡x=C1⁢ⅇ−2⁢x+C2⁢x⁢ⅇ−2⁢x+12⁢cos⁡x25−9⁢sin⁡x25
ode8≔diff⁡y⁡x,x,x+2⁢y⁡x+2⁢diff⁡y⁡x,x=0
ode8≔ⅆ2ⅆx2y⁡x+2⁢y⁡x+2⁢ⅆⅆxy⁡x=0
ODESteps⁡ode8
Let's solveⅆ2ⅆx2y⁡x+2⁢y⁡x+2⁢ⅆⅆxy⁡x=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Characteristic polynomial of ODEr2+2⁢r+2=0•Use quadratic formula to solve forrr=−2±−42•Roots of the characteristic polynomialr=−1−I,−1+I•1st solution of the ODEy1⁡x=ⅇ−x⁢cos⁡x•2nd solution of the ODEy2⁡x=ⅇ−x⁢sin⁡x•General solution of the ODEy⁡x=C1⁢y1⁡x+C2⁢y2⁡x•Substitute in solutionsy⁡x=C1⁢ⅇ−x⁢cos⁡x+C2⁢ⅇ−x⁢sin⁡x
ode9≔diff⁡y⁡x,x,x+2⁢y⁡x−2⁢diff⁡y⁡x,x=exp⁡x
ode9≔ⅆ2ⅆx2y⁡x+2⁢y⁡x−2⁢ⅆⅆxy⁡x=ⅇx
ODESteps⁡ode9
Let's solveⅆ2ⅆx2y⁡x+2⁢y⁡x−2⁢ⅆⅆxy⁡x=ⅇx•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Characteristic polynomial of homogeneous ODEr2−2⁢r+2=0•Use quadratic formula to solve forrr=2±−42•Roots of the characteristic polynomialr=1−I,1+I•1st solution of the homogeneous ODEy1⁡x=ⅇx⁢cos⁡x•2nd solution of the homogeneous ODEy2⁡x=ⅇx⁢sin⁡x•General solution of the ODEy⁡x=C1⁢y1⁡x+C2⁢y2⁡x+yp⁡x•Substitute in solutions of the homogeneous ODEy⁡x=C1⁢ⅇx⁢cos⁡x+C2⁢ⅇx⁢sin⁡x+yp⁡x▫Find a particular solutionyp⁡xof the ODE◦Use variation of parameters to findypheref⁡xis the forcing functionyp⁡x=−y1⁡x⁢∫y2⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx+y2⁡x⁢∫y1⁡x⁢f⁡xW⁡y1⁡x,y2⁡xⅆx,f⁡x=ⅇx◦Wronskian of solutions of the homogeneous equationW⁡y1⁡x,y2⁡x=ⅇx⁢cos⁡xⅇx⁢sin⁡xⅇx⁢cos⁡x−ⅇx⁢sin⁡xⅇx⁢sin⁡x+ⅇx⁢cos⁡x◦Compute WronskianW⁡y1⁡x,y2⁡x=ⅇ2⁢x◦Substitute functions into equation foryp⁡xyp⁡x=ⅇx⁢−cos⁡x⁢∫sin⁡xⅆx+sin⁡x⁢∫cos⁡xⅆx◦Compute integralsyp⁡x=ⅇx•Substitute particular solution into general solution to ODEy⁡x=C1⁢ⅇx⁢cos⁡x+C2⁢ⅇx⁢sin⁡x+ⅇx
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document