Student[ODEs]
ODESteps
Show a step-by-step solution process for ODEs, IVPs, or systems
Calling Sequence
Parameters
Description
Examples
ODESteps(ODE)
ODESteps(ODE, y(x))
ODESteps(sys)
ODE
-
an ordinary differential equation
y
name ; the dependent variable
x
name ; the independent variable
sys
set ; an ODE system including initial values
The ODESteps() command solves an ordinary differential equation (ODE) or system of ODEs.
The input may include a corresponding set of initial values, which would make it an initial value problem (IVP).
The output shows a series of steps in the solving process.
The following types of ODEs and ODE systems and/or solving methods are considered:
Cauchy-Euler Equations
First Order IVPs
First Order ODEs
Second Order IVPs
Second Order ODEs
Series Solutions
Special Function Solutions
Systems of ODEs
Systems of ODEs with IVP
with⁡StudentODEs:
A first order ODE:
ode1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢diff⁡z⁡t,t=0
ode1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0
ODESteps⁡ode1
Let's solvet2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0•Highest derivative means the order of the ODE is1ⅆⅆtz⁡t•Separate variablesⅆⅆtz⁡t⁢z⁡t2z⁡t+1=−t2t−1•Integrate both sides with respect tot∫ⅆⅆtz⁡t⁢z⁡t2z⁡t+1ⅆt=∫−t2t−1ⅆt+C1•Evaluate integralz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+C1
A first order IVP:
ivp1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢diff⁡z⁡t,t=0,z⁡3=1
ivp1≔t2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0,z⁡3=1
ODESteps⁡ivp1
Let's solvet2⁢z⁡t+1+z⁡t2⁢t−1⁢ⅆⅆtz⁡t=0,z⁡3=1•Highest derivative means the order of the ODE is1ⅆⅆtz⁡t•Separate variablesⅆⅆtz⁡t⁢z⁡t2z⁡t+1=−t2t−1•Integrate both sides with respect tot∫ⅆⅆtz⁡t⁢z⁡t2z⁡t+1ⅆt=∫−t2t−1ⅆt+C1•Evaluate integralz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+C1•Use initial conditionz⁡3=1−12+ln⁡2=−152−ln⁡2+C1•Solve for_C1C1=7+2⁢ln⁡2•Substitute_C1=7+2⁢ln⁡2into general solution and simplifyz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+7+2⁢ln⁡2•Solution to the IVPz⁡t22−z⁡t+ln⁡z⁡t+1=−t22−t−ln⁡t−1+7+2⁢ln⁡2
A second order ODE:
ode2≔2⁢x⁢diff⁡y⁡x,x−9⁢x2+2⁢diff⁡y⁡x,x+x2+1⁢diff⁡y⁡x,x,x=0
ode2≔2⁢x⁢ⅆⅆxy⁡x−9⁢x2+2⁢ⅆⅆxy⁡x+x2+1⁢ⅆ2ⅆx2y⁡x=0
ODESteps⁡ode2
Let's solve2⁢x⁢ⅆⅆxy⁡x−9⁢x2+2⁢ⅆⅆxy⁡x+x2+1⁢ⅆ2ⅆx2y⁡x=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Make substitutionu=ⅆⅆxy⁡xto reduce order of ODE2⁢x⁢u⁡x−9⁢x2+2⁢u⁡x+x2+1⁢ⅆⅆxu⁡x=0▫Check if ODE is exact◦ODE is exact if the lhs is the total derivative of aC2functionⅆⅆxF⁡x,u⁡x=0◦Compute derivative of lhs∂∂xF⁡x,u+∂∂uF⁡x,u⁢ⅆⅆxu⁡x=0◦Evaluate derivatives2⁢x=2⁢x◦Condition met, ODE is exact•Exact ODE implies solution will be of this formF⁡x,u=C1,M⁡x,u=∂∂xF⁡x,u,N⁡x,u=∂∂uF⁡x,u•Solve forF⁡x,uby integratingM⁡x,uwith respect toxF⁡x,u=∫2⁢x⁢u−9⁢x2ⅆx+_F1⁡u•Evaluate integralF⁡x,u=x2⁢u−3⁢x3+_F1⁡u•Take derivative ofF⁡x,uwith respect touN⁡x,u=∂∂uF⁡x,u•Compute derivativex2+2⁢u+1=x2+ⅆⅆu_F1⁡u•Isolate forⅆⅆu_F1⁡uⅆⅆu_F1⁡u=2⁢u+1•Solve for_F1⁡u_F1⁡u=u2+u•Substitute_F1⁡uinto equation forF⁡x,uF⁡x,u=x2⁢u−3⁢x3+u2+u•SubstituteF⁡x,uinto the solution of the ODEx2⁢u−3⁢x3+u2+u=C1•Solve foru⁡xu⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12,u⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12•Solve 1st ODE foru⁡xu⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12•Make substitutionu=ⅆⅆxy⁡xⅆⅆxy⁡x=−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12•Integrate both sides to solve fory⁡x∫ⅆⅆxy⁡xⅆx=∫−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2•Compute lhsy⁡x=∫−x22−12−x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2•Solve 2nd ODE foru⁡xu⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12•Make substitutionu=ⅆⅆxy⁡xⅆⅆxy⁡x=−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12•Integrate both sides to solve fory⁡x∫ⅆⅆxy⁡xⅆx=∫−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2•Compute lhsy⁡x=∫−x22−12+x4+12⁢x3+2⁢x2+4⁢C1+12ⅆx+C2
A second order IVP:
ivp2≔diff⁡y⁡x,x,x−diff⁡y⁡x,x−x⁢exp⁡x=0,eval⁡diff⁡y⁡x,x,x=0=0,y⁡0=1
ivp2≔ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x−x⁢ⅇx=0,ⅆⅆxy⁡xx=0|ⅆⅆxy⁡xx=0=0,y⁡0=1
ODESteps⁡ivp2
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=C1⁢y1⁡x+C2⁢y2⁡x+yp⁡x•Substitute in solutions of the homogeneous ODEy⁡x=C1+C2⁢ⅇ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=C1+C2⁢ⅇx+ⅇx⁢1−x+12⁢x2▫Check validity of solutiony⁡x=c__1+_C2⁢ⅇx+ⅇx⁢1−x+12⁢x2◦Use initial conditiony⁡0=11=c__1+_C2+1◦Compute derivative of the solutionⅆⅆxy⁡x=_C2⁢ⅇx+ⅇx⁢1−x+12⁢x2+x−1⁢ⅇx◦Use the initial conditionⅆⅆxy⁡xx=0|ⅆⅆxy⁡xx=0=00=_C2◦Solve forc__1and_C2c__1=0,_C2=0◦Substitute constant values into general solution and simplifyy⁡x=ⅇx⁢x2−2⁢x+22•Solution to the IVPy⁡x=ⅇx⁢x2−2⁢x+22
An Cauchy-Euler equation:
EC≔x2⁢diff⁡y⁡x,x,x−4⁢x⁢diff⁡y⁡x,x+2⁢y⁡x=0
EC≔x2⁢ⅆ2ⅆx2y⁡x−4⁢x⁢ⅆⅆxy⁡x+2⁢y⁡x=0
ODESteps⁡EC
Let's solvex2⁢ⅆ2ⅆx2y⁡x−4⁢x⁢ⅆⅆxy⁡x+2⁢y⁡x=0•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=C1⁢y1⁡t+C2⁢y2⁡t•Substitute in solutionsy⁡t=C1⁢ⅇ52−172⁢t+C2⁢ⅇ52+172⁢t•Change variables back usingt=ln⁡xy⁡x=C1⁢ⅇ52−172⁢ln⁡x+C2⁢ⅇ52+172⁢ln⁡x•Simplifyy⁡x=x52⁢x−172⁢C1+x172⁢C2
Finding a series solution:
series_ode≔diff⁡y⁡x,x,x+x⁢diff⁡y⁡x,x+y⁡x=0
series_ode≔ⅆ2ⅆx2y⁡x+x⁢ⅆⅆxy⁡x+y⁡x=0
ODESteps⁡series_ode
Let's solveⅆ2ⅆx2y⁡x+x⁢ⅆⅆxy⁡x+y⁡x=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Assume series solution fory⁡xy⁡x=∑k=0∞⁡ak⁢xk▫Rewrite DE with series expansions◦Convertx⋅ⅆⅆxy⁡xto series expansionx⋅ⅆⅆxy⁡x=∑k=0∞⁡ak⁢k⁢xk◦Convertⅆ2ⅆx2y⁡xto series expansionⅆ2ⅆx2y⁡x=∑k=2∞⁡ak⁢k⁢k−1⁢xk−2◦Shift index usingk->k+2ⅆ2ⅆx2y⁡x=∑k=0∞⁡ak+2⁢k+2⁢k+1⁢xkRewrite DE with series expansions∑k=0∞⁡ak+2⁢k+2⁢k+1+ak⁢k+1⁢xk=0•Each term in the series must be 0, giving the recursion relationk+1⁢ak+2⁢k+2+ak=0•Recursion relation that defines the series solution to the ODEy⁡x=∑k=0∞⁡ak⁢xk,ak+2=−akk+2
Solving an ODE with special function solution:
Bessel_ode≔x2⁢diff⁡y⁡x,x,x+4⁢x⁢diff⁡y⁡x,x+25⁢x2−9⁢y⁡x=0
Bessel_ode≔x2⁢ⅆ2ⅆx2y⁡x+4⁢x⁢ⅆⅆxy⁡x+25⁢x2−9⁢y⁡x=0
ODESteps⁡Bessel_ode
Let's solvex2⁢ⅆ2ⅆx2y⁡x+4⁢x⁢ⅆⅆxy⁡x+25⁢x2−9⁢y⁡x=0•Highest derivative means the order of the ODE is2ⅆ2ⅆx2y⁡x•Isolate 2nd derivativeⅆ2ⅆx2y⁡x=−25⁢x2−9⁢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+25⁢x2−9⁢y⁡xx2=0•Simplify ODEx2⁢ⅆ2ⅆx2y⁡x+25⁢y⁡x⁢x2+4⁢x⁢ⅆⅆxy⁡x−9⁢y⁡x=0•Make a change of variablest=5⁢x•Computeⅆⅆxy⁡xⅆⅆxy⁡x=5⁢ⅆⅆty⁡t•Compute second derivativeⅆ2ⅆx2y⁡x=25⁢ⅆ2ⅆt2y⁡t•Apply change of variables to the ODEt2⁢ⅆ2ⅆt2y⁡t+y⁡t⁢t2+4⁢t⁢ⅆⅆty⁡t−9⁢y⁡t=0•Make a change of variablesy⁡t=u⁡tt32•Computeⅆⅆty⁡tⅆⅆty⁡t=−3⁢u⁡t2⁢t52+ⅆⅆtu⁡tt32•Computeⅆ2ⅆt2y⁡tⅆ2ⅆt2y⁡t=15⁢u⁡t4⁢t72−3⁢ⅆⅆtu⁡tt52+ⅆ2ⅆt2u⁡tt32•Apply change of variables to the ODEu⁡t⁢t2+ⅆ2ⅆt2u⁡t⁢t2+ⅆⅆtu⁡t⁢t−45⁢u⁡t4=0•ODE is now of the Bessel form•Solution to Bessel ODEu⁡t=C1⁢BesselJ⁡3⁢52,t+C2⁢BesselY⁡3⁢52,t•Make the change fromy⁡xback toy⁡ty⁡t=C1⁢BesselJ⁡3⁢52,t+C2⁢BesselY⁡3⁢52,tt32•Make the change fromtback toxy⁡x=C1⁢BesselJ⁡3⁢52,5⁢x+C2⁢BesselY⁡3⁢52,5⁢x⁢525⁢x32
Solving a third order ODE by writing it as a system:
ode3≔diff⁡y⁡x,x,x,x+3⁢diff⁡y⁡x,x,x+4⁢diff⁡y⁡x,x+2⁢y⁡x=0
ode3≔ⅆ3ⅆx3y⁡x+3⁢ⅆ2ⅆx2y⁡x+4⁢ⅆⅆxy⁡x+2⁢y⁡x=0
ODESteps⁡ode3
See Also
DEtools/odeadvisor
dsolve
Student
Download Help Document