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

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

withStudent:-ODEs:

ivp1diffyx,x,xdiffyx,xxexpx=0,evaldiffyx,x,x=0=0,y0=1

ivp1ⅆ2ⅆx2yxⅆⅆxyxxⅇx=0,ⅆⅆxyxx=0|ⅆⅆxyxx=0=0,y0=1

(1)

ODEStepsivp1

Let's solveⅆ2ⅆx2yxⅆⅆxyxxⅇx=0,ⅆⅆxyxx=0|ⅆⅆxyxx=0=0,y0=1Highest derivative means the order of the ODE is2ⅆ2ⅆx2yxIsolate 2nd derivativeⅆ2ⅆx2yx=ⅆⅆxyx+xⅇxGroup terms withyxon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2yxⅆⅆxyx=xⅇxCharacteristic polynomial of homogeneous ODEr2r=0Factor the characteristic polynomialrr1=0Roots of the characteristic polynomialr=0,11st solution of the homogeneous ODEy1x=12nd solution of the homogeneous ODEy2x=ⅇxGeneral solution of the ODEyx=c__1y1x+c__2y2x+ypxSubstitute in solutions of the homogeneous ODEyx=c__1+c__2ⅇx+ypxFind a particular solutionypxof the ODEUse variation of parameters to findypherefxis the forcing functionypx=y1xy2xfxWy1x,y2xⅆx+y2xy1xfxWy1x,y2xⅆx,fx=xⅇxWronskian of solutions of the homogeneous equationWy1x,y2x=1ⅇx0ⅇxCompute WronskianWy1x,y2x=ⅇxSubstitute functions into equation forypxypx=xⅇxⅆx+ⅇxxⅆxCompute integralsypx=ⅇx1x+12x2Substitute particular solution into general solution to ODEyx=c__1+c__2ⅇx+ⅇx1x+12x2Check validity of solutionyx=c__1+c__2ⅇx+ⅇx1x+12x2Use initial conditiony0=11=c__1+c__2+1Compute derivative of the solutionⅆⅆxyx=c__2ⅇx+ⅇx1x+12x2+x1ⅇxUse the initial conditionⅆⅆxyxx=0|ⅆⅆxyxx=0=00=c__2Solve forc__1andc__2c__1=0,c__2=0Substitute constant values into general solution and simplifyyx=ⅇx1x+12x2Solution to the IVPyx=ⅇx1x+12x2

(2)

ivp2diffyx,x,x+5diffyx,x2yx=0,evaldiffyx,x,x=1=3,y1=1

ivp2ⅆ2ⅆx2yx+5ⅆⅆxyx2yx=0,ⅆⅆxyxx=1|ⅆⅆxyxx=1=−3,y1=1

(3)

ODEStepsivp2

Let's solveⅆ2ⅆx2yx+5ⅆⅆxyx2yx=0,ⅆⅆxyxx=1|ⅆⅆxyxx=1=−3,y1=1Highest derivative means the order of the ODE is2ⅆ2ⅆx2yxDefine new dependent variableuux=ⅆⅆxyxComputeⅆ2ⅆx2yxⅆⅆxux=ⅆ2ⅆx2yxUse chain rule on the lhsⅆⅆxyxⅆⅆyuy=ⅆ2ⅆx2yxSubstitute in the definition ofuuyⅆⅆyuy=ⅆ2ⅆx2yxMake substitutionsⅆⅆxyx=uy,ⅆ2ⅆx2yx=uyⅆⅆyuyto reduce order of ODEuyⅆⅆyuy+5uy2y=0Solve for the highest derivativeⅆⅆyuy=5uyySeparate variablesⅆⅆyuyuy=5yIntegrate both sides with respect toyⅆⅆyuyuyⅆy=5yⅆy+c__1Evaluate integrallnuy=5lny+c__1Solve foruyuy=ⅇc__1y5Redefine the integration constant(s)uy=c__1y5Solve 1st ODE foruyuy=c__1y5Revert to original variables with substitutionuy=ⅆⅆxyx,y=yxⅆⅆxyx=c__1yx5Solve for the highest derivativeⅆⅆxyx=c__1yx5Separate variablesⅆⅆxyxyx5=c__1Integrate both sides with respect toxⅆⅆxyxyx5ⅆx=c__1ⅆx+c__2Evaluate integralyx66=c__1x+c__2Solve foryxyx=6c__1x+6c__216,yx=12I326c__1x+6c__216,yx=12+I326c__1x+6c__216,yx=12I326c__1x+6c__216,yx=12+I326c__1x+6c__216,yx=6c__1x+6c__216Simplifyyx=6c__1x+6c__216,yx=6c__1x+6c__216,yx=1+I36c__1x+6c__2162,yx=1+I36c__1x+6c__2162,yx=I316c__1x+6c__2162,yx=I316c__1x+6c__2162Redefine the integration constant(s)yx=6c__1x+c__216,yx=6c__1x+c__216,yx=1+I36c__1x+c__2162,yx=1+I36c__1x+c__2162,yx=I316c__1x+c__2162,yx=I316c__1x+c__2162Redefine the integration constant(s)yx=c__1x+c__216,yx=c__1x+c__216,yx=c__2c__1x+116Check validity of solutionyx=c__1x+c__216Use initial conditiony1=11=c__1+c__216Compute derivative of the solutionⅆⅆxyx=c__16c__1x+c__256Use the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=−3−3=c__16c__1+c__256Solve forc__1andc__2c__1=−18,c__2=19Substitute constant values into general solution and simplifyyx=18x+1916Solution has no non-real coefficients. Ignore remaining solutions.Solution to the IVPyx=18x+1916

(4)

ivp3diffyx,x,xdiffyx,x6yx=0,evaldiffyx,x,x=1=a,y1=0

ivp3ⅆ2ⅆx2yxⅆⅆxyx6yx=0,ⅆⅆxyxx=1|ⅆⅆxyxx=1=a,y1=0

(5)

ODEStepsivp3

Let's solveⅆ2ⅆx2yxⅆⅆxyx6yx=0,ⅆⅆxyxx=1|ⅆⅆxyxx=1=a,y1=0Highest derivative means the order of the ODE is2ⅆ2ⅆx2yxCharacteristic polynomial of ODEr2r6=0Factor the characteristic polynomialr+2r3=0Roots of the characteristic polynomialr=−2,31st solution of the ODEy1x=ⅇ2x2nd solution of the ODEy2x=ⅇ3xGeneral solution of the ODEyx=c__1y1x+c__2y2xSubstitute in solutionsyx=c__1ⅇ2x+c__2ⅇ3xCheck validity of solutionyx=c__1ⅇ2x+c__2ⅇ3xUse initial conditiony1=00=c__1ⅇ−2+c__2ⅇ3Compute derivative of the solutionⅆⅆxyx=2c__1ⅇ2x+3c__2ⅇ3xUse the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=aa=2c__1ⅇ−2+3c__2ⅇ3Solve forc__1andc__2c__1=a5ⅇ−2,c__2=a5ⅇ3Substitute constant values into general solution and simplifyyx=aⅇ22xⅇ3+3x5Solution to the IVPyx=aⅇ22xⅇ3+3x5

(6)

ivp4x2diffyx,x,x4xdiffyx,x+2yx=0,evaldiffyx,x,x=1=10,y1=1

ivp4x2ⅆ2ⅆx2yx4xⅆⅆxyx+2yx=0,ⅆⅆxyxx=1|ⅆⅆxyxx=1=10,y1=−1

(7)

ODEStepsivp4

Let's solvex2ⅆ2ⅆx2yx4xⅆⅆxyx+2yx=0,ⅆⅆxyxx=1|ⅆⅆxyxx=1=10,y1=−1Highest derivative means the order of the ODE is2ⅆ2ⅆx2yxIsolate 2nd derivativeⅆ2ⅆx2yx=2yxx2+4ⅆⅆxyxxGroup terms withyxon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2yx4ⅆⅆxyxx+2yxx2=0Multiply by denominators of the ODEx2ⅆ2ⅆx2yx4xⅆⅆxyx+2yx=0Make a change of variablest=lnxSubstitute the change of variables back into the ODECalculate the1stderivative ofywith respect tox, using the chain ruleⅆⅆxyx=ⅆⅆtytⅆⅆxtxCompute derivativeⅆⅆxyx=ⅆⅆtytxCalculate the2ndderivative ofywith respect tox, using the chain ruleⅆ2ⅆx2yx=ⅆ2ⅆt2ytⅆⅆxtx2+ⅆ2ⅆx2txⅆⅆtytCompute derivativeⅆ2ⅆx2yx=ⅆ2ⅆt2ytx2ⅆⅆtytx2Substitute the change of variables back into the ODEx2ⅆ2ⅆt2ytx2ⅆⅆtytx24ⅆⅆtyt+2yt=0Simplifyⅆ2ⅆt2yt5ⅆⅆtyt+2yt=0Characteristic polynomial of ODEr25r+2=0Use quadratic formula to solve forrr=5±172Roots of the characteristic polynomialr=52172,52+1721st solution of the ODEy1t=ⅇ52172t2nd solution of the ODEy2t=ⅇ52+172tGeneral solution of the ODEyt=c__1y1t+c__2y2tSubstitute in solutionsyt=c__1ⅇ52172t+c__2ⅇ52+172tChange variables back usingt=lnxyx=c__1ⅇ52172lnx+c__2ⅇ52+172lnxSimplifyyx=x52172x17c__2+c__1Check validity of solutionyx=x52172x17c__2+c__1Use initial conditiony1=−1−1=c__1+c__2Compute derivative of the solutionⅆⅆxyx=x5217252172x17c__2+c__1x+x52172x1717c__2xUse the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=1010=52172c__1+c__2+17c__2Solve forc__1andc__2c__1=12251734,c__2=12+251734Substitute constant values into general solution and simplifyyx=251717x17251717x5217234Solution to the IVPyx=251717x17251717x5217234

(8)

ivp5x2+1diffyx,x,xxdiffyx,x+yx=0,evaldiffyx,x,x=2=1,y2=1

ivp5x2+1ⅆ2ⅆx2yxxⅆⅆxyx+yx=0,ⅆⅆxyxx=2|ⅆⅆxyxx=2=−1,y2=1

(9)

ODEStepsivp5

Let's solvex2+1ⅆ2ⅆx2yxxⅆⅆxyx+yx=0,ⅆⅆxyxx=2|ⅆⅆxyxx=2=−1,y2=1Highest derivative means the order of the ODE is2ⅆ2ⅆx2yxIsolate 2nd derivativeⅆ2ⅆx2yx=yxx21xⅆⅆxyxx21Group terms withyxon the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearⅆ2ⅆx2yx+xⅆⅆxyxx21yxx21=0Multiply by denominators of ODEx2+1ⅆ2ⅆx2yxxⅆⅆxyx+yx=0Make a change of variablesθ=arccosxCalculateⅆⅆxyxwith change of variablesⅆⅆxyx=ⅆⅆθyθⅆⅆxθxCompute1stderivativeⅆⅆxyxⅆⅆxyx=ⅆⅆθyθx2+1Calculateⅆ2ⅆx2yxwith change of variablesⅆ2ⅆx2yx=ⅆ2ⅆθ2yθⅆⅆxθx2+ⅆ2ⅆx2θxⅆⅆθyθCompute2ndderivativeⅆ2ⅆx2yxⅆ2ⅆx2yx=ⅆ2ⅆθ2yθx2+1xⅆⅆθyθx2+132Apply the change of variables to the ODEx2+1ⅆ2ⅆθ2yθx2+1xⅆⅆθyθx2+132+xⅆⅆθyθx2+1+yx=0Multiply throughⅆ2ⅆθ2yθx2x2+1+ⅆ2ⅆθ2yθx2+1+x3ⅆⅆθyθx2+132xⅆⅆθyθx2+132+xⅆⅆθyθx2+1+yx=0Simplify ODEⅆ2ⅆθ2yθ+yx=0ODE is that of a harmonic oscillator with given general solutionyθ=c__1sinθ+c__2cosθRevert back toxyx=c__1sinarccosx+c__2cosarccosxUse trig identity to simplifysinarccosxsinarccosx=x2+1Simplify solution to the ODEyx=c__1x2+1+c__2xCheck validity of solutionyx=c__1x2+1+c__2xUse initial conditiony2=11=c__1−3+2c__2Compute derivative of the solutionⅆⅆxyx=c__1xx2+1+c__2Use the initial conditionⅆⅆxyxx=2|ⅆⅆxyxx=2=−1−1=2c__1−33+c__2Solve forc__1andc__2c__1=3−3,c__2=5Substitute constant values into general solution and simplifyyx=3I3x2+1+5xSolution to the IVPyx=3I3x2+1+5x

(10)

See Also

diff

Int

Student

Student[ODEs]

Student[ODEs][ODESteps]