Internal problem ID [6437]
Internal file name [OUTPUT/5685_Sunday_June_05_2022_03_46_58_PM_37379447/index.tex
]
Book: Differential Equations: Theory, Technique, and Practice by George Simmons, Steven
Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section: Chapter 4. Power Series Solutions and Special Functions. Section 4.3. Second-Order
Linear Equations: Ordinary Points. Page 169
Problem number: 5.
ODE order: 2.
ODE degree: 1.
The type(s) of ODE detected by this program : "second_order_bessel_ode", "second order series method. Ordinary point", "second order series method. Taylor series method"
Maple gives the following as the ode type
[[_2nd_order, _with_linear_symmetries]]
\[ \boxed {y^{\prime \prime }+\left (p +\frac {1}{2}-\frac {x^{2}}{4}\right ) y=0} \] With the expansion point for the power series method at \(x = 0\).
Solving ode using Taylor series method. This gives review on how the Taylor series method works for solving second order ode.
Let \[ y^{\prime \prime }=f\left ( x,y,y^{\prime }\right ) \] Assuming expansion is at \(x_{0}=0\) (we can always shift the actual expansion point to \(0\) by change of variables) and assuming \(f\left ( x,y,y^{\prime }\right ) \) is analytic at \(x_{0}\) which must be the case for an ordinary point. Let initial conditions be \(y\left ( x_{0}\right ) =y_{0}\) and \(y^{\prime }\left ( x_{0}\right ) =y_{0}^{\prime }\). Using Taylor series gives\begin {align*} y\left ( x\right ) & =y\left ( x_{0}\right ) +\left ( x-x_{0}\right ) y^{\prime }\left ( x_{0}\right ) +\frac {\left ( x-x_{0}\right ) ^{2}}{2}y^{\prime \prime }\left ( x_{0}\right ) +\frac {\left ( x-x_{0}\right ) ^{3}}{3!}y^{\prime \prime \prime }\left ( x_{0}\right ) +\cdots \\ & =y_{0}+xy_{0}^{\prime }+\frac {x^{2}}{2}\left . f\right \vert _{x_{0},y_{0},y_{0}^{\prime }}+\frac {x^{3}}{3!}\left . f^{\prime }\right \vert _{x_{0},y_{0},y_{0}^{\prime }}+\cdots \\ & =y_{0}+xy_{0}^{\prime }+\sum _{n=0}^{\infty }\frac {x^{n+2}}{\left ( n+2\right ) !}\left . \frac {d^{n}f}{dx^{n}}\right \vert _{x_{0},y_{0},y_{0}^{\prime }} \end {align*}
But \begin {align} \frac {df}{dx} & =\frac {\partial f}{\partial x}\frac {dx}{dx}+\frac {\partial f}{\partial y}\frac {dy}{dx}+\frac {\partial f}{\partial y^{\prime }}\frac {dy^{\prime }}{dx}\tag {1}\\ & =\frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}y^{\prime }+\frac {\partial f}{\partial y^{\prime }}y^{\prime \prime }\\ & =\frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}y^{\prime }+\frac {\partial f}{\partial y^{\prime }}f\\ \frac {d^{2}f}{dx^{2}} & =\frac {d}{dx}\left ( \frac {df}{dx}\right ) \nonumber \\ & =\frac {\partial }{\partial x}\left ( \frac {df}{dx}\right ) +\frac {\partial }{\partial y}\left ( \frac {df}{dx}\right ) y^{\prime }+\frac {\partial }{\partial y^{\prime }}\left ( \frac {df}{dx}\right ) f\tag {2}\\ \frac {d^{3}f}{dx^{3}} & =\frac {d}{dx}\left ( \frac {d^{2}f}{dx^{2}}\right ) \nonumber \\ & =\frac {\partial }{\partial x}\left ( \frac {d^{2}f}{dx^{2}}\right ) +\left ( \frac {\partial }{\partial y}\frac {d^{2}f}{dx^{2}}\right ) y^{\prime }+\frac {\partial }{\partial y^{\prime }}\left ( \frac {d^{2}f}{dx^{2}}\right ) f\tag {3}\\ & \vdots \nonumber \end {align}
And so on. Hence if we name \(F_{0}=f\left ( x,y,y^{\prime }\right ) \) then the above can be written as \begin {align} F_{0} & =f\left ( x,y,y^{\prime }\right ) \tag {4}\\ F_{1} & =\frac {df}{dx}\nonumber \\ & =\frac {dF_{0}}{dx}\nonumber \\ & =\frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}y^{\prime }+\frac {\partial f}{\partial y^{\prime }}y^{\prime \prime }\nonumber \\ & =\frac {\partial f}{\partial x}+\frac {\partial f}{\partial y}y^{\prime }+\frac {\partial f}{\partial y^{\prime }}f\tag {5}\\ & =\frac {\partial F_{0}}{\partial x}+\frac {\partial F_{0}}{\partial y}y^{\prime }+\frac {\partial F_{0}}{\partial y^{\prime }}F_{0}\nonumber \\ F_{2} & =\frac {d}{dx}\left ( \frac {d}{dx}f\right ) \nonumber \\ & =\frac {d}{dx}\left ( F_{1}\right ) \nonumber \\ & =\frac {\partial }{\partial x}F_{1}+\left ( \frac {\partial F_{1}}{\partial y}\right ) y^{\prime }+\left ( \frac {\partial F_{1}}{\partial y^{\prime }}\right ) y^{\prime \prime }\nonumber \\ & =\frac {\partial }{\partial x}F_{1}+\left ( \frac {\partial F_{1}}{\partial y}\right ) y^{\prime }+\left ( \frac {\partial F_{1}}{\partial y^{\prime }}\right ) F_{0}\nonumber \\ & \vdots \nonumber \\ F_{n} & =\frac {d}{dx}\left ( F_{n-1}\right ) \nonumber \\ & =\frac {\partial }{\partial x}F_{n-1}+\left ( \frac {\partial F_{n-1}}{\partial y}\right ) y^{\prime }+\left ( \frac {\partial F_{n-1}}{\partial y^{\prime }}\right ) y^{\prime \prime }\nonumber \\ & =\frac {\partial }{\partial x}F_{n-1}+\left ( \frac {\partial F_{n-1}}{\partial y}\right ) y^{\prime }+\left ( \frac {\partial F_{n-1}}{\partial y^{\prime }}\right ) F_{0} \tag {6} \end {align}
Therefore (6) can be used from now on along with \begin {equation} y\left ( x\right ) =y_{0}+xy_{0}^{\prime }+\sum _{n=0}^{\infty }\frac {x^{n+2}}{\left ( n+2\right ) !}\left . F_{n}\right \vert _{x_{0},y_{0},y_{0}^{\prime }} \tag {7} \end {equation} To find \(y\left ( x\right ) \) series solution around \(x=0\). Hence \begin {align*} F_0 &= -\frac {\left (-x^{2}+4 p +2\right ) y}{4}\\ F_1 &= \frac {d F_0}{dx} \\ &= \frac {\partial F_{0}}{\partial x}+ \frac {\partial F_{0}}{\partial y} y^{\prime }+ \frac {\partial F_{0}}{\partial y^{\prime }} F_0 \\ &= \frac {\left (x^{2}-4 p -2\right ) y^{\prime }}{4}+\frac {y x}{2}\\ F_2 &= \frac {d F_1}{dx} \\ &= \frac {\partial F_{1}}{\partial x}+ \frac {\partial F_{1}}{\partial y} y^{\prime }+ \frac {\partial F_{1}}{\partial y^{\prime }} F_1 \\ &= y^{\prime } x +\left (\frac {x^{4}}{16}+\left (-\frac {p}{2}-\frac {1}{4}\right ) x^{2}+p^{2}+p +\frac {3}{4}\right ) y\\ F_3 &= \frac {d F_2}{dx} \\ &= \frac {\partial F_{2}}{\partial x}+ \frac {\partial F_{2}}{\partial y} y^{\prime }+ \frac {\partial F_{2}}{\partial y^{\prime }} F_2 \\ &= \frac {\left (x^{4}+\left (-8 p -4\right ) x^{2}+16 p^{2}+16 p +28\right ) y^{\prime }}{16}-2 \left (p +\frac {1}{2}-\frac {x^{2}}{4}\right ) y x\\ F_4 &= \frac {d F_3}{dx} \\ &= \frac {\partial F_{3}}{\partial x}+ \frac {\partial F_{3}}{\partial y} y^{\prime }+ \frac {\partial F_{3}}{\partial y^{\prime }} F_3 \\ &= \frac {3 \left (x^{3}+2 \left (-2 p -1\right ) x \right ) y^{\prime }}{4}-\left (-\frac {x^{6}}{64}+\frac {3 \left (p +\frac {1}{2}\right ) x^{4}}{16}+\frac {3 \left (-\frac {11}{4}-p^{2}-p \right ) x^{2}}{4}+\left (p^{2}+p +\frac {15}{4}\right ) \left (p +\frac {1}{2}\right )\right ) y\\ F_5 &= \frac {d F_4}{dx} \\ &= \frac {\partial F_{4}}{\partial x}+ \frac {\partial F_{4}}{\partial y} y^{\prime }+ \frac {\partial F_{4}}{\partial y^{\prime }} F_4 \\ &= \frac {\left (x^{6}+\left (-12 p -6\right ) x^{4}+\left (48 p^{2}+48 p +276\right ) x^{2}-64 p^{3}-96 p^{2}-464 p -216\right ) y^{\prime }}{64}+\frac {9 \left (\frac {x^{4}}{16}+\left (-\frac {p}{2}-\frac {1}{4}\right ) x^{2}+p^{2}+p +\frac {13}{12}\right ) y x}{2}\\ F_6 &= \frac {d F_5}{dx} \\ &= \frac {\partial F_{5}}{\partial x}+ \frac {\partial F_{5}}{\partial y} y^{\prime }+ \frac {\partial F_{5}}{\partial y^{\prime }} F_5 \\ &= 6 x \left (\frac {9}{4}+\frac {x^{4}}{16}+\frac {\left (-p -\frac {1}{2}\right ) x^{2}}{2}+p^{2}+p \right ) y^{\prime }+\left (\frac {105}{16}+\frac {x^{8}}{256}+\frac {\left (-p -\frac {1}{2}\right ) x^{6}}{16}+\frac {3 \left (p^{2}+p +\frac {27}{4}\right ) x^{4}}{8}+\left (-p^{3}-\frac {3}{2} p^{2}-\frac {53}{4} p -\frac {51}{8}\right ) x^{2}+p^{4}+2 p^{3}+\frac {25 p^{2}}{2}+\frac {23 p}{2}\right ) y \end {align*}
And so on. Evaluating all the above at initial conditions \(x = 0\) and \(y \left (0\right ) = y \left (0\right )\) and \(y^{\prime }\left (0\right ) = y^{\prime }\left (0\right )\) gives \begin {align*} F_0 &= -\frac {y \left (0\right ) \left (2 p +1\right )}{2}\\ F_1 &= -y^{\prime }\left (0\right ) p -\frac {y^{\prime }\left (0\right )}{2}\\ F_2 &= y \left (0\right ) p^{2}+y \left (0\right ) p +\frac {3 y \left (0\right )}{4}\\ F_3 &= y^{\prime }\left (0\right ) p^{2}+y^{\prime }\left (0\right ) p +\frac {7 y^{\prime }\left (0\right )}{4}\\ F_4 &= -y \left (0\right ) p^{3}-\frac {3 y \left (0\right ) p^{2}}{2}-\frac {17 y \left (0\right ) p}{4}-\frac {15 y \left (0\right )}{8}\\ F_5 &= -y^{\prime }\left (0\right ) p^{3}-\frac {3 y^{\prime }\left (0\right ) p^{2}}{2}-\frac {29 y^{\prime }\left (0\right ) p}{4}-\frac {27 y^{\prime }\left (0\right )}{8}\\ F_6 &= y \left (0\right ) p^{4}+2 y \left (0\right ) p^{3}+\frac {25 y \left (0\right ) p^{2}}{2}+\frac {23 y \left (0\right ) p}{2}+\frac {105 y \left (0\right )}{16} \end {align*}
Substituting all the above in (7) and simplifying gives the solution as \[ y = \left (1-\frac {1}{4} x^{2}+\frac {1}{32} x^{4}-\frac {1}{384} x^{6}+\frac {1}{6144} x^{8}+\frac {1}{40320} x^{8} p^{4}+\frac {1}{20160} x^{8} p^{3}+\frac {5}{16128} x^{8} p^{2}+\frac {23}{80640} x^{8} p -\frac {1}{2} x^{2} p +\frac {1}{24} p^{2} x^{4}+\frac {1}{24} p \,x^{4}-\frac {1}{720} x^{6} p^{3}-\frac {1}{480} x^{6} p^{2}-\frac {17}{2880} p \,x^{6}\right ) y \left (0\right )+\left (x -\frac {1}{12} x^{3}+\frac {7}{480} x^{5}-\frac {3}{4480} x^{7}-\frac {1}{3360} x^{7} p^{2}-\frac {29}{20160} x^{7} p -\frac {1}{6} x^{3} p +\frac {1}{120} x^{5} p^{2}+\frac {1}{120} x^{5} p -\frac {1}{5040} x^{7} p^{3}\right ) y^{\prime }\left (0\right )+O\left (x^{8}\right ) \] Since the expansion point \(x = 0\) is an ordinary, we can also solve this using standard power series Let the solution be represented as power series of the form \[ y = \moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n} \] Then \begin {align*} y^{\prime } &= \moverset {\infty }{\munderset {n =1}{\sum }}n a_{n} x^{n -1}\\ y^{\prime \prime } &= \moverset {\infty }{\munderset {n =2}{\sum }}n \left (n -1\right ) a_{n} x^{n -2} \end {align*}
Substituting the above back into the ode gives \begin {align*} \moverset {\infty }{\munderset {n =2}{\sum }}n \left (n -1\right ) a_{n} x^{n -2} = -\frac {\left (-x^{2}+4 p +2\right ) \left (\moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n}\right )}{4}\tag {1} \end {align*}
Which simplifies to \begin{equation} \tag{2} \left (\moverset {\infty }{\munderset {n =2}{\sum }}n \left (n -1\right ) a_{n} x^{n -2}\right )+\moverset {\infty }{\munderset {n =0}{\sum }}\left (-\frac {x^{n +2} a_{n}}{4}\right )+\left (\moverset {\infty }{\munderset {n =0}{\sum }}\frac {a_{n} x^{n} \left (2 p +1\right )}{2}\right ) = 0 \end{equation} The next step is to make all powers of \(x\) be \(n\) in each summation term. Going over each summation term above with power of \(x\) in it which is not already \(x^{n}\) and adjusting the power and the corresponding index gives \begin{align*} \moverset {\infty }{\munderset {n =2}{\sum }}n \left (n -1\right ) a_{n} x^{n -2} &= \moverset {\infty }{\munderset {n =0}{\sum }}\left (n +2\right ) a_{n +2} \left (n +1\right ) x^{n} \\ \moverset {\infty }{\munderset {n =0}{\sum }}\left (-\frac {x^{n +2} a_{n}}{4}\right ) &= \moverset {\infty }{\munderset {n =2}{\sum }}\left (-\frac {a_{n -2} x^{n}}{4}\right ) \\ \end{align*} Substituting all the above in Eq (2) gives the following equation where now all powers of \(x\) are the same and equal to \(n\). \begin{equation} \tag{3} \left (\moverset {\infty }{\munderset {n =0}{\sum }}\left (n +2\right ) a_{n +2} \left (n +1\right ) x^{n}\right )+\moverset {\infty }{\munderset {n =2}{\sum }}\left (-\frac {a_{n -2} x^{n}}{4}\right )+\left (\moverset {\infty }{\munderset {n =0}{\sum }}\frac {a_{n} x^{n} \left (2 p +1\right )}{2}\right ) = 0 \end{equation} \(n=0\) gives \[ 2 a_{2}+\frac {a_{0} \left (2 p +1\right )}{2}=0 \] \[ a_{2} = -\frac {1}{2} a_{0} p -\frac {1}{4} a_{0} \] \(n=1\) gives \[ 6 a_{3}+\frac {a_{1} \left (2 p +1\right )}{2}=0 \] Which after substituting earlier equations, simplifies to \[ a_{3} = -\frac {1}{6} a_{1} p -\frac {1}{12} a_{1} \] For \(2\le n\), the recurrence equation is \begin{equation} \tag{4} \left (n +2\right ) a_{n +2} \left (n +1\right )-\frac {a_{n -2}}{4}+\frac {a_{n} \left (2 p +1\right )}{2} = 0 \end{equation} Solving for \(a_{n +2}\), gives \begin{align*} \tag{5} a_{n +2}&= -\frac {4 p a_{n}+2 a_{n}-a_{n -2}}{4 \left (n +2\right ) \left (n +1\right )} \\ &= -\frac {\left (4 p +2\right ) a_{n}}{4 \left (n +2\right ) \left (n +1\right )}+\frac {a_{n -2}}{4 \left (n +2\right ) \left (n +1\right )} \\ \end{align*} For \(n = 2\) the recurrence equation gives \[ 12 a_{4}-\frac {a_{0}}{4}+\frac {a_{2} \left (2 p +1\right )}{2} = 0 \] Which after substituting the earlier terms found becomes \[ a_{4} = \frac {1}{32} a_{0}+\frac {1}{24} a_{0} p^{2}+\frac {1}{24} a_{0} p \] For \(n = 3\) the recurrence equation gives \[ 20 a_{5}-\frac {a_{1}}{4}+\frac {a_{3} \left (2 p +1\right )}{2} = 0 \] Which after substituting the earlier terms found becomes \[ a_{5} = \frac {7}{480} a_{1}+\frac {1}{120} a_{1} p^{2}+\frac {1}{120} a_{1} p \] For \(n = 4\) the recurrence equation gives \[ 30 a_{6}-\frac {a_{2}}{4}+\frac {a_{4} \left (2 p +1\right )}{2} = 0 \] Which after substituting the earlier terms found becomes \[ a_{6} = -\frac {17}{2880} a_{0} p -\frac {1}{384} a_{0}-\frac {1}{720} a_{0} p^{3}-\frac {1}{480} a_{0} p^{2} \] For \(n = 5\) the recurrence equation gives \[ 42 a_{7}-\frac {a_{3}}{4}+\frac {a_{5} \left (2 p +1\right )}{2} = 0 \] Which after substituting the earlier terms found becomes \[ a_{7} = -\frac {29}{20160} a_{1} p -\frac {3}{4480} a_{1}-\frac {1}{5040} a_{1} p^{3}-\frac {1}{3360} a_{1} p^{2} \] For \(n = 6\) the recurrence equation gives \[ 56 a_{8}-\frac {a_{4}}{4}+\frac {a_{6} \left (2 p +1\right )}{2} = 0 \] Which after substituting the earlier terms found becomes \[ a_{8} = \frac {1}{6144} a_{0}+\frac {5}{16128} a_{0} p^{2}+\frac {23}{80640} a_{0} p +\frac {1}{40320} a_{0} p^{4}+\frac {1}{20160} a_{0} p^{3} \] For \(n = 7\) the recurrence equation gives \[ 72 a_{9}-\frac {a_{5}}{4}+\frac {a_{7} \left (2 p +1\right )}{2} = 0 \] Which after substituting the earlier terms found becomes \[ a_{9} = \frac {107}{1935360} a_{1}+\frac {37}{725760} a_{1} p^{2}+\frac {1}{20736} a_{1} p +\frac {1}{362880} a_{1} p^{4}+\frac {1}{181440} a_{1} p^{3} \] And so on. Therefore the solution is \begin {align*} y &= \moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n}\\ &= a_{3} x^{3}+a_{2} x^{2}+a_{1} x +a_{0} + \dots \end {align*}
Substituting the values for \(a_{n}\) found above, the solution becomes \[ y = a_{0}+a_{1} x +\left (-\frac {1}{2} a_{0} p -\frac {1}{4} a_{0}\right ) x^{2}+\left (-\frac {1}{6} a_{1} p -\frac {1}{12} a_{1}\right ) x^{3}+\left (\frac {1}{32} a_{0}+\frac {1}{24} a_{0} p^{2}+\frac {1}{24} a_{0} p \right ) x^{4}+\left (\frac {7}{480} a_{1}+\frac {1}{120} a_{1} p^{2}+\frac {1}{120} a_{1} p \right ) x^{5}+\left (-\frac {17}{2880} a_{0} p -\frac {1}{384} a_{0}-\frac {1}{720} a_{0} p^{3}-\frac {1}{480} a_{0} p^{2}\right ) x^{6}+\left (-\frac {29}{20160} a_{1} p -\frac {3}{4480} a_{1}-\frac {1}{5040} a_{1} p^{3}-\frac {1}{3360} a_{1} p^{2}\right ) x^{7}+\dots \] Collecting terms, the solution becomes \begin{equation} \tag{3} y = \left (1+\left (-\frac {p}{2}-\frac {1}{4}\right ) x^{2}+\left (\frac {1}{32}+\frac {1}{24} p^{2}+\frac {1}{24} p \right ) x^{4}+\left (-\frac {17}{2880} p -\frac {1}{384}-\frac {1}{720} p^{3}-\frac {1}{480} p^{2}\right ) x^{6}\right ) a_{0}+\left (x +\left (-\frac {p}{6}-\frac {1}{12}\right ) x^{3}+\left (\frac {7}{480}+\frac {1}{120} p^{2}+\frac {1}{120} p \right ) x^{5}+\left (-\frac {29}{20160} p -\frac {3}{4480}-\frac {1}{5040} p^{3}-\frac {1}{3360} p^{2}\right ) x^{7}\right ) a_{1}+O\left (x^{8}\right ) \end{equation} At \(x = 0\) the solution above becomes \[ y = \left (1+\left (-\frac {p}{2}-\frac {1}{4}\right ) x^{2}+\left (\frac {1}{32}+\frac {1}{24} p^{2}+\frac {1}{24} p \right ) x^{4}+\left (-\frac {17}{2880} p -\frac {1}{384}-\frac {1}{720} p^{3}-\frac {1}{480} p^{2}\right ) x^{6}\right ) c_{1} +\left (x +\left (-\frac {p}{6}-\frac {1}{12}\right ) x^{3}+\left (\frac {7}{480}+\frac {1}{120} p^{2}+\frac {1}{120} p \right ) x^{5}+\left (-\frac {29}{20160} p -\frac {3}{4480}-\frac {1}{5040} p^{3}-\frac {1}{3360} p^{2}\right ) x^{7}\right ) c_{2} +O\left (x^{8}\right ) \]
The solution(s) found are the following \begin{align*} \tag{1} y &= \left (1-\frac {1}{4} x^{2}+\frac {1}{32} x^{4}-\frac {1}{384} x^{6}+\frac {1}{6144} x^{8}+\frac {1}{40320} x^{8} p^{4}+\frac {1}{20160} x^{8} p^{3}+\frac {5}{16128} x^{8} p^{2}+\frac {23}{80640} x^{8} p -\frac {1}{2} x^{2} p +\frac {1}{24} p^{2} x^{4}+\frac {1}{24} p \,x^{4}-\frac {1}{720} x^{6} p^{3}-\frac {1}{480} x^{6} p^{2}-\frac {17}{2880} p \,x^{6}\right ) y \left (0\right )+\left (x -\frac {1}{12} x^{3}+\frac {7}{480} x^{5}-\frac {3}{4480} x^{7}-\frac {1}{3360} x^{7} p^{2}-\frac {29}{20160} x^{7} p -\frac {1}{6} x^{3} p +\frac {1}{120} x^{5} p^{2}+\frac {1}{120} x^{5} p -\frac {1}{5040} x^{7} p^{3}\right ) y^{\prime }\left (0\right )+O\left (x^{8}\right ) \\ \tag{2} y &= \left (1+\left (-\frac {p}{2}-\frac {1}{4}\right ) x^{2}+\left (\frac {1}{32}+\frac {1}{24} p^{2}+\frac {1}{24} p \right ) x^{4}+\left (-\frac {17}{2880} p -\frac {1}{384}-\frac {1}{720} p^{3}-\frac {1}{480} p^{2}\right ) x^{6}\right ) c_{1} +\left (x +\left (-\frac {p}{6}-\frac {1}{12}\right ) x^{3}+\left (\frac {7}{480}+\frac {1}{120} p^{2}+\frac {1}{120} p \right ) x^{5}+\left (-\frac {29}{20160} p -\frac {3}{4480}-\frac {1}{5040} p^{3}-\frac {1}{3360} p^{2}\right ) x^{7}\right ) c_{2} +O\left (x^{8}\right ) \\ \end{align*}
Verification of solutions
\[ y = \left (1-\frac {1}{4} x^{2}+\frac {1}{32} x^{4}-\frac {1}{384} x^{6}+\frac {1}{6144} x^{8}+\frac {1}{40320} x^{8} p^{4}+\frac {1}{20160} x^{8} p^{3}+\frac {5}{16128} x^{8} p^{2}+\frac {23}{80640} x^{8} p -\frac {1}{2} x^{2} p +\frac {1}{24} p^{2} x^{4}+\frac {1}{24} p \,x^{4}-\frac {1}{720} x^{6} p^{3}-\frac {1}{480} x^{6} p^{2}-\frac {17}{2880} p \,x^{6}\right ) y \left (0\right )+\left (x -\frac {1}{12} x^{3}+\frac {7}{480} x^{5}-\frac {3}{4480} x^{7}-\frac {1}{3360} x^{7} p^{2}-\frac {29}{20160} x^{7} p -\frac {1}{6} x^{3} p +\frac {1}{120} x^{5} p^{2}+\frac {1}{120} x^{5} p -\frac {1}{5040} x^{7} p^{3}\right ) y^{\prime }\left (0\right )+O\left (x^{8}\right ) \] Verified OK.
\[ y = \left (1+\left (-\frac {p}{2}-\frac {1}{4}\right ) x^{2}+\left (\frac {1}{32}+\frac {1}{24} p^{2}+\frac {1}{24} p \right ) x^{4}+\left (-\frac {17}{2880} p -\frac {1}{384}-\frac {1}{720} p^{3}-\frac {1}{480} p^{2}\right ) x^{6}\right ) c_{1} +\left (x +\left (-\frac {p}{6}-\frac {1}{12}\right ) x^{3}+\left (\frac {7}{480}+\frac {1}{120} p^{2}+\frac {1}{120} p \right ) x^{5}+\left (-\frac {29}{20160} p -\frac {3}{4480}-\frac {1}{5040} p^{3}-\frac {1}{3360} p^{2}\right ) x^{7}\right ) c_{2} +O\left (x^{8}\right ) \] Verified OK.
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y^{\prime \prime }=-\frac {\left (-x^{2}+4 p +2\right ) y}{4} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & y^{\prime \prime } \\ \bullet & {} & \textrm {Isolate 2nd derivative}\hspace {3pt} \\ {} & {} & y^{\prime \prime }=\left (-p -\frac {1}{2}+\frac {x^{2}}{4}\right ) y \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE; ODE is linear}\hspace {3pt} \\ {} & {} & y^{\prime \prime }+\left (p +\frac {1}{2}-\frac {x^{2}}{4}\right ) y=0 \\ \bullet & {} & \textrm {Multiply by denominators}\hspace {3pt} \\ {} & {} & 4 y^{\prime \prime }+\left (-x^{2}+4 p +2\right ) y=0 \\ \bullet & {} & \textrm {Assume series solution for}\hspace {3pt} y \\ {} & {} & y=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k} x^{k} \\ \square & {} & \textrm {Rewrite ODE with series expansions}\hspace {3pt} \\ {} & \circ & \textrm {Convert}\hspace {3pt} x^{m}\cdot y\hspace {3pt}\textrm {to series expansion for}\hspace {3pt} m =0..2 \\ {} & {} & x^{m}\cdot y=\moverset {\infty }{\munderset {k =\max \left (0, -m \right )}{\sum }}a_{k} x^{k +m} \\ {} & \circ & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k -m \\ {} & {} & x^{m}\cdot y=\moverset {\infty }{\munderset {k =\max \left (0, -m \right )+m}{\sum }}a_{k -m} x^{k} \\ {} & \circ & \textrm {Convert}\hspace {3pt} y^{\prime \prime }\hspace {3pt}\textrm {to series expansion}\hspace {3pt} \\ {} & {} & y^{\prime \prime }=\moverset {\infty }{\munderset {k =2}{\sum }}a_{k} k \left (k -1\right ) x^{k -2} \\ {} & \circ & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k +2 \\ {} & {} & y^{\prime \prime }=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k +2} \left (k +2\right ) \left (k +1\right ) x^{k} \\ & {} & \textrm {Rewrite ODE with series expansions}\hspace {3pt} \\ {} & {} & 8 a_{2}+2 a_{0} \left (2 p +1\right )+\left (24 a_{3}+2 a_{1} \left (2 p +1\right )\right ) x +\left (\moverset {\infty }{\munderset {k =2}{\sum }}\left (4 a_{k +2} \left (k +2\right ) \left (k +1\right )+2 a_{k} \left (2 p +1\right )-a_{k -2}\right ) x^{k}\right )=0 \\ \bullet & {} & \textrm {The coefficients of each power of}\hspace {3pt} x \hspace {3pt}\textrm {must be 0}\hspace {3pt} \\ {} & {} & \left [8 a_{2}+2 a_{0} \left (2 p +1\right )=0, 24 a_{3}+2 a_{1} \left (2 p +1\right )=0\right ] \\ \bullet & {} & \textrm {Solve for the dependent coefficient(s)}\hspace {3pt} \\ {} & {} & \left \{a_{2}=-\frac {1}{2} a_{0} p -\frac {1}{4} a_{0}, a_{3}=-\frac {1}{6} a_{1} p -\frac {1}{12} a_{1}\right \} \\ \bullet & {} & \textrm {Each term in the series must be 0, giving the recursion relation}\hspace {3pt} \\ {} & {} & 4 \left (k^{2}+3 k +2\right ) a_{k +2}+2 a_{k} \left (2 p +1\right )-a_{k -2}=0 \\ \bullet & {} & \textrm {Shift index using}\hspace {3pt} k \mathrm {->}k +2 \\ {} & {} & 4 \left (\left (k +2\right )^{2}+3 k +8\right ) a_{k +4}+2 a_{k +2} \left (2 p +1\right )-a_{k}=0 \\ \bullet & {} & \textrm {Recursion relation that defines the series solution to the ODE}\hspace {3pt} \\ {} & {} & \left [y=\moverset {\infty }{\munderset {k =0}{\sum }}a_{k} x^{k}, a_{k +4}=-\frac {4 p a_{k +2}-a_{k}+2 a_{k +2}}{4 \left (k^{2}+7 k +12\right )}, a_{2}=-\frac {1}{2} a_{0} p -\frac {1}{4} a_{0}, a_{3}=-\frac {1}{6} a_{1} p -\frac {1}{12} a_{1}\right ] \end {array} \]
Maple trace
`Methods for second order ODEs: --- Trying classification methods --- trying a quadrature checking if the LODE has constant coefficients checking if the LODE is of Euler type trying a symmetry of the form [xi=0, eta=F(x)] checking if the LODE is missing y -> Trying a Liouvillian solution using Kovacics algorithm <- No Liouvillian solutions exists -> Trying a solution in terms of special functions: -> Bessel -> elliptic -> Legendre -> Whittaker -> hyper3: Equivalence to 1F1 under a power @ Moebius <- hyper3 successful: received ODE is equivalent to the 1F1 ODE <- Whittaker successful <- special function solution successful`
✓ Solution by Maple
Time used: 0.0 (sec). Leaf size: 120
Order:=8; dsolve(diff(y(x),x$2)+(p+1/2-x^2/4)*y(x)=0,y(x),type='series',x=0);
\[ y \left (x \right ) = \left (1-\frac {\left (1+2 p \right ) x^{2}}{4}+\frac {\left (4 p^{2}+4 p +3\right ) x^{4}}{96}-\frac {\left (8 p^{3}+12 p^{2}+34 p +15\right ) x^{6}}{5760}\right ) y \left (0\right )+\left (x -\frac {\left (1+2 p \right ) x^{3}}{12}+\frac {\left (4 p^{2}+4 p +7\right ) x^{5}}{480}-\frac {\left (8 p^{3}+12 p^{2}+58 p +27\right ) x^{7}}{40320}\right ) D\left (y \right )\left (0\right )+O\left (x^{8}\right ) \]
✓ Solution by Mathematica
Time used: 0.001 (sec). Leaf size: 142
AsymptoticDSolveValue[y''[x]+(p+1/2-x^2/4)*y[x]==0,y[x],{x,0,7}]
\[ y(x)\to c_2 \left (\frac {(-4 p-2) (4 p+2)^2 x^7}{322560}+\frac {13 (-4 p-2) x^7}{40320}+\frac {(4 p+2)^2 x^5}{1920}+\frac {1}{24} (-4 p-2) x^3+\frac {x^5}{80}+x\right )+c_1 \left (\frac {(-4 p-2) (4 p+2)^2 x^6}{46080}+\frac {7 (-4 p-2) x^6}{5760}+\frac {1}{384} (4 p+2)^2 x^4+\frac {1}{8} (-4 p-2) x^2+\frac {x^4}{48}+1\right ) \]