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.
withStudent:-ODEs:
ode1≔2xdiffyx,x−9x2+2diffyx,x+x2+1diffyx,x,x=0
ode1≔2xⅆⅆxyx−9x2+2ⅆⅆxyx+x2+1ⅆ2ⅆx2yx=0
ODEStepsode1
Let's solve2xⅆⅆxyx−9x2+2ⅆⅆxyx+x2+1ⅆ2ⅆx2yx=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Make substitutionu=ⅆⅆxyxto reduce order of ODE2xux−9x2+2ux+x2+1ⅆⅆxux=0▫Check if ODE is exact◦ODE is exact if the lhs is the total derivative of aC2functionⅆⅆxFx,ux=0◦Compute derivative of lhs∂∂xFx,u+∂∂uFx,uⅆⅆxux=0◦Evaluate derivatives2x=2x◦Condition met, ODE is exact•Exact ODE implies solution will be of this formFx,u=C1,Mx,u=∂∂xFx,u,Nx,u=∂∂uFx,u•Solve forFx,uby integratingMx,uwith respect toxFx,u=∫2ux−9x2ⅆx+_F1u•Evaluate integralFx,u=x2u−3x3+_F1u•Take derivative ofFx,uwith respect touNx,u=∂∂uFx,u•Compute derivativex2+2u+1=x2+ⅆⅆu_F1u•Isolate forⅆⅆu_F1uⅆⅆu_F1u=2u+1•Solve for_F1u_F1u=u2+u•Substitute_F1uinto equation forFx,uFx,u=x2u−3x3+u2+u•SubstituteFx,uinto the solution of the ODEx2u−3x3+u2+u=C1•Solve foruxux=−x22−12−x4+12x3+2x2+4C1+12,ux=−x22−12+x4+12x3+2x2+4C1+12•Solve 1st ODE foruxux=−x22−12−x4+12x3+2x2+4C1+12•Make substitutionu=ⅆⅆxyxⅆⅆxyx=−x22−12−x4+12x3+2x2+4C1+12•Integrate both sides to solve foryx∫ⅆⅆxyxⅆx=∫−x22−12−x4+12x3+2x2+4C1+12ⅆx+C2•Compute lhsyx=∫−x22−12−x4+12x3+2x2+4C1+12ⅆx+C2•Solve 2nd ODE foruxux=−x22−12+x4+12x3+2x2+4C1+12•Make substitutionu=ⅆⅆxyxⅆⅆxyx=−x22−12+x4+12x3+2x2+4C1+12•Integrate both sides to solve foryx∫ⅆⅆxyxⅆx=∫−x22−12+x4+12x3+2x2+4C1+12ⅆx+C2•Compute lhsyx=∫−x22−12+x4+12x3+2x2+4C1+12ⅆx+C2
ode2≔diffyx,x,x−diffyx,x−xexpx=0
ode2≔ⅆ2ⅆx2yx−ⅆⅆxyx−xⅇx=0
ODEStepsode2
Let's solveⅆ2ⅆx2yx−ⅆⅆxyx−xⅇx=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Isolate 2nd derivativeⅆ2ⅆx2yx=ⅆⅆxyx+xⅇx•Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2yx−ⅆⅆxyx=xⅇx•Characteristic polynomial of homogeneous ODEr2−r=0•Factor the characteristic polynomialrr−1=0•Roots of the characteristic polynomialr=0,1•1st solution of the homogeneous ODEy1x=1•2nd solution of the homogeneous ODEy2x=ⅇx•General solution of the ODEyx=C1y1x+C2y2x+ypx•Substitute in solutions of the homogeneous ODEyx=C1+C2ⅇx+ypx▫Find a particular solutionypxof the ODE◦Use variation of parameters to findypherefxis the forcing functionypx=−y1x∫y2xfxWy1x,y2xⅆx+y2x∫y1xfxWy1x,y2xⅆx,fx=xⅇx◦Wronskian of solutions of the homogeneous equationWy1x,y2x=1ⅇx0ⅇx◦Compute WronskianWy1x,y2x=ⅇx◦Substitute functions into equation forypxypx=−∫xⅇxⅆx+ⅇx∫xⅆx◦Compute integralsypx=ⅇx1−x+12x2•Substitute particular solution into general solution to ODEyx=C1+C2ⅇx+ⅇx1−x+12x2
ode3≔diffyx,x,x+5diffyx,x2yx=0
ode3≔ⅆ2ⅆx2yx+5ⅆⅆxyx2yx=0
ODEStepsode3
Let's solveⅆ2ⅆx2yx+5ⅆⅆxyx2yx=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Define new dependent variableuux=ⅆⅆxyx•Computeⅆ2ⅆx2yxⅆⅆxux=ⅆ2ⅆx2yx•Use chain rule on the lhsⅆⅆxyxⅆⅆyuy=ⅆ2ⅆx2yx•Substitute in the definition ofuuyⅆⅆyuy=ⅆ2ⅆx2yx•Make substitutionsⅆⅆxyx=uy,ⅆ2ⅆx2yx=uyⅆⅆyuyto reduce order of ODEuyⅆⅆyuy+5uy2y=0•Separate variablesⅆⅆyuyuy=−5y•Integrate both sides with respect toy∫ⅆⅆyuyuyⅆy=∫−5yⅆy+C1•Evaluate integrallnuy=−5lny+C1•Solve foruyuy=ⅇC1y5•Solve 1st ODE foruyuy=ⅇC1y5•Revert to original variables with substitutionuy=ⅆⅆxyx,y=yxⅆⅆxyx=ⅇC1yx5•Separate variablesⅆⅆxyxyx5=ⅇC1•Integrate both sides with respect tox∫ⅆⅆxyxyx5ⅆx=∫ⅇC1ⅆx+C2•Evaluate integralyx66=ⅇC1x+C2•Solve foryxyx=6ⅇC1x+6C216,yx=−6ⅇC1x+6C216
ode4≔diffyx,x,x−diffyx,x−6yx=0
ode4≔ⅆ2ⅆx2yx−ⅆⅆxyx−6yx=0
ODEStepsode4
Let's solveⅆ2ⅆx2yx−ⅆⅆxyx−6yx=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Characteristic polynomial of ODEr2−r−6=0•Factor the characteristic polynomialr+2r−3=0•Roots of the characteristic polynomialr=−2,3•1st solution of the ODEy1x=ⅇ−2x•2nd solution of the ODEy2x=ⅇ3x•General solution of the ODEyx=C1y1x+C2y2x•Substitute in solutionsyx=C1ⅇ−2x+C2ⅇ3x
ode5≔diffyx,x,x−diffyx,x=x2+6yx
ode5≔ⅆ2ⅆx2yx−ⅆⅆxyx=x2+6yx
ODEStepsode5
Let's solveⅆ2ⅆx2yx−ⅆⅆxyx=x2+6yx•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Isolate 2nd derivativeⅆ2ⅆx2yx=ⅆⅆxyx+x2+6yx•Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2yx−ⅆⅆxyx−6yx=x2•Characteristic polynomial of homogeneous ODEr2−r−6=0•Factor the characteristic polynomialr+2r−3=0•Roots of the characteristic polynomialr=−2,3•1st solution of the homogeneous ODEy1x=ⅇ−2x•2nd solution of the homogeneous ODEy2x=ⅇ3x•General solution of the ODEyx=C1y1x+C2y2x+ypx•Substitute in solutions of the homogeneous ODEyx=C1ⅇ−2x+C2ⅇ3x+ypx▫Find a particular solutionypxof the ODE◦Use variation of parameters to findypherefxis the forcing functionypx=−y1x∫y2xfxWy1x,y2xⅆx+y2x∫y1xfxWy1x,y2xⅆx,fx=x2◦Wronskian of solutions of the homogeneous equationWy1x,y2x=ⅇ−2xⅇ3x−2ⅇ−2x3ⅇ3x◦Compute WronskianWy1x,y2x=5ⅇx◦Substitute functions into equation forypxypx=ⅇ5x∫x2ⅇ−3xⅆx−∫x2ⅇ2xⅆxⅇ−2x5◦Compute integralsypx=−16x2+118x−7108•Substitute particular solution into general solution to ODEyx=C1ⅇ−2x+C2ⅇ3x−x26+x18−7108
ode6≔diffyx,x,x+4yx=−4diffyx,x
ode6≔ⅆ2ⅆx2yx+4yx=−4ⅆⅆxyx
ODEStepsode6
Let's solveⅆ2ⅆx2yx+4yx=−4ⅆⅆxyx•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Isolate 2nd derivativeⅆ2ⅆx2yx=−4yx−4ⅆⅆxyx•Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2yx+4yx+4ⅆⅆxyx=0•Characteristic polynomial of ODEr2+4r+4=0•Factor the characteristic polynomialr+22=0•Root of the characteristic polynomialr=−2•1st solution of the ODEy1x=ⅇ−2x•Repeated root, multiplyy1xbyxto ensure linear independencey2x=xⅇ−2x•General solution of the ODEyx=C1y1x+C2y2x•Substitute in solutionsyx=C1ⅇ−2x+C2xⅇ−2x
ode7≔5diffyx,x,x+20yx+15sinx=−20diffyx,x
ode7≔5ⅆ2ⅆx2yx+20yx+15sinx=−20ⅆⅆxyx
ODEStepsode7
Let's solve5ⅆ2ⅆx2yx+20yx+15sinx=−20ⅆⅆxyx•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Isolate 2nd derivativeⅆ2ⅆx2yx=−4yx−3sinx−4ⅆⅆxyx•Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2yx+4yx+4ⅆⅆxyx=−3sinx•Characteristic polynomial of homogeneous ODEr2+4r+4=0•Factor the characteristic polynomialr+22=0•Root of the characteristic polynomialr=−2•1st solution of the homogeneous ODEy1x=ⅇ−2x•Repeated root, multiplyy1xbyxto ensure linear independencey2x=xⅇ−2x•General solution of the ODEyx=C1y1x+C2y2x+ypx•Substitute in solutions of the homogeneous ODEyx=C1ⅇ−2x+C2xⅇ−2x+ypx▫Find a particular solutionypxof the ODE◦Use variation of parameters to findypherefxis the forcing functionypx=−y1x∫y2xfxWy1x,y2xⅆx+y2x∫y1xfxWy1x,y2xⅆx,fx=−3sinx◦Wronskian of solutions of the homogeneous equationWy1x,y2x=ⅇ−2xxⅇ−2x−2ⅇ−2xⅇ−2x−2xⅇ−2x◦Compute WronskianWy1x,y2x=ⅇ−4x◦Substitute functions into equation forypxypx=3ⅇ−2x∫sinxxⅇ2xⅆx−x∫sinxⅇ2xⅆx◦Compute integralsypx=12cosx25−9sinx25•Substitute particular solution into general solution to ODEyx=C1ⅇ−2x+C2xⅇ−2x+12cosx25−9sinx25
ode8≔diffyx,x,x+2yx+2diffyx,x=0
ode8≔ⅆ2ⅆx2yx+2yx+2ⅆⅆxyx=0
ODEStepsode8
Let's solveⅆ2ⅆx2yx+2yx+2ⅆⅆxyx=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Characteristic polynomial of ODEr2+2r+2=0•Use quadratic formula to solve forrr=−2±−42•Roots of the characteristic polynomialr=−1−I,−1+I•1st solution of the ODEy1x=ⅇ−xcosx•2nd solution of the ODEy2x=ⅇ−xsinx•General solution of the ODEyx=C1y1x+C2y2x•Substitute in solutionsyx=C1ⅇ−xcosx+C2ⅇ−xsinx
ode9≔diffyx,x,x+2yx−2diffyx,x=expx
ode9≔ⅆ2ⅆx2yx+2yx−2ⅆⅆxyx=ⅇx
ODEStepsode9
Let's solveⅆ2ⅆx2yx+2yx−2ⅆⅆxyx=ⅇx•Highest derivative means the order of the ODE is2ⅆ2ⅆx2yx•Characteristic polynomial of homogeneous ODEr2−2r+2=0•Use quadratic formula to solve forrr=2±−42•Roots of the characteristic polynomialr=1−I,1+I•1st solution of the homogeneous ODEy1x=ⅇxcosx•2nd solution of the homogeneous ODEy2x=ⅇxsinx•General solution of the ODEyx=C1y1x+C2y2x+ypx•Substitute in solutions of the homogeneous ODEyx=C1ⅇxcosx+C2ⅇxsinx+ypx▫Find a particular solutionypxof the ODE◦Use variation of parameters to findypherefxis the forcing functionypx=−y1x∫y2xfxWy1x,y2xⅆx+y2x∫y1xfxWy1x,y2xⅆx,fx=ⅇx◦Wronskian of solutions of the homogeneous equationWy1x,y2x=ⅇxcosxⅇxsinxⅇxcosx−ⅇxsinxⅇxsinx+ⅇxcosx◦Compute WronskianWy1x,y2x=ⅇ2x◦Substitute functions into equation forypxypx=ⅇx−cosx∫sinxⅆx+sinx∫cosxⅆx◦Compute integralsypx=ⅇx•Substitute particular solution into general solution to ODEyx=C1ⅇxcosx+C2ⅇxsinx+ⅇx
See Also
diff
Int
Student
Student[ODEs]
Student[ODEs][ODESteps]
Download Help Document