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=C1y1x+C2y2x+ypxSubstitute in solutions of the homogeneous ODEyx=C1+C2ⅇ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=C1+C2ⅇx+ⅇx1x+12x2Check validity of solutionyx=_C1+_C2ⅇx+ⅇx1x+12x2Use initial conditiony0=11=_C1+_C2+1Compute derivative of the solutionⅆⅆxyx=_C2ⅇx+ⅇx1x+12x2+x1ⅇxUse the initial conditionⅆⅆxyxx=0|ⅆⅆxyxx=0=00=_C2Solve for_C1and_C2_C1=0,_C2=0Substitute constant values into general solution and simplifyyx=ⅇxx22x+22Solution to the IVPyx=ⅇxx22x+22

(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=0Separate variablesⅆⅆyuyuy=5yIntegrate both sides with respect toyⅆⅆyuyuyⅆy=5yⅆy+C1Evaluate integrallnuy=5lny+C1Solve foruyuy=ⅇC1y5Solve 1st ODE foruyuy=ⅇC1y5Revert to original variables with substitutionuy=ⅆⅆxyx,y=yxⅆⅆxyx=ⅇC1yx5Separate variablesⅆⅆxyxyx5=ⅇC1Integrate both sides with respect toxⅆⅆxyxyx5ⅆx=ⅇC1ⅆx+C2Evaluate integralyx66=ⅇC1x+C2Solve foryxyx=6ⅇC1x+6C216,yx=6ⅇC1x+6C216Check validity of solutionyx=6ⅇc__1x+6_C216Use initial conditiony1=11=6ⅇc__1+6_C216Compute derivative of the solutionⅆⅆxyx=ⅇc__16ⅇc__1x+6_C256Use the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=−3−3=ⅇc__16ⅇc__1+6_C256Solve forc__1and_C2c__1=ln3+Iπ,_C2=196Substitute constant values into general solution and simplifyyx=18x+1916Check validity of solutionyx=6ⅇc__1x+6_C216Use initial conditiony1=11=6ⅇc__1+6_C216Compute derivative of the solutionⅆⅆxyx=ⅇc__16ⅇc__1x+6_C256Use the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=−3−3=ⅇc__16ⅇc__1+6_C256Solve forc__1and_C2The solution does not satisfy the initial conditionsSolution 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=C1y1x+C2y2xSubstitute in solutionsyx=C1ⅇ2x+C2ⅇ3xCheck validity of solutionyx=c__1ⅇ2x+_C2ⅇ3xUse initial conditiony1=00=c__1ⅇ−2+_C2ⅇ3Compute derivative of the solutionⅆⅆxyx=2c__1ⅇ2x+3_C2ⅇ3xUse the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=aa=2c__1ⅇ−2+3_C2ⅇ3Solve forc__1and_C2c__1=a5ⅇ−2,_C2=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=C1y1t+C2y2tSubstitute in solutionsyt=C1ⅇ52172t+C2ⅇ52+172tChange variables back usingt=lnxyx=C1ⅇ52172lnx+C2ⅇ52+172lnxSimplifyyx=x52x172C1+x172C2Check validity of solutionyx=x52x172c__1+x172_C2Use initial conditiony1=−1−1=c__1+_C2Compute derivative of the solutionⅆⅆxyx=5x32x172c__1+x172_C22+x52x17217c__12x+x17217_C22xUse the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=1010=5c__12+5_C2217c__12+17_C22Solve forc__1and_C2c__1=12251734,_C2=12+251734Substitute constant values into general solution and simplifyyx=x5225x1721725x17217+17x172+17x17234Solution to the IVPyx=x5225x1721725x17217+17x172+17x17234

(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θ=C1sinθ+C2cosθRevert back toxyx=C1sinarccosx+C2cosarccosxUse trig identity to simplifysinarccosxsinarccosx=x2+1Simplify solution to the ODEyx=C1x2+1+C2xCheck 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]