SecondOrderIVPs - Maple Help

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 paramaters 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=ⅇxx22x+22Substitute particular solution into general solution to ODEyx=_C1+_C2ⅇx+ⅇxx22x+22Use initial conditiony0=11=_C1+_C2+1Compute derivative of the solutionⅆⅆxyx=_C2ⅇx+ⅇxx22x+22+ⅇx2x22Use the initial conditionⅆⅆxyxx=0|ⅆⅆxyxx=0=00=_C2Solve for_C1and_C2_C1=0,_C2=0Solution 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 variableyux=Computeⅆ2ⅆx2yx=Use chain rule on the lhs=Substitute in the definition ofuuy=Make 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 foryyuy=ⅇ_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+6_C216,yx=6ⅇ_C1x+6_C216Use initial conditiony1=11=6ⅇ_C1+6_C216Compute derivative of the solutionⅆⅆxyx=ⅇ_C16ⅇ_C1x+6_C256Use the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=−3−3=ⅇ_C16ⅇ_C1+6_C256Solution is complexUse initial conditiony1=11=6ⅇ_C1+6_C216Compute derivative of the solutionⅆⅆxyx=ⅇ_C16ⅇ_C1x+6_C256Use the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=−3−3=ⅇ_C16ⅇ_C1+6_C256Solution is complex

(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ⅇ3xUse initial conditiony1=00=_C1ⅇ−2+_C2ⅇ3Compute derivative of the solutionⅆⅆxyx=2_C1ⅇ2x+3_C2ⅇ3xUse the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=aa=2_C1ⅇ−2+3_C2ⅇ3Solve for_C1and_C2_C1=a5ⅇ−2,_C2=a5ⅇ3Solution to the IVPyx=aⅇ2x5ⅇ−2+aⅇ3x5ⅇ3

(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 the 1st derivative ofywith respect tox, using the chain ruleⅆⅆtyt=ⅆⅆxyxCompute derivativeⅆⅆtyt=ⅆⅆtytxCalculate the 2nd derivative ofywith respect tox, using the chain ruleⅆ2ⅆt2yt=ⅆ2ⅆx2yxCompute derivativeⅆ2ⅆt2yt=ⅆⅆtytx2+ⅆ2ⅆt2ytx2Substitute the change of variables back into the ODEx2ⅆⅆtytx2+ⅆ2ⅆt2ytx24ⅆⅆtyt+2yt=0Simplify5ⅆⅆtyt+ⅆ2ⅆt2yt+2yt=0Characteristic polynomial of ODEr25r+2=0Use quadratic formula to solve forrr=5±2Roots 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ⅇ52172+_C2ⅇ52+172Simplifyyx=_C1ⅇ5+172+_C2ⅇ5+172Use initial conditiony1=−1−1=_C1+_C2Compute derivative of the solutionⅆⅆxyx=_C15+17ⅇ5+17lnx22x+_C25+17ⅇ5+17lnx22xUse the initial conditionⅆⅆxyxx=1|ⅆⅆxyxx=1=1010=_C15+172+_C25+172Solve for_C1