Second Order IVPs - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


ODE Steps for Second Order IVPs

 

Overview

Examples

Overview

• 

This help page gives a few examples of using the command ODESteps to solve second order initial value problems.

• 

See Student[ODEs][ODESteps] for a general description of the command ODESteps and its calling sequence.

Examples

> 

with⁡Student:-ODEs:

> 

ivp1≔diff⁡y⁡x,x,x−diff⁡y⁡x,x−x⁢exp⁡x=0,eval⁡diff⁡y⁡x,x,x=0=0,y⁡0=1

ivp1≔ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−x⁢ⅇx=0,ⅆⅆxy⁡xx=0|ⅆⅆxy⁡xx=0=0,y⁡0=1

(1)
> 

ODESteps⁡ivp1

Let's solveⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−x⁢ⅇx=0,ⅆⅆxy⁡xx=0|ⅆⅆxy⁡xx=0=0,y⁡0=1•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=c__1⁢y1⁡x+c__2⁢y2⁡x+yp⁡x•Substitute in solutions of the homogeneous ODEy⁡x=c__1+c__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=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=c__1+c__2⁢ⅇx+ⅇx⁢1−x+12⁢x2▫Check validity of solutiony⁡x=c__1+c__2⁢ⅇx+ⅇx⁢1−x+12⁢x2◦Use initial conditiony⁡0=11=c__1+c__2+1◦Compute derivative of the solutionⅆⅆxy⁡x=c__2⁢ⅇx+ⅇx⁢1−x+12⁢x2+x−1⁢ⅇx◦Use the initial conditionⅆⅆxy⁡xx=0|ⅆⅆxy⁡xx=0=00=c__2◦Solve forc__1andc__2c__1=0,c__2=0◦Substitute constant values into general solution and simplifyy⁡x=ⅇx⁢1−x+12⁢x2•Solution to the IVPy⁡x=ⅇx⁢1−x+12⁢x2

(2)
> 

ivp2≔diff⁡y⁡x,x,x+5⁢diff⁡y⁡x,x2y⁡x=0,eval⁡diff⁡y⁡x,x,x=1=−3,y⁡1=1

ivp2≔ⅆ2ⅆx2y⁡x+5⁢ⅆⅆxy⁡x2y⁡x=0,ⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=−3,y⁡1=1

(3)
> 

ODESteps⁡ivp2

Let's solveⅆ2ⅆx2y⁡x+5⁢ⅆⅆxy⁡x2y⁡x=0,ⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=−3,y⁡1=1•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•Solve for the highest derivativeⅆⅆyu⁡y=−5⁢u⁡yy•Separate variablesⅆⅆyu⁡yu⁡y=−5y•Integrate both sides with respect toy∫ⅆⅆyu⁡yu⁡yⅆy=∫−5yⅆy+c__1•Evaluate integralln⁡u⁡y=−5⁢ln⁡y+c__1•Solve foru⁡yu⁡y=ⅇc__1y5•Redefine the integration constant(s)u⁡y=c__1y5•Solve 1st ODE foru⁡yu⁡y=c__1y5•Revert to original variables with substitutionu⁡y=ⅆⅆxy⁡x,y=y⁡xⅆⅆxy⁡x=c__1y⁡x5•Solve for the highest derivativeⅆⅆxy⁡x=c__1y⁡x5•Separate variablesⅆⅆxy⁡x⁢y⁡x5=c__1•Integrate both sides with respect tox∫ⅆⅆxy⁡x⁢y⁡x5ⅆx=∫c__1ⅆx+c__2•Evaluate integraly⁡x66=c__1⁢x+c__2•Solve fory⁡xy⁡x=6⁢c__1⁢x+6⁢c__216,y⁡x=−12−I⁢32⁢6⁢c__1⁢x+6⁢c__216,y⁡x=−12+I⁢32⁢6⁢c__1⁢x+6⁢c__216,y⁡x=12−I⁢32⁢6⁢c__1⁢x+6⁢c__216,y⁡x=12+I⁢32⁢6⁢c__1⁢x+6⁢c__216,y⁡x=−6⁢c__1⁢x+6⁢c__216•Simplifyy⁡x=6⁢c__1⁢x+6⁢c__216,y⁡x=−6⁢c__1⁢x+6⁢c__216,y⁡x=−1+I⁢3⁢6⁢c__1⁢x+6⁢c__2162,y⁡x=1+I⁢3⁢6⁢c__1⁢x+6⁢c__2162,y⁡x=−I⁢3−1⁢6⁢c__1⁢x+6⁢c__2162,y⁡x=I⁢3−1⁢6⁢c__1⁢x+6⁢c__2162•Redefine the integration constant(s)y⁡x=6⁢c__1⁢x+c__216,y⁡x=−6⁢c__1⁢x+c__216,y⁡x=−1+I⁢3⁢6⁢c__1⁢x+c__2162,y⁡x=1+I⁢3⁢6⁢c__1⁢x+c__2162,y⁡x=−I⁢3−1⁢6⁢c__1⁢x+c__2162,y⁡x=I⁢3−1⁢6⁢c__1⁢x+c__2162•Redefine the integration constant(s)y⁡x=c__1⁢x+c__216,y⁡x=c__1⁢x+c__216,y⁡x=c__2⁢c__1⁢x+116▫Check validity of solutiony⁡x=c__1⁢x+c__216◦Use initial conditiony⁡1=11=c__1+c__216◦Compute derivative of the solutionⅆⅆxy⁡x=c__16⁢c__1⁢x+c__256◦Use the initial conditionⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=−3−3=c__16⁢c__1+c__256◦Solve forc__1andc__2c__1=−18,c__2=19◦Substitute constant values into general solution and simplifyy⁡x=−18⁢x+1916◦Solution has no non-real coefficients. Ignore remaining solutions.•Solution to the IVPy⁡x=−18⁢x+1916

(4)
> 

ivp3≔diff⁡y⁡x,x,x−diff⁡y⁡x,x−6⁢y⁡x=0,eval⁡diff⁡y⁡x,x,x=1=a,y⁡1=0

ivp3≔ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−6⁢y⁡x=0,ⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=a,y⁡1=0

(5)
> 

ODESteps⁡ivp3

Let's solveⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−6⁢y⁡x=0,ⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=a,y⁡1=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=c__1⁢y1⁡x+c__2⁢y2⁡x•Substitute in solutionsy⁡x=c__1⁢ⅇ−2⁢x+c__2⁢ⅇ3⁢x▫Check validity of solutiony⁡x=c__1⁢ⅇ−2⁢x+c__2⁢ⅇ3⁢x◦Use initial conditiony⁡1=00=c__1⁢ⅇ−2+c__2⁢ⅇ3◦Compute derivative of the solutionⅆⅆxy⁡x=−2⁢c__1⁢ⅇ−2⁢x+3⁢c__2⁢ⅇ3⁢x◦Use the initial conditionⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=aa=−2⁢c__1⁢ⅇ−2+3⁢c__2⁢ⅇ3◦Solve forc__1andc__2c__1=−a5⁢ⅇ−2,c__2=a5⁢ⅇ3◦Substitute constant values into general solution and simplifyy⁡x=−a⁢ⅇ2−2⁢x−ⅇ−3+3⁢x5•Solution to the IVPy⁡x=−a⁢ⅇ2−2⁢x−ⅇ−3+3⁢x5

(6)
> 

ivp4≔x2⁢diff⁡y⁡x,x,x−4⁢x⁢diff⁡y⁡x,x+2⁢y⁡x=0,eval⁡diff⁡y⁡x,x,x=1=10,y⁡1=−1

ivp4≔x2⁢ⅆ2ⅆx2y⁡x−4⁢x⁢ⅆⅆxy⁡x+2⁢y⁡x=0,ⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=10,y⁡1=−1

(7)
> 

ODESteps⁡ivp4

Let's solvex2⁢ⅆ2ⅆx2y⁡x−4⁢x⁢ⅆⅆxy⁡x+2⁢y⁡x=0,ⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=10,y⁡1=−1•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Isolate 2nd derivativeⅆ2ⅆx2y⁡x=−2⁢y⁡xx2+4⁢ⅆⅆxy⁡xx•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⁢ⅆⅆxy⁡xx+2⁢y⁡xx2=0•Multiply by denominators of the ODEx2⁢ⅆ2ⅆx2y⁡x−4⁢x⁢ⅆⅆxy⁡x+2⁢y⁡x=0•Make a change of variablest=ln⁡x▫Substitute the change of variables back into the ODE◦Calculate the1stderivative ofywith respect tox, using the chain ruleⅆⅆxy⁡x=ⅆⅆty⁡t⁢ⅆⅆxt⁡x◦Compute derivativeⅆⅆxy⁡x=ⅆⅆty⁡tx◦Calculate the2ndderivative ofywith respect tox, using the chain ruleⅆ2ⅆx2y⁡x=ⅆ2ⅆt2y⁡t⁢ⅆⅆxt⁡x2+ⅆ2ⅆx2t⁡x⁢ⅆⅆty⁡t◦Compute derivativeⅆ2ⅆx2y⁡x=ⅆ2ⅆt2y⁡tx2−ⅆⅆty⁡tx2Substitute the change of variables back into the ODEx2⁢ⅆ2ⅆt2y⁡tx2−ⅆⅆty⁡tx2−4⁢ⅆⅆty⁡t+2⁢y⁡t=0•Simplifyⅆ2ⅆt2y⁡t−5⁢ⅆⅆty⁡t+2⁢y⁡t=0•Characteristic polynomial of ODEr2−5⁢r+2=0•Use quadratic formula to solve forrr=5±172•Roots of the characteristic polynomialr=52−172,52+172•1st solution of the ODEy1⁡t=ⅇ52−172⁢t•2nd solution of the ODEy2⁡t=ⅇ52+172⁢t•General solution of the ODEy⁡t=c__1⁢y1⁡t+c__2⁢y2⁡t•Substitute in solutionsy⁡t=c__1⁢ⅇ52−172⁢t+c__2⁢ⅇ52+172⁢t•Change variables back usingt=ln⁡xy⁡x=c__1⁢ⅇ52−172⁢ln⁡x+c__2⁢ⅇ52+172⁢ln⁡x•Simplifyy⁡x=x52−172⁢x17⁢c__2+c__1▫Check validity of solutiony⁡x=x52−172⁢x17⁢c__2+c__1◦Use initial conditiony⁡1=−1−1=c__1+c__2◦Compute derivative of the solutionⅆⅆxy⁡x=x52−172⁢52−172⁢x17⁢c__2+c__1x+x52−172⁢x17⁢17⁢c__2x◦Use the initial conditionⅆⅆxy⁡xx=1|ⅆⅆxy⁡xx=1=1010=52−172⁢c__1+c__2+17⁢c__2◦Solve forc__1andc__2c__1=−12−25⁢1734,c__2=−12+25⁢1734◦Substitute constant values into general solution and simplifyy⁡x=25⁢17−17⁢x17−25⁢17−17⁢x52−17234•Solution to the IVPy⁡x=25⁢17−17⁢x17−25⁢17−17⁢x52−17234

(8)
> 

ivp5≔−x2+1⁢diff⁡y⁡x,x,x−x⁢diff⁡y⁡x,x+y⁡x=0,eval⁡diff⁡y⁡x,x,x=2=−1,y⁡2=1

ivp5≔−x2+1⁢ⅆ2ⅆx2y⁡x−x⁢ⅆⅆxy⁡x+y⁡x=0,ⅆⅆxy⁡xx=2|ⅆⅆxy⁡xx=2=−1,y⁡2=1

(9)
> 

ODESteps⁡ivp5

Let's solve−x2+1⁢ⅆ2ⅆx2y⁡x−x⁢ⅆⅆxy⁡x+y⁡x=0,ⅆⅆxy⁡xx=2|ⅆⅆxy⁡xx=2=−1,y⁡2=1•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Isolate 2nd derivativeⅆ2ⅆx2y⁡x=y⁡xx2−1−x⁢ⅆⅆxy⁡xx2−1•Group terms withy⁡xon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2y⁡x+x⁢ⅆⅆxy⁡xx2−1−y⁡xx2−1=0•Multiply by denominators of ODE−x2+1⁢ⅆ2ⅆx2y⁡x−x⁢ⅆⅆxy⁡x+y⁡x=0•Make a change of variablesθ=arccos⁡x•Calculateⅆⅆxy⁡xwith change of variablesⅆⅆxy⁡x=ⅆⅆθy⁡θ⁢ⅆⅆxθ⁡x•Compute1stderivativeⅆⅆxy⁡xⅆⅆxy⁡x=−ⅆⅆθy⁡θ−x2+1•Calculateⅆ2ⅆx2y⁡xwith change of variablesⅆ2ⅆx2y⁡x=ⅆ2ⅆθ2y⁡θ⁢ⅆⅆxθ⁡x2+ⅆ2ⅆx2θ⁡x⁢ⅆⅆθy⁡θ•Compute2ndderivativeⅆ2ⅆx2y⁡xⅆ2ⅆx2y⁡x=ⅆ2ⅆθ2y⁡θ−x2+1−x⁢ⅆⅆθy⁡θ−x2+132•Apply the change of variables to the ODE−x2+1⁢ⅆ2ⅆθ2y⁡θ−x2+1−x⁢ⅆⅆθy⁡θ−x2+132+x⁢ⅆⅆθy⁡θ−x2+1+y⁡x=0•Multiply through−ⅆ2ⅆθ2y⁡θ⁢x2−x2+1+ⅆ2ⅆθ2y⁡θ−x2+1+x3⁢ⅆⅆθy⁡θ−x2+132−x⁢ⅆⅆθy⁡θ−x2+132+x⁢ⅆⅆθy⁡θ−x2+1+y⁡x=0•Simplify ODEⅆ2ⅆθ2y⁡θ+y⁡x=0•ODE is that of a harmonic oscillator with given general solutiony⁡θ=c__1⁢sin⁡θ+c__2⁢cos⁡θ•Revert back toxy⁡x=c__1⁢sin⁡arccos⁡x+c__2⁢cos⁡arccos⁡x•Use trig identity to simplifysin⁡arccos⁡xsin⁡arccos⁡x=−x2+1•Simplify solution to the ODEy⁡x=c__1⁢−x2+1+c__2⁢x▫Check validity of solutiony⁡x=c__1⁢−x2+1+c__2⁢x◦Use initial conditiony⁡2=11=c__1⁢−3+2⁢c__2◦Compute derivative of the solutionⅆⅆxy⁡x=−c__1⁢x−x2+1+c__2◦Use the initial conditionⅆⅆxy⁡xx=2|ⅆⅆxy⁡xx=2=−1−1=2⁢c__1⁢−33+c__2◦Solve forc__1andc__2c__1=3⁢−3,c__2=5◦Substitute constant values into general solution and simplifyy⁡x=3⁢I⁢3⁢−x2+1+5⁢x•Solution to the IVPy⁡x=3⁢I⁢3⁢−x2+1+5⁢x

(10)

See Also

diff

Int

Student

Student[ODEs]

Student[ODEs][ODESteps]